-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
230 lines (175 loc) · 5.94 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
AC_PREREQ([2.69])
AC_INIT([ITSREACH],[0.2],[Yann.Thierry-mieg@lip6.fr])
# We use automake to build makefiles
AM_INIT_AUTOMAKE([-Wall foreign])
# option to indicate libddd folder
AC_ARG_WITH([libddd],
[AS_HELP_STRING([--with-libddd=/root/of/libddd],[specify the path of libddd])])
AM_CONDITIONAL([WITH_LIBDDD_PATH], [test "x${with_libddd}" != x])
if test "x${with_libddd}" != x; then
AC_SUBST([LIBDDD_ROOT],[${with_libddd}])
fi
# option to indicate the path to the antlr jar
AC_ARG_WITH([antlrjar],
[AS_HELP_STRING([--with-antlrjar=/root/of/antlrjar],[specify the path of antlr jar])])
AM_CONDITIONAL([WITH_ANTLRJAR_PATH], [test "x${with_antlrjar}" != x])
if test "x${with_antlrjar}" != x; then
AC_SUBST([ANTLRJAR_PATH],[${with_antlrjar}])
fi
# option to indicate the path to the antlr C runtime
AC_ARG_WITH([antlrc],
[AS_HELP_STRING([--with-antlrc=/root/of/antlrc],[specify the path of antlr C runtime])])
AM_CONDITIONAL([WITH_ANTLRC_PATH], [test "x${with_antlrc}" != x])
if test "x${with_antlrc}" != x; then
AC_SUBST([ANTLRC_ROOT],[${with_antlrc}])
fi
# 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
CFLAGS="-flto $CFLAGS"
CXXFLAGS="-flto $CXXFLAGS"
test -z "$AR" && AR=gcc-ar
test -z "$RANLIB" && RANLIB=gcc-ranlib
else
CXXFLAGS="-fno-lto $CXXFLAGS"
CFLAGS="-fno-lto $CFLAGS"
fi
# AC_CHECK_LIB(tcmalloc, malloc, ,AC_MSG_WARN(google perftool not detected : not using tcmalloc))
#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++"])
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"
LDFLAGS="-Wl,-static,--stack,16777216 $LDFLAGS"
LIBS="-lPSAPI -lstdc++ -lpthread $LIBS"
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
AC_ARG_ENABLE([dll],
[AS_HELP_STRING([--enable-dll],[Activate dynamic library loading input options -t DLL and -t NDLL (not available on Win)])],
[ case "${enable_dll}" in
yes) CXXFLAGS="-DENABLE_DLL=1 $CXXFLAGS"
AC_CHECK_LIB(dl, dlopen, ,AC_MSG_WARN(No operational dynamic link libdl found. This is a real problem.))
;;
no)
;;
*) AC_MSG_ERROR(Bad value ${enableval})
;;
esac])
# option to indicate libexpat folder
AC_ARG_WITH([libexpat],
[AS_HELP_STRING([--with-libexpat=/root/of/libexpat],[specify the path of libexpat])])
AM_CONDITIONAL([WITH_LIBEXPAT_PATH], [test "x${with_libexpat}" != x])
if test "x${with_libexpat}" != x; then
AC_SUBST([LIBEXPAT_ROOT],[${with_libexpat}])
fi
# option to indicate GNU multi-precision library folder
AC_ARG_WITH([gmp],
[AS_HELP_STRING([--with-gmp=/root/of/gmp],[specify the path of gmp])])
AM_CONDITIONAL([WITH_GMP_PATH], [test "x${with_gmp}" != x])
if test "x${with_gmp}" != x; then
AC_SUBST([GMP_ROOT],[${with_gmp}])
fi
# M4 macros location
AC_CONFIG_MACRO_DIR([m4])
# programs used to build
# we make static libs (use ranlib)
AC_PROG_RANLIB
# programs used to build
# we make static libs (use ranlib)
# we make shared libs (use libtool)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT([dlopen])
# no dynamic libs unless --enable-shared is passed to configure
AC_DISABLE_SHARED
# build static libs by default
AC_ENABLE_STATIC
# 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
test -z "$CFLAGS" && CFLAGS=
test -z "$CXXFLAGS" && CXXFLAGS=
# we compile C++11
CFLAGS="-std=c11 $CFLAGS"
CXXFLAGS="-std=c++11 $CXXFLAGS"
# to be compatible with Spot
CXXFLAGS="-fvisibility=hidden -fvisibility-inlines-hidden $CXXFLAGS"
# to be nice to DLL users
CFLAGS="-fPIC $CFLAGS"
CXXFLAGS="-fPIC $CXXFLAGS"
# 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])
#compile in C++
AC_PROG_CC
AC_PROG_CXX
AC_LANG(C++)
#use bison/flex parsers
AM_PROG_LEX
AC_PROG_YACC
# define HAS_STDC_HEADERS
AC_HEADER_STDC
AC_CHECK_TOOL([STRIP],[strip])
# automake :
# build these Makefile using the Makefile.in files in each directory
AC_CONFIG_FILES([
Makefile
its/Makefile
lib/Makefile
its/expression/Makefile
its/parser_RdPE/Makefile
its/parser_CAMI/Makefile
its/gal/Makefile
its/gal/parser/Makefile
bin/Makefile
Samples/Makefile
Samples/prod/Makefile
Samples/prod/Generators/Makefile
Samples/prod/Generators/CiardoPN2000/Makefile
Samples/prod/Generators/Other/Makefile
tests/Makefile
])
# demo/Makefile # skipped/unused in releases
# Do it !! (mandatory)
AC_OUTPUT