From 97cad8f63b9ceaad5feddfc451deb1cf4b3cdbda Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 14 Aug 2007 00:26:58 +0000 Subject: Replaced the hard-coded /bin/bash with an environment variable. --- bootstrap/bootstrap | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/bootstrap b/bootstrap/bootstrap index 7fb176629a3..520b6d29c92 100755 --- a/bootstrap/bootstrap +++ b/bootstrap/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: bootstrap,v 1.106 2007/08/13 22:48:59 rillig Exp $ +# $NetBSD: bootstrap,v 1.107 2007/08/14 00:26:58 rillig Exp $ # # # Copyright (c) 2001-2002 Alistair G. Crooks. All rights reserved. @@ -37,7 +37,7 @@ # the following environment variables are honored: # compiler/linker flags: CFLAGS, CPPFLAGS, LDFLAGS -# tools: CP, GREP, ID, MKDIR, TEST, TOUCH, XARGS +# tools: CP, GREP, ID, MKDIR, SH, TEST, TOUCH, XARGS BOOTSTRAP_VERSION=20060721 @@ -261,6 +261,20 @@ get_optarg() expr "x$1" : "x[^=]*=\\(.*\\)" } +bootstrap_sh=${SH-/bin/sh} +bootstrap_sh_set=${SH+set} + +# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash, +# whose echo(1) is not BSD-compatible. +dash_echo_test=`$bootstrap_sh -c 'echo "\\100"'` +if [ "$dash_echo_test" = "@" ]; then + { echo "ERROR: Your shell's echo command is not BSD-compatible." + echo "ERROR: Please select another shell by setting the environment" + echo "ERROR: variable SH." + } 1>&2 + exit 1; +fi + build_start=`date` echo_msg "bootstrap command: $0 $@" echo_msg "bootstrap started: $build_start" @@ -838,12 +852,9 @@ fi MAKECONF=$wrkdir/mk.conf export MAKECONF -# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash, -# whose echo(1) is not BSD-compatible. -dash_echo_test=`echo "\\100"` -if [ "$dash_echo_test" = "@" ]; then - echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${TARGET_MKCONF} - echo "TOOLS_PLATFORM.sh?= /bin/bash # instead of /bin/sh" >> ${BOOTSTRAP_MKCONF} +if [ "$bootstrap_sh_set" = "set" ]; then + echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${TARGET_MKCONF} + echo "TOOLS_PLATFORM.sh?= ${bootstrap_sh}" >> ${BOOTSTRAP_MKCONF} fi # preserve compiler and tool environment variables settings -- cgit v1.2.3