2 # Process this file with autoconf to produce a configure script.
8 AC_CONFIG_SRCDIR([src/include/cvc4_config.h])
9 AC_CONFIG_AUX_DIR([config])
10 AC_CONFIG_MACRO_DIR([config])
12 CVC4_RELEASE=prerelease
13 CVC4_LIBRARY_RELEASE_CODE=0:0:0
14 CVC4_LIBRARY_VERSION=0:0:0
15 CVC4_PARSER_LIBRARY_VERSION=0:0:0
17 # really irritating: AC_CANONICAL_* bash $@
20 # turn off static lib building by default
28 # Features requested by the user
29 AC_MSG_CHECKING([for requested build profile])
30 AC_ARG_WITH([build], [AS_HELP_STRING([--with-build=profile], [for profile in {production,debug,default,competition}])])
31 if test -z "${with_build+set}" -o "$with_build" = default; then
34 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
35 non_standard_build_profile=no
37 non_standard_build_profile=yes
40 if test -n "${enable_optimized+set}"; then
41 if test "$enable_optimized" = yes; then
44 btargs="$btargs noopt"
47 if test -n "${enable_debug_symbols+set}"; then
48 if test "$enable_debug_symbols" = yes; then
51 btargs="$btargs nodsy"
54 if test -n "${enable_assertions+set}"; then
55 if test "$enable_assertions" = yes; then
58 btargs="$btargs noass"
61 if test -n "${enable_tracing+set}"; then
62 if test "$enable_tracing" = yes; then
65 btargs="$btargs notrc"
68 if test -n "${enable_muzzle+set}"; then
69 if test "$enable_muzzle" = yes; then
72 btargs="$btargs nomzl"
75 if test -n "${enable_coverage+set}"; then
76 if test "$enable_coverage" = yes; then
79 btargs="$btargs nocvg"
82 if test -n "${enable_profiling+set}"; then
83 if test "$enable_profiling" = yes; then
86 btargs="$btargs noprf"
89 AC_MSG_RESULT([$with_build])
91 AC_MSG_CHECKING([for appropriate build string])
92 build_type=`$ac_confdir/config/build-type $with_build $btargs`
93 if test "$non_standard_build_profile" = yes; then
94 if test "$with_build" = default; then
95 build_type=`$ac_confdir/config/build-type custom $btargs`
98 AC_MSG_RESULT($build_type)
100 # require building in target and build-specific build directory
101 AC_MSG_CHECKING([what dir to configure])
102 if test "$CVC4_CONFIGURE_IN_BUILDS" = yes; then
103 AC_MSG_RESULT([this one (in builds/)])
104 elif test -e src/include/cvc4_config.h; then
105 AC_MSG_RESULT([builds/$target/$build_type])
107 if test -z "$ac_srcdir"; then
108 mkbuilddir=./config/mkbuilddir
110 mkbuilddir=$ac_srcdir/config/mkbuilddir
112 echo $mkbuilddir "$target" "$build_type"
113 $mkbuilddir "$target" "$build_type"
114 echo cd "builds/$target/$build_type"
115 cd "builds/$target/$build_type"
116 CVC4_CONFIGURE_IN_BUILDS=yes; export CVC4_CONFIGURE_IN_BUILDS
117 echo ../../../configure $config_cmdline
118 exec ../../../configure $config_cmdline
120 AC_MSG_RESULT([this one (user-specified)])
123 case "$with_build" in
128 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
129 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
130 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
133 CVC4CPPFLAGS=-DCVC4_DEBUG
134 CVC4CXXFLAGS='-O0 -fno-inline -ggdb3'
136 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
137 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
138 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
144 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
145 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
146 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
150 CVC4CXXFLAGS='-O9 -funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs'
152 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
153 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
154 if test -z "${enable_muzzle+set}" ; then enable_muzzle=yes ; fi
157 AC_MSG_FAILURE([unknown build profile: $with_build])
161 AC_MSG_CHECKING([whether to optimize libcvc4])
162 AC_ARG_ENABLE([optimized], [AS_HELP_STRING([--enable-optimized], [optimize the build])])
163 if test -z "${enable_optimized+set}"; then
166 AC_MSG_RESULT([$enable_optimized])
167 if test "$enable_optimized" = yes; then
168 CVC4CXXFLAGS="$CVC4CXXFLAGS -O3"
171 AC_MSG_CHECKING([whether to include debugging symbols in libcvc4])
172 AC_ARG_ENABLE([debug-symbols], [AS_HELP_STRING([--disable-debug-symbols], [do not include debug symbols in libcvc4])])
173 if test -z "${enable_debug_symbols+set}"; then
174 enable_debug_symbols=yes
176 AC_MSG_RESULT([$enable_debug_symbols])
177 if test "$enable_debug_symbols" = yes; then
178 CVC4CXXFLAGS="$CVC4CXXFLAGS -ggdb3"
181 AC_MSG_CHECKING([whether to include assertions in build])
182 AC_ARG_ENABLE([assertions], [AS_HELP_STRING([--disable-assertions], [turn off assertions in build])])
183 if test -z "${enable_assertions+set}"; then
184 enable_assertions=yes
186 AC_MSG_RESULT([$enable_assertions])
187 if test "$enable_assertions" = yes; then
188 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_ASSERTIONS"
191 AC_MSG_CHECKING([whether to do a traceable build of CVC4])
192 AC_ARG_ENABLE([tracing], [AS_HELP_STRING([--disable-tracing], [remove all tracing code from CVC4])])
193 if test -z "${enable_tracing+set}"; then
196 AC_MSG_RESULT([$enable_tracing])
197 if test "$enable_tracing" = yes; then
198 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_TRACING"
201 AC_MSG_CHECKING([whether to do a muzzled build of CVC4])
202 AC_ARG_ENABLE([muzzle], [AS_HELP_STRING([--enable-muzzle], [completely silence CVC4; remove ALL non-result output from build])])
203 if test -z "${enable_muzzle+set}"; then
206 AC_MSG_RESULT([$enable_muzzle])
207 if test "$enable_muzzle" = yes; then
208 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_MUZZLE"
211 AC_MSG_CHECKING([whether to do a gcov-enabled build of CVC4])
212 AC_ARG_ENABLE([coverage], [AS_HELP_STRING([--enable-coverage], [build with support for gcov coverage testing])])
213 if test -z "${enable_coverage+set}"; then
216 AC_MSG_RESULT([$enable_coverage])
217 if test "$enable_coverage" = yes; then
218 CVC4CXXFLAGS="$CVC4CXXFLAGS --coverage"
219 CVC4LDFLAGS="$CVC4LDFLAGS --coverage"
222 AC_MSG_CHECKING([whether to do a profiling-enabled build of CVC4])
223 AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [build with support for gprof profiling])])
224 if test -z "${enable_profiling+set}"; then
227 AC_MSG_RESULT([$enable_profiling])
228 if test "$enable_profiling" = yes; then
229 CVC4CXXFLAGS="$CVC4CXXFLAGS -pg"
230 CVC4LDFLAGS="$CVC4LDFLAGS -pg"
233 AM_INIT_AUTOMAKE(cvc4, $CVC4_RELEASE)
234 AC_CONFIG_HEADERS([config.h])
236 # keep track of whether the user set these (check here, because
237 # autoconf might set a default later)
238 AC_MSG_CHECKING([for user CPPFLAGS])
239 if test -z "${CPPFLAGS+set}"; then user_cppflags=no; else user_cppflags=yes; fi
240 AC_MSG_RESULT([${CPPFLAGS-none}])
241 AC_MSG_CHECKING([for user CXXFLAGS])
242 if test -z "${CXXFLAGS+set}"; then user_cxxflags=no; else user_cxxflags=yes; fi
243 AC_MSG_RESULT([${CXXFLAGS-none}])
244 AC_MSG_CHECKING([for user LDFLAGS])
245 if test -z "${LDFLAGS+set}" ; then user_ldflags=no ; else user_ldflags=yes ; fi
246 AC_MSG_RESULT([${LDFLAGS-none}])
248 _LT_SET_OPTION([LT_INIT],[win32-dll])
252 # Checks for programs.
256 # Check for ANTLR runantlr script (defined in config/antlr.m4)
259 AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, [])
260 if test -z "$DOXYGEN"; then
261 AC_MSG_WARN([documentation targets require doxygen. Set your PATH appropriately or set DOXYGEN to point to a valid doxygen binary.])
263 AC_ARG_VAR(DOXYGEN, [location of doxygen binary])
266 AC_ARG_WITH([cxxtest-dir],
267 [AS_HELP_STRING([--with-cxxtest-dir=DIR], [path to CxxTest installation])],
268 [CXXTEST="$withval"])
270 dnl AC_ARG_VAR(CXXTEST, [path to cxxtest installation])
272 AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH])
273 if test -z "$CXXTESTGEN"; then
274 AC_MSG_NOTICE([unit tests disabled, cxxtestgen.pl not found.])
275 elif test -z "$CXXTEST"; then
276 CXXTEST=$(dirname "$CXXTESTGEN")
277 AC_MSG_CHECKING([for location of CxxTest headers])
278 if test -e "$CXXTEST/cxxtest/TestRunner.h"; then
279 AC_MSG_RESULT([$CXXTEST])
281 AC_MSG_RESULT([not found])
282 AC_MSG_WARN([unit tests disabled, CxxTest headers not found.])
287 AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"])
289 AC_ARG_VAR(TEST_CPPFLAGS, [CXXFLAGS to use when testing (default=$CPPFLAGS)])
290 AC_ARG_VAR(TEST_CXXFLAGS, [CXXFLAGS to use when testing (default=$CXXFLAGS)])
291 AC_ARG_VAR(TEST_LDFLAGS, [LDFLAGS to use when testing (default=$LDFLAGS)])
293 if test -n "$CXXTEST"; then
294 AC_CHECK_PROG(PERL, perl, perl, [])
295 if test -z "$PERL"; then
296 AC_MSG_WARN([unit tests disabled, perl not found.])
302 # Checks for libraries.
303 AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])])
304 # Check for antlr C++ runtime (defined in config/antlr.m4)
308 # Checks for header files.
309 AC_CHECK_HEADERS([getopt.h unistd.h])
311 # Checks for typedefs, structures, and compiler characteristics.
318 # Checks for library functions.
320 # Some definitions for config.h
322 # Prepare configure output
324 AC_SUBST(CVC4_LIBRARY_RELEASE_CODE)
325 AC_SUBST(CVC4_LIBRARY_VERSION)
326 AC_SUBST(CVC4_PARSER_LIBRARY_VERSION)
327 if test "$user_cppflags" = no; then
328 CPPFLAGS="$CVC4CPPFLAGS"
330 if test "$user_cxxflags" = no; then
331 CXXFLAGS="$CVC4CXXFLAGS"
333 if test "$user_ldflags" = no; then
334 LDFLAGS="$CVC4LDFLAGS"
349 src/prop/minisat/Makefile
354 src/parser/cvc/Makefile
355 src/parser/smt/Makefile
357 src/theory/uf/Makefile
359 test/regress/Makefile
366 # Final information to the user
369 if test "$non_standard_build_profile" = yes; then
370 if test "$with_build" = default; then
374 AC_MSG_WARN([This is a non-standard $with_build build profile.])
380 support_unit_tests='cxxtest not found; unit tests not supported'
381 if test -n "$CXXTEST"; then
382 support_unit_tests='unit testing infrastructure enabled in build directory'
389 Build profile: $with_build$non_standard
390 Build ID : $build_type
391 Optimized : $enable_optimized
392 Debug symbols: $enable_debug_symbols
393 Assertions : $enable_assertions
394 Tracing : $enable_tracing
395 Muzzle : $enable_muzzle
396 gcov support : $enable_coverage
397 gprof support: $enable_profiling
398 unit tests : $support_unit_tests
404 Library releases : $CVC4_LIBRARY_RELEASE_CODE
405 libcvc4 version : $CVC4_LIBRARY_VERSION
406 libcvc4parser version: $CVC4_PARSER_LIBRARY_VERSION
408 Now just type make, followed by make check or make install, as you like.
410 You can use 'make <build_profile>' to reconfig/build a different profile.
411 Build profiles: production optimized default competition
415 if test "$user_cppflags" = yes; then
417 AC_MSG_WARN([I won't override your CPPFLAGS setting. But some of your build options to configure may not be honored.])
418 AC_MSG_WARN([To support your options to configure, I would like to set CPPFLAGS to:])
419 AC_MSG_WARN([ $CVC4CPPFLAGS])
422 if test "$user_cxxflags" = yes; then
424 AC_MSG_WARN([I won't override your CXXFLAGS setting. But some of your build options to configure may not be honored.])
425 AC_MSG_WARN([To support your options to configure, I would like to set CXXFLAGS to:])
426 AC_MSG_WARN([ $CVC4CXXFLAGS])
429 if test "$user_ldflags" = yes; then
431 AC_MSG_WARN([I won't override your LDFLAGS setting. But some of your build options to configure may not be honored.])
432 AC_MSG_WARN([To support your options to configure, I would like to set LDFLAGS to:])
433 AC_MSG_WARN([ $CVC4LDFLAGS])
437 if test "$non_standard_build_profile" = yes; then
438 if test "$with_build" = default; then :; else
440 AC_MSG_WARN([This is a non-standard $with_build build profile.])