build: Support building with Gash.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 25 Feb 2019 17:37:18 +0000 (18:37 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 25 Feb 2019 17:37:18 +0000 (18:37 +0100)
* build-aux/check-mes.sh: Replace unspported $((..)) by $(expr ...).
* build-aux/check-mescc.sh: Likewise.
* build-aux/check-tcc.sh: Likewise.

build-aux/check-mes.sh
build-aux/check-mescc.sh
build-aux/check-tcc.sh
build-aux/check.sh.in
build-aux/install.sh.in

index 1555f31b26b09efb9e6675290653114b8b734b81..a2dabc890bd1a31da91ddfe22ded23713e1c74a8 100755 (executable)
@@ -66,14 +66,14 @@ for t in $tests; do
         echo $t: [SKIP];
         continue
     fi
-    ${top_builddir}/pre-inst-env sh "$t" &> $t.${mes}log
+    ${top_builddir}/pre-inst-env sh "$t" > $t.${mes}log 2>&1
     r=$?
-    total=$((total+1))
+    total=$(expr $total + 1)
     if [ $r = 0 ]; then
         echo $t: [${mes}OK]
     else
         echo $t: [${mes}FAIL]
-        fail=$((fail+1))
+        fail=$(expr $fail + 1)
     fi
 done
 if [ $fail != 0 ]; then
index 3504eb1669e18200a0a8260bebfb629705d7800e..99008fdb84cf30ef1bbaf609f86b50ed2b70eea7 100755 (executable)
@@ -248,21 +248,21 @@ for t in $tests; do
     else
         libc='-l c'
     fi
-    sh $test_sh "$t" &> "$t".log
+    sh $test_sh "$t" > "$t".log 2>&1
     r=$?
-    total=$((total+1))
+    total=$(expr $total + 1)
     if [ $r = 0 ]; then
         echo $t: [OK]
-        pass=$((pass+1))
+        pass=$(expr $pass + 1)
     else
         echo $t: [FAIL]
-        fail=$((fail+1))
+        fail=$(expr $fail + 1)
     fi
 done
 
 [ $expect != 0 ] && echo "expect: $expect"
 [ $fail != 0 ] && echo "failed: $fail"
-[ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
+[ $fail -lt $expect ] && echo "solved: $(expr $expect - $fail)"
 echo "passed: $pass"
 echo "total:  $total"
 if [ $fail != 0 -a $fail -gt $expect ]; then
index 9fe08bb8aaf7f6e2fb73310a9e0f685d282f5048..e38302fdd5c3c1087c239aec1c5928f4472e4e00 100755 (executable)
@@ -135,20 +135,20 @@ for t in $tests; do
         continue;
     fi
     cp $TINYCC_PREFIX/tests/tests2/$i* scaffold/tinycc
-    sh ${srcdest}build-aux/test.sh "scaffold/tinycc/$t" &> scaffold/tinycc/"$t".log
+    sh ${srcdest}build-aux/test.sh "scaffold/tinycc/$t" > scaffold/tinycc/"$t".log 2>&1
     r=$?
-    total=$((total+1))
+    total=$(expr $total + 1)
     if [ $r = 0 ]; then
         echo $t: [OK]
-        pass=$((pass+1))
+        pass=$(expr $pass + 1)
     else
         echo $t: [FAIL]
-        fail=$((fail+1))
+        fail=$(expr $fail + 1)
     fi
 done
 [ $expect != 0 ] && echo "expect: $expect"
 [ $fail != 0 ] && echo "failed: $fail"
-[ $fail -lt $expect ] && echo "solved: $(($expect - $fail))"
+[ $fail -lt $expect ] && echo "solved: $(expr $expect - $fail)"
 echo "passed: $pass"
 echo "total:  $total"
 if [ $fail != 0 -a $fail -gt $expect ]; then
index d91e6d1e2d8c0c18af8a6ff26433e6a3c97e975d..cd8d476c9021b9a64d3b6e6d9b3e897567fefcfb 100644 (file)
@@ -25,8 +25,8 @@ set -e
 . ${srcdest}build-aux/trace.sh
 
 ./pre-inst-env bash ${srcdest}build-aux/check-boot.sh
-./pre-inst-env bash ${srcdest}build-aux/check-mes.sh
-./pre-inst-env bash ${srcdest}build-aux/check-mescc.sh
+./pre-inst-env sh ${srcdest}build-aux/check-mes.sh
+./pre-inst-env sh ${srcdest}build-aux/check-mescc.sh
 if [ -d $TINYCC_PREFIX/tests/tests2 ] ;then
-    ./pre-inst-env bash ${srcdest}build-aux/check-tcc.sh
+    ./pre-inst-env sh ${srcdest}build-aux/check-tcc.sh
 fi
index 1cd0a313192167451a4f6c5fda92f1994c949303..6a1074f63cb1c07f7339107b626866595ad6a375 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # GNU Mes --- Maxwell Equations of Software
-# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 #
 # This file is part of GNU Mes.
 #
@@ -25,7 +25,7 @@ set -e
 mes_prefix=@prefix@/share/mes
 
 # use bash or lose if pipes fail
-if [ "$(basename $SHELL)" == bash ]; then
+if [ "$(basename $SHELL)" = bash ]; then
    set -o pipefail
 fi
 
@@ -39,7 +39,7 @@ cp scripts/mescc $DESTDIR@bindir@/mescc
 sed \
     -e "s,^#! /bin/sh,#! @SHELL@," \
     scripts/diff.scm > $DESTDIR@bindir@/diff.scm
-chmod -w+x $DESTDIR@bindir@/diff.scm
+chmod +x $DESTDIR@bindir@/diff.scm
 
 mkdir -p $DESTDIR@docdir@