From d00a96c846dc7bad686d174aa27ad7d66da149da Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 2 Dec 2021 21:35:45 +0100 Subject: Add support for bootstrapping with custom compiler, including check for c++20 support. --- bootstrap.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bootstrap.sh') diff --git a/bootstrap.sh b/bootstrap.sh index a5c11ac..510320a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,14 @@ #!/bin/sh echo "Bootstrapping..." -g++ -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:=g++} +$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 +$CXX -std=c++20 -Wall -O3 -Isrc -pthread src/bootstrap.cc ctor.cc -o ctor && \ +CXX=`which $CXX` ./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." -- cgit v1.2.3