1 # minimod.PL writes the contents of miniperlmain.c into the module
2 # ExtUtils::Miniperl for later perusal (when the perl source is
5 # It also writes the subroutine writemain(), which takes as its
6 # arguments module names that shall be statically linked into perl.
8 # Authors: Andreas Koenig <k@franz.ww.TU-Berlin.DE>, Tim Bunce
11 # Version 1.0, Feb 2nd 1995 by Andreas Koenig
14 # This File keeps the contents of miniperlmain.c.
16 # It was generated automatically by minimod.PL from the contents
17 # of miniperlmain.c. Don't edit this file!
19 # ANY CHANGES MADE HERE WILL BE LOST!
23 package ExtUtils::Miniperl;
26 @EXPORT = qw(&writemain);
31 open MINI, "miniperlmain.c";
33 last if /Do not delete this line--writemain depends on it/;
54 my($dl) = canon('/','DynaLoader');
58 my($pname) = canon('/', $_);
60 ($mname = $pname) =~ s!/!::!g;
61 ($cname = $pname) =~ s!/!__!g;
62 print "EXTERN_C void boot_${cname} _((CV* cv));\n";
65 my ($tail1,$tail2) = ( $tail =~ /\A(.*\n)(\s*\}.*)\Z/s );
68 print " char *file = __FILE__;\n";
70 my($pname) = canon('/', $_);
71 my($mname, $cname, $ccode);
72 ($mname = $pname) =~ s!/!::!g;
73 ($cname = $pname) =~ s!/!__!g;
76 # Must NOT install 'DynaLoader::boot_DynaLoader' as 'bootstrap'!
77 # boot_DynaLoader is called directly in DynaLoader.pm
78 $ccode = "\t/* DynaLoader is a special case */\n
79 \tnewXS(\"${mname}::boot_${cname}\", boot_${cname}, file);\n";
80 print $ccode unless $SEEN{$ccode}++;
82 $ccode = "\tnewXS(\"${mname}::bootstrap\", boot_${cname}, file);\n";
83 print $ccode unless $SEEN{$ccode}++;
93 # might be X::Y or lib/auto/X/Y/Y.a
95 s:^(lib|ext)/(auto/)?::;
98 grep(s:/:$as:, @ext) if ($as ne '/');