-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·72 lines (60 loc) · 2.15 KB
/
setup.sh
File metadata and controls
executable file
·72 lines (60 loc) · 2.15 KB
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
71
72
#!/bin/sh
#
# Copyright (C) 2016 Marco Pensallorto < marco AT pensallorto DOT gmail DOT com >
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
# set to 1 to enable distcc compilation
USE_DISTCC=0
# set to 1 to make a debugger-friendly build
USE_DEBUGGER=0
# set to 1 to enable strict compilation settings
USE_STRICT=1
# a few useful standard defines
DEFINES="-D __STDC_LIMIT_MACROS -D __STDC_FORMAT_MACROS -DPIC"
if [ $USE_DISTCC -eq 1 ];
then
CC="distcc gcc"
CXX="distcc g++"
else
CC="gcc"
CXX="g++"
fi
COMMON_OPTIONS="-fPIC -std=c++20"
if [ $USE_DEBUGGER -eq 1 ];
then
# compilation options for debugging, all + extra warnings enabled. Any warning is fatal.
OPTIONS="-g -O0"
else
# compilation options for debugging, all + extra warnings enabled. Any warning is fatal.
OPTIONS="-O2"
fi
if [ $USE_STRICT -eq 1 ];
then
# compilation options for debugging, all + extra warnings enabled. Any warning is fatal.
FLAGS="-Wall -Wno-deprecated-declarations -Werror"
else
# compilation options for debugging, all + extra warnings enabled. Any warning is fatal.
FLAGS=""
fi
SETTINGS="$DEFINES $COMMON_OPTIONS $OPTIONS $FLAGS"
# extract microcode (do it only once)
if ! [ -f microcode/u-ge-26.json ]; then
echo -n "Extracting microcode ... " && tar xfj microcode.tar.bz2 && echo "done."
fi
# generate configure script
autoreconf -vif
# invoking configure script with above settings
./configure --prefix=/usr/local CC="$CC" CXX="$CXX" CFLAGS="-O2" CXXFLAGS="$SETTINGS"