-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathconfigure.sh
executable file
·73 lines (56 loc) · 1.67 KB
/
configure.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
71
72
73
#!/usr/bin/env bash
set -e -o pipefail
BUILD_DIR=build
asan=no
check=no
debug=no
static=no
btor2aiger=no
#--------------------------------------------------------------------------#
die () {
echo "*** configure.sh: $*" 1>&2
exit 1
}
usage () {
cat <<EOF
usage: ./configure.sh [<option> ...]
where <option> is one of the following:
-O optimized compilation (default)
-g compile with debugging support
-c check assertions even in optimized compilation
--static static compilation
--asan compile with ASAN support
--btor2aiger build btor2aiger binary
You might also want to use the environment variables
CC and CXX to specify the used C and C++ compiler, as in
CC=gcc-4.4 CXX=g++-4.4 ./configure.sh
which forces to use 'gcc-4.4' and 'g++-4.4'.
EOF
exit 0
}
#--------------------------------------------------------------------------#
while [ $# -gt 0 ]
do
case $1 in
-g) debug=yes;;
-O) debug=no;;
-c) check=yes;;
--static) static=yes;;
--asan) asan=yes;;
--btor2aiger) btor2aiger=yes;;
-h|-help|--help) usage;;
-*) die "invalid option '$1' (try '-h')";;
esac
shift
done
#--------------------------------------------------------------------------#
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
cmake_opts=""
[ $debug = yes ] && cmake_opts="$cmake_opts -DCMAKE_BUILD_TYPE=Debug"
[ $check = yes ] && cmake_opts="$cmake_opts -DCHECK=ON"
[ $static = yes ] && cmake_opts="$cmake_opts -DBUILD_SHARED_LIBS=OFF"
[ $asan = yes ] && cmake_opts="$cmake_opts -DASAN=ON"
[ $btor2aiger = yes ] && cmake_opts="$cmake_opts -DBUILD_BTOR2AIGER=ON"
cd "${BUILD_DIR}"
cmake .. $cmake_opts