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>
(transplanted from e5fc5c9ea78af28d05244ba09cf718cf75470903)
This commit is contained in:
Yann E. MORIN" 2011-09-07 01:22:37 +02:00
parent 3bcc156ec0
commit 8764d8089b

View File

@ -273,7 +273,7 @@ if [ -z "${CT_RESTART}" ]; then
# Arrange paths depending on wether we use sysroot or not.
if [ "${CT_USE_SYSROOT}" = "y" ]; then
CT_SYSROOT_REL_DIR="${CT_SYSROOT_DIR_PREFIX}/${CT_SYSROOT_NAME}"
CT_SYSROOT_REL_DIR="${CT_SYSROOT_DIR_PREFIX:+${CT_SYSROOT_DIR_PREFIX}/}${CT_SYSROOT_NAME}"
CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_REL_DIR}"
CT_DEBUGROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/debug-root"
CT_HEADERS_DIR="${CT_SYSROOT_DIR}/usr/include"
@ -317,7 +317,9 @@ if [ -z "${CT_RESTART}" ]; then
if [ "${CT_USE_SYSROOT}" = "y" ]; then
# Prevent gcc from installing its libraries outside of the sysroot
CT_DoExecLog ALL ln -sf ".${CT_SYSROOT_REL_DIR}/lib" "${CT_PREFIX_DIR}/${CT_TARGET}/lib"
CT_Pushd "${CT_PREFIX_DIR}/${CT_TARGET}"
CT_DoExecLog ALL ln -sf "${CT_SYSROOT_REL_DIR}/lib" "lib"
CT_Popd
fi
# Since we're *not* multilib on the target side, we want all the