diff options
| author | 2026-03-19 19:32:43 +0100 | |
|---|---|---|
| committer | 2026-03-19 19:33:50 +0100 | |
| commit | 05e132851016d566629fcfd279eef025a14ddb32 (patch) | |
| tree | d30140d50f676052558a3e6b9bf8bcfb0470e8bd /bootstrap.sh | |
| parent | ff143376a7b4ac3b370bd8683d7aeb0b4827a494 (diff) | |
Shell script changes for portability
Diffstat (limited to 'bootstrap.sh')
| -rwxr-xr-x | bootstrap.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index b193bbd..1478e1f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/env sh +#!/bin/sh set -eo pipefail @@ -14,18 +14,23 @@ if test -n "$V"; then fi src=$(find src/ -name '*.c') X() { - echo "> $@" | (test -n "$V" && cat || sed -s 's/\([^ ]\+\.c \?\)\{10\}$/.../') + echo "> $@" | (test -n "$V" && cat || sed 's/\([^ ]\+\.c \?\)\{10\}$/.../') $@ } +md5=md5sum +if ! $(command -v md5sum > /dev/null); then + md5=md5 +fi + echo "== Stage 0 (compiling with $cc) ==" X $cc $cflags -o antcc0 $src echo echo "== Stage 1 (compiling with stage 0 output) ==" X ./antcc0 $opt $cflags -o antcc1 $src -X md5sum antcc1 +X $md5 antcc1 echo echo "== Stage 2 (compiling with stage 1 output) ==" X ./antcc1 $opt $cflags -o antcc2 $src -X md5sum antcc2 +X $md5 antcc2 (X cmp antcc1 antcc2) && echo ok. || (echo 'bootstrap FAIL!'; exit 1) |