diff options
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) |