Move do_finish from scripts/functions to its own file in scipts/build/internals.sh.
/trunk/scripts/build/internals.sh | 907 4 903 0 ---------------------------------------------
/trunk/scripts/addToolVersion.sh | 8 4 4 0
/trunk/scripts/crosstool-NG.sh.in | 1 1 0 0 +
/trunk/scripts/functions | 48 0 48 0 --
4 files changed, 9 insertions(+), 955 deletions(-)
1.1 --- a/scripts/addToolVersion.sh Wed Mar 04 17:49:10 2009 +0000
1.2 +++ b/scripts/addToolVersion.sh Wed Mar 04 17:59:35 2009 +0000
1.3 @@ -17,16 +17,16 @@
1.4
1.5 Valid options for all tools:
1.6 --stable, -s, +x (default)
1.7 - mark the version as being stable (as opposed to experimental)
1.8 + mark the version as being stable (as opposed to experimental, below)
1.9
1.10 --experimental, -x, +s
1.11 - mark the version as being experimental (as opposed to stable)
1.12 + mark the version as being experimental (as opposed to stable, above)
1.13
1.14 --current, -c, +o (default)
1.15 - mark the version as being cuurent (as opposed to obsolete)
1.16 + mark the version as being cuurent (as opposed to obsolete, below)
1.17
1.18 --obsolete, -o, +c
1.19 - mark the version as being obsolete (as opposed to current)
1.20 + mark the version as being obsolete (as opposed to current, above)
1.21
1.22 Note: setting a new tool resets to the defaults: 'stable' and 'current'.
1.23
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/scripts/build/internals.sh Wed Mar 04 17:59:35 2009 +0000
2.3 @@ -0,0 +1,52 @@
2.4 +# This file contains crosstool-NG internal steps
2.5 +
2.6 +# This step is called once all components were built, to remove
2.7 +# un-wanted files, to add tuple aliases, and to add the final
2.8 +# crosstool-NG-provided files.
2.9 +do_finish() {
2.10 + CT_DoStep INFO "Cleaning-up the toolchain's directory"
2.11 +
2.12 + CT_DoLog EXTRA "Removing access to the build system tools"
2.13 + find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
2.14 + find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
2.15 + CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
2.16 +
2.17 + if [ "${CT_BARE_METAL}" != "y" ]; then
2.18 + CT_DoLog EXTRA "Installing the populate helper"
2.19 + sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
2.20 + -e 's|@@CT_install@@|'"${install}"'|g;' \
2.21 + -e 's|@@CT_bash@@|'"${bash}"'|g;' \
2.22 + -e 's|@@CT_grep@@|'"${grep}"'|g;' \
2.23 + -e 's|@@CT_make@@|'"${make}"'|g;' \
2.24 + -e 's|@@CT_awk@@|'"${awk}"'|g;' \
2.25 + -e 's|@@CT_sed@@|'"${sed}"'|g;' \
2.26 + "${CT_LIB_DIR}/scripts/populate.in" \
2.27 + >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
2.28 + CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
2.29 + fi
2.30 +
2.31 + # Create the aliases to the target tools
2.32 + CT_DoLog EXTRA "Creating toolchain aliases"
2.33 + CT_Pushd "${CT_PREFIX_DIR}/bin"
2.34 + for t in "${CT_TARGET}-"*; do
2.35 + if [ -n "${CT_TARGET_ALIAS}" ]; then
2.36 + _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
2.37 + CT_DoExecLog ALL ln -sv "${t}" "${_t}"
2.38 + fi
2.39 + if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
2.40 + _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
2.41 + CT_DoExecLog ALL ln -sv "${t}" "${_t}"
2.42 + fi
2.43 + done
2.44 + CT_Popd
2.45 +
2.46 + # Remove the generated documentation files
2.47 + if [ "${CT_REMOVE_DOCS}" = "y" ]; then
2.48 + CT_DoLog EXTRA "Removing installed documentation"
2.49 + CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
2.50 + CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
2.51 + CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
2.52 + fi
2.53 +
2.54 + CT_EndStep
2.55 +}
3.1 --- a/scripts/crosstool-NG.sh.in Wed Mar 04 17:49:10 2009 +0000
3.2 +++ b/scripts/crosstool-NG.sh.in Wed Mar 04 17:59:35 2009 +0000
3.3 @@ -79,6 +79,7 @@
3.4
3.5 # Include sub-scripts instead of calling them: that way, we do not have to
3.6 # export any variable, nor re-parse the configuration and functions files.
3.7 +. "${CT_LIB_DIR}/scripts/build/internals.sh"
3.8 . "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
3.9 . "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
3.10 . "${CT_LIB_DIR}/scripts/build/gmp.sh"
4.1 --- a/scripts/functions Wed Mar 04 17:49:10 2009 +0000
4.2 +++ b/scripts/functions Wed Mar 04 17:59:35 2009 +0000
4.3 @@ -901,51 +901,3 @@
4.4 rm -f "${state_dir}/tail.log"
4.5 fi
4.6 }
4.7 -
4.8 -do_finish() {
4.9 - CT_DoStep INFO "Cleaning-up the toolchain's directory"
4.10 -
4.11 - CT_DoLog EXTRA "Removing access to the build system tools"
4.12 - find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
4.13 - find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
4.14 - CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
4.15 -
4.16 - if [ "${CT_BARE_METAL}" != "y" ]; then
4.17 - CT_DoLog EXTRA "Installing the populate helper"
4.18 - sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
4.19 - -e 's|@@CT_install@@|'"${install}"'|g;' \
4.20 - -e 's|@@CT_bash@@|'"${bash}"'|g;' \
4.21 - -e 's|@@CT_grep@@|'"${grep}"'|g;' \
4.22 - -e 's|@@CT_make@@|'"${make}"'|g;' \
4.23 - -e 's|@@CT_awk@@|'"${awk}"'|g;' \
4.24 - -e 's|@@CT_sed@@|'"${sed}"'|g;' \
4.25 - "${CT_LIB_DIR}/scripts/populate.in" \
4.26 - >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
4.27 - CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
4.28 - fi
4.29 -
4.30 - # Create the aliases to the target tools
4.31 - CT_DoLog EXTRA "Creating toolchain aliases"
4.32 - CT_Pushd "${CT_PREFIX_DIR}/bin"
4.33 - for t in "${CT_TARGET}-"*; do
4.34 - if [ -n "${CT_TARGET_ALIAS}" ]; then
4.35 - _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
4.36 - CT_DoExecLog ALL ln -sv "${t}" "${_t}"
4.37 - fi
4.38 - if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
4.39 - _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
4.40 - CT_DoExecLog ALL ln -sv "${t}" "${_t}"
4.41 - fi
4.42 - done
4.43 - CT_Popd
4.44 -
4.45 - # Remove the generated documentation files
4.46 - if [ "${CT_REMOVE_DOCS}" = "y" ]; then
4.47 - CT_DoLog EXTRA "Removing installed documentation"
4.48 - CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
4.49 - CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
4.50 - CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
4.51 - fi
4.52 -
4.53 - CT_EndStep
4.54 -}