* genscripts.sh (libpath.exp): Only generate for first emulation.
authorAlan Modra <amodra@gmail.com>
Wed, 13 Aug 2003 08:38:23 +0000 (08:38 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 13 Aug 2003 08:38:23 +0000 (08:38 +0000)
(LIB_PATH): Correct order of paths.  Don't add $tool_lib when
already present or when LIB_PATH is set to ":".

ld/ChangeLog
ld/genscripts.sh

index 5a9f404f21ee7d682e4655197c27bb9dd7fbe12b..a44a02743aa7fed348c8cbdba2333f54285f973e 100644 (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'
index dce413692e739e979d6f986d78504cba784bb04e..c06c0d54304c2f8ef603da8f2c043aae5bd34523 100755 (executable)
@@ -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
This page took 0.029562 seconds and 4 git commands to generate.