summaryrefslogtreecommitdiff
path: root/win32/config_sh.PL
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-10-27 23:54:36 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-10-27 23:54:36 +0000
commit52b0428e3435010996923055059a0bfd91b64619 (patch)
tree0f4e66aeebe692c43e225c6d523900f911a29587 /win32/config_sh.PL
parentbca6c107bab5aabfb35be60303a5b31e9c9ec4a4 (diff)
downloadperl-52b0428e3435010996923055059a0bfd91b64619.tar.gz
regen config* stuff for windows
p4raw-id: //depot/perl@4476
Diffstat (limited to 'win32/config_sh.PL')
-rw-r--r--win32/config_sh.PL18
1 files changed, 16 insertions, 2 deletions
diff --git a/win32/config_sh.PL b/win32/config_sh.PL
index a5c6c0dec8..9e53b54827 100644
--- a/win32/config_sh.PL
+++ b/win32/config_sh.PL
@@ -17,17 +17,31 @@ 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\d)?$/) { # should always be true
+if (-e $pl_h) {
+ open PL, "<$pl_h" or die "Can't open $pl_h: $!";
+ while (<PL>) {
+ 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 || '00';
+ $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]
unless $opt{'cf_email'};