summaryrefslogtreecommitdiff
path: root/bootstrap.sh
blob: abe8012bf7c3505b2a344916ba900994f475b7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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..."
$CXX -std=c++20 -Wall -O3 -Isrc -pthread src/bootstrap.cc ctor.cc test/ctor.cc -o ctor && \
./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."