--- /usr/share/libtool/ltmain.sh.orig Thu Jul 5 16:41:01 2001 +++ /usr/share/libtool/ltmain.sh Sat Mar 2 18:45:59 2002 @@ -1861,7 +1861,11 @@ add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" + if test "X$installed" = Xyes; then + add_dir="-L$libdir" + else + add_dir="-L$DESTDIR$libdir" + fi add="-l$name" fi @@ -4106,12 +4110,21 @@ esac # Add the libdir to current_libdirs if it is the destination. + DESTDIR= if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else + case "$destdir" in + *"$libdir") + DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'` + if test "X$destdir" != "X$DESTDIR$libdir"; then + DESTDIR= + fi + ;; + esac # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; @@ -4125,6 +4138,7 @@ if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 + export DESTDIR $show "$relink_command" if $run eval "$relink_command"; then : else @@ -4132,6 +4146,7 @@ continue fi fi + unset DESTDIR # See the names of the shared library. set dummy $library_names