X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=minimod.pl;h=a5bd17220421f41fe55790ff23142ccb9c72aaaa;hb=17c59fdf7540adaf656e96fe6d48b58dab391dc0;hp=8efbd31ffc5be2ad391ab36139885acbbdeb3868;hpb=20ce7b12268a3d32b5b246928de5084322e709cf;p=p5sagit%2Fp5-mst-13.2.git diff --git a/minimod.pl b/minimod.pl index 8efbd31..a5bd172 100644 --- a/minimod.pl +++ b/minimod.pl @@ -1,4 +1,5 @@ -# minimod.PL writes the contents of miniperlmain.c into the module +#./miniperl -w +# minimod.pl writes the contents of miniperlmain.c into the module # ExtUtils::Miniperl for later perusal (when the perl source is # deleted) # @@ -10,6 +11,10 @@ # # Version 1.0, Feb 2nd 1995 by Andreas Koenig +BEGIN { unshift @INC, "lib" } + +use strict; + print <<'END'; # This File keeps the contents of miniperlmain.c. # @@ -32,6 +37,7 @@ open MINI, "miniperlmain.c"; while () { last if /Do not delete this line--writemain depends on it/; print; + /#include "perl.h"/ and print qq/#include "XSUB.h"\n/; } print <<'END'; @@ -59,14 +65,15 @@ sub writemain{ my($mname, $cname); ($mname = $pname) =~ s!/!::!g; ($cname = $pname) =~ s!/!__!g; - print "EXTERN_C void boot_${cname} (CV* cv);\n"; + print "EXTERN_C void boot_${cname} (pTHX_ CV* cv);\n"; } - my ($tail1,$tail2) = ( $tail =~ /\A(.*\n)(\s*\}.*)\Z/s ); - print $tail1; + my ($tail1,$tail2,$tail3) = ( $tail =~ /\A(.*{\s*\n)(.*\n)(\s*\}.*)\Z/s ); - print "\tchar *file = __FILE__;\n"; + print $tail1; + print "\tconst char file[] = __FILE__;\n"; print "\tdXSUB_SYS;\n" if $] > 5.002; + print $tail2; foreach $_ (@exts){ my($pname) = canon('/', $_); @@ -86,7 +93,7 @@ sub writemain{ } print "\t}\n"; } - print $tail2; + print $tail3; } sub canon{