buildtools: store path to buildtools in a variable
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Feb 20 22:12:43 2011 +0100 (2011-02-20)
changeset 23060a9e8cb7ccf4
parent 2305 2ed26c646568
child 2307 2efd46963086
buildtools: store path to buildtools in a variable

Currently, the buildtools are installed relative to ${CT_PREFIX_DIR}.
Change that by introducing ${CT_BUILDTOOLS_DIR}, which is
still set relative to ${CT_PREFIX_DIR}, but which will make it easy
to change in the future.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
scripts/crosstool-NG.sh.in
     1.1 --- a/scripts/crosstool-NG.sh.in	Sat Jan 22 23:20:18 2011 +0100
     1.2 +++ b/scripts/crosstool-NG.sh.in	Sun Feb 20 22:12:43 2011 +0100
     1.3 @@ -152,6 +152,7 @@
     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 @@ -241,6 +242,7 @@
    1.12  # Create the directories we'll use, even if restarting: it does no harm to
    1.13  # create already existent directories, and CT_BUILD_DIR needs to be created
    1.14  # anyway
    1.15 +CT_DoExecLog ALL mkdir -p "${CT_BUILDTOOLS_DIR}"
    1.16  CT_DoExecLog ALL mkdir -p "${CT_TARBALLS_DIR}"
    1.17  CT_DoExecLog ALL mkdir -p "${CT_SRC_DIR}"
    1.18  CT_DoExecLog ALL mkdir -p "${CT_BUILD_DIR}"
    1.19 @@ -405,7 +407,6 @@
    1.20      # Now we have mangled our BUILD and HOST tuples, we must fake the new
    1.21      # cross-tools for those mangled tuples.
    1.22      CT_DoLog DEBUG "Making build system tools available"
    1.23 -    CT_DoExecLog ALL mkdir -p "${CT_PREFIX_DIR}/buildtools"
    1.24      for m in ${install_build_tools_for}; do
    1.25          r="CT_REAL_${m}"
    1.26          v="CT_${m}"
    1.27 @@ -442,8 +443,8 @@
    1.28              # bally needed
    1.29              if [ -n "${where}" ]; then
    1.30                  CT_DoLog DEBUG "  '${!v}-${tool}' -> '${where}'"
    1.31 -                printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/buildtools/${!v}-${tool}"
    1.32 -                CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/${!v}-${tool}"
    1.33 +                printf "#${BANG}${CT_SHELL}\nexec '${where}' \"\${@}\"\n" >"${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
    1.34 +                CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/${!v}-${tool}"
    1.35              else
    1.36                  case "${tool}" in
    1.37                      # We'll at least need some of them...
    1.38 @@ -476,8 +477,8 @@
    1.39      # Go ahead with those, by creating a wrapper that keeps partial files, and that
    1.40      # never fails:
    1.41      CT_DoLog DEBUG "  'makeinfo' -> '$(CT_Which makeinfo)'"
    1.42 -    printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/buildtools/makeinfo"
    1.43 -    CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/buildtools/makeinfo"
    1.44 +    printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_BUILDTOOLS_DIR}/makeinfo"
    1.45 +    CT_DoExecLog ALL chmod 700 "${CT_BUILDTOOLS_DIR}/makeinfo"
    1.46  
    1.47      # Carefully add paths in the order we want them:
    1.48      #  - first try in ${CT_PREFIX_DIR}/bin
    1.49 @@ -487,8 +488,8 @@
    1.50      # Of course, neither cross-native nor canadian can run on BUILD,
    1.51      # so don't add those PATHs in this case...
    1.52      case "${CT_TOOLCHAIN_TYPE}" in
    1.53 -        cross)  export PATH="${CT_PREFIX_DIR}/buildtools:${CT_PREFIX_DIR}/bin:${CT_CC_CORE_SHARED_PREFIX_DIR}/bin:${CT_CC_CORE_STATIC_PREFIX_DIR}/bin:${PATH}";;
    1.54 -        canadian) export PATH="${CT_PREFIX_DIR}/buildtools:${PATH}";;
    1.55 +        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.56 +        canadian) export PATH="${CT_BUILDTOOLS_DIR}:${PATH}";;
    1.57          *)  ;;
    1.58      esac
    1.59