-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.od
56 lines (51 loc) · 1.32 KB
/
config.od
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
die() {
echo Error: "$@" >&2
exit 99
}
[ -n "$OUT" ] || die "run redo from your output dir (obj/), not source dir."
redo-ifchange "$OUT/_config.od"
. "$OUT/_config.od"
if [ "$enable_optimization" = "yes" ]; then
CXXFLAGS="$CXXFLAGS -O2"
CFLAGS="$CFLAGS -O2"
fi
if [ "$enable_warnings" != "no" ]; then
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Woverloaded-virtual -Wno-unused-parameter"
CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter"
fi
if [ "$enable_debug" = "yes" ]; then
CPPFLAGS="$CPPFLAGS -ggdb -DDEBUG=1"
LDFLAGS="$LDFLAGS -ggdb"
fi
if [ -n "$USE_WVSTREAMS_ARGP" ]; then
CPPFLAGS="$CPPFLAGS -Iargp"
fi
CPPFLAGS="$CPPFLAGS
-D_DEFAULT_SOURCE -D_GNU_SOURCE
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUNSTABLE
"
# FIXME: os-specific defines aren't great. Convert to autoconf-detected
# per-feature flags instead.
case $OS in
LINUX)
_LINUX=1
;;
SOLARIS)
_SOLARIS=1
CPPFLAGS="$CPPFLAGS -D_SOLARIS -DSOLARIS"
;;
MACOS)
_MACOS=1
CPPFLAGS="$CPPFLAGS -D_MACOS -DMACOS"
;;
WIN32)
_WIN32=1
CPPFLAGS="$CPPFLAGS -Iwin32 -D_WIN32"
LIBS="$LIBS -lole32 -lrpcrt4 -lwsock32 -lgdi32 -limagehlp -lstdc++"
;;
*) die "$OS: unrecognized operating system for compilation." ;;
esac
if [ -z "$WIN32" ]; then
CFLAGS="$CFLAGS -fPIC"
CXXFLAGS="$CXXFLAGS -fPIC"
fi