Title: RE: [EMAIL PROTECTED] [PATCH MakeMaker and File::Spec::Win32]

Rafael Garcia-Suarez wrote
>ok : I applied this to perl-5.6.2 :
>
>Change 21006 on 2003/09/02 by [EMAIL PROTECTED]
>
>        Upgrade to File::Spec 0.85, grabbed from CPAN.
>        Get t/rel2abs2rel.t from bleadperl, because t/TEST was
>        unhappy with its unstandard test output.
>        Remove the old t/lib/filespec.t.
>
>Could you repost the relevant MM_Unix patch ? I'll apply it to blead
>as well, unless Schwern objects.

Yep no problem.

Patch is below and attached in case the MS gremlins eat it.

Schwern I hope you are ok with this.

The basic problem is that since init_main gets called before the OS specific init_others the linker is automatically set to "ld" which then causes extensions to fail build (doesnt affect perl itself as the linker is hard coded into the Win32 makefile).

So by moving the LD assignment to MM_Unix::init_others() the OS specific version gets called first, sets LD and then the unix specific setting isnt applied becuase of the ||=

Anyway, if you'd like me to test some other variant under VC/nmake then id be happy to help out.

BTW, I cant help wondering how many other things like this are possible booby traps. I somehow doubt that the extensions being built under Perl tax MM _that_ much so I think maybe some serious thought needs to go into considering what options should be set in init_main(). Id say off the cuff that _anything_ that is set in MM_SomeOS::init_others() should _not_ be set in MM_Unix::init_main().

Raphael let me know when you have a new bundle and ill do a build/test for you. Also, i'll apply the libwin stuff and test that that still functions ok under 5.6.2.

Cheers,
Yves

--- perl\lib\ExtUtils\MM_Unix.pm.bak    2003-09-01 22:04:34.000000000 +0200
+++ perl\lib\ExtUtils\MM_Unix.pm        2003-09-02 20:58:48.000000000 +0200
@@ -1669,7 +1669,7 @@

 Initializes AR, AR_STATIC_ARGS, BASEEXT, CONFIG, DISTNAME, DLBASE,
 EXE_EXT, FULLEXT, FULLPERL, FULLPERLRUN, FULLPERLRUNINST, INST_*,
-INSTALL*, INSTALLDIRS, LD, LIB_EXT, LIBPERL_A, MAP_TARGET, NAME,
+INSTALL*, INSTALLDIRS, LIB_EXT, LIBPERL_A, MAP_TARGET, NAME,
 OBJ_EXT, PARENT_NAME, PERL, PERL_ARCHLIB, PERL_INC, PERL_LIB,
 PERL_SRC, PERLRUN, PERLRUNINST, PREFIX, VERSION,
 VERSION_SYM, XS_VERSION.
@@ -1870,7 +1870,7 @@
     $self->{AR_STATIC_ARGS} ||= "cr";

     # These should never be needed
-    $self->{LD} ||= 'ld';
+    #$self->{LD} ||= 'ld'; # Breaks Win32, moved to init_others()
     $self->{OBJ_EXT} ||= '.o';
     $self->{LIB_EXT} ||= '.a';

@@ -1888,7 +1888,7 @@
 =item init_others

 Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH,
-OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, SHELL, NOOP,
+OBJECT, BOOTDEP, PERLMAINCC, LD, LDFROM, LINKTYPE, SHELL, NOOP,
 FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F,
 TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N

@@ -1897,6 +1897,8 @@
 sub init_others {      # --- Initialize Other Attributes
     my($self) = shift;

+    $self->{LD} ||= 'ld'; # Moved here so Win32 is happy
+
     # Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
     # Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
     # undefined. In any case we turn it into an anon array:

 

Attachment: mm_unix_ld.patch
Description: Binary data

Reply via email to