1.1 --- a/scripts/build/internals.sh Tue Jun 02 06:34:11 2009 +0000
1.2 +++ b/scripts/build/internals.sh Tue Jun 02 17:33:04 2009 +0000
1.3 @@ -4,6 +4,8 @@
1.4 # un-wanted files, to add tuple aliases, and to add the final
1.5 # crosstool-NG-provided files.
1.6 do_finish() {
1.7 + local _t
1.8 +
1.9 CT_DoStep INFO "Cleaning-up the toolchain's directory"
1.10
1.11 CT_DoLog EXTRA "Removing access to the build system tools"
1.12 @@ -39,6 +41,23 @@
1.13 done
1.14 CT_Popd
1.15
1.16 + # If using the companion libraries, we need a wrapper
1.17 + # that will set LD_LIBRARY_PATH approriately
1.18 + if [ "${CT_GMP_MPFR}" = "y" \
1.19 + -o "${CT_PPL_CLOOG_MPC}" = "y" ]; then
1.20 + CT_DoLog EXTRA "Installing toolchain wrappers"
1.21 + CT_Pushd "${CT_PREFIX_DIR}/bin"
1.22 + sed -r -e 's|@@CT_bash@@|'"${bash}"'|g;' \
1.23 + "${CT_LIB_DIR}/scripts/wrapper.in" \
1.24 + >".${CT_TARGET}-wrapper"
1.25 + CT_DoExecLog ALL chmod 755 ".${CT_TARGET}-wrapper"
1.26 + for t in "${CT_TARGET}-"*; do
1.27 + CT_DoExecLog ALL mv "${t}" ".${t}"
1.28 + CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${t}"
1.29 + done
1.30 + CT_Popd
1.31 + fi
1.32 +
1.33 # Remove the generated documentation files
1.34 if [ "${CT_REMOVE_DOCS}" = "y" ]; then
1.35 CT_DoLog EXTRA "Removing installed documentation"
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/scripts/wrapper.in Tue Jun 02 17:33:04 2009 +0000
2.3 @@ -0,0 +1,15 @@
2.4 +#!@@CT_bash@@
2.5 +# There are bashisms on the last line
2.6 +
2.7 +dirname="$(dirname "${0}")"
2.8 +basename="$(basename "${0}")"
2.9 +
2.10 +ld_lib_path="$(dirname "${dirname}")/lib"
2.11 +
2.12 +case ":${LD_LIBRARY_PATH}:" in
2.13 + *":${ld_lib_path}:"*) ;;
2.14 + *) LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
2.15 +esac
2.16 +
2.17 +export LD_LIBRARY_PATH
2.18 +exec -a "${basename}" "${dirname}/.${basename}" "$@"