diff options
author | rillig <rillig@pkgsrc.org> | 2007-08-14 00:26:58 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-08-14 00:26:58 +0000 |
commit | e34c7d8696f2b63866a4cdf1da5bfa286dd4acf3 (patch) | |
tree | a7c09afad1444deb9b4f8dcf22102d25b1852a1a | |
parent | acb9366a92ccf8dd0ebd2cb38cbe2de7bd36d317 (diff) | |
download | pkgsrc-e34c7d8696f2b63866a4cdf1da5bfa286dd4acf3.tar.gz |
Replaced the hard-coded /bin/bash with an environment variable.
-rwxr-xr-x | bootstrap/bootstrap | 27 |
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 |