# HG changeset patch # User "Yann E. MORIN" # Date 1293133412 -3600 # Node ID 2efd469630864e0cb2cc749f72d5e4632cee5cf7 # Parent 0a9e8cb7ccf4e8f7f5226d6f5d0deead1af82f23 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" diff -r 0a9e8cb7ccf4 -r 2efd46963086 scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Sun Feb 20 22:12:43 2011 +0100 +++ b/scripts/crosstool-NG.sh.in Thu Dec 23 20:43:32 2010 +0100 @@ -152,10 +152,10 @@ 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 @@ # 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 @@ # 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 @@ # 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 @@ # 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 -r 0a9e8cb7ccf4 -r 2efd46963086 scripts/functions --- a/scripts/functions Sun Feb 20 22:12:43 2011 +0100 +++ b/scripts/functions Thu Dec 23 20:43:32 2010 +0100 @@ -1023,6 +1023,7 @@ 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_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