summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure1
-rw-r--r--scripts/build/internals.sh22
-rw-r--r--scripts/wrapper.in5
3 files changed, 19 insertions, 9 deletions
diff --git a/configure b/configure
index 518a3db..a43eb66 100755
--- a/configure
+++ b/configure
@@ -337,6 +337,7 @@ has_or_abort prog=automake
has_or_abort prog=libtool \
ver='\(GNU libtool.*\) (2[[:digit:]]*\.|1\.6[[:digit:]]*\.|1\.5\.[2-9][[:digit:]]+)' \
err="'libtool' 1.5.26 or above was not found"
+has_or_abort prog=stat ver='GNU coreutils'
has_or_abort prog="curl wget"
has_or_abort prog=cvs
has_or_abort prog=patch
diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
index 51272e6..b8a80f2 100644
--- a/scripts/build/internals.sh
+++ b/scripts/build/internals.sh
@@ -47,14 +47,24 @@ do_finish() {
-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"
+
+ # 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
- CT_DoExecLog ALL mv "${t}" ".${t}"
- CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${t}"
+ 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
diff --git a/scripts/wrapper.in b/scripts/wrapper.in
index 70cb5d3..6222333 100644
--- a/scripts/wrapper.in
+++ b/scripts/wrapper.in
@@ -1,5 +1,4 @@
-#!@@CT_bash@@
-# There are bashisms on the last line
+#!/bin/sh
dirname="$(dirname "${0}")"
basename="$(basename "${0}")"
@@ -12,4 +11,4 @@ case ":${LD_LIBRARY_PATH}:" in
esac
export LD_LIBRARY_PATH
-exec -a "${basename}" "${dirname}/.${basename}" "$@"
+exec "${dirname}/.${basename}" "$@"