From 05e132851016d566629fcfd279eef025a14ddb32 Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 19 Mar 2026 19:32:43 +0100 Subject: Shell script changes for portability --- bootstrap.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'bootstrap.sh') 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) -- cgit v1.2.3