summaryrefslogtreecommitdiff
path: root/build.sh
blob: b5920c0a515f50ffde52521570fd68b8899e5544 (plain) (blame)
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
#!/bin/bash

CMD="$1"

if [[ -z "${CMD}" ]]; then
    export CMD="default"
fi

source tools/vars.sh

mkdir build
# this need for some outdated os
mkdir m4
autoreconf -i
cd build
if [[ "${CMD}" == "default" ]]; then
    export CC=gcc
    ../configure --enable-sanitize --enable-lto CPPFLAGS="${VARS}"
elif [[ "${CMD}" == "old" ]]; then
    ../configure CPPFLAGS="${VARS}"
elif [[ "${CMD}" == "gprof" ]]; then
    export CC=gcc
    ../configure --enable-gprof CPPFLAGS="${VARS}"
fi
make -j3
export RET=$?
cd -
exit $RET