Hi, [...]
> I do agree that the general solution would involve a libtool change. > As long as everyone agrees on something like DESTDIR (which I believe > is the automake convention in any case) then there's no reason why > libtool shouldn't be able to handle it (or at least, facilitate it). > For the time being, though, all of my configure scripts include > hacked-up linker and/or compiler wrappers. There was a patch for this problem posted on this mailing list about two months ago by Bruno Haible. It seems to work really well and, from what I can tell, seems safe for platforms not supporting DESTDIR. This would really help fix packaging problems for many projects (at least on some platforms). I have attached the (modified) patch for libtool 1.4.2. You can find the original patch by Bruno Haible in the archive of this mailing list. It would be nice if this would finally be fixed. :) Thank you. bye, ewald
--- /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