diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-02-07 14:21:03 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2003-02-07 14:21:03 +0000 |
commit | d460ab58231f7e1acb87b8a4c1f3a54981976fad (patch) | |
tree | 0c312b014f8377c6b0101cac743572da70503c35 | |
parent | c328dc3fe7ad85ba309ad6768797b384e7fba8e9 (diff) | |
download | gdb-d460ab58231f7e1acb87b8a4c1f3a54981976fad.zip gdb-d460ab58231f7e1acb87b8a4c1f3a54981976fad.tar.gz gdb-d460ab58231f7e1acb87b8a4c1f3a54981976fad.tar.bz2 |
* genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths
which already have it. Avoid duplicates.
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rwxr-xr-x | ld/genscripts.sh | 31 |
2 files changed, 29 insertions, 7 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8c697cf..958acc0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2003-02-07 Jakub Jelinek <jakub@redhat.com> + + * genscripts.sh (LIB_PATH): Don't append LIBPATH_SUFFIX to paths + which already have it. Avoid duplicates. + 2003-02-06 Jakub Jelinek <jakub@redhat.com> * emulparams/elf64_s390.sh (LIBPATH_SUFFIX): Set to 64. diff --git a/ld/genscripts.sh b/ld/genscripts.sh index 63a7d09..39d97ae 100755 --- a/ld/genscripts.sh +++ b/ld/genscripts.sh @@ -77,20 +77,37 @@ if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then if [ x"$use_sysroot" != xyes ] ; then LIB_PATH=${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 lib="=${lib}" fi - case :${LIB_PATH}: in - *:${lib}:*) ;; - ::) LIB_PATH=${lib} ;; - *) LIB_PATH=${LIB_PATH}:${lib} ;; + addsuffix= + case "${LIBPATH_SUFFIX}:${lib}" in + :*) ;; + *:*${LIBPATH_SUFFIX}) ;; + *) addsuffix=yes ;; esac + if test -n "$addsuffix"; then + case :${LIB_PATH}: in + *:${lib}${LIBPATH_SUFFIX}:*) ;; + ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;; + *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;; + esac + case :${LIB_PATH}${LIB_PATH2}: in + *:${lib}:*) ;; + *) LIB_PATH2=${LIB_PATH2}:${lib} ;; + esac + else + case :${LIB_PATH}: in + *:${lib}:*) ;; + ::) LIB_PATH=${lib} ;; + *) LIB_PATH=${LIB_PATH}:${lib} ;; + esac + fi done - if test -n "$LIBPATH_SUFFIX" ; then - LIB_PATH=`echo ${LIB_PATH}: | sed -e s,:,${LIBPATH_SUFFIX}:,g`$LIB_PATH - fi + LIB_PATH=${LIB_PATH}${LIB_PATH2} fi |