1.1 --- a/scripts/crosstool.sh Tue Nov 04 16:14:55 2008 +0000
1.2 +++ b/scripts/crosstool.sh Tue Nov 04 16:30:11 2008 +0000
1.3 @@ -310,17 +310,25 @@
1.4 *,y) CT_HOST=$(echo "${CT_HOST}" |sed -r -e 's/-/-host_/;');;
1.5 esac
1.6
1.7 + # What's our shell?
1.8 + # Will be plain /bin/sh on most systems, except if we have /bin/ash and we
1.9 + # _explictly_ required using it
1.10 + CT_SHELL="/bin/sh"
1.11 + [ "${CT_CONFIG_SHELL_ASH}" = "y" -a -x "/bin/ash" ] && CT_SHELL="/bin/ash"
1.12 +
1.13 # Ah! Recent versions of binutils need some of the build and/or host system
1.14 # (read CT_BUILD and CT_HOST) tools to be accessible (ar is but an example).
1.15 # Do that:
1.16 + BANG='!'
1.17 CT_DoLog DEBUG "Making build system tools available"
1.18 mkdir -p "${CT_PREFIX_DIR}/bin"
1.19 for tool in ar as dlltool ${CT_CC_NATIVE:=gcc} gnatbind gnatmake ld nm ranlib strip windres objcopy objdump; do
1.20 tmp=$(CT_Which ${tool})
1.21 if [ -n "${tmp}" ]; then
1.22 - ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
1.23 - ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
1.24 - ln -sfv "${tmp}" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
1.25 + printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}"
1.26 + printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}"
1.27 + printf "#${BANG}${CT_SHELL}\nexec '${tmp}' \"\${@}\"\n" >"${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
1.28 + chmod 700 "${CT_PREFIX_DIR}/bin/${CT_BUILD}-${tool}" "${CT_PREFIX_DIR}/bin/${CT_UNIQ_BUILD}-${tool}" "${CT_PREFIX_DIR}/bin/${CT_HOST}-${tool}"
1.29 fi |CT_DoLog DEBUG
1.30 done
1.31
1.32 @@ -337,9 +345,9 @@
1.33 # Override the configured jobs with what's been given on the command line
1.34 [ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}"
1.35
1.36 - # Help ./configure scripts go faster
1.37 - [ "${CT_CONFIG_SHELL_ASH}" = "y" ] && export CONFIG_SHELL=/bin/ash
1.38 - export CONFIG_SHELL
1.39 + # Set the shell to be used by ./configure scripts and by Makefiles (those
1.40 + # that support it!).
1.41 + export CONFIG_SHELL="${CT_SHELL}"
1.42
1.43 # And help make go faster
1.44 PARALLELMFLAGS=