From 8764d8089bb0d447f82d43d3a5eb0cdb357e0a00 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 7 Sep 2011 01:22:37 +0200 Subject: 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 Signed-off-by: "Yann E. MORIN" (transplanted from e5fc5c9ea78af28d05244ba09cf718cf75470903) diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in index 509a74b..7d93ec8 100644 --- a/scripts/crosstool-NG.sh.in +++ b/scripts/crosstool-NG.sh.in @@ -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 -- cgit v0.10.2-6-g49f6