summaryrefslogtreecommitdiff
path: root/scripts/functions
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2018-04-07 21:39:56 (GMT)
committerAlexey Neyman <stilor@att.net>2018-04-07 21:39:56 (GMT)
commit4e7d0906c1047516ab6517e3abd4a83cba98139d (patch)
treee3ca3eb2ac3d5590ae95724ae5e5a21cac174247 /scripts/functions
parent7eb903667b59ac00d28e2ebad26e4b8c56bb0b84 (diff)
Support out-of-tree local builds
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/functions')
-rw-r--r--scripts/functions17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions
index 62966fd..0b8fba5 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -985,7 +985,7 @@ CT_GetFile()
# Two wrappers to call config.(guess|sub) either from CT_TOP_DIR or CT_LIB_DIR.
# Those from CT_TOP_DIR, if they exist, will be be more recent than those from CT_LIB_DIR.
CT_DoConfigGuess() {
- if [ -x "${CT_TOP_DIR}/scripts/config.guess" ]; then
+ if [ -r "${CT_TOP_DIR}/scripts/config.guess" ]; then
"${CT_CONFIG_SHELL}" "${CT_TOP_DIR}/scripts/config.guess"
else
"${CT_CONFIG_SHELL}" "${CT_LIB_DIR}/scripts/config.guess"
@@ -993,7 +993,7 @@ CT_DoConfigGuess() {
}
CT_DoConfigSub() {
- if [ -x "${CT_TOP_DIR}/scripts/config.sub" ]; then
+ if [ -r "${CT_TOP_DIR}/scripts/config.sub" ]; then
"${CT_CONFIG_SHELL}" "${CT_TOP_DIR}/scripts/config.sub" "$@"
else
"${CT_CONFIG_SHELL}" "${CT_LIB_DIR}/scripts/config.sub" "$@"
@@ -2283,3 +2283,16 @@ CT_GetChoicePkgBuildVersion()
eval "component=\${CT_${choice}_CHOICE_KSYM}"
CT_GetPkgBuildVersion "${choice}" "${component}" "${var}"
}
+
+# Finally, load paths.sh. For --enable-local build, it is located in
+# the current directory (CT_TOP_DIR) while the rest of the scripts are
+# in the source directory (CT_LIB_DIR). For other setups, paths.sh
+# is in CT_LIB_DIR.
+if [ -r "${CT_LIB_DIR}/paths.sh" ]; then
+ paths_sh_location="${CT_LIB_DIR}/paths.sh"
+elif [ -r "${CT_TOP_DIR}/paths.sh" ]; then
+ paths_sh_location="${CT_TOP_DIR}/paths.sh"
+else
+ CT_Error "Not found: paths.sh"
+fi
+. "${paths_sh_location}"