diff options
Diffstat (limited to 'scripts/build/internals.sh')
-rw-r--r-- | scripts/build/internals.sh | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh index acaf864..a920c50 100644 --- a/scripts/build/internals.sh +++ b/scripts/build/internals.sh @@ -4,12 +4,12 @@ # un-wanted files, to add tuple aliases, and to add the final # crosstool-NG-provided files. do_finish() { + local _t + 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" + CT_DoExecLog DEBUG rm -rf "${CT_PREFIX_DIR}/buildtools" if [ "${CT_BARE_METAL}" != "y" ]; then CT_DoLog EXTRA "Installing the populate helper" @@ -39,6 +39,33 @@ do_finish() { done CT_Popd + # If using the companion libraries, we need a wrapper + # that will set LD_LIBRARY_PATH approriately + if [ "${CT_GMP_MPFR}" = "y" \ + -o "${CT_PPL_CLOOG_MPC}" = "y" ]; then + CT_DoLog EXTRA "Installing toolchain wrappers" + CT_Pushd "${CT_PREFIX_DIR}/bin" + + # Copy the wrapper + CT_DoExecLog DEBUG install -m 0755 "${CT_LIB_DIR}/scripts/wrapper.in" \ + ".${CT_TARGET}-wrapper" + + # Replace every tools with the wrapper + # Do it unconditionally, even for those tools that happen to be shell + # scripts, we don't know if they would in the end spawn a binary... + # Just skip symlinks + for _t in "${CT_TARGET}-"*; do + if [ "$( LANG=C stat -c '%F' "${_t}" )" != "symbolic link" ]; then + CT_DoExecLog ALL mv "${_t}" ".${_t}" + CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${_t}" + fi + done + + # Get rid of the wrapper, we're using hardlinks + CT_DoExecLog DEBUG rm -f ".${CT_TARGET}-wrapper" + CT_Popd + fi + # Remove the generated documentation files if [ "${CT_REMOVE_DOCS}" = "y" ]; then CT_DoLog EXTRA "Removing installed documentation" |