AUTHORS updates.
[p5sagit/p5-mst-13.2.git] / win32 / buildext.pl
index 6e64b91..5800750 100644 (file)
@@ -1,6 +1,6 @@
-use File::Find;
 use File::Basename;
 use Cwd;
+use FindExt;
 my $here = getcwd();
 my $perl = $^X;
 $here =~ s,/,\\,g;
@@ -9,24 +9,24 @@ if ($perl =~ m#^\.\.#)
   $perl = "$here\\$perl";
  }
 my $make = shift;
+$make .= " ".shift while $ARGV[0]=~/^-/;
 my $dep  = shift;
 my $dmod = -M $dep;
 my $dir  = shift;
 chdir($dir) || die "Cannot cd to $dir\n";
 (my $ext = getcwd()) =~ s,/,\\,g;
-my $no = join('|',qw(DynaLoader GDBM_File ODBM_File NDBM_File DB_File Syslog Sysv));
-$no = qr/^(?:$no)$/i;
-my %ext;
-find(\&find_xs,'.');
+FindExt::scan_ext($ext);
 
-foreach my $dir (sort keys %ext)
+my @ext = FindExt::extensions();
+
+foreach my $dir (sort @ext)
  {
   if (chdir("$ext\\$dir"))
    {
     my $mmod = -M 'Makefile';
     if (!(-f 'Makefile') || $mmod > $dmod)
      {
-      print "\nMakefile.PL in $dir ($mmod > $dmod)\n";
+      print "\nRunning Makefile.PL in $dir\n";
       my $code = system($perl,"-I$here\\..\lib",'Makefile.PL','INSTALLDIRS=perl');
       warn "$code from $dir's Makefile.PL" if $code;
       $mmod = -M 'Makefile';
@@ -45,19 +45,3 @@ foreach my $dir (sort keys %ext)
    }
  }
 
-sub find_xs
-{
- if (/^(.*)\.pm$/i)
-  {
-   my $name = $1;
-   return if $name =~ $no; 
-   my $dir = $File::Find::dir; 
-   $dir =~ s,./,,;
-   return if exists $ext{$dir};
-   return unless -f "$ext/$dir/Makefile.PL";
-   if ($dir =~ /$name$/i)
-    {
-     $ext{$dir} = $name; 
-    }
-  }
-}
\ No newline at end of file