1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/scripts/build/internals.sh Sun Apr 19 16:17:11 2009 +0000
1.3 @@ -0,0 +1,52 @@
1.4 +# This file contains crosstool-NG internal steps
1.5 +
1.6 +# This step is called once all components were built, to remove
1.7 +# un-wanted files, to add tuple aliases, and to add the final
1.8 +# crosstool-NG-provided files.
1.9 +do_finish() {
1.10 + CT_DoStep INFO "Cleaning-up the toolchain's directory"
1.11 +
1.12 + CT_DoLog EXTRA "Removing access to the build system tools"
1.13 + find "${CT_PREFIX_DIR}/bin" -name "${CT_BUILD}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
1.14 + find "${CT_PREFIX_DIR}/bin" -name "${CT_HOST}-"'*' -exec rm -fv {} \; |CT_DoLog DEBUG
1.15 + CT_DoExecLog DEBUG rm -fv "${CT_PREFIX_DIR}/bin/makeinfo"
1.16 +
1.17 + if [ "${CT_BARE_METAL}" != "y" ]; then
1.18 + CT_DoLog EXTRA "Installing the populate helper"
1.19 + sed -r -e 's|@@CT_TARGET@@|'"${CT_TARGET}"'|g;' \
1.20 + -e 's|@@CT_install@@|'"${install}"'|g;' \
1.21 + -e 's|@@CT_bash@@|'"${bash}"'|g;' \
1.22 + -e 's|@@CT_grep@@|'"${grep}"'|g;' \
1.23 + -e 's|@@CT_make@@|'"${make}"'|g;' \
1.24 + -e 's|@@CT_awk@@|'"${awk}"'|g;' \
1.25 + -e 's|@@CT_sed@@|'"${sed}"'|g;' \
1.26 + "${CT_LIB_DIR}/scripts/populate.in" \
1.27 + >"${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
1.28 + CT_DoExecLog ALL chmod 755 "${CT_PREFIX_DIR}/bin/${CT_TARGET}-populate"
1.29 + fi
1.30 +
1.31 + # Create the aliases to the target tools
1.32 + CT_DoLog EXTRA "Creating toolchain aliases"
1.33 + CT_Pushd "${CT_PREFIX_DIR}/bin"
1.34 + for t in "${CT_TARGET}-"*; do
1.35 + if [ -n "${CT_TARGET_ALIAS}" ]; then
1.36 + _t=$(echo "$t" |sed -r -e 's/^'"${CT_TARGET}"'-/'"${CT_TARGET_ALIAS}"'-/;')
1.37 + CT_DoExecLog ALL ln -sv "${t}" "${_t}"
1.38 + fi
1.39 + if [ -n "${CT_TARGET_ALIAS_SED_EXPR}" ]; then
1.40 + _t=$(echo "$t" |sed -r -e "${CT_TARGET_ALIAS_SED_EXPR}")
1.41 + CT_DoExecLog ALL ln -sv "${t}" "${_t}"
1.42 + fi
1.43 + done
1.44 + CT_Popd
1.45 +
1.46 + # Remove the generated documentation files
1.47 + if [ "${CT_REMOVE_DOCS}" = "y" ]; then
1.48 + CT_DoLog EXTRA "Removing installed documentation"
1.49 + CT_DoForceRmdir "${CT_PREFIX_DIR}/"{,usr/}{man,info}
1.50 + CT_DoForceRmdir "${CT_SYSROOT_DIR}/"{,usr/}{man,info}
1.51 + CT_DoForceRmdir "${CT_DEBUGROOT_DIR}/"{,usr/}{man,info}
1.52 + fi
1.53 +
1.54 + CT_EndStep
1.55 +}