This repository has been archived by the owner on Feb 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
autogen.sh
executable file
·64 lines (53 loc) · 1.6 KB
/
autogen.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
#!/bin/sh
set -e
oldpwd=$(pwd)
topdir=$(dirname $0)
cd $topdir
autoreconf --force --install --symlink
libdir() {
echo $(cd "$1/$(gcc -print-multi-os-directory)"; pwd)
}
args="\
--sysconfdir=/etc \
--localstatedir=/var \
--libdir=$(libdir /usr/lib) \
"
if [ -f "$topdir/.config.args" ]; then
args="$args $(cat $topdir/.config.args)"
fi
if [ ! -L /bin ]; then
args="$args \
--with-rootprefix= \
--with-rootlibdir=$(libdir /lib) \
"
fi
cd $oldpwd
if [ $# -ge 1 ]; then
cmd=$1
shift
fi
args="$args $@"
if [ "$cmd" = "c" ]; then
$topdir/configure CFLAGS='-g -O2' CXXFLAGS='-g -O2' $args
make clean
elif [ "$cmd" = "g" ]; then
$topdir/configure CFLAGS='-g -Og' CXXFLAGS='-g -O2' $args
make clean
elif [ "$cmd" = "l" ]; then
$topdir/configure CC=clang CXX=clang++ CFLAGS='-g -O2' CXXFLAGS='-g -O2' $args
make clean
elif [ "$cmd" = "a" ]; then
$topdir/configure CFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' CXXFLAGS='-g -O2 -Wsuggest-attribute=pure -Wsuggest-attribute=const' $args
make clean
elif [ "$cmd" = "s" ]; then
scan-build $topdir/configure CFLAGS='-g -O0 -std=gnu11' CXXFLAGS='-g -O0 -std=gnu++11' $args
scan-build make
else
echo
echo "----------------------------------------------------------------"
echo "Initialized build system. For a common configuration please run:"
echo "----------------------------------------------------------------"
echo
echo "$topdir/configure CFLAGS='-g -O2' CXXFLAGS='-g -O2' $args"
echo
fi