summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2007-08-14 00:26:58 +0000
committerrillig <rillig@pkgsrc.org>2007-08-14 00:26:58 +0000
commit97cad8f63b9ceaad5feddfc451deb1cf4b3cdbda (patch)
treea7c09afad1444deb9b4f8dcf22102d25b1852a1a /bootstrap
parentd9cb93db17055c5f68c2e8c63a9768272ec1be21 (diff)
downloadpkgsrc-97cad8f63b9ceaad5feddfc451deb1cf4b3cdbda.tar.gz
Replaced the hard-coded /bin/bash with an environment variable.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap/bootstrap27
1 files changed, 19 insertions, 8 deletions
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