summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-12-23 19:43:32 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2010-12-23 19:43:32 (GMT)
commit5d175195f61e4d6f1565ccbc74619c4e7c84c431 (patch)
treed5497c7083e488830b6865dec8c276dfe923198d /scripts
parent69a876c46e7ecab46c11b14b87003b1118b068e4 (diff)
buildtools: move to working directory
There is absolutely *no* reason for the buildtools (wrappers to gcc, g++, as, ld... for the local machine) to be in the toolchain directory. Moreover, they are removed after the build completes. Move them out of the toolchain directory, and into the build directory (but yet the part specific to the current toolchain). This means we no longer need to explicitly remove them either, BTW, but we need to save/restore them for the restart feature. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/crosstool-NG.sh.in16
-rw-r--r--scripts/functions2
2 files changed, 10 insertions, 8 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index a914adc..a49bd97 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -152,10 +152,10 @@ CT_CC_CORE_EXTRA_CONFIG="${CT_ARCH_CC_CORE_EXTRA_CONFIG} ${CT_CC_CORE_EXTRA_CONF
CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}"
# Compute the working directories names
-CT_BUILDTOOLS_DIR="${CT_PREFIX_DIR}/buildtools"
CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
CT_SRC_DIR="${CT_WORK_DIR}/src"
CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
+CT_BUILDTOOLS_DIR="${CT_WORK_DIR}/${CT_TARGET}/buildtools"
CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state"
CT_CONFIG_DIR="${CT_BUILD_DIR}/configs"
if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
@@ -242,7 +242,7 @@ fi
# Create the directories we'll use, even if restarting: it does no harm to
# create already existent directories, and CT_BUILD_DIR needs to be created
# anyway
-CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_DIR}"
+CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_DIR}/bin"
CT_DoExecLog ALL mkdir -p "${CT_TARBALLS_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
@@ -443,8 +443,8 @@ if [ -z "${CT_RESTART}" ]; then
# bally needed
if [ -n "${where}" ]; then
CT_DoLog DEBUG " '${!v}-${tool}' -> '${where}'"
- printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
- CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_DIR}/bin/${!v}-${tool}"
+ CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/bin/${!v}-${tool}"
else
case "${tool}" in
# We'll at least need some of them...
@@ -477,8 +477,8 @@ if [ -z "${CT_RESTART}" ]; then
# Go ahead with those, by creating a wrapper that keeps partial files, and that
# never fails:
CT_DoLog DEBUG " 'makeinfo' -> '$(CT_Which makeinfo)'"
- printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_BUILDTOOLS_DIR}/makeinfo"
- CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/makeinfo"
+ printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_BUILDTOOLS_DIR}/bin/makeinfo"
+ CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/bin/makeinfo"
# Carefully add paths in the order we want them:
# - first try in ${CT_PREFIX_DIR}/bin
@@ -488,8 +488,8 @@ if [ -z "${CT_RESTART}" ]; then
# Of course, neither cross-native nor canadian can run on BUILD,
# so don't add those PATHs in this case...
case "${CT_TOOLCHAIN_TYPE}" in
- cross) export PATH="${CT_BUILDTOOLS_DIR}:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
- canadian) export PATH="${CT_BUILDTOOLS_DIR}:${PATH}";;
+ cross) export PATH="${CT_BUILDTOOLS_DIR}/bin:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
+ canadian) export PATH="${CT_BUILDTOOLS_DIR}/bin:${PATH}";;
*) ;;
esac
diff --git a/scripts/functions b/scripts/functions
index ba92d11..0e92b92 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -1023,6 +1023,7 @@ CT_DoSaveState() {
if [ "${CT_COMPLIBS_BACKUP}" = "y" ]; then
CT_DoTarballIfExists "${CT_COMPLIBS_DIR}" "${state_dir}/complibs_dir"
fi
+ CT_DoTarballIfExists "${CT_BUILDTOOLS_DIR}" "${state_dir}/buildtools_dir"
CT_DoTarballIfExists "${CT_CONFIG_DIR}" "${state_dir}/config_dir"
CT_DoTarballIfExists "${CT_CC_CORE_STATIC_PREFIX_DIR}" "${state_dir}/cc_core_static_prefix_dir"
CT_DoTarballIfExists "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${state_dir}/cc_core_shared_prefix_dir"
@@ -1061,6 +1062,7 @@ CT_DoLoadState(){
CT_DoExtractTarballIfExists "${state_dir}/cc_core_shared_prefix_dir" "${CT_CC_CORE_SHARED_PREFIX_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/cc_core_static_prefix_dir" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
CT_DoExtractTarballIfExists "${state_dir}/config_dir" "${CT_CONFIG_DIR}"
+ CT_DoExtractTarballIfExists "${state_dir}/buildtools_dir" "${CT_BUILDTOOLS_DIR}"
if [ "${CT_COMPLIBS_BACKUP}" = "y" ]; then
CT_DoExtractTarballIfExists "${state_dir}/complibs_dir" "${CT_COMPLIBS_DIR}"
fi