scripts: fix sysroot prefix dir
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Wed Sep 07 01:22:37 2011 +0200 (2011-09-07)
changeset 2653e5fc5c9ea78a
parent 2652 8e76355776c3
child 2654 32209f462bbb
scripts: fix sysroot prefix dir

The sysroot prefix dir was broken in #4960f5d9f829 due to a mishap
when making the out-of-sysroot lib/ symlink: the './' was mistakenly
changed into a single '.' .

Although Jonathan suggested restoring the missing '/' to restore it to
normal operation, I prefered using an explicit pushd/popd to be extra
sure of the symlink location and target, along with a fix in the sysroot
relative directory calculation.

Reported-by: Jonathan Grundon <JGrundon@xos.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/crosstool-NG.sh.in
     1.1 --- a/scripts/crosstool-NG.sh.in	Wed Sep 07 00:20:30 2011 +0200
     1.2 +++ b/scripts/crosstool-NG.sh.in	Wed Sep 07 01:22:37 2011 +0200
     1.3 @@ -273,7 +273,7 @@
     1.4  
     1.5      # Arrange paths depending on wether we use sysroot or not.
     1.6      if [ "${CT_USE_SYSROOT}" = "y" ]; then
     1.7 -        CT_SYSROOT_REL_DIR="${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}"
     1.8 +        CT_SYSROOT_REL_DIR="${CT_SYSROOT_DIR_PREFIX:+${CT_SYSROOT_DIR_PREFIX}/}${CT_SYSROOT_NAME}"
     1.9          CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_REL_DIR}"
    1.10          CT_DEBUGROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/debug-root"
    1.11          CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include"
    1.12 @@ -317,7 +317,9 @@
    1.13  
    1.14      if [ "${CT_USE_SYSROOT}" = "y" ]; then
    1.15          # Prevent gcc from installing its libraries outside of the sysroot
    1.16 -        CT_DoExecLog ALL ln -sf ".${CT_SYSROOT_REL_DIR}/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
    1.17 +        CT_Pushd "${CT_PREFIX_DIR}/${CT_TARGET}"
    1.18 +        CT_DoExecLog ALL ln -sf "${CT_SYSROOT_REL_DIR}/lib" "lib"
    1.19 +        CT_Popd
    1.20      fi
    1.21  
    1.22      # Since we're *not* multilib on the target side, we want all the