In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/9b7091183a0e6b41a658e590f90e543efae3b2e4?hp=710e07e27761e9989c10a90b08bcfb94284b9806>

- Log -----------------------------------------------------------------
commit 9b7091183a0e6b41a658e590f90e543efae3b2e4
Author: Steve Hay <[email protected]>
Date:   Tue Sep 29 15:41:46 2009 +0100

    Put a watchdog on openpid.t: it has been found to hang in some Win32 smokes.

M       t/io/openpid.t

commit a85e0e8cf88042961f6f69a4f64e20f985d31654
Author: Steve Hay <[email protected]>
Date:   Tue Sep 29 15:41:06 2009 +0100

    Fix distclean on Win32
    
    nmake realclean in the Encode sub-dirs didn't work because it needed an
    extra ../ on the relative paths in @INC. Make the paths absolute instead.
    
    nmake realclean in DynaLoader didn't work either because it tried to make
    DynaLoader.c... three times. Move the loop over @ext out of the loop over
    @dirs to fix the repetitions, but don't add DynaLoader.c anyway when just
    making a 'clean' target.
    
    Also clean up the XSLoader.pm that gets left behind.

M       make_ext.pl
M       win32/Makefile
M       win32/makefile.mk
-----------------------------------------------------------------------

Summary of changes:
 make_ext.pl       |   68 ++++++++++++++++++++++++++++------------------------
 t/io/openpid.t    |    2 +-
 win32/Makefile    |    1 +
 win32/makefile.mk |    1 +
 4 files changed, 40 insertions(+), 32 deletions(-)

diff --git a/make_ext.pl b/make_ext.pl
index b1980a5..e272d5b 100644
--- a/make_ext.pl
+++ b/make_ext.pl
@@ -3,9 +3,10 @@ use strict;
 use warnings;
 use Config;
 BEGIN {
-    unshift @INC, $^O eq 'MSWin32' ? '../cpan/Cwd' : 'cpan/Cwd';
+    unshift @INC, $^O eq 'MSWin32' ? ('../cpan/Cwd', '../cpan/Cwd/lib') : 
'cpan/Cwd';
 }
 use Cwd;
+use File::Spec::Functions qw(rel2abs);
 
 # To clarify, this isn't the entire suite of modules considered "toolchain"
 # It's not even all modules needed to build ext/
@@ -179,35 +180,36 @@ if ($is_Win32) {
        (my $ext = getcwd()) =~ s{/}{\\}g;
        FindExt::scan_ext($ext);
        FindExt::set_static_extensions(split ' ', $Config{static_ext});
+       chdir $build
+           or die "Couldn't chdir to '$build': $!"; # restore our start 
directory
+    }
 
-       my @ext;
-       push @ext, FindExt::static_ext() if $static;
-       push @ext, FindExt::dynamic_ext() if $dynamic;
-       push @ext, FindExt::nonxs_ext() if $nonxs;
-       push @ext, 'DynaLoader' if $dynaloader;
+    my @ext;
+    push @ext, FindExt::static_ext() if $static;
+    push @ext, FindExt::dynamic_ext() if $dynamic;
+    push @ext, FindExt::nonxs_ext() if $nonxs;
+    push @ext, 'DynaLoader' if $dynaloader;
 
-       foreach (sort @ext) {
-           if (%incl and !exists $incl{$_}) {
-               #warn "Skipping extension $ext\\$_, not in inclusion list\n";
-               next;
-           }
-           if (exists $excl{$_}) {
-               warn "Skipping extension $ext\\$_, not ported to current 
platform";
-               next;
-           }
-           push @extspec, $_;
-           if($_ eq 'DynaLoader') {
-               # No, we don't know why nmake can't work out the dependency 
chain
-               push @{$extra_passthrough{$_}}, 'DynaLoader.c';
-           } elsif(FindExt::is_static($_)) {
-               push @{$extra_passthrough{$_}}, 'LINKTYPE=static';
-           }
+    foreach (sort @ext) {
+       if (%incl and !exists $incl{$_}) {
+           #warn "Skipping extension $_, not in inclusion list\n";
+           next;
+       }
+       if (exists $excl{$_}) {
+           warn "Skipping extension $_, not ported to current platform";
+           next;
+       }
+       push @extspec, $_;
+       if($_ eq 'DynaLoader' and $target !~ /clean$/) {
+           # No, we don't know why nmake can't work out the dependency chain
+           push @{$extra_passthrough{$_}}, 'DynaLoader.c';
+       } elsif(FindExt::is_static($_)) {
+           push @{$extra_passthrough{$_}}, 'LINKTYPE=static';
        }
-       chdir $build
-           or die "Couldn't chdir to '$build': $!"; # restore our start 
directory
     }
+
     chdir '..'
-       or die "Couldn't chdir to build directory: $!"; # now in the Perl build 
directory
+       or die "Couldn't chdir to build directory: $!"; # now in the Perl build
 }
 elsif ($is_VMS) {
     $perl = $^X;
@@ -271,6 +273,11 @@ foreach my $spec (@extspec)  {
 sub build_extension {
     my ($ext_dir, $perl, $mname, $pass_through) = @_;
 
+    unless (chdir "$ext_dir") {
+       warn "Cannot cd to $ext_dir: $!";
+       return;
+    }
+
     my $up = $ext_dir;
     $up =~ s![^/]+!..!g;
 
@@ -280,14 +287,13 @@ sub build_extension {
     # $lib_dir must be last, as we're copying files into it, and in a parallel
     # make there's a race condition if one process tries to open a module that
     # another process has half-written.
-    $ENV{PERL5LIB}
-       = join $Config{path_sep}, (map {"$up/$_"} @toolchain), $lib_dir;
+    my @new_inc = ((map {"$up/$_"} @toolchain), $lib_dir);
+    if ($is_Win32) {
+       @new_inc = map {rel2abs($_)} @new_inc;
+    }
+    $ENV{PERL5LIB} = join $Config{path_sep}, @new_inc;
     $ENV{PERL_CORE} = 1;
 
-    unless (chdir "$ext_dir") {
-       warn "Cannot cd to $ext_dir: $!";
-       return;
-    }
     my $makefile;
     if ($is_VMS) {
        $makefile = 'descrip.mms';
diff --git a/t/io/openpid.t b/t/io/openpid.t
index 7503f34..ee4702c 100644
--- a/t/io/openpid.t
+++ b/t/io/openpid.t
@@ -18,7 +18,7 @@ if ($^O eq 'dos') {
 }
 
 plan tests => 10;
-
+watchdog(15);
 
 use Config;
 $| = 1;
diff --git a/win32/Makefile b/win32/Makefile
index 3459014..e59bbe1 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -1152,6 +1152,7 @@ distclean: realclean
        -del /f $(LIBDIR)\Win32CORE.pm
        -del /f $(LIBDIR)\Win32API\File.pm
        -del /f $(LIBDIR)\Win32API\File\cFile.pc
+       -del /f $(DISTDIR)\XSLoader\XSLoader.pm
        -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
        -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
        -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data
diff --git a/win32/makefile.mk b/win32/makefile.mk
index 3dc0fe5..04d7143 100644
--- a/win32/makefile.mk
+++ b/win32/makefile.mk
@@ -1485,6 +1485,7 @@ distclean: realclean
        -del /f $(LIBDIR)\Win32CORE.pm
        -del /f $(LIBDIR)\Win32API\File.pm
        -del /f $(LIBDIR)\Win32API\File\cFile.pc
+       -del /f $(DISTDIR)\XSLoader\XSLoader.pm
        -if exist $(LIBDIR)\B rmdir /s /q $(LIBDIR)\B
        -if exist $(LIBDIR)\Compress rmdir /s /q $(LIBDIR)\Compress
        -if exist $(LIBDIR)\Data rmdir /s /q $(LIBDIR)\Data

--
Perl5 Master Repository

Reply via email to