develooper Front page | perl.perl5.porters | Postings from September 2003

RE: MM in maint@21251 breaks mp2

Thread Previous | Thread Next
From:
Orton, Yves
Date:
September 17, 2003 07:47
Subject:
RE: MM in maint@21251 breaks mp2
Message ID:
71B318898201D311845C0008C75DAD1C089611FE@defra1ex2
diff -wurd ExtUtils-MakeMaker-6.17/lib/ExtUtils/MM_Unix.pm ExtUtils-MakeMaker-6.17-Patched-Test/lib/ExtUtils/MM_Unix.pm
--- ExtUtils-MakeMaker-6.17/lib/ExtUtils/MM_Unix.pm	2003-09-16 00:14:42.000000000 +0200
+++ ExtUtils-MakeMaker-6.17-Patched-Test/lib/ExtUtils/MM_Unix.pm	2003-09-17 16:12:53.000000000 +0200
@@ -1886,17 +1886,19 @@
 
 =item init_others
 
-Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH, LD,
+Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH,
 OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, SHELL, NOOP,
 FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F,
 TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N
 
+LD is initialized in init_linker()
+
 =cut
 
 sub init_others {	# --- Initialize Other Attributes
     my($self) = shift;
 
-    $self->{LD} ||= 'ld';
+
 
     # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
     # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
@@ -2237,10 +2239,14 @@
 
 Unix has no need of special linker flags.
 
+However this does initialize the default linker if it has not already been set. It uses
+the value from Config and then falls back to 'ld'
+
 =cut
 
 sub init_linker {
     my($self) = shift;
+    $self->{LD} ||= $Config{ld} || 'ld';
     $self->{PERL_ARCHIVE} ||= '';
     $self->{PERL_ARCHIVE_AFTER} ||= '';
     $self->{EXPORT_LIST}  ||= '';
diff -wurd ExtUtils-MakeMaker-6.17/lib/ExtUtils/MM_Win32.pm ExtUtils-MakeMaker-6.17-Patched-Test/lib/ExtUtils/MM_Win32.pm
--- ExtUtils-MakeMaker-6.17/lib/ExtUtils/MM_Win32.pm	2003-09-16 00:14:50.000000000 +0200
+++ ExtUtils-MakeMaker-6.17-Patched-Test/lib/ExtUtils/MM_Win32.pm	2003-09-17 16:16:25.000000000 +0200
@@ -155,8 +155,8 @@
 Override some of the Unix specific commands with portable
 ExtUtils::Command ones.
 
-Also provide defaults for LD and AR in case the %Config values aren't
-set.
+Also provide a default for AR in case the %Config values aren't
+set. LD is now set in init_linker().
 
 LDLOADLIBS's default is changed to $Config{libs}.
 
@@ -181,7 +181,7 @@
     $self->{TEST_F}   ||= '$(PERLRUN) -MExtUtils::Command -e test_f';
     $self->{DEV_NULL} ||= '> NUL';
 
-    $self->{LD}     ||= $Config{ld} || 'link';
+
     $self->{AR}     ||= $Config{ar} || 'lib';
 
     $self->SUPER::init_others;
@@ -382,11 +382,15 @@
 
 =item init_linker
 
+Unless previosuly set initializes LD to be the linker specified in Config and falls back
+to the standard Win32 linker 'link'.
+
 =cut
 
 sub init_linker {
     my $self = shift;
 
+    $self->{LD}     ||= $Config{ld} || 'link';
     $self->{PERL_ARCHIVE}       = "\$(PERL_INC)\\$Config{libperl}";
     $self->{PERL_ARCHIVE_AFTER} = '';
     $self->{EXPORT_LIST}        = '$(BASEEXT).def';
diff -wurd ExtUtils-MakeMaker-6.17/t/MM_Unix.t ExtUtils-MakeMaker-6.17-Patched-Test/t/MM_Unix.t
--- ExtUtils-MakeMaker-6.17/t/MM_Unix.t	2003-08-01 21:58:46.000000000 +0200
+++ ExtUtils-MakeMaker-6.17-Patched-Test/t/MM_Unix.t	2003-09-17 16:24:55.000000000 +0200
@@ -18,7 +18,7 @@
         plan skip_all => 'Non-Unix platform';
     }
     else {
-        plan tests => 115;
+        plan tests => 116;
     }
 }
 
@@ -235,7 +235,7 @@
 ###############################################################################
 
 $t->init_linker;
-foreach (qw/ EXPORT_LIST PERL_ARCHIVE PERL_ARCHIVE_AFTER /)
+foreach (qw/ EXPORT_LIST PERL_ARCHIVE PERL_ARCHIVE_AFTER LD /)
 {
     ok( exists $t->{$_}, "$_ was defined" );
     is( $t->{$_}, '', "$_ is empty on Unix"); 
diff -wurd ExtUtils-MakeMaker-6.17/t/MM_Win32.t ExtUtils-MakeMaker-6.17-Patched-Test/t/MM_Win32.t
--- ExtUtils-MakeMaker-6.17/t/MM_Win32.t	2003-07-23 11:07:14.000000000 +0200
+++ ExtUtils-MakeMaker-6.17-Patched-Test/t/MM_Win32.t	2003-09-17 16:23:34.000000000 +0200
@@ -110,12 +110,12 @@
 }
 
 # init_others(): check if all keys are created and set?
-# qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP TEST_F LD AR LDLOADLIBS DEV_NUL )
+# qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP TEST_F AR LDLOADLIBS DEV_NUL )
 {
     my $mm_w32 = bless( { BASEEXT => 'Foo' }, 'MM' );
     $mm_w32->init_others();
     my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP 
-                   TEST_F LD AR LDLOADLIBS DEV_NULL );
+                   TEST_F AR LDLOADLIBS DEV_NULL );
     for my $key ( @keys ) {
         ok( $mm_w32->{ $key }, "init_others: $key" );
     }
@@ -192,6 +192,7 @@
     my $after   = '';
     $MM->init_linker;
 
+    ok( $MM->{ LD }, "init_linker sets LD" );
     is( $MM->{PERL_ARCHIVE},        $libperl,   'PERL_ARCHIVE' );
     is( $MM->{PERL_ARCHIVE_AFTER},  $after,     'PERL_ARCHIVE_AFTER' );
     is( $MM->{EXPORT_LIST},         $export,    'EXPORT_LIST' );

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About