| 1 | # -*- Autoconf -*-
|
|---|
| 2 | # Process this file with autoconf to produce a configure script.
|
|---|
| 3 |
|
|---|
| 4 | AC_PREREQ(2.59)
|
|---|
| 5 | AC_INIT(MoleCuilder, 1.0.0, heber@ins.uni-bonn.de, molecuilder)
|
|---|
| 6 | AC_CONFIG_AUX_DIR(config)
|
|---|
| 7 | AC_CONFIG_SRCDIR([src/builder.cpp])
|
|---|
| 8 | AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
|
|---|
| 9 | AC_CONFIG_MACRO_DIR([m4])
|
|---|
| 10 |
|
|---|
| 11 | AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests])
|
|---|
| 12 |
|
|---|
| 13 | # Checks for programs.
|
|---|
| 14 | AM_PATH_CPPUNIT(1.9.6)
|
|---|
| 15 | AC_PROG_CXX
|
|---|
| 16 | AC_PROG_CC
|
|---|
| 17 | AC_PROG_INSTALL
|
|---|
| 18 | AC_CHECK_PROG([LATEX],[latex],[latex],[:])
|
|---|
| 19 | AC_CHECK_PROG([BIBTEX],[bibtex],[bibtex],[:])
|
|---|
| 20 | AC_CHECK_PROG([DVIPS],[dvips],[dvips],[:])
|
|---|
| 21 | AC_CHECK_PROG([PDFLATEX],[pdflatex],[pdflatex],[:])
|
|---|
| 22 | AC_CHECK_PROG([XMLTO],[xmlto],[xmlto],[:])
|
|---|
| 23 | AM_MISSING_PROG([DOXYGEN], [doxygen])
|
|---|
| 24 |
|
|---|
| 25 | LT_INIT([disable-static])
|
|---|
| 26 |
|
|---|
| 27 | # Define these substitions here to keep all version information in one place.
|
|---|
| 28 | # For information on how to properly maintain the library version information,
|
|---|
| 29 | # refer to the libtool manual, section "Updating library version information":
|
|---|
| 30 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
|---|
| 31 | AC_SUBST([MOLECUILDER_SO_VERSION], [1:2:0])
|
|---|
| 32 | AC_SUBST([MOLECUILDER_API_VERSION], [1.0])
|
|---|
| 33 |
|
|---|
| 34 | # Checks for libraries.
|
|---|
| 35 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
|
|---|
| 36 |
|
|---|
| 37 | # Boost libraries
|
|---|
| 38 | AX_BOOST_BASE([1.40])
|
|---|
| 39 | AX_BOOST_PROGRAM_OPTIONS
|
|---|
| 40 | AX_BOOST_FILESYSTEM
|
|---|
| 41 | AX_BOOST_THREAD
|
|---|
| 42 | #AX_BOOST_SERIALIZATION
|
|---|
| 43 |
|
|---|
| 44 | #QT4 libraries
|
|---|
| 45 | gw_CHECK_QT4
|
|---|
| 46 | AX_CHECK_GLU
|
|---|
| 47 | AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | # Checks for header files.
|
|---|
| 51 | AC_HEADER_STDC
|
|---|
| 52 | AC_CHECK_HEADERS([sys/time.h])
|
|---|
| 53 | AC_HEADER_STDBOOL
|
|---|
| 54 |
|
|---|
| 55 | AC_FUNC_MALLOC
|
|---|
| 56 | AC_FUNC_REALLOC
|
|---|
| 57 | AC_CHECK_FUNCS([floor pow sqrt strchr])
|
|---|
| 58 |
|
|---|
| 59 | # Checks for typedefs, structures, and compiler characteristics.
|
|---|
| 60 | AC_C_CONST
|
|---|
| 61 | AC_C_INLINE
|
|---|
| 62 | AC_C_RESTRICT
|
|---|
| 63 | AC_TYPE_SIZE_T
|
|---|
| 64 |
|
|---|
| 65 | # Checks for library functions.
|
|---|
| 66 | # check for GNU Scientific Library
|
|---|
| 67 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
|
|---|
| 68 | AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas)
|
|---|
| 69 | AC_CHECK_LIB(gsl, main, [],
|
|---|
| 70 | [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)])
|
|---|
| 71 | AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
|
|---|
| 72 |
|
|---|
| 73 | # add replacement/saturation hydrogen or not
|
|---|
| 74 | AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]),
|
|---|
| 75 | [enable_hydrogen=$enableval], [enable_hydrogen=yes])
|
|---|
| 76 | if test x"$enable_hydrogen" = xyes; then
|
|---|
| 77 | AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"])
|
|---|
| 78 | AC_SUBST(ADDHYDROGEN)
|
|---|
| 79 | fi
|
|---|
| 80 |
|
|---|
| 81 | # use CppUnit TestRunner or not
|
|---|
| 82 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
|
|---|
| 83 | [enable_ecut=$enableval], [enable_ecut=no])
|
|---|
| 84 | if test x"$enable_ecut" = xyes; then
|
|---|
| 85 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
|
|---|
| 86 | AC_SUBST(HAVE_ECUT)
|
|---|
| 87 | fi
|
|---|
| 88 |
|
|---|
| 89 | # with valgrinding testsuite or not
|
|---|
| 90 | AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
|
|---|
| 91 | [with_valgrind=$withval], [with_valgrind=no])
|
|---|
| 92 | if test x"$with_valgrind" = xyes; then
|
|---|
| 93 | AC_CHECK_HEADER([valgrind/valgrind.h],
|
|---|
| 94 | [
|
|---|
| 95 | # check header
|
|---|
| 96 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
|
|---|
| 97 | # check path
|
|---|
| 98 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
|
|---|
| 99 | # set variables
|
|---|
| 100 | AC_SUBST(HAVE_VALGRIND_TESTSUITE)
|
|---|
| 101 | AC_SUBST(VALGRIND)
|
|---|
| 102 | ],
|
|---|
| 103 | [
|
|---|
| 104 | AC_MSG_ERROR(["Valgrind support requested but headers not available."])
|
|---|
| 105 | ]
|
|---|
| 106 | )
|
|---|
| 107 | fi
|
|---|
| 108 |
|
|---|
| 109 | # Check for "extern inline", using a modified version
|
|---|
| 110 | # of the test for AC_C_INLINE from acspecific.mt
|
|---|
| 111 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
|
|---|
| 112 | [ac_cv_c_extern_inline=no
|
|---|
| 113 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
|
|---|
| 114 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
|
|---|
| 115 | double foo (double x) { return x + 1.0; };],
|
|---|
| 116 | [ foo(1.0) ],
|
|---|
| 117 | [ac_cv_c_extern_inline="yes"])
|
|---|
| 118 | ])
|
|---|
| 119 |
|
|---|
| 120 | if test "$ac_cv_c_inline" != no ; then
|
|---|
| 121 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
|
|---|
| 122 | AC_SUBST(HAVE_INLINE)
|
|---|
| 123 | fi
|
|---|
| 124 |
|
|---|
| 125 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
|
|---|
| 126 |
|
|---|
| 127 | # test suite
|
|---|
| 128 | AC_CONFIG_TESTDIR(tests/regression)
|
|---|
| 129 | AC_CONFIG_FILES([
|
|---|
| 130 | tests/Makefile
|
|---|
| 131 | tests/regression/atlocal
|
|---|
| 132 | tests/regression/Makefile])
|
|---|
| 133 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
|
|---|
| 134 | AC_CONFIG_FILES([
|
|---|
| 135 | tests/Tesselations/Makefile
|
|---|
| 136 | tests/Tesselations/defs])
|
|---|
| 137 | AC_CONFIG_FILES([
|
|---|
| 138 | doc/molecuilder.xml])
|
|---|
| 139 | AC_CONFIG_FILES([
|
|---|
| 140 | molecuilder-${MOLECUILDER_API_VERSION}.pc:molecuilder.pc.in])
|
|---|
| 141 | AC_CONFIG_FILES([
|
|---|
| 142 | Makefile
|
|---|
| 143 | doc/Makefile
|
|---|
| 144 | src/Makefile
|
|---|
| 145 | src/Actions/Makefile
|
|---|
| 146 | src/Exceptions/Makefile
|
|---|
| 147 | src/Helpers/Makefile
|
|---|
| 148 | src/LinearAlgebra/Makefile
|
|---|
| 149 | src/Parser/Makefile
|
|---|
| 150 | src/UIElements/Makefile
|
|---|
| 151 | src/unittests/Makefile])
|
|---|
| 152 | AC_OUTPUT
|
|---|