prototype("CORE::recv")
[p5sagit/p5-mst-13.2.git] / win32 / buildext.pl
CommitLineData
17af6fb0 1use File::Basename;
2use Cwd;
8e232993 3use FindExt;
17af6fb0 4my $here = getcwd();
5my $perl = $^X;
6$here =~ s,/,\\,g;
7if ($perl =~ m#^\.\.#)
8 {
9 $perl = "$here\\$perl";
10 }
11my $make = shift;
f76dcffd 12$make .= " ".shift while $ARGV[0]=~/^-/;
17af6fb0 13my $dep = shift;
14my $dmod = -M $dep;
15my $dir = shift;
16chdir($dir) || die "Cannot cd to $dir\n";
17(my $ext = getcwd()) =~ s,/,\\,g;
8e232993 18FindExt::scan_ext($ext);
17af6fb0 19
8e232993 20my @ext = FindExt::extensions();
21
22foreach my $dir (sort @ext)
17af6fb0 23 {
24 if (chdir("$ext\\$dir"))
25 {
26 my $mmod = -M 'Makefile';
27 if (!(-f 'Makefile') || $mmod > $dmod)
28 {
0026721a 29 print "\nRunning Makefile.PL in $dir\n";
17af6fb0 30 my $code = system($perl,"-I$here\\..\lib",'Makefile.PL','INSTALLDIRS=perl');
31 warn "$code from $dir's Makefile.PL" if $code;
32 $mmod = -M 'Makefile';
33 if ($mmod > $dmod)
34 {
35 warn "Makefile $mmod > $dmod ($dep)\n";
36 }
37 }
38 print "\nMaking $dir\n";
39 system($make);
40 chdir($here) || die "Cannot cd to $here:$!";
41 }
42 else
43 {
44 warn "Cannot cd to $ext\\$dir:$!";
45 }
46 }
47