summaryrefslogtreecommitdiff
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-07-15 11:14:14 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2022-07-16 14:33:01 +0200
commit523bb702ec416e77ecf2eab91021c7b044f4aec0 (patch)
tree0a09c1674ab3bcb94ab5427dc9466a579b13fafd /bootstrap.sh
parentae1871ca0ffcac3e8bd337f8d8bb4e7fd6c59295 (diff)
Build with clang
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index a5c11ac..abe8012 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,7 +1,16 @@
#!/bin/sh
+: ${CXX:=g++}
+CXX=$(which $CXX)
+$CXX -std=c++20 /dev/null -c -o /dev/null 2> /dev/null 1> /dev/null
+if [ $? != 0 ]
+then
+ echo "Set CXX to a compiler supporting c++20."
+ exit 1
+fi
+
echo "Bootstrapping..."
-g++ -std=c++20 -Wall -O3 -Isrc -pthread src/bootstrap.cc ctor.cc test/ctor.cc -o ctor && \
+$CXX -std=c++20 -Wall -O3 -Isrc -pthread src/bootstrap.cc ctor.cc test/ctor.cc -o ctor && \
./ctor && \
-g++ -std=c++20 -Wall -O3 -Isrc -pthread ctor.cc test/ctor.cc -Lbuild -lctor -o ctor && \
+$CXX -std=c++20 -Wall -O3 -Isrc -pthread ctor.cc test/ctor.cc -Lbuild -lctor -o ctor && \
./ctor configure --ctor-includedir=src --ctor-libdir=build && \
echo "Done. Now run ./ctor to (re)build."