Den 2011-01-07 17:55 skrev Charles Wilson: > On 1/7/2011 3:02 AM, Peter Rosin wrote: >> Den 2011-01-06 21:29 skrev Ralf Wildenhues: >>> * Peter Rosin wrote on Tue, Jan 04, 2011 at 05:44:58PM CET: >>>> Before I tie up the lose ends with this patch, I wonder if Ralf (or someone >>>> else) could tell me if I should also fix the other assignments of >>>> old_archive_cmds -- such as in the below snippet -- or is that completely >>>> irrelevant? >>> >>> I wouldn't change them without being sure that the changes are >>> necessary. >> >> Well, they are necessary, but in cases which are, errhm, convoluted... >> >> Such as: win32-hosted cross-tools (I mean native win32 here, not >> dependent on Cygwin or MSYS) for targeting irix (or whatever) and >> running them from Cygwin (or Wine) instead of MSYS. >> >> I think I'll skip the extra changes, as someone doing the above needs >> a clue-bat anyway. > > Err...that's not really uncommon. Take the following fer-instance: > 1) You use a "vendor-provided" gcc for your fav embedded target > 1a) naturally, it's a MinGW->$foo cross compiler > 2) But, you like to work from a cygwin shell because it doesn't suck > as bad as dosbox, and provides tools that MSYS does not. > > Now, MOST of the time, if you're using a vendor-provided compiler, > you're also going to use the vendor-provided IDE, so...the fact that you > like to "play" in the cygwin shell doesn't matter; the IDE doesn't use > "your" shell anyway. > > But...if you step outside of the IDE...say, you just want to use the > normal configure/make process with --host=$foo > CC="/path/to/vendor/bin/gcc", since you don't really want to set up an > IDE project for $third-party-package-with-perfectly-good-autoconfigury, > do you really need a cluebat? "Don't do that, download and install the > (limited in functionality compared to cygwin) MSYS environment, even > though you are not using "real" MinGW gcc, but a vendor toolchain?" > Or...a few more, already identified and well-understood changes in libtool?
Below is a patch that changes all old_archive_cmds assignments. If you examine it for a bit you will notice that the special casing of old_archive_cmds happens for major OSes like Solaris and Irix, which are not very likely to end up on embedded systems. Changing the default old_archive_cmds will change things for cases which are more interesting (at least for me), namely using the ar-lib wrapper to wrap MS lib.exe. So, I'd have to do extensive tests before signing off on this patch. BTW, I (consciously) didn't state on whom the cluebat should be applied, and that could easily be me :-) It's always good to have one lying around. One last note, my guess is that in the vast majority of cases, $oldlib will be a relative path when old_archive_cmds is executed, thus making the conversion a NOP anyway. Cheers, Peter >From 0d175d6a4e9b2d78e6b2f12543d62501efb4399c Mon Sep 17 00:00:00 2001 From: Peter Rosin <p...@lysator.liu.se> Date: Fri, 7 Jan 2011 21:22:10 +0100 Subject: [PATCH] Convert to toolchain format when invoking the archiver. --- libltdl/m4/libtool.m4 | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index c144755..261c953 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -1441,7 +1441,7 @@ _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_archive_cmds='$AR $AR_FLAGS $tool_oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -5147,7 +5147,7 @@ _LT_EOF # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$tool_oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac @@ -6347,7 +6347,7 @@ if test "$_lt_caught_CXX_error" != yes; then # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $tool_oldlib $oldobjs' ;; *) if test "$GXX" = yes; then @@ -6390,7 +6390,7 @@ if test "$_lt_caught_CXX_error" != yes; then # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $tool_oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ @@ -6500,7 +6500,7 @@ if test "$_lt_caught_CXX_error" != yes; then # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $tool_oldlib $oldobjs' ;; esac ;; @@ -6585,8 +6585,8 @@ if test "$_lt_caught_CXX_error" != yes; then # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $tool_oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $tool_oldlib $oldobjs' ;; esac ;; RCC*) @@ -6705,14 +6705,14 @@ if test "$_lt_caught_CXX_error" != yes; then # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $tool_oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $tool_oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker -- 1.7.2.3