From 1ba8bf539a111ededd97e9b8e68a659c57b6ee14 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 25 Jun 2019 21:40:43 +0200 Subject: [PATCH] build: Use bash if available to avoid dash problems. * configure: Set SHELL to bash. * configure.sh: Likewise. * build-aux/test-suite.sh (TEST_LOGS): * build-aux/export.make: Export SHELL. * build-aux/config.sh.in (SHELL): New substitute, export. * build-aux/config.make.in (SHELL): New substitute. * build-aux/GNUmakefile.in (build, check, install, uninstall): Use $SHELL to avoid dash problems. * build-aux/check-mescc.sh: Likewise. * build-aux/build.sh.in: Likewise. * build-aux/check-mes.sh: Likewise. * build-aux/check.sh.in: Likewise. --- build-aux/GNUmakefile.in | 10 +++++----- build-aux/build.sh.in | 10 +++++----- build-aux/check-mes.sh | 2 +- build-aux/check-mescc.sh | 2 +- build-aux/check.sh.in | 8 ++++---- build-aux/config.make.in | 1 + build-aux/config.sh.in | 2 ++ build-aux/export.make | 4 ++++ build-aux/test-suite.sh | 2 +- configure | 4 +++- configure.sh | 2 ++ 11 files changed, 29 insertions(+), 18 deletions(-) diff --git a/build-aux/GNUmakefile.in b/build-aux/GNUmakefile.in index af290903..ee10116c 100644 --- a/build-aux/GNUmakefile.in +++ b/build-aux/GNUmakefile.in @@ -92,7 +92,7 @@ all: doc doc: build build: - ./build.sh + $(SHELL) build.sh src/${program_prefix}mes: build @@ -129,20 +129,20 @@ clean-go: rm -f $(shell find . -name '*.go') check: - ./check.sh + $(SHELL) check.sh check-mescc: - ./pre-inst-env build-aux/check-mescc.sh + $(SHELL) pre-inst-env build-aux/check-mescc.sh # Mes does not feature post-install checks yet, so we're great! installcheck: true install: - ./install.sh + $(SHELL) install.sh uninstall: - ./uninstall.sh + $(SHELL) uninstall.sh doc/version.texi: ${srcdest}doc/mes.texi GNUmakefile @mkdir -p $(@D) diff --git a/build-aux/build.sh.in b/build-aux/build.sh.in index 4f3891d7..7bfe3fe6 100644 --- a/build-aux/build.sh.in +++ b/build-aux/build.sh.in @@ -42,10 +42,10 @@ if $courageous; then set +e fi -sh ${srcdest}build-aux/build-scaffold.sh +${SHELL} ${srcdest}build-aux/build-scaffold.sh if test -n "$GUILE" -a "$GUILE" != true; then - sh ${srcdest}build-aux/build-guile.sh + ${SHELL} ${srcdest}build-aux/build-guile.sh fi debug= @@ -101,7 +101,7 @@ if test $compiler = gcc; then -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu " - sh ${srcdest}build-aux/build-lib.sh + ${SHELL} ${srcdest}build-aux/build-lib.sh cp crt1.o .. ) fi @@ -119,7 +119,7 @@ fi -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu " - sh ${srcdest}build-aux/build-mes.sh + ${SHELL} ${srcdest}build-aux/build-mes.sh ) ( @@ -143,5 +143,5 @@ fi compiler=mescc AR="${srcdest}pre-inst-env ar" CC="${srcdest}pre-inst-env mescc -m $mes_bits" - sh ${srcdest}build-aux/build-lib.sh + ${SHELL} ${srcdest}build-aux/build-lib.sh ) diff --git a/build-aux/check-mes.sh b/build-aux/check-mes.sh index 7e4057c9..b6f92b7a 100755 --- a/build-aux/check-mes.sh +++ b/build-aux/check-mes.sh @@ -58,5 +58,5 @@ tests/psyntax.test XFAIL_TESTS= test_ext=.test -log_compiler=sh +log_compiler=${SHELL} . ${srcdest}build-aux/test-suite.sh diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index 0e328832..6dd1262d 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -269,5 +269,5 @@ fi recheck=${recheck-false} test_ext=.c -log_compiler=${srcdest}build-aux/test-c.sh +log_compiler="${SHELL} ${srcdest}build-aux/test-c.sh" . ${srcdest}build-aux/test-suite.sh diff --git a/build-aux/check.sh.in b/build-aux/check.sh.in index 6732910e..2ecac1b2 100644 --- a/build-aux/check.sh.in +++ b/build-aux/check.sh.in @@ -60,15 +60,15 @@ export LDFLAGS recheck=${recheck-false} export recheck -./pre-inst-env sh ${srcdest}build-aux/check-boot.sh -./pre-inst-env sh ${srcdest}build-aux/check-mes.sh +./pre-inst-env ${SHELL} ${srcdest}build-aux/check-boot.sh +./pre-inst-env ${SHELL} ${srcdest}build-aux/check-mes.sh if test $compiler = gcc; then ( cd gcc-lib srcdest=$srcdir/../ srcdir=../$srcdir - ../pre-inst-env sh ${srcdest}build-aux/check-mescc.sh + ../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh ) fi @@ -89,5 +89,5 @@ fi LIBS=-lc AR="${srcdest}pre-inst-env ar" CC="${srcdest}pre-inst-env mescc" - ../pre-inst-env sh ${srcdest}build-aux/check-mescc.sh + ../pre-inst-env ${SHELL} ${srcdest}build-aux/check-mescc.sh ) diff --git a/build-aux/config.make.in b/build-aux/config.make.in index 61b5fc29..54d23bd3 100644 --- a/build-aux/config.make.in +++ b/build-aux/config.make.in @@ -41,6 +41,7 @@ PACKAGE:=@PACKAGE@ PACKAGE_NAME:=@PACKAGE_NAME@ PACKAGE_BUGREPORT:=@PACKAGE_BUGREPORT@ PERL:=@PERL@ +SHELL:=@SHELL@ TINYCC_PREFIX:=@TINYCC_PREFIX@ VERSION:=@VERSION@ V:=@V@ diff --git a/build-aux/config.sh.in b/build-aux/config.sh.in index 7bd137c4..e6e8d241 100644 --- a/build-aux/config.sh.in +++ b/build-aux/config.sh.in @@ -41,6 +41,7 @@ PACKAGE="@PACKAGE@" PACKAGE_NAME="@PACKAGE_NAME@" PACKAGE_BUGREPORT="@PACKAGE_BUGREPORT@" PERL="@PERL@" +SHELL="@SHELL@" TINYCC_PREFIX="@TINYCC_PREFIX@" VERSION="@VERSION@" V=${V-"@V@"} @@ -86,6 +87,7 @@ export PACKAGE_BUGREPORT export AR export CC export DIFF +export SHELL export V export colors export compiler diff --git a/build-aux/export.make b/build-aux/export.make index 4d30a75f..58814524 100644 --- a/build-aux/export.make +++ b/build-aux/export.make @@ -114,6 +114,10 @@ ifdef PERL export PERL endif +ifdef SHELL +export SHELL +endif + ifdef GUILE_LOAD_PATH export GUILE_LOAD_PATH endif diff --git a/build-aux/test-suite.sh b/build-aux/test-suite.sh index 976b3cac..e7767704 100644 --- a/build-aux/test-suite.sh +++ b/build-aux/test-suite.sh @@ -44,7 +44,7 @@ for t in $TESTS; do fail=no;; esac mkdir -p $d - sh ${srcdest}build-aux/test-driver\ + ${SHELL} ${srcdest}build-aux/test-driver\ --test-name $t \ --log-file $b.log\ --trs-file $b.trs\ diff --git a/configure b/configure index 9157e5dd..3d85a6c3 100755 --- a/configure +++ b/configure @@ -598,7 +598,9 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system) guile)) ("@MES_SEED@" . ,(or mes-seed "")) ("@PERL@" . ,(or (file-name "perl" deps) "")) - ("@SHELL@" . ,(or (file-name "sh" deps) "")) + ("@SHELL@" . ,(or (file-name "bash" deps) + (file-name "sh" deps) + "sh")) ("@CFLAGS@" . ,(or (getenv "CFLAGS") "")) ("@HEX2FLAGS@" . ,(or (getenv "HEX2FLAGS") "")) diff --git a/configure.sh b/configure.sh index 26f233e1..67013db0 100755 --- a/configure.sh +++ b/configure.sh @@ -106,6 +106,8 @@ M1=${M1-$(command -v M1)} MES_FOR_BUILD=${MES_FOR_BUILD-$(command -v mes || command -v guile || echo mes)} GIT=${GIT-$(command -v git)} || true PERL=${PERL-$(command -v perl)} || true +SHELL=${BASH-$SHELL} + MES_SEED=${MES_SEED-../mes-seed} if test "$srcdir" = .; then