summaryrefslogtreecommitdiff
path: root/scripts/crosstool.sh
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-11-04 16:30:11 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-11-04 16:30:11 (GMT)
commit70a0eeedc29437fce97c15a0aa502e58e75e0017 (patch)
treeb59fab41346f9c2e8bc39f1eaf19b41a7a57513f /scripts/crosstool.sh
parent37f81168672b1f27e17d7748ee71a373d3f3f8ae (diff)
Merge #1190 from /devel/YEM-build_host_target_cleanup:
- Use shell wrappers to point to the build tools, rather than symlinks. /trunk/scripts/crosstool.sh | 20 14 6 0 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
Diffstat (limited to 'scripts/crosstool.sh')
-rwxr-xr-xscripts/crosstool.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh
index d688c28..599fa8a 100755
--- a/scripts/crosstool.sh
+++ b/scripts/crosstool.sh
@@ -310,17 +310,25 @@ if [ -z "${CT_RESTART}" ]; then
*,y) CT_HOST=$(echo "${CT_HOST}" |sed -r -e 's/-/-host_/;');;
esac
+ # What's our shell?
+ # Will be plain /bin/sh on most systems, except if we have /bin/ash and we
+ # _explictly_ required using it
+ CT_SHELL="/bin/sh"
+ [ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash"
+
# Ah! Recent versions of binutils need some of the build and/or host system
# (read CT_BUILD and CT_HOST) tools to be accessible (ar is but an example).
# Do that:
+ BANG='!'
CT_DoLog DEBUG "Making build system tools available"
mkdir -p "${CT_PREFIX_DIR}/bin"
for tool in ar as dlltool ${CT_CC_NATIVE:=gcc} gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
tmp=$(CT_Which ${tool})
if [ -n "${tmp}" ]; then
- ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
- ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
- ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
+ printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
+ chmod 700 "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
fi |CT_DoLog DEBUG
done
@@ -337,9 +345,9 @@ if [ -z "${CT_RESTART}" ]; then
# Override the configured jobs with what's been given on the command line
[ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}"
- # Help ./configure scripts go faster
- [ "${CT_CONFIG_SHELL_ASH}" = "y" ] && export CONFIG_SHELL=/bin/ash
- export CONFIG_SHELL
+ # Set the shell to be used by ./configure scripts and by Makefiles (those
+ # that support it!).
+ export CONFIG_SHELL="${CT_SHELL}"
# And help make go faster
PARALLELMFLAGS=