1 --- binutils-2.14.90.0.4/ltmain.sh.orig 2002-03-22 23:06:16.000000000 +0100
2 +++ binutils-2.14.90.0.4/ltmain.sh 2003-06-01 10:44:39.000000000 +0200
16 + inst_prefix_dir="$arg"
23 @@ -1169,6 +1175,11 @@
32 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
33 # so, if we see these flags be careful not to treat them like -L
35 @@ -2135,6 +2146,14 @@
37 elif test "$hardcode_minus_L" = yes; then
39 + # Try looking first in the location we're being installed to.
40 + if test -n "$inst_prefix_dir"; then
43 + add_dir="-L$inst_prefix_dir$libdir $add_dir"
48 elif test "$hardcode_shlibpath_var" = yes; then
52 if test $linkmode = prog || test "$mode" = relink; then
57 # Finalize command for both is simple: just hardcode it.
58 @@ -2193,13 +2213,33 @@
60 # We cannot seem to hardcode it, guess we'll fake it.
62 + # Try looking first in the location we're being installed to.
63 + if test -n "$inst_prefix_dir"; then
66 + add_dir="-L$inst_prefix_dir$libdir $add_dir"
73 + if test -n "$inst_prefix_dir"; then
76 + add_prefix_dir="-L$inst_prefix_dir$libdir"
81 + # add_prefix_dir must be appended instead, otherwise it can
82 + # possibly be overrided by any hardcoded -L/... path in deplibs
83 if test $linkmode = prog; then
84 + test -n "$add_prefix_dir" && finalize_deplibs="$finalize_deplibs $add_prefix_dir"
85 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
86 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
88 + test -n "$add_prefix_dir" && deplibs="$deplibs $add_prefix_dir"
89 test -n "$add_dir" && deplibs="$add_dir $deplibs"
90 test -n "$add" && deplibs="$add $deplibs"
93 for tag in $taglist; do
94 tagopts="$tagopts --tag $tag"
96 - relink_command="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args)"
97 + relink_command="(cd `pwd`; $SHELL $0$tagopts --mode=relink $libtool_args @inst_prefix_dir@)"
98 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
100 # Only create the output if not a dry run.
101 @@ -4613,6 +4653,27 @@
104 if test -n "$relink_command"; then
105 + # Determine the prefix the user has applied to our future dir.
106 + inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
108 + # Don't allow the user to place us outside of our expected
109 + # location b/c this prevents finding dependent libraries that
110 + # are installed to the same prefix.
111 + # At present, this check doesn't affect windows .dll's that
112 + # are installed into $libdir/../bin (currently, that works fine)
113 + # but it's something to keep an eye on.
114 + if test "$inst_prefix_dir" = "$destdir"; then
115 + $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
119 + if test -n "$inst_prefix_dir"; then
120 + # Stick the inst_prefix_dir data into the link command.
121 + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
123 + relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
126 $echo "$modename: warning: relinking \`$file'" 1>&2
127 $show "$relink_command"
128 if $run eval "$relink_command"; then :