--- libltdl/config/ltmain.sh 2009-03-14 14:00:47.000000000 +0000 +++ libltdl/config/ltmain.sh.new 2009-03-14 14:03:09.000000000 +0000 @@ -5768,7 +5768,12 @@ test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + add_dir="-L$inst_prefix_dir$libdir" + else + add_dir="-L$libdir" + fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in @@ -5785,7 +5790,6 @@ fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -5793,6 +5797,8 @@ add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac + else + add_dir="-L$libdir" fi add="-l$name" fi