-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·61 lines (52 loc) · 1.42 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# change into script directory
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
cd "$DIR"
install=""
if [ "$1" == "--install" ]; then
install="y"
elif [ -n "$1" ]; then
echo "unknown argument $1"
exit 255
fi
set -Eeuo pipefail
mkdir -p bootstrap.d && cd $_
echo "building temporary busy executable"
g++ -std=c++20 -lyaml-cpp -lfmt -O0 -ggdb3 -o busy \
-isystem ../src \
../src/busy/main.cpp \
../src/busy-lib/main.cpp \
../src/busy-lib/cmdInstall.cpp \
../src/busy-lib/cmdStatus.cpp \
../src/busy-lib/cmdInfo.cpp \
../src/clice-main/main.cpp \
../src/clice/Argument.cpp
echo "creating proper busy environment"
mkdir -p tmp-root
for f in "compilers" "stdlib" "yaml-cpp" "fmt"; do
rm -rf build
(
mkdir build && cd $_
../busy compile -f ../../extern/$f.yaml
../busy install --prefix ../tmp-root
if [ -n "${install}" ]; then
../busy install
fi
)
done
echo "compiling busy with busy"
export BUSY_ROOT=tmp-root
./busy compile -f ../busy.yaml -t gcc12.2
rm busy
if [ -n "${install}" ]; then
./bin/busy install
fi
echo "Compiling busy was a success!"
echo ""
echo "add following line to your .bashrc or .zshrc:"
echo " "'export PATH="${HOME}/.config/busy/env/bin:${PATH+:$PATH}"'
if [ -z "${install}" ]; then
echo ""
echo "and install busy by calling"
echo " bootstrap.sh --install"
fi