buildtools: move to working directory
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Dec 23 20:43:32 2010 +0100 (2010-12-23)
changeset 23072efd46963086
parent 2306 0a9e8cb7ccf4
child 2308 911b3a703497
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>
scripts/crosstool-NG.sh.in
scripts/functions
     1.1 --- a/scripts/crosstool-NG.sh.in	Sun Feb 20 22:12:43 2011 +0100
     1.2 +++ b/scripts/crosstool-NG.sh.in	Thu Dec 23 20:43:32 2010 +0100
     1.3 @@ -152,10 +152,10 @@
     1.4  CT_CC_EXTRA_CONFIG="${CT_ARCH_CC_EXTRA_CONFIG} ${CT_CC_EXTRA_CONFIG}"
     1.5  
     1.6  # Compute the working directories names
     1.7 -CT_BUILDTOOLS_DIR="${CT_PREFIX_DIR}/buildtools"
     1.8  CT_TARBALLS_DIR="${CT_WORK_DIR}/tarballs"
     1.9  CT_SRC_DIR="${CT_WORK_DIR}/src"
    1.10  CT_BUILD_DIR="${CT_WORK_DIR}/${CT_TARGET}/build"
    1.11 +CT_BUILDTOOLS_DIR="${CT_WORK_DIR}/${CT_TARGET}/buildtools"
    1.12  CT_STATE_DIR="${CT_WORK_DIR}/${CT_TARGET}/state"
    1.13  CT_CONFIG_DIR="${CT_BUILD_DIR}/configs"
    1.14  if [ "${CT_COMPLIBS_SHARED}" = "y" ]; then
    1.15 @@ -242,7 +242,7 @@
    1.16  # Create the directories we'll use, even if restarting: it does no harm to
    1.17  # create already existent directories, and CT_BUILD_DIR needs to be created
    1.18  # anyway
    1.19 -CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_DIR}"
    1.20 +CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_DIR}/bin"
    1.21  CT_DoExecLog ALL mkdir -p "${CT_TARBALLS_DIR}"
    1.22  CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
    1.23  CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
    1.24 @@ -443,8 +443,8 @@
    1.25              # bally needed
    1.26              if [ -n "${where}" ]; then
    1.27                  CT_DoLog DEBUG "  '${!v}-${tool}' -> '${where}'"
    1.28 -                printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
    1.29 -                CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
    1.30 +                printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_DIR}/bin/${!v}-${tool}"
    1.31 +                CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/bin/${!v}-${tool}"
    1.32              else
    1.33                  case "${tool}" in
    1.34                      # We'll at least need some of them...
    1.35 @@ -477,8 +477,8 @@
    1.36      # Go ahead with those, by creating a wrapper that keeps partial files, and that
    1.37      # never fails:
    1.38      CT_DoLog DEBUG "  'makeinfo' -> '$(CT_Which makeinfo)'"
    1.39 -    printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_BUILDTOOLS_DIR}/makeinfo"
    1.40 -    CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/makeinfo"
    1.41 +    printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_BUILDTOOLS_DIR}/bin/makeinfo"
    1.42 +    CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/bin/makeinfo"
    1.43  
    1.44      # Carefully add paths in the order we want them:
    1.45      #  - first try in ${CT_PREFIX_DIR}/bin
    1.46 @@ -488,8 +488,8 @@
    1.47      # Of course, neither cross-native nor canadian can run on BUILD,
    1.48      # so don't add those PATHs in this case...
    1.49      case "${CT_TOOLCHAIN_TYPE}" in
    1.50 -        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}";;
    1.51 -        canadian) export PATH="${CT_BUILDTOOLS_DIR}:${PATH}";;
    1.52 +        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}";;
    1.53 +        canadian) export PATH="${CT_BUILDTOOLS_DIR}/bin:${PATH}";;
    1.54          *)  ;;
    1.55      esac
    1.56  
     2.1 --- a/scripts/functions	Sun Feb 20 22:12:43 2011 +0100
     2.2 +++ b/scripts/functions	Thu Dec 23 20:43:32 2010 +0100
     2.3 @@ -1023,6 +1023,7 @@
     2.4      if [ "${CT_COMPLIBS_BACKUP}" = "y" ]; then
     2.5          CT_DoTarballIfExists "${CT_COMPLIBS_DIR}" "${state_dir}/complibs_dir"
     2.6      fi
     2.7 +    CT_DoTarballIfExists "${CT_BUILDTOOLS_DIR}" "${state_dir}/buildtools_dir"
     2.8      CT_DoTarballIfExists "${CT_CONFIG_DIR}" "${state_dir}/config_dir"
     2.9      CT_DoTarballIfExists "${CT_CC_CORE_STATIC_PREFIX_DIR}" "${state_dir}/cc_core_static_prefix_dir"
    2.10      CT_DoTarballIfExists "${CT_CC_CORE_SHARED_PREFIX_DIR}" "${state_dir}/cc_core_shared_prefix_dir"
    2.11 @@ -1061,6 +1062,7 @@
    2.12      CT_DoExtractTarballIfExists "${state_dir}/cc_core_shared_prefix_dir" "${CT_CC_CORE_SHARED_PREFIX_DIR}"
    2.13      CT_DoExtractTarballIfExists "${state_dir}/cc_core_static_prefix_dir" "${CT_CC_CORE_STATIC_PREFIX_DIR}"
    2.14      CT_DoExtractTarballIfExists "${state_dir}/config_dir" "${CT_CONFIG_DIR}"
    2.15 +    CT_DoExtractTarballIfExists "${state_dir}/buildtools_dir" "${CT_BUILDTOOLS_DIR}"
    2.16      if [ "${CT_COMPLIBS_BACKUP}" = "y" ]; then
    2.17          CT_DoExtractTarballIfExists "${state_dir}/complibs_dir" "${CT_COMPLIBS_DIR}"
    2.18      fi