X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=win32%2Fconfig_sh.PL;h=9e53b54827e211df2b6b580e407112417807dc79;hb=d20626d86bf3d55ba658adbc2678de4c519cbc6c;hp=3edc20bdac0f4105ae89f7242fb84c16ba8c3066;hpb=691c0cce63d17f1cd46c50c7861ddd4fb55f308c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/win32/config_sh.PL b/win32/config_sh.PL index 3edc20b..9e53b54 100644 --- a/win32/config_sh.PL +++ b/win32/config_sh.PL @@ -17,12 +17,30 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) shift(@ARGV); } +my $pl_h = '../patchlevel.h'; + $opt{VERSION} = $]; $opt{INST_VER} =~ s|~VERSION~|$]|g; -if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true - $opt{PERL_VERSION} = int($1 || 0); - $opt{PERL_SUBVERSION} = $2 || '00'; +if (-e $pl_h) { + open PL, "<$pl_h" or die "Can't open $pl_h: $!"; + while () { + if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) { + $opt{$1} = $2; + } + } + close PL; +} +elsif ($] =~ /^(\d+)\.(\d\d\d)?(\d\d)?$/) { # should always be true + $opt{PERL_REVISION} = $1; + $opt{PERL_VERSION} = int($2 || 0); + $opt{PERL_SUBVERSION} = $3; + $opt{PERL_APIVERSION} = $]; } +else { + die "Can't parse perl version ($])"; +} + +$opt{PERL_SUBVERSION} ||= '00'; $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'}; $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]