This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow Data::Dumper to work on older Perls
[perl5.git]
/
minimod.pl
diff --git
a/minimod.pl
b/minimod.pl
index
b9b7071
..
a5bd172
100644
(file)
--- 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)
#
# ExtUtils::Miniperl for later perusal (when the perl source is
# deleted)
#
@@
-10,6
+11,10
@@
#
# Version 1.0, Feb 2nd 1995 by Andreas Koenig
#
# 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.
#
print <<'END';
# This File keeps the contents of miniperlmain.c.
#
@@
-32,6
+37,7
@@
open MINI, "miniperlmain.c";
while (<MINI>) {
last if /Do not delete this line--writemain depends on it/;
print;
while (<MINI>) {
last if /Do not delete this line--writemain depends on it/;
print;
+ /#include "perl.h"/ and print qq/#include "XSUB.h"\n/;
}
print <<'END';
}
print <<'END';
@@
-40,7
+46,7
@@
$tail=<<'EOF!TAIL';
END
while (<MINI>) {
END
while (<MINI>) {
- print;
+ print
unless /dXSUB_SYS/
;
}
close MINI;
}
close MINI;
@@
-59,13
+65,16
@@
sub writemain{
my($mname, $cname);
($mname = $pname) =~ s!/!::!g;
($cname = $pname) =~ s!/!__!g;
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 );
+ my ($tail1,$tail2,$tail3) = ( $tail =~ /\A(.*{\s*\n)(.*\n)(\s*\}.*)\Z/s );
+
print $tail1;
print $tail1;
+ print "\tconst char file[] = __FILE__;\n";
+ print "\tdXSUB_SYS;\n" if $] > 5.002;
+ print $tail2;
- print " char *file = __FILE__;\n";
foreach $_ (@exts){
my($pname) = canon('/', $_);
my($mname, $cname, $ccode);
foreach $_ (@exts){
my($pname) = canon('/', $_);
my($mname, $cname, $ccode);
@@
-84,7
+93,7
@@
sub writemain{
}
print "\t}\n";
}
}
print "\t}\n";
}
- print $tail
2
;
+ print $tail
3
;
}
sub canon{
}
sub canon{