--- binutils-2.17.50.0.17/ltmain.sh.orig 2007-06-18 19:29:28.000000000 +0200 +++ binutils-2.17.50.0.17/ltmain.sh 2007-06-21 22:27:40.096178020 +0200 @@ -4306,6 +4306,7 @@ if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= + add_prefix_dir= add_dir= add= # Finalize command for both is simple: just hardcode it. @@ -4342,10 +4343,22 @@ add="-l$name" fi + if test -n "$inst_prefix_dir"; then + case "$libdir" in + [\\/]*) + add_prefix_dir="-L$inst_prefix_dir$libdir" + ;; + esac + fi + + # add_prefix_dir must be appended instead, otherwise it can + # possibly be overrided by any hardcoded -L/... path in deplibs if test "$linkmode" = prog; then + test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir" test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else + test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir" test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi