* 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.
This commit is contained in:
Albert Chin-A-Young 2006-05-17 14:28:40 +00:00 committed by Gary V. Vaughan
parent 216754e101
commit e73b15356c
4 changed files with 44 additions and 7 deletions

View File

@ -1,3 +1,16 @@
2006-05-17 Albert Chin-A-Young <china@thewrittenword.com>
* 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 <Ralf.Wildenhues@gmx.de>
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) <shell wrapper>:
* libltdl/config/ltmain.m4sh (func_mode_link) <shell wrapper>:
Add _AS_BOURNE_COMPATIBLE code from Autoconf, to fix issues
with zsh and other shells.
Reported by David Gómez Espinosa <david@pleyades.net>.

View File

@ -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"

14
libltdl/m4/libtool.m4 vendored
View File

@ -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)=

View File

@ -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