-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure.ac
190 lines (146 loc) · 4.99 KB
/
configure.ac
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# AC_INIT (package, version, [bug-report], [tarname])
AC_INIT([DDD],[1.9.0],[[email protected]])
# We use automake to build makefiles
AM_INIT_AUTOMAKE([-Wall, subdir-objects])
# link time opt, set AR and RANLIB before LT_INIT call, unless configure overrides them.
# also Options for disabling LTO on Darwin since binutils sucks big time on that platform.
nolto=false
AC_ARG_ENABLE( [nolto],
[AS_HELP_STRING([--enable-nolto],[avoid using LTO flags, mostly for Darwin])],
[ case "${enable_nolto}" in
yes) nolto=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
if test "x$nolto" = "xfalse"; then
CXXFLAGS="-flto $CXXFLAGS"
test -z "$AR" && AR=gcc-ar
test -z "$RANLIB" && RANLIB=gcc-ranlib
else
CXXFLAGS="-fno-lto $CXXFLAGS"
fi
# programs used to build
# we make static libs (use ranlib)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# boot libtool, no special flags
LT_INIT
# no dynamic libs unless --enable-shared is passed to configure
AC_DISABLE_SHARED
# build static libs by default
AC_ENABLE_STATIC
# M4 macros location
AC_CONFIG_MACRO_DIR([m4])
# we compile C++
# set Cxx compilation flags to either the value passed in
# ./configure --cxxflags=
# or none to change behavior from default cxx flags generated by autoconf
# default : -02 -g
#CXXFLAGS=${CXXFLAGS-}
test -z "$CFLAGS" && CFLAGS=
test -z "$CXXFLAGS" && CXXFLAGS=
# we compile C++11
CXXFLAGS="-std=c++11 $CXXFLAGS"
# to be compatible with Spot
CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden $CXXFLAGS"
# to be nice to DLL users
CXXFLAGS="-fPIC $CXXFLAGS"
# AC_CHECK_LIB(tcmalloc, malloc, ,AC_MSG_WARN(google perftool not detected : not using tcmalloc))
#compile in C++
AC_PROG_CXX
AC_LANG(C++)
reentrant=false
parallel=false
# option to indicate libtbb folder
AC_ARG_WITH([libtbbinc],
[AS_HELP_STRING([--with-libtbbinc=/include/path/libtbb],[specify the include path of libtbb])])
AC_ARG_WITH([libtbbbin],
[AS_HELP_STRING([--with-libtbbbin=/path/to/libtbb.a],[specify the library linker path of libtbb])])
#Options for disabling google hash
stdhash=false
AC_ARG_ENABLE( [stdhash],
[AS_HELP_STRING([--enable-stdhash],[revert std lib hash map(default uses google sparse hash)])],
[ case "${enable_stdhash}" in
yes) stdhash=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
if test "x$stdhash" = "xtrue"; then
AC_DEFINE([USE_STD_HASH],1,[Define if you want to use std hash instead of google sparse hash.])
fi
CPPFLAGS="-Wno-unused-local-typedefs $CPPFLAGS"
AC_SUBST([STATICFLAGS],["-all-static -static-libgcc -static-libstdc++"])
# Option to enable hash stats
AC_ARG_ENABLE([mingw-native],
[AS_HELP_STRING([--enable-mingw-native],[build native win32 binaries for redistribution])],
[ case "${enable_mingw_native}" in
yes) CXXFLAGS="-DPSAPI_VERSION=1 $CXXFLAGS"
LIBS="-lPSAPI $LIBS"
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
# Option to enable hash stats
AC_ARG_ENABLE([hash-stat],
[AS_HELP_STRING([--enable-hash-stat],[collect stats on hash])],
[ case "${enable_hash_stat}" in
yes) CFLAGS="-DHASH_STAT $CFLAGS"
CXXFLAGS="-DHASH_STAT $CXXFLAGS"
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
AC_ARG_ENABLE( [reentrant],
[AS_HELP_STRING([--enable-reentrant],[turn on on thread-safe mode])],
[ case "${enable_reentrant}" in
yes) reentrant=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
AC_ARG_ENABLE( [parallel],
[AS_HELP_STRING([--enable-parallel],[turn on on parallel mode])],
[ case "${enable_parallel}" in
yes) parallel=true
reentrant=true
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
if test "x$parallel" = "xtrue"; then
AC_DEFINE([PARALLEL_DD],1,[Define if you want parallel code.])
fi
if test "x$reentrant" = "xtrue"; then
AC_DEFINE([REENTRANT],1,[Define if you want a thread-safe library.])
fi
AM_CONDITIONAL([REENTRANT], [test "x${reentrant}" = "xtrue" ])
AM_CONDITIONAL([WITH_LIBTBBINC_PATH], [test "x${with_libtbbinc}" != x])
if test "x${with_libtbbinc}" != x; then
AC_SUBST([LIBTBB_INC],["${with_libtbbinc}"])
fi
AM_CONDITIONAL([WITH_LIBTBBBIN_PATH], [test "x${with_libtbbbin}" != x])
if test "x${with_libtbbbin}" != x; then
AC_SUBST([LIBTBB_BIN],["${with_libtbbbin}"])
fi
AC_CONFIG_FILES([ Makefile
demo/Makefile
demo/hanoi/Makefile
demo/morpion/Makefile
ddd/Makefile
doc/Doxyfile
doc/Makefile])
# Do it !! (mandatory)
AC_OUTPUT