summaryrefslogtreecommitdiff
path: root/ld/genscripts.sh
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-01-28 13:31:30 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-01-28 13:31:30 +0000
commit7f8c875ce3c7319b78d4edb83bbc89fb10e327d6 (patch)
tree9eeca541e491ee0872e012e27b597776de570d5c /ld/genscripts.sh
parent9ff7a1f1839ad0b3d09f60be503ae215e1e1a89b (diff)
downloadbinutils-redhat-7f8c875ce3c7319b78d4edb83bbc89fb10e327d6.tar.gz
* genscripts.sh: Apply $LIBPATH_SUFFIX to $tool_lib and $libdir too.
Diffstat (limited to 'ld/genscripts.sh')
-rwxr-xr-xld/genscripts.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index 4c7226ad6b..4069d68b27 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -128,10 +128,20 @@ fi
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
LIB_PATH2=
- if [ x"$use_sysroot" != xyes ] ; then
- LIB_PATH2=${libdir}
+
+ libs=${NATIVE_LIB_DIRS}
+ if [ "x${use_sysroot}" != "xyes" ] ; then
+ case " ${libs} " in
+ *" ${libdir} "*) ;;
+ *) libs="${libdir} ${libs}"
+ esac
+ case " ${libs} " in
+ *" ${tool_lib} "*) ;;
+ *) libs="${tool_lib} ${libs}"
+ esac
fi
- for lib in ${NATIVE_LIB_DIRS}; do
+
+ for lib in ${libs}; do
# The "=" is harmless if we aren't using a sysroot, but also needless.
if [ "x${use_sysroot}" = "xyes" ] ; then
lib="=${lib}"
@@ -161,13 +171,13 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
esac
fi
done
+
case :${LIB_PATH}:${LIB_PATH2}: in
*:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;;
*) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;;
esac
fi
-
# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib, except for
# sysrooted configurations and when LIBPATH=":".
if [ "x${use_sysroot}" != "xyes" ] ; then