Integrate perlio:
[p5sagit/p5-mst-13.2.git] / win32 / config_sh.PL
index b1c7b9f..9757e52 100644 (file)
@@ -1,3 +1,4 @@
+use FindExt;
 # take a semicolon separated path list and turn it into a quoted
 # list of paths that Text::Parsewords will grok
 sub mungepath {
@@ -33,17 +34,21 @@ sub loadopts {
     }
 }
 
+FindExt::scan_ext("../ext");
+
 my %opt;
+
 my $optref = loadopts();
 while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) {
     $opt{$1}=$2;
     shift(@{$optref});
 }
 
+$opt{'dynamic_ext'} = join(' ',FindExt::dynamic_extensions());
+$opt{'nonxs_ext'}   = join(' ',FindExt::noxs_extensions());
+
 my $pl_h = '../patchlevel.h';
 
-$opt{VERSION} = $];
-$opt{INST_VER} =~ s|~VERSION~|$]|g;
 if (-e $pl_h) {
     open PL, "<$pl_h" or die "Can't open $pl_h: $!";
     while (<PL>) {
@@ -53,17 +58,11 @@ if (-e $pl_h) {
     }
     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 ($])";
+    die "Can't find $pl_h: $!";
 }
-
-$opt{PERL_SUBVERSION} ||= '00';
+$opt{VERSION} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
+$opt{INST_VER} =~ s|~VERSION~|$opt{VERSION}|g;
 
 $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'};
 $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0]