AC_INIT(cryptominisat, 2.9.2) AC_PREREQ([2.62]) dnl use libtool AC_PROG_LIBTOOL dnl we are C++ AC_LANG_CPLUSPLUS if test -n "${CXXFLAGS}"; then user_set_cxxflags=yes fi AC_PROG_CXX if test X$user_set_cxxflags != Xyes; then CXXFLAGS="-g -O3 -Wall -pedantic -Werror" fi AC_LANG(C++) AC_CACHE_CHECK([for gcc bug number 47365], fpre_cv_bug, [ AC_TRY_RUN([ extern "C" { #include #include #include } #include class Lit { public: uint32_t x; Lit() { } explicit Lit(uint32_t x): x(x) { } Lit(int var, bool sign): x(var + var + (int) sign) { } int var() const { return x & 1; } bool sign() const { return x >> 1; } Lit operator~() const { return Lit(x ^ 1); } bool operator==(const Lit &p) const { return x == p.x; } }; class Clause { public: Lit data[2]; Clause(std::vector &ps) { data[0] = ps[0]; data[1] = ps[1]; } Lit& operator [] (uint32_t i) { return data[i]; } }; static std::vector assigns(2); inline int prop(Clause &c, const Lit p) { if (c[0] == ~p) { Lit t = c[0]; c[0] = c[1]; c[1] = t; } assert(c[1] == ~p); if (assigns[c[0].var()] ^ c[0].sign()) { return 0; } else { return 1; } } int main(int argc, char** argv) { std::vector c1; c1.push_back(Lit(0, false)); c1.push_back(Lit(1, true)); Clause *cl = new Clause(c1); assigns[1] = false; return prop(*cl, Lit(0, true)); } ],[fpre_cv_bug=no], [fpre_cv_bug=yes],[fpre_cv_bug=cross]) ]) if test "x$fpre_cv_bug" = "xno" ; then AC_MSG_RESULT([Your gcc version doesn't _seem_ broken]) else AC_MSG_RESULT([Your gcc may be broken. Disabling -ftree-pre, but this may slow down CryptoMS]) CXXFLAGS="$CXXFLAGS -fno-tree-pre" fi # Enable static linking AC_MSG_CHECKING([static linking]) AC_ARG_ENABLE(static-link, [AC_HELP_STRING([--enable-static-link], [Enable static linking \ (off by default)])], use_static="yes" AC_MSG_RESULT([yes]), use_static="no" AC_MSG_RESULT([no])) dnl AC_CONFIG_AUX_DIR([m4-extra]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(config.h) AC_CHECK_HEADERS(iostream) # checks for compiler characteristics AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([size_t]) # checks for library functions #AC_FUNC_MALLOC #AC_FUNC_MEMCMP #gauss generation needed AH_TEMPLATE([USE_GAUSS],[Enable gaussian elimination code]) AC_DEFINE([USE_GAUSS]) #search for openmp AC_OPENMP #check zlib AC_CHECK_LIB([z], [gzread], , [AC_MSG_ERROR([zlib not found, see http://www.zlib.net])]) if test "$use_static" = "yes"; then LDFLAGS="$LDFLAGS -all-static" fi AC_OUTPUT(Makefile Solver/Makefile mtl/Makefile MTRand/Makefile man/Makefile)