2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([src/include/cvc4.h])
6 AC_CONFIG_AUX_DIR([config])
7 #AC_CONFIG_LIBOBJ_DIR([lib])
8 AC_CONFIG_MACRO_DIR([config])
10 CVC4_RELEASE=prerelease
11 CVC4_LIBRARY_RELEASE_CODE=0:0:0
12 CVC4_LIBRARY_VERSION=0:0:0
13 CVC4_PARSER_LIBRARY_VERSION=0:0:0
15 # really irritating: AC_CANONICAL_* bash $@
22 # Features requested by the user
23 AC_MSG_CHECKING([for requested build profile])
24 AC_ARG_WITH([build], [AS_HELP_STRING([--with-build=profile], [for profile in {production,debug,default,competition}])])
25 if test -z "${with_build+set}" -o "$with_build" = default; then
28 if test -z "${enable_optimized+set}" -a -z "${enable_debug_symbols+set}" -a -z "${enable_assertions+set}" -a -z "${enable_tracing+set}" -a -z "${enable_muzzle+set}" -a -z "${enable_coverage+set}" -a -z "${enable_profiling+set}"; then
29 non_standard_build_profile=no
31 non_standard_build_profile=yes
34 if test -n "${enable_optimized+set}"; then
35 if test "$enable_optimized" = no; then
36 build_type_suffix=$build_type_suffix-noopt
38 build_type_suffix=$build_type_suffix-opt
41 if test -n "${enable_debug_symbols+set}"; then
42 if test "$enable_debug_symbols" = no; then
43 build_type_suffix=$build_type_suffix-nodsy
45 build_type_suffix=$build_type_suffix-dsy
48 if test -n "${enable_assertions+set}"; then
49 if test "$enable_assertions" = no; then
50 build_type_suffix=$build_type_suffix-noass
52 build_type_suffix=$build_type_suffix-ass
55 if test -n "${enable_tracing+set}"; then
56 if test "$enable_tracing" = no; then
57 build_type_suffix=$build_type_suffix-notrc
59 build_type_suffix=$build_type_suffix-trc
62 if test -n "${enable_muzzle+set}"; then
63 if test "$enable_muzzle" = no; then
64 build_type_suffix=$build_type_suffix-nomzl
66 build_type_suffix=$build_type_suffix-mzl
69 if test -n "${enable_coverage+set}"; then
70 if test "$enable_coverage" = no; then
71 build_type_suffix=$build_type_suffix-nocvg
73 build_type_suffix=$build_type_suffix-cvg
76 if test -n "${enable_profiling+set}"; then
77 if test "$enable_profiling" = no; then
78 build_type_suffix=$build_type_suffix-noprf
80 build_type_suffix=$build_type_suffix-prf
83 AC_MSG_RESULT([$with_build])
85 AC_MSG_CHECKING([for appropriate build string])
86 build_type=$with_build$build_type_suffix
87 if test "$non_standard_build_profile" = yes; then
88 if test "$with_build" = default; then
89 build_type=custom$build_type_suffix
92 AC_MSG_RESULT($build_type)
94 # require building in target and build-specific build directory
95 AC_MSG_CHECKING([what dir to configure])
96 if test "$CVC4_CONFIGURE_IN_BUILDS" = yes; then
97 AC_MSG_RESULT([this one (in builds/)])
98 elif test -e src/include/cvc4.h; then
99 AC_MSG_RESULT([builds/$target/$build_type])
101 echo Setting up "builds/$target/$build_type"...
102 rm -fv config.log config.status confdefs.h
103 mkdir -pv "builds/$target/$build_type"
104 test -e builds/Makefile || ln -sfv "$target/$build_type/Makefile.builds" builds/Makefile
105 echo Creating builds/current...
106 (echo "# This is the most-recently-configured CVC4 build"; \
107 echo "# 'make' in the top-level source directory applies to this build"; \
108 echo "CURRENT_BUILD = $target/$build_type") > builds/current
109 echo cd "builds/$target/$build_type"
110 cd "builds/$target/$build_type"
111 CVC4_CONFIGURE_IN_BUILDS=yes; export CVC4_CONFIGURE_IN_BUILDS
112 echo ../../../configure $config_cmdline
113 exec ../../../configure $config_cmdline
115 AC_MSG_RESULT([this one (user-specified)])
118 case "$with_build" in
123 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
124 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
125 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
128 CVC4CPPFLAGS=-DCVC4_DEBUG
129 CVC4CXXFLAGS='-O0 -fno-inline -ggdb3'
131 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
132 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
133 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
139 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
140 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
141 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
145 CVC4CXXFLAGS='-O9 -funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs'
147 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
148 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
149 if test -z "${enable_muzzle+set}" ; then enable_muzzle=yes ; fi
152 AC_MSG_FAILURE([unknown build profile: $with_build])
156 AC_MSG_CHECKING([whether to optimize libcvc4])
157 AC_ARG_ENABLE([optimized], [AS_HELP_STRING([--enable-optimized], [optimize the build])])
158 if test -z "${enable_optimized+set}"; then
161 AC_MSG_RESULT([$enable_optimized])
162 if test "$enable_optimized" = yes; then
163 CVC4CXXFLAGS="$CVC4CXXFLAGS -O3"
166 AC_MSG_CHECKING([whether to include debugging symbols in libcvc4])
167 AC_ARG_ENABLE([debug-symbols], [AS_HELP_STRING([--disable-debug-symbols], [do not include debug symbols in libcvc4])])
168 if test -z "${enable_debug_symbols+set}"; then
169 enable_debug_symbols=yes
171 AC_MSG_RESULT([$enable_debug_symbols])
172 if test "$enable_debug_symbols" = yes; then
173 CVC4CXXFLAGS="$CVC4CXXFLAGS -ggdb3"
176 AC_MSG_CHECKING([whether to include assertions in build])
177 AC_ARG_ENABLE([assertions], [AS_HELP_STRING([--disable-assertions], [turn off assertions in build])])
178 if test -z "${enable_assertions+set}"; then
179 enable_assertions=yes
181 AC_MSG_RESULT([$enable_assertions])
182 if test "$enable_assertions" = yes; then
183 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_ASSERTIONS"
186 AC_MSG_CHECKING([whether to do a traceable build of CVC4])
187 AC_ARG_ENABLE([tracing], [AS_HELP_STRING([--disable-tracing], [remove all tracing code from CVC4])])
188 if test -z "${enable_tracing+set}"; then
191 AC_MSG_RESULT([$enable_tracing])
192 if test "$enable_tracing" = yes; then
193 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_TRACING"
196 AC_MSG_CHECKING([whether to do a muzzled build of CVC4])
197 AC_ARG_ENABLE([muzzle], [AS_HELP_STRING([--enable-muzzle], [completely silence CVC4; remove ALL non-result output from build])])
198 if test -z "${enable_muzzle+set}"; then
201 AC_MSG_RESULT([$enable_muzzle])
202 if test "$enable_muzzle" = yes; then
203 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_MUZZLE"
206 AC_MSG_CHECKING([whether to do a gcov-enabled build of CVC4])
207 AC_ARG_ENABLE([coverage], [AS_HELP_STRING([--enable-coverage], [build with support for gcov coverage testing])])
208 if test -z "${enable_coverage+set}"; then
211 AC_MSG_RESULT([$enable_coverage])
212 if test "$enable_coverage" = yes; then
213 CVC4CXXFLAGS="$CVC4CXXFLAGS --coverage"
214 CVC4LDFLAGS="$CVC4LDFLAGS --coverage"
217 AC_MSG_CHECKING([whether to do a profiling-enabled build of CVC4])
218 AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [build with support for gprof profiling])])
219 if test -z "${enable_profiling+set}"; then
222 AC_MSG_RESULT([$enable_profiling])
223 if test "$enable_profiling" = yes; then
224 CVC4CXXFLAGS="$CVC4CXXFLAGS -pg"
225 CVC4LDFLAGS="$CVC4LDFLAGS -pg"
228 AM_INIT_AUTOMAKE(cvc4, $CVC4_RELEASE)
229 AC_CONFIG_HEADERS([config.h])
231 # keep track of whether the user set these (check here, because
232 # autoconf might set a default later)
233 AC_MSG_CHECKING([for user CPPFLAGS])
234 if test -z "${CPPFLAGS+set}"; then user_cppflags=no; else user_cppflags=yes; fi
235 AC_MSG_RESULT([${CPPFLAGS-none}])
236 AC_MSG_CHECKING([for user CXXFLAGS])
237 if test -z "${CXXFLAGS+set}"; then user_cxxflags=no; else user_cxxflags=yes; fi
238 AC_MSG_RESULT([${CXXFLAGS-none}])
239 AC_MSG_CHECKING([for user LDFLAGS])
240 if test -z "${LDFLAGS+set}" ; then user_ldflags=no ; else user_ldflags=yes ; fi
241 AC_MSG_RESULT([${LDFLAGS-none}])
251 # Checks for programs.
259 # Check for ANTLR runantlr script (defined in config/antlr.m4)
260 AC_ARG_ENABLE(antlr, AS_HELP_STRING([--enable-antlr],[use Dejan's ANTLR parsers]))
261 AC_MSG_CHECKING([whether you want to use the ANTLR parsers])
262 if test -z "${enable_antlr+set}"; then
265 AC_MSG_RESULT([$enable_antlr])
266 AM_CONDITIONAL(USE_ANTLR, test "$enable_antlr" = yes)
267 if test "$enable_antlr" = yes; then
269 AC_DEFINE(ANTLR_PARSERS, [], [whether we're using ANTLR parsers])
272 AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, [])
273 if test -z "$DOXYGEN"; then
274 AC_MSG_WARN([documentation targets require doxygen. Set your PATH appropriately or set DOXYGEN to point to a valid doxygen binary.])
276 AC_ARG_VAR(DOXYGEN, [location of doxygen binary])
279 AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH])
280 if test -z "$CXXTESTGEN"; then
281 AC_MSG_NOTICE([unit tests disabled, cxxtestgen.pl not found.])
282 elif test -z "$CXXTEST"; then
283 CXXTEST=$(dirname "$CXXTESTGEN")
284 AC_MSG_CHECKING([for location of CxxTest headers])
285 if test -e "$CXXTEST/cxxtest/TestRunner.h"; then
286 AC_MSG_RESULT([$CXXTEST])
288 AC_MSG_RESULT([not found])
289 AC_MSG_WARN([unit tests disabled, CxxTest headers not found.])
294 AC_ARG_VAR(CXXTEST, [path to CxxTest installation])
295 AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"])
297 AC_ARG_VAR(TEST_CPPFLAGS, [CXXFLAGS to use when testing (default=$CPPFLAGS)])
298 AC_ARG_VAR(TEST_CXXFLAGS, [CXXFLAGS to use when testing (default=$CXXFLAGS)])
299 AC_ARG_VAR(TEST_LDFLAGS, [LDFLAGS to use when testing (default=$LDFLAGS)])
301 if test -n "$CXXTEST"; then
302 AC_CHECK_PROG(PERL, perl, perl, [])
303 if test -z "$PERL"; then
304 AC_MSG_WARN([unit tests disabled, perl not found.])
310 # Checks for libraries.
311 AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])])
312 # Check for antlr C++ runtime (defined in config/antlr.m4)
313 if test "$enable_antlr" = yes; then
317 # Checks for header files.
318 AC_CHECK_HEADERS([getopt.h unistd.h])
320 # Checks for typedefs, structures, and compiler characteristics.
327 # Checks for library functions.
329 # Some definitions for config.h
331 # Prepare configure output
333 AC_SUBST(CVC4_LIBRARY_RELEASE_CODE)
334 AC_SUBST(CVC4_LIBRARY_VERSION)
335 AC_SUBST(CVC4_PARSER_LIBRARY_VERSION)
336 if test "$user_cppflags" = no; then
337 CPPFLAGS="$CVC4CPPFLAGS"
339 if test "$user_cxxflags" = no; then
340 CXXFLAGS="$CVC4CXXFLAGS"
342 if test "$user_ldflags" = no; then
343 LDFLAGS="$CVC4LDFLAGS"
355 src/prop/minisat/Makefile
360 src/parser/smt/Makefile
363 test/regress/Makefile
369 # Final information to the user
372 if test "$non_standard_build_profile" = yes; then
373 if test "$with_build" = default; then
377 AC_MSG_WARN([This is a non-standard $with_build build profile.])
387 Build profile: $with_build$non_standard
388 Build ID : $build_type
389 Optimized : $enable_optimized
390 Debug symbols: $enable_debug_symbols
391 Assertions : $enable_assertions
392 Tracing : $enable_tracing
393 Muzzle : $enable_muzzle
394 gcov support : $enable_coverage
395 gprof support: $enable_profiling
401 Using ANTLR parsers : $enable_antlr
402 Library releases : $CVC4_LIBRARY_RELEASE_CODE
403 libcvc4 version : $CVC4_LIBRARY_VERSION
404 libcvc4parser version: $CVC4_PARSER_LIBRARY_VERSION
406 Now just type make, followed by make check or make install, as you like.
408 You can use 'make <build_profile>' to reconfig/build a different profile.
409 Build profiles: production optimized default competition
413 if test "$user_cppflags" = yes; then
415 AC_MSG_WARN([I won't override your CPPFLAGS setting. But some of your build options to configure may not be honored.])
416 AC_MSG_WARN([To support your options to configure, I would like to set CPPFLAGS to:])
417 AC_MSG_WARN([ $CVC4CPPFLAGS])
420 if test "$user_cxxflags" = yes; then
422 AC_MSG_WARN([I won't override your CXXFLAGS setting. But some of your build options to configure may not be honored.])
423 AC_MSG_WARN([To support your options to configure, I would like to set CXXFLAGS to:])
424 AC_MSG_WARN([ $CVC4CXXFLAGS])
427 if test "$user_ldflags" = yes; then
429 AC_MSG_WARN([I won't override your LDFLAGS setting. But some of your build options to configure may not be honored.])
430 AC_MSG_WARN([To support your options to configure, I would like to set LDFLAGS to:])
431 AC_MSG_WARN([ $CVC4LDFLAGS])
435 if test "$non_standard_build_profile" = yes; then
436 if test "$with_build" = default; then :; else
438 AC_MSG_WARN([This is a non-standard $with_build build profile.])