-
Notifications
You must be signed in to change notification settings - Fork 412
/
autogen.sh
executable file
·68 lines (54 loc) · 1.37 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
65
66
67
68
#!/bin/sh
set -e
oldpwd=$(pwd)
topdir=$(dirname $0)
cd $topdir
#intltoolize --force --automake
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
cd $oldpwd
if [ "x$1" = "xc" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
elif [ "x$1" = "xg" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
elif [ "x$1" = "xa" ]; then
shift
args="$args $@"
$topdir/configure CFLAGS='-g -O0 -Wsuggest-attribute=pure -Wsuggest-attribute=const -ftrapv' $args
elif [ "x$1" = "xl" ]; then
shift
args="$args $@"
$topdir/configure CC=clang CFLAGS='-g -O0 -ftrapv' $args
elif [ "x$1" = "xs" ]; then
shift
args="$args $@"
scan-build $topdir/configure CFLAGS='-std=gnu99 -g -O0 -ftrapv' $args
scan-build make
else
cat <<EOF
----------------------------------------------------------------
Initialized build system. For a common configuration please run:
----------------------------------------------------------------
$topdir/configure CFLAGS='-g -O0 -ftrapv' $args
or run $0 with param:
- c: compilation
- g: debugging
- a: pure/const warning
- l: clang build
- s: scan-build reporting
EOF
fi