From: Edouard G. Parmelan Date: Fri, 22 Jan 1999 10:01:10 +0000 (+0000) Subject: * ltmain.in (finalize_hardcode_libdirs, finalize_rpath): in X-Git-Tag: ild-branchpoint~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcdffabfe985642c99cf799aa7b6929d0df43433;p=thirdparty%2Flibtool.git * ltmain.in (finalize_hardcode_libdirs, finalize_rpath): in platforms that use -rpath, programs must be finalized at installation time, otherwise build-tree programs will prefer installed libraries over build-tree ones --- diff --git a/ChangeLog b/ChangeLog index 80b2c679e..9a57d5a60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1999-01-22 Edouard G. Parmelan + + * ltmain.in (finalize_hardcode_libdirs, finalize_rpath): in + platforms that use -rpath, programs must be finalized at + installation time, otherwise build-tree programs will + prefer installed libraries over build-tree ones + 1999-01-22 Alexandre Oliva * mdemo/Makefile.am (../libltdl/libtool): if it does not exist, diff --git a/ltmain.in b/ltmain.in index b11e58587..f0d03b202 100644 --- a/ltmain.in +++ b/ltmain.in @@ -672,6 +672,7 @@ compiler." export_symbols= generated= hardcode_libdirs= + finalize_hardcode_libdirs= libobjs= link_against_libtool_libs= ltlibs= @@ -685,6 +686,7 @@ compiler." xrpath= perm_rpath= temp_rpath= + finalize_rpath= vinfo= # We need to know -static, to get the right output filenames. @@ -1058,6 +1060,21 @@ compiler." # This is the magic to use -rpath. if test -n "$hardcode_libdir_flag_spec"; then + saved_libdir="$libdir" + libdir="$dir" + + # We need an absolute path. + case "$libdir" in + /* | [A-Za-z]:[/\\]*) ;; + *) + absdir=`cd "$libdir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2 + else + libdir="$absdir" + fi + ;; + esac if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then # Put the magic libdir with the hardcode flag. @@ -1080,13 +1097,53 @@ compiler." eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" + fi + + libdir="$saved_libdir" + if test -n "$hardcode_libdir_separator"; then + if test -z "$finalize_hardcode_libdirs"; then + # Put the magic libdir with the hardcode flag. + finalize_hardcode_libdirs="$libdir" + libdir="@HARDCODE_LIBDIRS@" + else + # Just accumulate the unique libdirs. + case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + libdir= + fi + fi + + if test -n "$libdir"; then + eval flag=\"$hardcode_libdir_flag_spec\" + finalize_command="$finalize_command $flag" fi + # libdir is also use after "$hardcode_action" case + libdir="$saved_libdir" elif test -n "$runpath_var"; then # Do the same for the permanent run path. + case "$dir" in + /* | [A-Za-z]:[/\\]*) absdir="$dir";; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 + absdir="$dir" + fi + ;; + esac case "$perm_rpath " in + *" $absdir "*) ;; + *) perm_rpath="$perm_rpath $absdir" ;; + esac + case "$finalize_perm_rpath " in *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi @@ -1942,6 +1999,7 @@ EOF # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do if test -n "$hardcode_libdir_flag_spec"; then + saved_libdir="$libdir" if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then # Put the magic libdir with the hardcode flag. @@ -1964,6 +2022,30 @@ EOF eval flag=\"$hardcode_libdir_flag_spec\" compile_command="$compile_command $flag" + fi + + libdir="$saved_libdir" + if test -n "$hardcode_libdir_separator"; then + if test -z "$finalize_hardcode_libdirs"; then + # Put the magic libdir with the hardcode flag. + finalize_hardcode_libdirs="$libdir" + libdir="@HARDCODE_LIBDIRS@" + else + # Just accumulate the unique libdirs. + case "$hardcode_libdir_separator$finalize_hardcode_libdirs$hardcode_libdir_separator" in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + finalize_hardcode_libdirs="$finalize_hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + libdir= + fi + fi + + if test -n "$libdir"; then + eval flag=\"$hardcode_libdir_flag_spec\" + finalize_command="$finalize_command $flag" fi elif test -n "$runpath_var"; then @@ -1971,6 +2053,10 @@ EOF *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac fi done fi @@ -1978,7 +2064,7 @@ EOF # Substitute the hardcoded libdirs into the compile commands. if test -n "$hardcode_libdir_separator"; then compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` - finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$finalize_hardcode_libdirs%g"` fi output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` @@ -2201,14 +2287,23 @@ static const void *lt_preloaded_setup() { finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command" - finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command" + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command" + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command" + fi fi if test "$hardcode_action" = relink; then