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)
262 AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, [])
263 if test -z "$DOXYGEN"; then
264 AC_MSG_WARN([documentation targets require doxygen. Set your PATH appropriately or set DOXYGEN to point to a valid doxygen binary.])
266 AC_ARG_VAR(DOXYGEN, [location of doxygen binary])
269 AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH])
270 if test -z "$CXXTESTGEN"; then
271 AC_MSG_NOTICE([unit tests disabled, cxxtestgen.pl not found.])
272 elif test -z "$CXXTEST"; then
273 CXXTEST=$(dirname "$CXXTESTGEN")
274 AC_MSG_CHECKING([for location of CxxTest headers])
275 if test -e "$CXXTEST/cxxtest/TestRunner.h"; then
276 AC_MSG_RESULT([$CXXTEST])
278 AC_MSG_RESULT([not found])
279 AC_MSG_WARN([unit tests disabled, CxxTest headers not found.])
284 AC_ARG_VAR(CXXTEST, [path to CxxTest installation])
285 AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"])
287 AC_ARG_VAR(TEST_CPPFLAGS, [CXXFLAGS to use when testing (default=$CPPFLAGS)])
288 AC_ARG_VAR(TEST_CXXFLAGS, [CXXFLAGS to use when testing (default=$CXXFLAGS)])
289 AC_ARG_VAR(TEST_LDFLAGS, [LDFLAGS to use when testing (default=$LDFLAGS)])
291 if test -n "$CXXTEST"; then
292 AC_CHECK_PROG(PERL, perl, perl, [])
293 if test -z "$PERL"; then
294 AC_MSG_WARN([unit tests disabled, perl not found.])
300 # Checks for libraries.
301 AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])])
302 # Check for antlr C++ runtime (defined in config/antlr.m4)
306 # Checks for header files.
307 AC_CHECK_HEADERS([getopt.h unistd.h])
309 # Checks for typedefs, structures, and compiler characteristics.
316 # Checks for library functions.
318 # Some definitions for config.h
320 # Prepare configure output
322 AC_SUBST(CVC4_LIBRARY_RELEASE_CODE)
323 AC_SUBST(CVC4_LIBRARY_VERSION)
324 AC_SUBST(CVC4_PARSER_LIBRARY_VERSION)
325 if test "$user_cppflags" = no; then
326 CPPFLAGS="$CVC4CPPFLAGS"
328 if test "$user_cxxflags" = no; then
329 CXXFLAGS="$CVC4CXXFLAGS"
331 if test "$user_ldflags" = no; then
332 LDFLAGS="$CVC4LDFLAGS"
344 src/prop/minisat/Makefile
349 src/parser/cvc/Makefile
350 src/parser/smt/Makefile
353 test/regress/Makefile
359 # Final information to the user
362 if test "$non_standard_build_profile" = yes; then
363 if test "$with_build" = default; then
367 AC_MSG_WARN([This is a non-standard $with_build build profile.])
377 Build profile: $with_build$non_standard
378 Build ID : $build_type
379 Optimized : $enable_optimized
380 Debug symbols: $enable_debug_symbols
381 Assertions : $enable_assertions
382 Tracing : $enable_tracing
383 Muzzle : $enable_muzzle
384 gcov support : $enable_coverage
385 gprof support: $enable_profiling
392 Library releases : $CVC4_LIBRARY_RELEASE_CODE
393 libcvc4 version : $CVC4_LIBRARY_VERSION
394 libcvc4parser version: $CVC4_PARSER_LIBRARY_VERSION
396 Now just type make, followed by make check or make install, as you like.
398 You can use 'make <build_profile>' to reconfig/build a different profile.
399 Build profiles: production optimized default competition
403 if test "$user_cppflags" = yes; then
405 AC_MSG_WARN([I won't override your CPPFLAGS setting. But some of your build options to configure may not be honored.])
406 AC_MSG_WARN([To support your options to configure, I would like to set CPPFLAGS to:])
407 AC_MSG_WARN([ $CVC4CPPFLAGS])
410 if test "$user_cxxflags" = yes; then
412 AC_MSG_WARN([I won't override your CXXFLAGS setting. But some of your build options to configure may not be honored.])
413 AC_MSG_WARN([To support your options to configure, I would like to set CXXFLAGS to:])
414 AC_MSG_WARN([ $CVC4CXXFLAGS])
417 if test "$user_ldflags" = yes; then
419 AC_MSG_WARN([I won't override your LDFLAGS setting. But some of your build options to configure may not be honored.])
420 AC_MSG_WARN([To support your options to configure, I would like to set LDFLAGS to:])
421 AC_MSG_WARN([ $CVC4LDFLAGS])
425 if test "$non_standard_build_profile" = yes; then
426 if test "$with_build" = default; then :; else
428 AC_MSG_WARN([This is a non-standard $with_build build profile.])