difforig perl-5.10.0/lib/ExtUtils

2007-12-22  Reini Urban <rurban@x-ray.at>

diff -ub  perl-5.10.0/lib/ExtUtils/Command.pm.orig
--- perl-5.10.0/lib/ExtUtils/Command.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ perl-5.10.0/lib/ExtUtils/Command.pm	2007-12-22 15:32:57.968750000 +0000
@@ -10,9 +10,9 @@
 require Exporter;
 use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
 @ISA       = qw(Exporter);
-@EXPORT    = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f test_d chmod
+@EXPORT    = qw(cp rm_f rm_rf mv cat eqtime mkpath touch test_f test_s test_d chmod
                 dos2unix);
-$VERSION = '1.13';
+$VERSION = '1.13_01';
 
 my $Is_VMS = $^O eq 'VMS';
 
@@ -31,6 +31,7 @@
   perl -MExtUtils::Command -e mkpath directories...
   perl -MExtUtils::Command -e eqtime source destination
   perl -MExtUtils::Command -e test_f file
+  perl -MExtUtils::Command -e test_s file
   perl -MExtUtils::Command -e test_d directory
   perl -MExtUtils::Command -e chmod mode files...
   ...
@@ -273,6 +274,19 @@
  exit(-f $ARGV[0] ? 0 : 1);
 }
 
+=item test_s
+
+    test_s file
+
+Tests if a file exists and is not empty (size > 0).  I<Exits> with 0 if it does, 1 if it does not.
+
+=cut 
+
+sub test_s
+{
+ exit(-s $ARGV[0] ? 0 : 1);
+}
+
 =item test_d
 
     test_d directory
diff -ub  perl-5.10.0/lib/ExtUtils/MM_Any.pm.orig
--- perl-5.10.0/lib/ExtUtils/MM_Any.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ perl-5.10.0/lib/ExtUtils/MM_Any.pm	2007-12-22 15:32:57.984375000 +0000
@@ -459,7 +459,7 @@
 #                    $(INST_BIN) $(INST_SCRIPT)
 #                    $(INST_MAN1DIR) $(INST_MAN3DIR)
 #                    $(INST_LIBDIR) $(INST_ARCHLIBDIR) $(INST_AUTODIR) 
-#                    $(INST_STATIC) $(INST_DYNAMIC) $(INST_BOOT)
+#                    $(INST_STATIC) $(INST_DYNAMIC)
 #                 );
                   
 
@@ -644,10 +644,11 @@
 
 sub dynamic {
 # --- Dynamic Loading Sections ---
+# Note:  $(INST_BOOT) moved to dynamic_lib to get rid of empty .bs
 
     my($self) = shift;
     '
-dynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
+dynamic :: $(FIRST_MAKEFILE) $(BOOTSTRAP) $(INST_DYNAMIC)
 	$(NOECHO) $(NOOP)
 ';
 }
diff -ub  perl-5.10.0/lib/ExtUtils/MM_Unix.pm.orig
--- perl-5.10.0/lib/ExtUtils/MM_Unix.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ perl-5.10.0/lib/ExtUtils/MM_Unix.pm	2007-12-22 15:32:58.000000000 +0000
@@ -865,7 +865,7 @@
 
 # As Mkbootstrap might not write a file (if none is required)
 # we use touch to prevent make continually trying to remake it.
-# The DynaLoader only reads a non-empty file.
+# BOOTSTRAP only gets installed if non-empty.
 $(BOOTSTRAP) : $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DFSEP).exists
 	$(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
 	$(NOECHO) $(PERLRUN) \
@@ -873,11 +873,6 @@
 		-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
 	$(NOECHO) $(TOUCH) %s
 	$(CHMOD) $(PERM_RW) %s
-
-$(INST_BOOT) : $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists
-	$(NOECHO) $(RM_RF) %s
-	- $(CP) $(BOOTSTRAP) %s
-	$(CHMOD) $(PERM_RW) %s
 MAKE_FRAG
 }
 
@@ -909,7 +904,7 @@
 INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
 INST_DYNAMIC_FIX = '.$ld_fix.'
 
-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(BOOTSTRAP) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
+$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
 ');
     if ($armaybe ne ':'){
 	$ldfrom = 'tmp$(LIB_EXT)';
@@ -955,8 +950,12 @@
 	  $(INST_DYNAMIC_FIX)
 MAKE
 
+    # copy .bs only if non-empty	
     push @m, <<'MAKE';
 	$(CHMOD) $(PERM_RWX) $@
+	$(NOECHO) $(RM_RF) $(BOOTSTRAP)
+	- $(TEST_S) $(BOOTSTRAP) && $(CP) $(BOOTSTRAP) $(INST_BOOT) && \
+	  $(CHMOD) $(PERM_RW) $(INST_BOOT)
 MAKE
 
     return join('',@m);
@@ -1734,7 +1733,7 @@
 
 Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH, LD,
 OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, SHELL, NOOP,
-FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F,
+FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F, TEST_S,
 TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N
 
 =cut
@@ -1811,6 +1810,7 @@
     $self->{RM_RF}      ||= "rm -rf";
     $self->{TOUCH}      ||= "touch";
     $self->{TEST_F}     ||= "test -f";
+    $self->{TEST_S}     ||= "test -s";
     $self->{CP}         ||= "cp";
     $self->{MV}         ||= "mv";
     $self->{CHMOD}      ||= "chmod";
@@ -3523,7 +3523,7 @@
 
     # We set PM_FILTER as late as possible so it can see all the earlier
     # on macro-order sensitive makes such as nmake.
-    for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TOUCH 
+    for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TEST_S TOUCH 
                       UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP 
                       ECHO ECHO_N
                       UNINST VERBINST
diff -ub  perl-5.10.0/lib/ExtUtils/MM_VMS.pm.orig
--- perl-5.10.0/lib/ExtUtils/MM_VMS.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ perl-5.10.0/lib/ExtUtils/MM_VMS.pm	2007-12-22 15:32:58.015625000 +0000
@@ -473,6 +473,7 @@
     $self->{RM_F}     ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_f';
     $self->{RM_RF}    ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e rm_rf';
     $self->{TEST_F}   ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e test_f';
+    $self->{TEST_S}   ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e test_s';
     $self->{EQUALIZE_TIMESTAMP} ||= '$(ABSPERLRUN) -we "open F,qq{>>$ARGV[1]};close F;utime(0,(stat($ARGV[0]))[9]+1,$ARGV[1])"';
 
     $self->{MOD_INSTALL} ||= 
diff -ub  perl-5.10.0/lib/ExtUtils/MM_Win32.pm.orig
--- perl-5.10.0/lib/ExtUtils/MM_Win32.pm.orig	2007-12-18 10:47:07.000000000 +0000
+++ perl-5.10.0/lib/ExtUtils/MM_Win32.pm	2007-12-22 15:32:58.015625000 +0000
@@ -165,6 +165,7 @@
     $self->{MV}       ||= '$(ABSPERLRUN) -MExtUtils::Command -e mv';
     $self->{NOOP}     ||= 'rem';
     $self->{TEST_F}   ||= '$(ABSPERLRUN) -MExtUtils::Command -e test_f';
+    $self->{TEST_S}   ||= '$(ABSPERLRUN) -MExtUtils::Command -e test_s';
     $self->{DEV_NULL} ||= '> NUL';
 
     $self->{FIXIN}    ||= $self->{PERL_CORE} ? 

