# HG changeset patch # User "Yann E. MORIN" # Date 1245790599 -7200 # Node ID 71a85f37efbccabaa0bcf8f39d38da112a8904fe # Parent 0e49e6eddac4f5bbde6394eb3e6e36be75fc550c Use configured shell in all build-tools wrappers Abide by the user's wish to use dash as shell in build-tools wrappers, instead of plain /bin/sh. diff -r 0e49e6eddac4 -r 71a85f37efbc scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Tue Jun 23 22:52:14 2009 +0200 +++ b/scripts/crosstool-NG.sh.in Tue Jun 23 22:56:39 2009 +0200 @@ -60,6 +60,12 @@ CT_TestAndAbort "Your file system in '${CT_WORK_DIR}' is *not* case-sensitive!" -f "${CT_WORK_DIR}/FOO" CT_DoExecLog DEBUG rm -f "${CT_WORK_DIR}/foo" +# 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" + # Create the bin-overide early # Contains symlinks to the tools found by ./configure # Note: CT_DoLog and CT_DoExecLog do not use any of those tool, so @@ -71,7 +77,7 @@ tool="${line%%=*}" path="${line#*=}" CT_DoLog DEBUG " '${tool}' -> '${path}'" - printf "#${BANG}/bin/sh\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}" + printf "#${BANG}${CT_SHELL}\nexec '${path}' \"\${@}\"\n" >"${CT_BIN_OVERIDE_DIR}/${tool}" CT_DoExecLog ALL chmod 700 "${CT_BIN_OVERIDE_DIR}/${tool}" done export PATH="${CT_BIN_OVERIDE_DIR}:${PATH}" @@ -250,12 +256,6 @@ # Setting up the rest of the environment only if not restarting if [ -z "${CT_RESTART}" ]; then - # 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" - # Arrange paths depending on wether we use sys-root or not. if [ "${CT_USE_SYSROOT}" = "y" ]; then CT_SYSROOT_DIR="${CT_PREFIX_DIR}/${CT_TARGET}/${CT_SYSROOT_DIR_PREFIX}/sys-root" @@ -425,7 +425,7 @@ # Go ahead with those, by creating a wrapper that keeps partial files, and that # never fails: CT_DoLog DEBUG " 'makeinfo' -> '$(CT_Which makeinfo)'" - printf "#${BANG}/bin/sh\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/bin/makeinfo" + printf "#${BANG}${CT_SHELL}\n$(CT_Which makeinfo) --force \"\${@}\"\ntrue\n" >"${CT_PREFIX_DIR}/bin/makeinfo" CT_DoExecLog ALL chmod 700 "${CT_PREFIX_DIR}/bin/makeinfo" # Help gcc