summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-09-27 08:01:20 (GMT)
committerAlexey Neyman <stilor@att.net>2018-09-27 08:01:20 (GMT)
commit2acab2f06197ab34243fc415020ead54d4a9e505 (patch)
treeddced0552dd95e0e75007e7cea3e824ea4228e0c
parentd573c1575825de8c47aaeca89db54226ff702924 (diff)
Make CT_PREFIX_DIR/CT_WORK_DIR/CT_BUILD_TOP_DIR absolute
... if they aren't already. Fixes #1010. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--config/global/paths.in2
-rw-r--r--scripts/crosstool-NG.sh15
2 files changed, 13 insertions, 4 deletions
diff --git a/config/global/paths.in b/config/global/paths.in
index 39e15f3..b4e93ee 100644
--- a/config/global/paths.in
+++ b/config/global/paths.in
@@ -42,7 +42,7 @@ config WORK_DIR
config BUILD_TOP_DIR
string
- default "${CT_WORK_DIR}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
+ default "${CT_WORK_DIR:-${CT_TOP_DIR}/.build}/${CT_HOST:+HOST-${CT_HOST}/}${CT_TARGET}"
config PREFIX_DIR
string
diff --git a/scripts/crosstool-NG.sh b/scripts/crosstool-NG.sh
index 7909438..fb6856e 100644
--- a/scripts/crosstool-NG.sh
+++ b/scripts/crosstool-NG.sh
@@ -74,6 +74,7 @@ for d in \
LOCAL_TARBALLS \
WORK \
PREFIX \
+ BUILD_TOP \
INSTALL \
; do
eval dir="\${CT_${d}_DIR}"
@@ -88,6 +89,17 @@ for d in \
CT_Abort "'CT_${d}_DIR'='${dir}' contains a comma in it.\nDon't use commas in paths, it breaks things."
;;
esac
+ case "${dir}" in
+ /*)
+ # Absolute path, okay
+ ;;
+ *)
+ # Relative path from CT_TOP_DIR, make absolute
+ eval CT_${d}_DIR="${CT_TOP_DIR}/${dir}"
+ # Having .. inside CT_PREFIX breaks relocatability.
+ CT_SanitizeVarDir CT_${d}_DIR
+ ;;
+ esac
done
# Where will we work?
@@ -315,9 +327,6 @@ CT_DoExecLog DEBUG rm -f "${CT_PREFIX_DIR}/foo"
# Setting up the rest of the environment only if not restarting
if [ -z "${CT_RESTART}" ]; then
- # Having .. inside CT_PREFIX breaks relocatability.
- CT_SanitizeVarDir CT_PREFIX_DIR
-
case "${CT_SYSROOT_NAME}" in
"") CT_SYSROOT_NAME="sysroot";;
.) CT_Abort "Sysroot name is set to '.' which is forbidden";;