summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-04 17:59:35 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-04 17:59:35 (GMT)
commit806a517cc2107d3176475346f6be4ac065015119 (patch)
treea22a4e407e8a347369bb478bb7e7cd6ad960af93
parentc4a2b614897a93429f62e781171e2375622d6ed0 (diff)
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(-)
-rwxr-xr-xscripts/addToolVersion.sh8
-rw-r--r--scripts/build/internals.sh52
-rw-r--r--scripts/crosstool-NG.sh.in1
-rw-r--r--scripts/functions48
4 files changed, 57 insertions, 52 deletions
diff --git a/scripts/addToolVersion.sh b/scripts/addToolVersion.sh
index 1fa6c13..0f6bf03 100755
--- a/scripts/addToolVersion.sh
+++ b/scripts/addToolVersion.sh
@@ -17,16 +17,16 @@ Usage: ${myname} <tool> <[options] version [...]> ...
Valid options for all tools:
--stable, -s, +x (default)
- mark the version as being stable (as opposed to experimental)
+ mark the version as being stable (as opposed to experimental, below)
--experimental, -x, +s
- mark the version as being experimental (as opposed to stable)
+ mark the version as being experimental (as opposed to stable, above)
--current, -c, +o (default)
- mark the version as being cuurent (as opposed to obsolete)
+ mark the version as being cuurent (as opposed to obsolete, below)
--obsolete, -o, +c
- mark the version as being obsolete (as opposed to current)
+ mark the version as being obsolete (as opposed to current, above)
Note: setting a new tool resets to the defaults: 'stable' and 'current'.
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
new file mode 100644
index 0000000..575f07d
--- /dev/null
+++ b/scripts/build/internals.sh
@@ -0,0 +1,52 @@
+# This file contains crosstool-NG internal steps
+
+# This step is called once all components were built, to remove
+# un-wanted files, to add tuple aliases, and to add the final
+# crosstool-NG-provided files.
+do_finish() {
+ CT_DoStep INFO "Cleaning-up the toolchain's directory"
+
+ CT_DoLog EXTRA "Removing access to the build system tools"
+ find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
+ find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
+ CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
+
+ if [ "${CT_BARE_METAL}" != "y" ]; then
+ CT_DoLog EXTRA "Installing the populate helper"
+ sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
+ -e 's|@@CT_install@@|'"${install}"'|g;' \
+ -e 's|@@CT_bash@@|'"${bash}"'|g;' \
+ -e 's|@@CT_grep@@|'"${grep}"'|g;' \
+ -e 's|@@CT_make@@|'"${make}"'|g;' \
+ -e 's|@@CT_awk@@|'"${awk}"'|g;' \
+ -e 's|@@CT_sed@@|'"${sed}"'|g;' \
+ "${CT_LIB_DIR}/scripts/populate.in" \
+ >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
+ CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
+ fi
+
+ # Create the aliases to the target tools
+ CT_DoLog EXTRA "Creating toolchain aliases"
+ CT_Pushd "${CT_PREFIX_DIR}/bin"
+ for t in "${CT_TARGET}-"*; do
+ if [ -n "${CT_TARGET_ALIAS}" ]; then
+ _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
+ CT_DoExecLog ALL ln -sv "${t}" "${_t}"
+ fi
+ if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
+ _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
+ CT_DoExecLog ALL ln -sv "${t}" "${_t}"
+ fi
+ done
+ CT_Popd
+
+ # Remove the generated documentation files
+ if [ "${CT_REMOVE_DOCS}" = "y" ]; then
+ CT_DoLog EXTRA "Removing installed documentation"
+ CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
+ CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
+ CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
+ fi
+
+ CT_EndStep
+}
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 820dde1..fb78c3c 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -79,6 +79,7 @@ CT_DoLog INFO "Building environment variables"
# Include sub-scripts instead of calling them: that way, we do not have to
# export any variable, nor re-parse the configuration and functions files.
+. "${CT_LIB_DIR}/scripts/build/internals.sh"
. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh"
. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh"
. "${CT_LIB_DIR}/scripts/build/gmp.sh"
diff --git a/scripts/functions b/scripts/functions
index 4207c35..3dc35f4 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -901,51 +901,3 @@ CT_DoLoadState(){
rm -f "${state_dir}/tail.log"
fi
}
-
-do_finish() {
- CT_DoStep INFO "Cleaning-up the toolchain's directory"
-
- CT_DoLog EXTRA "Removing access to the build system tools"
- find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
- find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
- CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
-
- if [ "${CT_BARE_METAL}" != "y" ]; then
- CT_DoLog EXTRA "Installing the populate helper"
- sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
- -e 's|@@CT_install@@|'"${install}"'|g;' \
- -e 's|@@CT_bash@@|'"${bash}"'|g;' \
- -e 's|@@CT_grep@@|'"${grep}"'|g;' \
- -e 's|@@CT_make@@|'"${make}"'|g;' \
- -e 's|@@CT_awk@@|'"${awk}"'|g;' \
- -e 's|@@CT_sed@@|'"${sed}"'|g;' \
- "${CT_LIB_DIR}/scripts/populate.in" \
- >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
- CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
- fi
-
- # Create the aliases to the target tools
- CT_DoLog EXTRA "Creating toolchain aliases"
- CT_Pushd "${CT_PREFIX_DIR}/bin"
- for t in "${CT_TARGET}-"*; do
- if [ -n "${CT_TARGET_ALIAS}" ]; then
- _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
- CT_DoExecLog ALL ln -sv "${t}" "${_t}"
- fi
- if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
- _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
- CT_DoExecLog ALL ln -sv "${t}" "${_t}"
- fi
- done
- CT_Popd
-
- # Remove the generated documentation files
- if [ "${CT_REMOVE_DOCS}" = "y" ]; then
- CT_DoLog EXTRA "Removing installed documentation"
- CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
- CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
- CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
- fi
-
- CT_EndStep
-}