-
Notifications
You must be signed in to change notification settings - Fork 30
/
configure.sh
executable file
·38 lines (33 loc) · 1.35 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
#!/bin/bash
# need --enable-maintainer-mode to be able to run in place
# must be disabled to build an installable package
# *FLAGS are what Arch Linux makepkg uses with the exception
# that -Wall -Werror is added
case "`uname -m`" in
i686)
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
DEBUG_CFLAGS="-g -ggdb -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -ggdb -fvar-tracking-assignments"
;;
x86_64)
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
DEBUG_CFLAGS="-g -ggdb -fvar-tracking-assignments"
DEBUG_CXXFLAGS="-g -ggdb -fvar-tracking-assignments"
;;
esac
./configure \
--enable-maintainer-mode \
--enable-dependency-tracking \
--enable-shared \
CPPFLAGS="$CPPFLAGS" \
CFLAGS="$DEBUG_CFLAGS -Wall -Wextra -Werror -Wno-array-bounds $CFLAGS" \
CXXFLAGS="$DEBUG_CXXFLAGS -Wall -Wextra -Werror -Wno-array-bounds $CXXFLAGS" \
LDFLAGS="$LDFLAGS" \
DEBUG_CFLAGS="$DEBUG_CFLAGS" \
DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS"