aboutsummaryrefslogtreecommitdiffhomepage
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-12-20 17:58:57 +0100
committerlemon <lsof@mailbox.org>2025-12-20 17:58:57 +0100
commita5009ae762541c29e9a123bf70877261db4ff628 (patch)
tree3c826b2bc6cb42c9bd4859717b4e54c12b7b35f7 /bootstrap.sh
parent771554e39c047eec8e0451c5d8d7adbf990d356c (diff)
bootstrap.sh options
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh15
1 files changed, 8 insertions, 7 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index 1665239..a65824e 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,11 +1,12 @@
#!/bin/env sh
set -eo pipefail
-if [ -x $CC ]; then
- cc=gcc
-else
- cc=$CC
-fi
+
+cc="$CC"
+test -n "$cc" || cc=cc
+opt="$O"
+test -n "$opt" || opt=
+
cflags="-std=c11"
src=$(grep -o '\([_A-Za-z0-9/]\)\+\.c' < Makefile)
X() {
@@ -16,9 +17,9 @@ echo "== Stage 0 (compiling with $cc) =="
X $cc $cflags -o antcc0 $src
echo
echo "== Stage 1 (compiling with stage 0 output) =="
-X ./antcc0 $cflags -o antcc1 $src
+X ./antcc0 $opt $cflags -o antcc1 $src
X md5sum antcc1
echo
echo "== Stage 2 (compiling with stage 1 output) =="
-X ./antcc1 $cflags -o antcc2 $src
+X ./antcc1 $opt $cflags -o antcc2 $src
X md5sum antcc2