forked from chsticksel/kind2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
350 lines (238 loc) · 8.93 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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# These lines are required
AC_PREREQ(2.59)
AC_INIT([kind2], [v0.7.0], [[email protected]])
# This just checks if some source file is present
AC_CONFIG_SRCDIR([src/kind2.ml])
# default prefix is /usr/local
AC_PREFIX_DEFAULT(/usr/local)
# Check for OCaml
AC_PROG_OCAML
if test "x$OCAMLOPT" = "xno"; then
AC_MSG_ERROR([You must install the OCaml native-code compiler])
fi
# Check for OCaml 4.01
if expr "$OCAMLVERSION" '<' '4.01' > /dev/null ; then
AC_MSG_ERROR([OCaml version 4.01 or later required])
fi
# Check for Camlp4
AC_PROG_CAMLP4
if test "x$CAMLP4" = "xno"; then
AC_MSG_ERROR([You must install the Camlp4 preprocessor])
fi
# Check for OCaml findlib
AC_PROG_FINDLIB
if test "x$OCAMLFIND" = "xno"; then
AC_MSG_WARN([You must install the OCaml findlib (the ocamlfind command)])
fi
# Check for C compiler
AC_PROG_CC
if test "x$CC" = "xno"; then
AC_MSG_ERROR([You need a C compiler])
fi
# ######################################################################
# Debug builds
# ######################################################################
AC_ARG_ENABLE(
[debug],
AS_HELP_STRING([--enable-debug@<:@=TAGS@:>@], [Enable debug output, optionally give tags to enable @<:@default: no, --enable-debug enables all tags@:>@]),
[],
[enable_debug=no])
if test "x$enable_debug" = "xyes"; then
static_camlp4_debug='*'
elif test "x$enable_debug" = "xno"; then
static_camlp4_debug=''
else
static_camlp4_debug=$enable_debug
fi
AC_SUBST(static_camlp4_debug)
dnl # ######################################################################
dnl # Check for SMT solvers
dnl # ######################################################################
dnl # Check for Z3
dnl # yes if --with-z3, no if --without-z3, or <arg> if --with-z3=<arg>
dnl AC_ARG_WITH(
dnl [z3],
dnl [AS_HELP_STRING([--with-z3@<:@=ARG@:>@], [Enable Z3 and use executable ARG @<:@default: search for Z3 in path@:>@])],
dnl [],
dnl [with_z3=yes])
dnl # Z3 disabled
dnl if test "x$with_z3" = "xno"; then
dnl have_z3=no
dnl # Z3 enabled, search in path
dnl elif test "x$with_z3" = "xyes"; then
dnl # Check for z3 in path
dnl AC_PATH_PROG([with_z3],[z3],[no])
dnl # Z3 found in path?
dnl if test "x$with_z3" != "xno"; then
dnl # Enable Z3 and use found executable
dnl have_z3=yes
dnl Z3_BIN=$with_z3
dnl else
dnl # Disable Z3
dnl have_z3=no
dnl fi
dnl else
dnl # Enable Z3 and use given executable
dnl have_z3=yes
dnl Z3_BIN=$with_z3
dnl fi
dnl # Check for CVC4
dnl # yes if --with-cvc4, no if --without-cvc4, or <arg> if --with-cvc4=<arg>
dnl AC_ARG_WITH(
dnl [cvc4],
dnl [AS_HELP_STRING([--with-cvc4@<:@=ARG@:>@], [Enable CVC4 and use executable ARG @<:@default: search for CVC4 in path@:>@])],
dnl [],
dnl [with_cvc4=yes])
dnl # CVC4 disabled
dnl if test "x$with_cvc4" = "xno"; then
dnl have_cvc4=no
dnl # CVC4 enabled, search in path
dnl elif test "x$with_cvc4" = "xyes"; then
dnl # Check for CVC4 in path
dnl AC_PATH_PROG([with_cvc4],[cvc4],[no])
dnl # CVC4 found in path?
dnl if test "x$with_cvc4" != "xno"; then
dnl # Enable CVC4 and use found executable
dnl have_cvc4=yes
dnl CVC4_BIN=$with_cvc4
dnl else
dnl # Disable CVC4
dnl have_cvc4=no
dnl fi
dnl else
dnl # Enable CVC4 and use given executable
dnl have_cvc4=yes
dnl CVC4_BIN=$with_cvc4
dnl fi
dnl # Check for MathSAT5
dnl # yes if --with-mathsat5, no if --without-mathsat5, or <arg> if --with-mathsat5=<arg>
dnl AC_ARG_WITH(
dnl [mathsat5],
dnl [AS_HELP_STRING([--with-mathsat5@<:@=ARG@:>@], [Enable MathSAT5 and use executable ARG @<:@default: search for MathSAT5 in path@:>@])],
dnl [],
dnl [with_mathsat5=yes])
dnl # MATHSAT5 disabled
dnl if test "x$with_mathsat5" = "xno"; then
dnl have_mathsat5=no
dnl # MATHSAT5 enabled, search in path
dnl elif test "x$with_mathsat5" = "xyes"; then
dnl # Check for MATHSAT5 in path
dnl AC_PATH_PROG([with_mathsat5],[mathsat],[no])
dnl # MATHSAT5 found in path?
dnl if test "x$with_mathsat5" != "xno"; then
dnl # Enable MATHSAT5 and use found executable
dnl have_mathsat5=yes
dnl MATHSAT5_BIN=$with_mathsat5
dnl else
dnl # Disable MATHSAT5
dnl have_mathsat5=no
dnl fi
dnl else
dnl # Enable MATHSAT5 and use given executable
dnl have_mathsat5=yes
dnl MATHSAT5_BIN=$with_mathsat5
dnl fi
dnl # Default SMT solver
dnl AC_ARG_WITH(
dnl [default_smtsolver],
dnl [AS_HELP_STRING([--with-default-smtsolver@<:@=ARG@:>@], [Default SMT solver @<:@default: Z3 if available, otherwise CVC4 if available, else MathSAT5@:>@])],
dnl [],
dnl [with_default_smtsolver=yes])
dnl # Z3 is set as default but not available
dnl if test "x$with_default_smtsolver" = "xz3" -a "x$have_z3" = "xno"; then
dnl AC_MSG_ERROR([You selected Z3 as the default solver, but is not available. Remove the option --with-default-smtsolver or choose a different solver.])
dnl # Z3 is available and set as default
dnl elif test "x$with_default_smtsolver" = "xz3"; then
dnl AC_MSG_NOTICE([Z3 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_z3
dnl # CVC4 is set as default but not available
dnl elif test "x$with_default_smtsolver" = "xcvc4" -a "x$have_cvc4" = "xno"; then
dnl AC_MSG_ERROR([You selected CVC4 as the default solver, but is not available. Remove the option --with-default-smtsolver or choose a different solver.])
dnl # CVC4 is available and set as default
dnl elif test "x$with_default_smtsolver" = "xcvc4"; then
dnl AC_MSG_NOTICE([CVC4 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_cvc4
dnl # MathSAT5 is set as default but not available
dnl elif test "x$with_default_smtsolver" = "xmathsat5" -a "x$have_mathsat5" = "xno"; then
dnl AC_MSG_ERROR([You selected MathSAT5 as the default solver, but is not available. Remove the option --with-default-smtsolver or choose a different solver.])
dnl # MathSAT5 is available and set as default
dnl elif test "x$with_default_smtsolver" = "xmathsat5"; then
dnl AC_MSG_NOTICE([MathSAT5 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_mathsat5
dnl # No default chosen
dnl elif test "x$with_default_smtsolver" = "xyes"; then
dnl # Z3 is not available
dnl if test "x$have_z3" = "xno"; then
dnl # CVC4 is not available
dnl if test "x$have_cvc4" = "xno"; then
dnl # MathSAT5 is not available
dnl if test "x$have_mathsat5" = "xno"; then
dnl AC_MSG_ERROR([Must have at least one SMT solver, use --with-z3, --with-cvc4 or --with-mathsat5])
dnl # MathSAT5 is available
dnl else
dnl AC_MSG_NOTICE([MathSAT5 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_mathsat5
dnl fi
dnl # CVC4 is available
dnl else
dnl AC_MSG_NOTICE([CVC4 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_cvc4
dnl fi
dnl # Z3 is available
dnl else
dnl AC_MSG_NOTICE([Z3 is the default solver])
dnl SMTSOLVER=SMTLIBSolver
dnl SMTLIBSOLVER_CONFIG=smtlibsolver_config_z3
dnl fi
dnl fi
dnl # Substitute for SMT solver
dnl AC_SUBST(SMTSOLVER)
dnl # Substitute for Z3 binary
dnl AC_SUBST(Z3_BIN)
dnl # Substitute for CVC4 binary
dnl AC_SUBST(CVC4_BIN)
dnl # Substitute for CVC4 binary
dnl AC_SUBST(MATHSAT5_BIN)
# ######################################################################
# Check for interpolating SMT solvers
# ######################################################################
# Check for iZ3
# yes if --with-iz3, no if --without-iz3, or <arg> if --with-iz3=<arg>
AC_ARG_WITH(
[iz3],
[AS_HELP_STRING([--with-iz3@<:@=ARG@:>@], [Enable iZ3 and use executable ARG @<:@default: search for iz3 in path@:>@])],
[],
[with_iz3=yes])
# iZ3 disabled
if test "x$with_iz3" = "xno"; then
have_iz3=no
# iZ3 enabled, search in path
elif test "x$with_iz3" = "xyes"; then
# Check for iz3 in path
AC_PATH_PROG([with_iz3],[iz3],[no])
# iZ3 found in path?
if test "x$with_iz3" != "xno"; then
# Enable iZ3 and use found executable
have_iz3=yes
IZ3_BIN=$with_iz3
else
# Disable iZ3
have_iz3=no
fi
else
# Enable iZ3 and use given executable
have_iz3=yes
IZ3_BIN=$with_iz3
fi
# Substitute for iZ3 binary
AC_SUBST(IZ3_BIN)
AC_CONFIG_SUBDIRS([ocamlczmq])
# Configuration files
AC_CONFIG_FILES([Makefile src/Makefile src/myocamlbuild.ml src/kind2Config.ml src/flags.ml server/Makefile server/myocamlbuild.ml])
# Write configuration files
AC_OUTPUT