* genscripts.sh (libpath.exp): Only generate for first emulation.

(LIB_PATH): Correct order of paths.  Don't add $tool_lib when
	already present or when LIB_PATH is set to ":".
This commit is contained in:
Alan Modra 2003-08-13 08:38:23 +00:00
parent 51dc90a107
commit f22f5fcd02
2 changed files with 26 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2003-08-13 Alan Modra <amodra@bigpond.net.au>
* genscripts.sh (libpath.exp): Only generate for first emulation.
(LIB_PATH): Correct order of paths. Don't add $tool_lib when
already present or when LIB_PATH is set to ":".
2003-08-12 Ian Lance Taylor <ian@airs.com>
* ldmain.c (undefined_symbol): Change parameter name from `fatal'

View file

@ -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_LIBPATH}" = xyes ] ; then
::) 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} ;;
*) LIB_PATH2=${LIB_PATH2}:${lib} ;;
esac
else
case :${LIB_PATH}: in
case :${LIB_PATH2}: in
*:${lib}:*) ;;
::) LIB_PATH=${lib} ;;
*) LIB_PATH=${LIB_PATH}:${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'`
@ -123,7 +131,7 @@ LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_
case " $EMULATION_LIBPATH " in
*" ${EMULATION_NAME} "*)
test -d tmpdir || mkdir tmpdir
rm -f tmpdir/libpath
test -f tmpdir/libpath.exp || \
echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
;;
esac