aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-08-13 08:38:23 +0000
committerAlan Modra <amodra@gmail.com>2003-08-13 08:38:23 +0000
commitf22f5fcd022d1078e8e27def5de0b079b0e5217f (patch)
treed6e16bc0c773fa6db9e4428a1fe39ba5bc1e9ae0 /ld
parent51dc90a1072b61de65d31548d8574d3365e61e63 (diff)
downloadgdb-f22f5fcd022d1078e8e27def5de0b079b0e5217f.zip
gdb-f22f5fcd022d1078e8e27def5de0b079b0e5217f.tar.gz
gdb-f22f5fcd022d1078e8e27def5de0b079b0e5217f.tar.bz2
* 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 ":".
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rwxr-xr-xld/genscripts.sh32
2 files changed, 26 insertions, 12 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 5a9f404..a44a027 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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'
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index dce4136..c06c0d5 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -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_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'`
@@ -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