/devel/gcc-4.4:

- add a wrapper to correctly set LD_LIBRARY_PATH to find our companion libraries.

 -------- diffstat follows --------
 /devel/gcc-4.4/scripts/build/internals.sh |   19    19     0     0 +++++++++++++++++++
 /devel/gcc-4.4/scripts/wrapper.in         |   15    15     0     0 +++++++++++++++
 2 files changed, 34 insertions(+)
This commit is contained in:
Yann E. MORIN" 2009-06-02 17:33:04 +00:00
parent d9ba421c78
commit d9e898bdbc
2 changed files with 34 additions and 0 deletions

View File

@ -4,6 +4,8 @@
# un-wanted files, to add tuple aliases, and to add the final # un-wanted files, to add tuple aliases, and to add the final
# crosstool-NG-provided files. # crosstool-NG-provided files.
do_finish() { do_finish() {
local _t
CT_DoStep INFO "Cleaning-up the toolchain's directory" CT_DoStep INFO "Cleaning-up the toolchain's directory"
CT_DoLog EXTRA "Removing access to the build system tools" CT_DoLog EXTRA "Removing access to the build system tools"
@ -39,6 +41,23 @@ do_finish() {
done done
CT_Popd 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"
sed -r -e 's|@@CT_bash@@|'"${bash}"'|g;' \
"${CT_LIB_DIR}/scripts/wrapper.in" \
>".${CT_TARGET}-wrapper"
CT_DoExecLog ALL chmod 755 ".${CT_TARGET}-wrapper"
for t in "${CT_TARGET}-"*; do
CT_DoExecLog ALL mv "${t}" ".${t}"
CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${t}"
done
CT_Popd
fi
# Remove the generated documentation files # Remove the generated documentation files
if [ "${CT_REMOVE_DOCS}" = "y" ]; then if [ "${CT_REMOVE_DOCS}" = "y" ]; then
CT_DoLog EXTRA "Removing installed documentation" CT_DoLog EXTRA "Removing installed documentation"

15
scripts/wrapper.in Normal file
View File

@ -0,0 +1,15 @@
#!@@CT_bash@@
# There are bashisms on the last line
dirname="$(dirname "${0}")"
basename="$(basename "${0}")"
ld_lib_path="$(dirname "${dirname}")/lib"
case ":${LD_LIBRARY_PATH}:" in
*":${ld_lib_path}:"*) ;;
*) LD_LIBRARY_PATH="${ld_lib_path}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}";;
esac
export LD_LIBRARY_PATH
exec -a "${basename}" "${dirname}/.${basename}" "$@"