-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSetup.sh
74 lines (61 loc) · 2.26 KB
/
Setup.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
62
63
64
65
66
67
68
69
70
#!/bin/bash
BASEDIR=$(dirname "$0")
GNU_GCC=$("$GNU_GCC/")
CAIRO="-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16"
JOIN_PIECES="Sources/API/JoinPieces"
echo "Welcome to the AssetsApplication Setup!";
echo "The reason for this script is for developers to choose which build system they want to use.";
echo "Afterwards, the program can be built and run like normal";
echo "Choose an option:";
echo "1. CMake and Clang";
echo "2 CMake and Clang to LLVM IR";
echo "3. GNU Autotools and GCC";
read OPTION;
clang_check () {
if [ ! -d "AssetsApplication-CMake-Clang" ];
then
echo "CMake-Clang not found, cloning them as deps from GitHub"
git clone https\:\/\/\github.com\/\ChristoffenOSWorks\/\AssetsApplication-CMake-Clang.git
else
echo "Moving on"
fi
cp $BASEDIR\/\AssetsApplication-CMake-Clang\/\CMakeLists.txt $BASEDIR
export CC=clang
export CXX=clang++
cmake -H. -Bbuild
cmake --build build -- -j3
}
if [ $OPTION -eq 1 ]
then
clang_check
elif [ $OPTION -eq 2 ]
then
mkdir $BASEDIR\/\IR
mkdir $BASEDIR\/\IR\/\API
mkdir $BASEDIR\/\IR\/\API\/\JoinPieces
clang -emit-llvm -S -o - $BASEDIR/$JOIN_PIECES/JoinTriangles.c $CAIRO > $BASEDIR\/\IR\/\API\/\JoinPieces\/\JoinTriangles.ir
elif [ $OPTION -eq 3 ]
then
if [ ! -d "$GNU_GCC" ];
then
echo "GNU-GCC not found, cloning them as deps from GitHub"
git clone https\:\/\/\github.com\/\ChristoffenOSWorks\/\$GNU_GCC.git
else
echo "Moving on"
fi
git clone https\:\/\/\github.com\/\ChristoffenOSWorks\/\$GNU_GCC.git
cp $BASEDIR\/\$GNU_GCC\/\aclocal.m4 $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\compile $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\config.h.in $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\configure $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\configure.ac $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\depcomp $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\install-sh $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\Makefile.am $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\Makefile.in $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\missing $BASEDIR
cp $BASEDIR\/\$GNU_GCC\/\Sources\/\Makefile.am $BASEDIR\/\Sources\/\Assets
cp $BASEDIR\/\$GNU_GCC\/\Sources\/\Makefile.in $BASEDIR\/\Sources\/\Assets
./configure
make
fi