From da1c529bb4692c9cf05383b6fef6c31565b86ff7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 25 Feb 2019 18:37:18 +0100 Subject: [PATCH] build: Support building with Gash. * 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 | 6 +++--- build-aux/check-mescc.sh | 10 +++++----- build-aux/check-tcc.sh | 10 +++++----- build-aux/check.sh.in | 6 +++--- build-aux/install.sh.in | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build-aux/check-mes.sh b/build-aux/check-mes.sh index 1555f31b..a2dabc89 100755 --- a/build-aux/check-mes.sh +++ b/build-aux/check-mes.sh @@ -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 diff --git a/build-aux/check-mescc.sh b/build-aux/check-mescc.sh index 3504eb16..99008fdb 100755 --- a/build-aux/check-mescc.sh +++ b/build-aux/check-mescc.sh @@ -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 diff --git a/build-aux/check-tcc.sh b/build-aux/check-tcc.sh index 9fe08bb8..e38302fd 100755 --- a/build-aux/check-tcc.sh +++ b/build-aux/check-tcc.sh @@ -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 diff --git a/build-aux/check.sh.in b/build-aux/check.sh.in index d91e6d1e..cd8d476c 100644 --- a/build-aux/check.sh.in +++ b/build-aux/check.sh.in @@ -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 diff --git a/build-aux/install.sh.in b/build-aux/install.sh.in index 1cd0a313..6a1074f6 100644 --- a/build-aux/install.sh.in +++ b/build-aux/install.sh.in @@ -1,7 +1,7 @@ #! /bin/sh # GNU Mes --- Maxwell Equations of Software -# Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen +# Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen # # 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@