From: Albert Chin-A-Young Date: Wed, 17 May 2006 14:28:40 +0000 (+0000) Subject: * libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4 X-Git-Tag: release-2-1b~294 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e73b15356c1b66d66832fbf4b0680014c676ce63;p=thirdparty%2Flibtool.git * libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4 (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, _LT_LANG_FC_CONFIG) [ aix4*, aix5*, hpux10*, hpux11* ]: Introduce a new variable, hardcode_direct_static, which would ignore hardcode_direct=yes if the result would create a static library dependency. Static library dependencies are immune to $shlibpath_var. * tests/link-order.at: Take hardcode_direct and hardcode_direct_static into consideration when testing link order. --- diff --git a/ChangeLog b/ChangeLog index 96717ed63..9a6786785 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2006-05-17 Albert Chin-A-Young + + * libltdl/config/ltmain.m4sh, libltdl/m4/libtool.m4 + (_LT_LINKER_SHLIBS, _LT_LANG_CXX_CONFIG, _LT_LANG_F77_CONFIG, + _LT_LANG_FC_CONFIG) [ aix4*, aix5*, hpux10*, hpux11* ]: + Introduce a new variable, hardcode_direct_static, which + would ignore hardcode_direct=yes if the result would create a + static library dependency. Static library dependencies are + immune to $shlibpath_var. + * tests/link-order.at: Take hardcode_direct and + hardcode_direct_static into consideration when testing + link order. + 2006-05-17 Ralf Wildenhues Eliminate quadratic scaling in argument parsing loop, for @@ -169,7 +182,7 @@ but also turn comma into space so $LD understands whole_archive_flag_spec correctly. - * libltdl/config/ltmain.m4sh (func_mode_link) : + * libltdl/config/ltmain.m4sh (func_mode_link) : Add _AS_BOURNE_COMPATIBLE code from Autoconf, to fix issues with zsh and other shells. Reported by David Gómez Espinosa . diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index 5872ad19d..7a26e8157 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -3832,7 +3832,8 @@ func_mode_link () fi ;; relink) - if test "$hardcode_direct" = yes; then + if test "$hardcode_direct" = yes && + test "$hardcode_direct_static" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" @@ -3887,7 +3888,8 @@ func_mode_link () add_dir= add= # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then + if test "$hardcode_direct" = yes && + test "$hardcode_direct_static" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4 index 6fcaee925..2f9800534 100644 --- a/libltdl/m4/libtool.m4 +++ b/libltdl/m4/libtool.m4 @@ -3967,6 +3967,7 @@ m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_static, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= @@ -4205,7 +4206,7 @@ _LT_EOF sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 @@ -4316,6 +4317,7 @@ _LT_EOF _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_static, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' @@ -4561,6 +4563,7 @@ _LT_EOF _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_static, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. @@ -4605,6 +4608,7 @@ _LT_EOF ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_static, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, @@ -4975,6 +4979,11 @@ _LT_TAGDECL([], [hardcode_libdir_separator], [1], _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_static], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + static, impossible to change by setting ${shlibpath_var} if the + library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) @@ -5134,6 +5143,7 @@ _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_static, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= @@ -6390,6 +6400,7 @@ _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_static, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= @@ -6523,6 +6534,7 @@ _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_static, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= diff --git a/tests/link-order.at b/tests/link-order.at index f586e6bde..403347a96 100644 --- a/tests/link-order.at +++ b/tests/link-order.at @@ -20,6 +20,7 @@ AT_SETUP([Link order test.]) AT_KEYWORDS([libtool]) +eval `$LIBTOOL --config | $EGREP '^(hardcode_direct|hardcode_direct_static|shrext_cmds)='` LDFLAGS="$LDFLAGS -no-undefined" prefix_old=`pwd`/old @@ -68,9 +69,18 @@ case $host_os in aix* | interix*) ;; # These systems have different path syntax *) # Do not error if we do not relink (e.g. static-only systems) - AT_CHECK([if $EGREP relinking stderr; then - $EGREP ' -L.*\/new\/lib -lb -L.*\/old\/lib -lcee' stdout - else :; fi], [0], [ignore], [], [echo "wrong link order"]) + case $hardcode_direct$hardcode_direct_static in + yesno) + AT_CHECK([if $EGREP relinking stderr; then + $EGREP " .*\/new\/lib/libb$shrext_cmds .*\/old\/lib/libcee$shrext_cmds" stdout + else :; fi], [0], [ignore], [], [echo "wrong link order"]) + ;; + *) + AT_CHECK([if $EGREP relinking stderr; then + $EGREP " -L.*\/new\/lib -lb -L.*\/old\/lib -lcee" stdout + else :; fi], [0], [ignore], [], [echo "wrong link order"]) + ;; + esac ;; esac