# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT(MoleCuilder, 1.0.8, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_SRCDIR([src/builder.cpp]) AC_CONFIG_HEADER([config.h libmolecuilder_config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests]) # Checks for programs. AM_PATH_CPPUNIT(1.9.6) AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_CHECK_PROG([LATEX],[latex],[latex],[:]) AC_CHECK_PROG([BIBTEX],[bibtex],[bibtex],[:]) AC_CHECK_PROG([DVIPS],[dvips],[dvips],[:]) AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[:]) AC_CHECK_PROG([XMLTO],[xmlto],[xmlto],[:]) AM_MISSING_PROG([DOXYGEN], [doxygen]) LT_INIT([static]) # Define these substitions here to keep all version information in one place. # For information on how to properly maintain the library version information, # refer to the libtool manual, section "Updating library version information": # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST([MOLECUILDER_SO_VERSION], [2:0:0]) AC_SUBST([MOLECUILDER_API_VERSION], [1.0.8]) dnl this macro is used to get the arguments supplied dnl to the configure script (./configure --enable-debug) dnl Check if we have enable debug support. AC_MSG_CHECKING(whether to enable debugging) default="no" have_debug="no" AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes/full] turn on debugging [default=$default]],, enable_debug=$default) if test "x$enable_debug" = "xyes"; then AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."]) have_debug="yes" elif test "x$enable_debug" = "xfull"; then AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."]) AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."]) have_debug="full" else AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."]) AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."]) have_debug="no" fi AC_MSG_RESULT($have_debug) AC_SUBST(HAVE_DEBUG) dnl this macro is used to get the arguments supplied dnl to the configure script (./configure --enable-debug) dnl Check if we have enable debug support. AC_MSG_CHECKING([whether to enable internal caching of values (speedup!)]) default="yes" AC_ARG_ENABLE(cache, [ --enable-cache=[no/yes] turn on caching [default=$default]],, enable_cache=$default) if test "x$enable_cache" = "xno"; then AC_DEFINE(NO_CACHING,1, ["Don't use caching code."]) AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."]) AC_MSG_RESULT(no) else AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."]) AC_MSG_RESULT(yes) fi AC_SUBST(HAVE_CACHE) #AC_MSG_CHECKING(whether to enable profiling) #default="no" #AC_ARG_ENABLE(debug, [ --enable-profile=[no/yes] turn on profiling # [default=$default]],, enable_profile=$default) #if test "x$enable_profile" = "xyes"; then # CXXFLAGS="$CXXFLAGS -g -DDEBUG -pg" # DEBUG=-pg; # AC_MSG_RESULT(yes) #else # AC_MSG_RESULT(no) #fi #AC_MSG_CHECKING(whether to enable serialization) #default="no" #AC_ARG_ENABLE(debug, [ --enable-serialization=[no/yes] turn on serialization support # [default=$default]],, enable_serialization=$default) #if test "x$enable_serialization" = "xyes"; then # CXXFLAGS="$CXXFLAGS -DSERIALIZATION" # serialization=yes; # AC_MSG_RESULT(yes) #else # serialization=no; # AC_MSG_RESULT(no) #fi # Checks for libraries. AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) # Boost libraries AX_BOOST_BASE([1.40]) AX_BOOST_PROGRAM_OPTIONS AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AX_BOOST_THREAD #AX_BOOST_SERIALIZATION #QT4 libraries gw_CHECK_QT4 AX_CHECK_GLU #AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"]) # CodePatterns library (needs ObservedIterator<> operator==,!= to be const) AM_PATH_CODEPATTERNS([1.0.11], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])]) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([sys/time.h]) AC_HEADER_STDBOOL AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([floor pow sqrt strchr]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_C_RESTRICT AC_TYPE_SIZE_T # Checks for library functions. # check for GNU Scientific Library AC_CHECK_HEADERS([gsl/gsl_blas.h]) AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas) AC_CHECK_LIB(gsl, main, [], [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)]) AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])]) # add replacement/saturation hydrogen or not AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]), [enable_hydrogen=$enableval], [enable_hydrogen=yes]) if test x"$enable_hydrogen" = xyes; then AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"]) AC_SUBST(ADDHYDROGEN) fi # use CppUnit TestRunner or not AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]), [enable_ecut=$enableval], [enable_ecut=no]) if test x"$enable_ecut" = xyes; then AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."]) AC_SUBST(HAVE_ECUT) fi # with valgrinding testsuite or not AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]), [with_valgrind=$withval], [with_valgrind=no]) if test x"$with_valgrind" = xyes; then AC_CHECK_HEADER([valgrind/valgrind.h], [ # check header AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."]) # check path AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false]) # set variables AC_SUBST(HAVE_VALGRIND_TESTSUITE) AC_SUBST(VALGRIND) ], [ AC_MSG_ERROR(["Valgrind support requested but headers not available."]) ] ) fi # Check for "extern inline", using a modified version # of the test for AC_C_INLINE from acspecific.mt AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, [ac_cv_c_extern_inline=no AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); extern $ac_cv_c_inline double foo(double x) { return x+1.0; }; double foo (double x) { return x + 1.0; };], [ foo(1.0) ], [ac_cv_c_extern_inline="yes"]) ]) if test "$ac_cv_c_inline" != no ; then AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"]) AC_SUBST(HAVE_INLINE) fi #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"]) # test suite AC_CONFIG_TESTDIR(tests/regression) AC_CONFIG_FILES([ tests/Makefile tests/regression/atlocal tests/regression/Makefile]) AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder]) AC_CONFIG_FILES([ tests/CodeChecks/atlocal tests/CodeChecks/Makefile]) AC_CONFIG_FILES([ tests/Fragmentations/Makefile tests/Fragmentations/defs]) AC_CONFIG_FILES([ tests/Tesselations/Makefile tests/Tesselations/defs]) AC_CONFIG_FILES([ doc/molecuilder.xml]) AC_CONFIG_FILES([ MoleCuilder.pc:MoleCuilder.pc.in]) AC_CONFIG_FILES([ Makefile doc/Makefile src/Makefile src/Actions/Makefile src/Exceptions/Makefile src/LinearAlgebra/Makefile src/Parser/Makefile src/RandomNumbers/Makefile src/Shapes/Makefile src/UIElements/Makefile ]) AC_CONFIG_FILES([ src/unittests/Makefile src/Actions/unittests/Makefile src/Descriptors/unittests/Makefile src/LinearAlgebra/unittests/Makefile src/Parser/unittests/Makefile src/RandomNumbers/unittests/Makefile src/Shapes/unittests/Makefile src/UIElements/Menu/unittests/Makefile ]) AC_OUTPUT