source: scripts/patches/binutils-2.14-genscripts-multilib.patch@ f6c354f

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f6c354f was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 3.4 KB
  • ld/genscripts.sh

    diff -uNr binutils-2.14-orig/ld/genscripts.sh binutils-2.14/ld/genscripts.sh
    old new  
    5050    if [ "x${host}" = "x${target}" ] ; then
    5151      NATIVE=yes
    5252      USE_LIBPATH=yes
     53      skip_libdir=no
    5354    elif [ "x${use_sysroot}" = "xyes" ] ; then
    5455      USE_LIBPATH=yes
     56      skip_libdir=no
     57    elif [ "x${LIB_PATH}" != "x" ] ; then
     58      USE_LIBPATH=yes
     59      skip_libdir=yes
    5560    fi
    5661    ;;
    5762esac
     
    7277#
    7378# If the emulparams file set LIBPATH_SUFFIX, prepend an extra copy of
    7479# the library path with the suffix applied.
     80if [ "x${USE_LIBPATH}" = xyes ] ; then
     81  LIB_PATH2=
     82  if [ "x${LIB_PATH}" = "x" ] ; then
     83    libs="${NATIVE_LIB_DIRS}"
     84  else
     85    libs=`echo ${LIB_PATH} | sed 's/:/ /g'`
     86    LIB_PATH=
     87  fi
    7588
    76 if [ "x${LIB_PATH}" = "x" ] && [ "x${USE_LIBPATH}" = xyes ] ; then
    77   if [ x"$use_sysroot" != xyes ] ; then
    78     LIB_PATH=${libdir}
     89  if [ "x${use_sysroot}" != "xyes" ] ; then
     90    if [ "x${skip_libdir}" != "xyes" ] ; then
     91      case " ${libs} " in
     92        *" ${libdir} "*) ;;
     93        *) libs="${libdir} ${libs}" ;;
     94      esac
     95    fi
     96    case " ${libs} " in
     97      *" ${tool_lib} "*) ;;
     98      *) libs="${tool_lib} ${libs}" ;;
     99    esac
    79100  fi
    80   LIB_PATH2=""
    81   for lib in ${NATIVE_LIB_DIRS}; do
     101
     102  for lib in ${libs}; do
    82103    # The "=" is harmless if we aren't using a sysroot, but also needless.
    83104    if [ "x${use_sysroot}" = "xyes" ] ; then
    84105      lib="=${lib}"
     
    91112    esac
    92113    if test -n "$addsuffix"; then
    93114      case :${LIB_PATH}: in
    94         *:${lib}${LIBPATH_SUFFIX}:*) ;;
    95         ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
    96         *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
     115        *:${lib}${LIBPATH_SUFFIX}:*) ;;
     116        ::) LIB_PATH=${lib}${LIBPATH_SUFFIX} ;;
     117        *) LIB_PATH=${LIB_PATH}:${lib}${LIBPATH_SUFFIX} ;;
    97118      esac
    98       case :${LIB_PATH}${LIB_PATH2}: in
    99         *:${lib}:*) ;;
     119      case :${LIB_PATH}:${LIB_PATH2}: in
     120        *:${lib}:*) ;;
     121        *::) LIB_PATH2=${lib} ;;
    100122        *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
    101123      esac
    102124    else
    103       case :${LIB_PATH}: in
     125      case :${LIB_PATH2}: in
    104126        *:${lib}:*) ;;
    105         ::) LIB_PATH=${lib} ;;
    106         *) LIB_PATH=${LIB_PATH}:${lib} ;;
     127        ::) LIB_PATH2=${lib} ;;
     128        *) LIB_PATH2=${LIB_PATH2}:${lib} ;;
    107129      esac
    108130    fi
    109131  done
    110   LIB_PATH=${LIB_PATH}${LIB_PATH2}
    111 fi
    112132
     133  case :${LIB_PATH}:${LIB_PATH2}: in
     134    *:: | ::*) LIB_PATH=${LIB_PATH}${LIB_PATH2} ;;
     135    *) LIB_PATH=${LIB_PATH}:${LIB_PATH2} ;;
     136  esac
     137fi
    113138
    114139# Always search $(tooldir)/lib, aka /usr/local/TARGET/lib, except for
    115140# sysrooted configurations.
    116141if [ "x${use_sysroot}" != "xyes" ] ; then
    117   LIB_PATH=${tool_lib}:${LIB_PATH}
     142  case :${LIB_PATH}: in
     143  ::: | *:${tool_lib}:*) ;;
     144  ::) LIB_PATH=${tool_lib} ;;
     145  *) LIB_PATH=${tool_lib}:${LIB_PATH} ;;
     146  esac
    118147fi
    119148
    120149LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
    121150
     151# We need it for testsuite.
     152case " $EMULATION_LIBPATH " in
     153  *" ${EMULATION_NAME} "*)
     154    test -d tmpdir || mkdir tmpdir
     155    test -f tmpdir/libpath.exp || \
     156    echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
     157    ;;
     158esac
     159
    122160# Generate 5 or 6 script files from a master script template in
    123161# ${srcdir}/scripttempl/${SCRIPT_NAME}.sh.  Which one of the 5 or 6
    124162# script files is actually used depends on command line options given
Note: See TracBrowser for help on using the repository browser.