build: Use bash if available to avoid dash problems.
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 25 Jun 2019 19:40:43 +0000 (21:40 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 25 Jun 2019 19:40:43 +0000 (21:40 +0200)
* 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
build-aux/build.sh.in
build-aux/check-mes.sh
build-aux/check-mescc.sh
build-aux/check.sh.in
build-aux/config.make.in
build-aux/config.sh.in
build-aux/export.make
build-aux/test-suite.sh
configure
configure.sh

index af2909036adb028b704a46e85f60cb6b0e241b1c..ee10116cf28920e888c1a51e8681e45bab29b62c 100644 (file)
@@ -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)
index 4f3891d77fa99c6bbf6c99f600b4fe5d454cd1b4..7bfe3fe60034a9f77e954c90d2751a0b20497f74 100644 (file)
@@ -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
 )
index 7e4057c90f9436327669739da17b02f10dee7878..b6f92b7a9675a0d654dfaa671f22e19bfbb80692 100755 (executable)
@@ -58,5 +58,5 @@ tests/psyntax.test
 XFAIL_TESTS=
 
 test_ext=.test
-log_compiler=sh
+log_compiler=${SHELL}
 . ${srcdest}build-aux/test-suite.sh
index 0e3288324cf77416221620f7f8b910ff28bf7f65..6dd1262d03c0ad127cac4302b04c990c47bdccca 100755 (executable)
@@ -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
index 6732910ed8ba642cb717cf8b3c709c1f00378ffa..2ecac1b29d8c3036f128b942fdacecd4d2ce2063 100644 (file)
@@ -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
 )
index 61b5fc298773b81acccc202453a32e2746124414..54d23bd300c88ef1b07d2c981f09987be8b5f205 100644 (file)
@@ -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@
index 7bd137c4259dac09603c854ccd853c902fb5c9ab..e6e8d241c2cf4f51bbfd61d21218ff9e80da9530 100644 (file)
@@ -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
index 4d30a75f902c806a81a93eeec38ab567cae4f904..5881452461847c91d34f36a310a4b0239804ef88 100644 (file)
@@ -114,6 +114,10 @@ ifdef PERL
 export PERL
 endif
 
+ifdef SHELL
+export SHELL
+endif
+
 ifdef GUILE_LOAD_PATH
 export GUILE_LOAD_PATH
 endif
index 976b3cac357591066f3b6bf489b37c8d55068e30..e77677043cf76766f3b80d2891b3937322cf65d3 100644 (file)
@@ -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\
index 9157e5ddab8303eff384fdf6ee5d880907aae0d9..3d85a6c3c8edc99f1297dde7b1051dc9fbbdaa0c 100755 (executable)
--- 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") ""))
index 26f233e14688ff3dbbb80d5af6a9bfaecd7a3e71..67013db0b2c0f1582bf780a3b909d18fcc3758a7 100755 (executable)
@@ -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