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])
14 # Features requested by the user
15 AC_MSG_CHECKING([for requested build profile])
16 AC_ARG_WITH([build], [AS_HELP_STRING([--with-build=profile], [for profile in {production,debug,default,competition}])])
17 if test -z "${with_build+set}" -o "$with_build" = default; then
20 if test "$user_cppflags" = no -a "$user_cxxflags" = no -a "$user_ldflags" = no -a -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
21 non_standard_build_profile=no
23 non_standard_build_profile=yes
26 if test -n "${enable_optimized+set}"; then build=$build-opt; fi
27 if test -n "${enable_debug_symbols+set}"; then build=$build-dsy; fi
28 if test -n "${enable_assertions+set}"; then build=$build-ass; fi
29 if test -n "${enable_tracing+set}"; then build=$build-trc; fi
30 if test -n "${enable_muzzle+set}"; then build=$build-mzl; fi
31 if test -n "${enable_coverage+set}"; then build=$build-cvg; fi
32 if test -n "${enable_profiling+set}"; then build=$build-prf; fi
33 AC_MSG_RESULT([$with_build])
35 AC_MSG_CHECKING([for appropriate build string])
36 build_type=$with_build$build_type_suffix
37 AC_MSG_RESULT($build_type)
39 # require building in target and build-specific build directory
40 if test -e src/include/cvc4.h; then
41 if test "$non_standard_build_profile" = yes; then
42 if test "$with_build" = default; then
43 build_type=custom$build_type_suffix
46 rm -f config.log config.status confdefs.h
47 mkdir -p "builds/$target/$build_type"
48 test -e builds/Makefile || cp Makefile.builds builds/Makefile
49 echo "CURRENT_BUILD = $target/$build_type" > builds/current
51 echo cd "builds/$target/$build_type"
52 cd "builds/$target/$build_type"
53 echo ../../../configure "$@"
54 exec ../../../configure "$@"
62 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
63 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
64 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
67 CVC4CPPFLAGS=-DCVC4_DEBUG
68 CVC4CXXFLAGS='-O0 -fno-inline -ggdb3'
70 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
71 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
72 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
78 if test -z "${enable_assertions+set}"; then enable_assertions=yes ; fi
79 if test -z "${enable_tracing+set}" ; then enable_tracing=yes ; fi
80 if test -z "${enable_muzzle+set}" ; then enable_muzzle=no ; fi
84 CVC4CXXFLAGS='-O9 -funroll-all-loops -fexpensive-optimizations -fno-enforce-eh-specs'
86 if test -z "${enable_assertions+set}"; then enable_assertions=no ; fi
87 if test -z "${enable_tracing+set}" ; then enable_tracing=no ; fi
88 if test -z "${enable_muzzle+set}" ; then enable_muzzle=yes ; fi
91 AC_MSG_FAILURE([unknown build profile: $with_build])
95 AC_MSG_CHECKING([whether to optimize libcvc4])
96 AC_ARG_ENABLE([optimized], [AS_HELP_STRING([--enable-optimized], [optimize the build])])
97 if test -z "${enable_optimized+set}"; then
100 AC_MSG_RESULT([$enable_optimized])
101 if test "$enable_optimized" = yes; then
102 CVC4CXXFLAGS="$CVC4CXXFLAGS -O3"
105 AC_MSG_CHECKING([whether to include debugging symbols in libcvc4])
106 AC_ARG_ENABLE([debug-symbols], [AS_HELP_STRING([--disable-debug-symbols], [do not include debug symbols in libcvc4])])
107 if test -z "${enable_debug_symbols+set}"; then
108 enable_debug_symbols=yes
110 AC_MSG_RESULT([$enable_debug_symbols])
111 if test "$enable_debug_symbols" = yes; then
112 CVC4CXXFLAGS="$CVC4CXXFLAGS -ggdb3"
115 AC_MSG_CHECKING([whether to include assertions in build])
116 AC_ARG_ENABLE([assertions], [AS_HELP_STRING([--disable-assertions], [turn off assertions in build])])
117 if test -z "${enable_assertions+set}"; then
118 enable_assertions=yes
120 AC_MSG_RESULT([$enable_assertions])
121 if test "$enable_assertions" = yes; then
122 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_ASSERTIONS"
125 AC_MSG_CHECKING([whether to do a traceable build of CVC4])
126 AC_ARG_ENABLE([tracing], [AS_HELP_STRING([--disable-tracing], [remove all tracing code from CVC4])])
127 if test -z "${enable_tracing+set}"; then
130 AC_MSG_RESULT([$enable_tracing])
131 if test "$enable_tracing" = yes; then
132 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_TRACING"
135 AC_MSG_CHECKING([whether to do a muzzled build of CVC4])
136 AC_ARG_ENABLE([muzzle], [AS_HELP_STRING([--enable-muzzle], [completely silence CVC4; remove ALL non-result output from build])])
137 if test -z "${enable_muzzle+set}"; then
140 AC_MSG_RESULT([$enable_muzzle])
141 if test "$enable_muzzle" = yes; then
142 CVC4CPPFLAGS="$CVC4CPPFLAGS -DCVC4_MUZZLE"
145 AC_MSG_CHECKING([whether to do a gcov-enabled build of CVC4])
146 AC_ARG_ENABLE([coverage], [AS_HELP_STRING([--enable-coverage], [build with support for gcov coverage testing])])
147 if test -z "${enable_coverage+set}"; then
150 AC_MSG_RESULT([$enable_coverage])
151 if test "$enable_coverage" = yes; then
152 CVC4CXXFLAGS="$CVC4CXXFLAGS --coverage"
153 CVC4LDFLAGS="$CVC4LDFLAGS --coverage"
156 AC_MSG_CHECKING([whether to do a profiling-enabled build of CVC4])
157 AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [build with support for gprof profiling])])
158 if test -z "${enable_profiling+set}"; then
161 AC_MSG_RESULT([$enable_profiling])
162 if test "$enable_profiling" = yes; then
163 CVC4CXXFLAGS="$CVC4CXXFLAGS -pg"
164 CVC4LDFLAGS="$CVC4LDFLAGS -pg"
167 AM_INIT_AUTOMAKE(cvc4, prerelease)
168 AC_CONFIG_HEADERS([config.h])
170 # keep track of whether the user set these (check here, because
171 # autoconf might set a default later)
172 AC_MSG_CHECKING([for user CPPFLAGS])
173 if test -z "${CPPFLAGS+set}"; then user_cppflags=no; else user_cppflags=yes; fi
174 AC_MSG_RESULT([${CPPFLAGS-none}])
175 AC_MSG_CHECKING([for user CXXFLAGS])
176 if test -z "${CXXFLAGS+set}"; then user_cxxflags=no; else user_cxxflags=yes; fi
177 AC_MSG_RESULT([${CXXFLAGS-none}])
178 AC_MSG_CHECKING([for user LDFLAGS])
179 if test -z "${LDFLAGS+set}" ; then user_ldflags=no ; else user_ldflags=yes ; fi
180 AC_MSG_RESULT([${LDFLAGS-none}])
190 # Checks for programs.
199 AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, [])
200 if test -z "$DOXYGEN"; then
201 AC_MSG_WARN([documentation targets require doxygen. Set your PATH appropriately or set DOXYGEN to point to a valid doxygen binary.])
203 AC_ARG_VAR(DOXYGEN, [location of doxygen binary])
206 AC_PATH_PROG(CXXTESTGEN, cxxtestgen.pl, [], [$CXXTEST:$PATH])
207 if test -z "$CXXTESTGEN"; then
208 AC_MSG_NOTICE([unit tests disabled, cxxtestgen.pl not found.])
209 elif test -z "$CXXTEST"; then
210 CXXTEST=$(dirname "$CXXTESTGEN")
211 AC_MSG_CHECKING([for location of CxxTest headers])
212 if test -e "$CXXTEST/cxxtest/TestRunner.h"; then
213 AC_MSG_RESULT([$CXXTEST])
215 AC_MSG_RESULT([not found])
216 AC_MSG_WARN([unit tests disabled, CxxTest headers not found.])
221 AC_ARG_VAR(CXXTEST, [path to CxxTest installation])
222 AM_CONDITIONAL([HAVE_CXXTESTGEN], [test -n "$CXXTESTGEN"])
224 AC_ARG_VAR(TEST_CPPFLAGS, [CXXFLAGS to use when testing (default=$CPPFLAGS)])
225 AC_ARG_VAR(TEST_CXXFLAGS, [CXXFLAGS to use when testing (default=$CXXFLAGS)])
226 AC_ARG_VAR(TEST_LDFLAGS, [LDFLAGS to use when testing (default=$LDFLAGS)])
228 if test -n "$CXXTEST"; then
229 AC_CHECK_PROG(PERL, perl, perl, [])
230 if test -z "$PERL"; then
231 AC_MSG_WARN([unit tests disabled, perl not found.])
237 # Checks for libraries.
238 AC_CHECK_LIB(gmp, __gmpz_init, , [AC_MSG_ERROR([GNU MP not found, see http://gmplib.org/])])
240 # Checks for header files.
241 AC_CHECK_HEADERS([getopt.h unistd.h])
243 # Checks for typedefs, structures, and compiler characteristics.
250 # Checks for library functions.
252 # Some definitions for config.h
254 # Prepare configure output
256 if test "$user_cppflags" = no; then
257 CPPFLAGS="$CVC4CPPFLAGS"
259 if test "$user_cxxflags" = no; then
260 CXXFLAGS="$CVC4CXXFLAGS"
262 if test "$user_ldflags" = no; then
263 LDFLAGS="$CVC4LDFLAGS"
274 src/prop/minisat/Makefile
281 test/regress/Makefile
287 # Final information to the user
293 Build profile: $with_build$non_standard
294 Optimized : $enable_optimized
295 Debug symbols: $enable_debug_symbols
296 Assertions : $enable_assertions
297 Tracing : $enable_tracing
298 Muzzle : $enable_muzzle
299 gcov support : $enable_coverage
300 gprof support: $enable_profiling
306 Now just type make, followed by make check or make install, as you like.
308 You can use 'make <build_profile>' to reconfig/build a different profile.
309 Build profiles: production optimized default competition
313 if test "$user_cppflags" = yes; then
315 AC_MSG_WARN([I won't override your CPPFLAGS setting. But some of your build options to configure may not be honored.])
316 AC_MSG_WARN([To support your options to configure, I would like to set CPPFLAGS to:])
317 AC_MSG_WARN([ $CVC4CPPFLAGS])
320 if test "$user_cxxflags" = yes; then
322 AC_MSG_WARN([I won't override your CXXFLAGS setting. But some of your build options to configure may not be honored.])
323 AC_MSG_WARN([To support your options to configure, I would like to set CXXFLAGS to:])
324 AC_MSG_WARN([ $CVC4CXXFLAGS])
327 if test "$user_ldflags" = yes; then
329 AC_MSG_WARN([I won't override your LDFLAGS setting. But some of your build options to configure may not be honored.])
330 AC_MSG_WARN([To support your options to configure, I would like to set LDFLAGS to:])
331 AC_MSG_WARN([ $CVC4LDFLAGS])
336 if test "$non_standard_build_profile" = yes; then
337 if test "$with_build" = default; then
341 AC_MSG_WARN([This is a non-standard $with_build build profile.])