# New Ticket Created by  Bernhard Schmalhofer 
# Please include the string:  [perl #37049]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37049 >


Hi,

ExtUtils::Command provides Unix commands on several platforms.
So it make sense to use ExtUtils::Command per default and not only for 
Win32.

The attached makes use of 'rm_f', 'rm_rf', 'cp' and 'touch' from 
ExtUtils::Command.
Could some kind souls test the patch on some platforms before I commit it?

CU, Bernhard




Index: config/init/data.pl
===================================================================
--- config/init/data.pl	(Revision 9118)
+++ config/init/data.pl	(Arbeitskopie)
@@ -117,8 +117,8 @@
 
     perl          => $^X,
     test_prog     => 'parrot',
-    rm_f          => 'rm -f',
-    rm_rf         => 'rm -rf',
+    rm_f          => '$(PERL) -MExtUtils::Command -e rm_f',
+    rm_rf         => '$(PERL) -MExtUtils::Command -e rm_rf',
     ar            => $Config{ar},
     ar_flags      => 'cr',
     ar_out        => '',                  # for Win32
@@ -135,7 +135,7 @@
     platform_asm  => 0,                   # if platform has a .s file that needs to be assembled
     as            => 'as',                # assembler
 
-    cp            => 'cp',
+    cp            => '$(PERL) -MExtUtils::Command -e cp',
     lns           => $Config{lns},        # soft link
     # On all platform slash == slash_exec, except with MinGW
     # slash_exec is needed by pathname of executable in test or makefile
Index: config/init/hints/mswin32.pl
===================================================================
--- config/init/hints/mswin32.pl	(Revision 9118)
+++ config/init/hints/mswin32.pl	(Arbeitskopie)
@@ -18,8 +18,6 @@
 	my $is_bcc   = grep { $cc eq $_ } ( qw(bcc32 bcc32.exe) );
 
 	Configure::Data->set(
-		rm_f  => '$(PERL) -MExtUtils::Command -e rm_f',
-		rm_rf => '$(PERL) -MExtUtils::Command -e rm_rf',
                 PQ    => '"',
                 make_c=> '$(PERL) -e "chdir shift @ARGV; system \'$(MAKE)\', @ARGV; exit $$? >> 8;"',
 		ncilib_link_extra => '-def:src/libnci_test.def',
@@ -52,7 +50,6 @@
 			ld_out     => '-out:',
 			ldflags    => '-nologo -nodefaultlib',
 			blib_lib_libparrot_a => 'blib/lib/libparrot_s$(A)',
-			cp         => 'copy',
 			ar_flags   => '',
 			ar_out     => '-out:',
 			slash      => '\\',
@@ -100,7 +97,6 @@
 			ld_out     => '-out:',
 			ldflags    => '-nologo -nodefaultlib',
 			blib_lib_libparrot_a => 'blib/lib/libparrot_s$(A)',
-			cp         => 'copy',
 			ar         => 'xilib',
 			ar_flags   => '',
 			ar_out     => '-out:',
@@ -143,7 +139,6 @@
                         link => ${cc},
                         linkflags => '',
 
-			cp => 'copy',
                         ar => 'tlib',
                         ar_flags => '',
                         ar_out => '',
@@ -163,7 +158,6 @@
 				'ar' => 'ar',
 				'cc' => 'gcc',
 				'ccflags' => '-DWIN32 ',
-				'cp' => '$(PERL) -MExtUtils::Command -e cp',
 				'ld' => 'g++',
 				'ld_load_flags' => '-shared ',
 				'ld_share_flags' => '-shared ',
@@ -185,7 +179,6 @@
 		} elsif ($make =~ /dmake/i) {
 			# mingw Perl
 			Configure::Data->set(
-				'cp' => '$(PERL) -MExtUtils::Command -e cp',
 				'ld_load_flags' => '-shared ',
 				'ld_share_flags' => '-shared ',
 				'make' => 'mingw32-make',
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in	(Revision 9118)
+++ config/gen/makefiles/root.in	(Arbeitskopie)
@@ -84,7 +84,7 @@
 AR_CR      = ${ar} ${ar_flags}
 RANLIB     = ${ranlib}
 PERL       = ${perl}
-TOUCH      = $(PERL) -e ${PQ}open(A,qq{>>$$_}) or die foreach @ARGV${PQ}
+TOUCH      = $(PERL) -MExtUtils::Command -e touch 
 YACC       = ${yacc}
 LEX        = ${lex}
 # do not die when dir already exits

Reply via email to