This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
search dirs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Wed, 13 Aug 2003 18:04:19 +0930
- Subject: search dirs
Biarch search dirs have been wrongly ordered since 2003-02-07. I was
seeing /usr/local/powerpc64-linux/lib /usr/local/lib /usr/local/lib64
/lib64 /usr/lib64 /lib /usr/lib, when we really want /usr/local/lib
after the *lib64 entries.
I've also tidied the addition of $tool_lib to LIB_PATH, so we don't
get trailing colons (not that it matters) or duplication. genscripts.sh
also mentions that LIB_PATH=":" should result in an empty search path.
* genscripts.sh (LIB_PATH): Correct order of paths. Don't add
$tool_lib when already present or when LIB_PATH is set to ":".
Index: ld/genscripts.sh
===================================================================
RCS file: /cvs/src/src/ld/genscripts.sh,v
retrieving revision 1.14
diff -u -p -r1.14 genscripts.sh
--- ld/genscripts.sh 30 May 2003 15:50:11 -0000 1.14
+++ ld/genscripts.sh 13 Aug 2003 08:18:23 -0000
@@ -74,10 +74,10 @@ fi
# the library path with the suffix applied.
if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
+ LIB_PATH2=
if [ x"$use_sysroot" != xyes ] ; then
- LIB_PATH=${libdir}
+ LIB_PATH2=${libdir}
fi
- LIB_PATH2=""
for lib in ${NATIVE_LIB_DIRS}; do
# The "=" is harmless if we aren't using a sysroot, but also needless.
if [ "x${use_sysroot}" = "xyes" ] ; then
@@ -95,26 +95,34 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE
::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
*) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
esac
- case :${LIB_PATH}${LIB_PATH2}: in
+ case :${LIB_PATH}:${LIB_PATH2}: in
*:${lib}:*) ;;
- *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
+ *::) LIB_PATH2=${lib} ;;
+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
esac
else
- case :${LIB_PATH}: in
- *:${lib}:*) ;;
- ::) LIB_PATH=${lib} ;;
- *) LIB_PATH=${LIB_PATH}:${lib} ;;
+ case :${LIB_PATH2}: in
+ *:${lib}:*) ;;
+ ::) LIB_PATH2=${lib} ;;
+ *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
esac
fi
done
- LIB_PATH=${LIB_PATH}${LIB_PATH2}
+ 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.
+# sysrooted configurations and when LIBPATH=":".
if [ "x${use_sysroot}" != "xyes" ] ; then
- LIB_PATH=${tool_lib}:${LIB_PATH}
+ case :${LIB_PATH}: in
+ ::: | *:${tool_lib}:*) ;;
+ ::) LIB_PATH=${tool_lib} ;;
+ *) LIB_PATH=${tool_lib}:${LIB_PATH} ;;
+ esac
fi
LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
--
Alan Modra
IBM OzLabs - Linux Technology Centre