| [14de469] | 1 | #                                               -*- Autoconf -*-
 | 
|---|
 | 2 | # Process this file with autoconf to produce a configure script.
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | AC_PREREQ(2.59)
 | 
|---|
| [b404da] | 5 | AC_INIT(MoleCuilder, 1.1.2, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
 | 
|---|
| [bf4b9f] | 6 | AC_CONFIG_AUX_DIR([build-aux])
 | 
|---|
| [14de469] | 7 | AC_CONFIG_SRCDIR([src/builder.cpp])
 | 
|---|
| [861874] | 8 | AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
 | 
|---|
 | 9 | AC_CONFIG_MACRO_DIR([m4])
 | 
|---|
| [bf4b9f] | 10 | AC_CONFIG_SUBDIRS([LinearAlgebra])
 | 
|---|
| [14de469] | 11 | 
 | 
|---|
| [dc322a] | 12 | # parallel-tests: use parallel test druver
 | 
|---|
 | 13 | # color-tests: us coloring to indicate success/failure when available
 | 
|---|
 | 14 | # tar-pax: use newer tar implementation with longer filename (>99 chars)
 | 
|---|
| [4cf35ac] | 15 | AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax])
 | 
|---|
| [14de469] | 16 | 
 | 
|---|
 | 17 | # Checks for programs.
 | 
|---|
| [54a746] | 18 | AM_PATH_CPPUNIT(1.9.6)
 | 
|---|
| [14de469] | 19 | AC_PROG_CXX
 | 
|---|
 | 20 | AC_PROG_CC
 | 
|---|
| [54a746] | 21 | AC_PROG_INSTALL
 | 
|---|
| [14de469] | 22 | 
 | 
|---|
| [ec188c] | 23 | # use doxygen
 | 
|---|
 | 24 | DX_HTML_FEATURE(ON)
 | 
|---|
 | 25 | DX_PS_FEATURE(OFF)
 | 
|---|
 | 26 | DX_PDF_FEATURE(OFF)
 | 
|---|
 | 27 | DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, $(docdir))
 | 
|---|
 | 28 | 
 | 
|---|
 | 29 | # use libtool
 | 
|---|
| [a0064e] | 30 | LT_INIT([static])
 | 
|---|
| [861874] | 31 | 
 | 
|---|
 | 32 | # Define these substitions here to keep all version information in one place.
 | 
|---|
 | 33 | # For information on how to properly maintain the library version information,
 | 
|---|
 | 34 | # refer to the libtool manual, section "Updating library version information":
 | 
|---|
 | 35 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
 | 
|---|
| [b404da] | 36 | AC_SUBST([MOLECUILDER_SO_VERSION], [4:0:0])
 | 
|---|
 | 37 | AC_SUBST([MOLECUILDER_API_VERSION], [1.1.2])
 | 
|---|
| [861874] | 38 | 
 | 
|---|
| [06aedc] | 39 | # for libLinearAlgebra
 | 
|---|
 | 40 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [1:0:0])
 | 
|---|
 | 41 | 
 | 
|---|
| [dc031c] | 42 | dnl this macro is used to get the arguments supplied
 | 
|---|
 | 43 | dnl to the configure script (./configure --enable-debug)
 | 
|---|
 | 44 | dnl Check if we have enable debug support.
 | 
|---|
 | 45 | AC_MSG_CHECKING(whether to enable debugging)
 | 
|---|
 | 46 | default="no"
 | 
|---|
 | 47 | have_debug="no"
 | 
|---|
 | 48 | AC_ARG_ENABLE(debug, [  --enable-debug=[no/yes/full] turn on debugging
 | 
|---|
 | 49 |                      [default=$default]],, enable_debug=$default)
 | 
|---|
 | 50 | if test "x$enable_debug" = "xyes"; then
 | 
|---|
 | 51 |   AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
 | 
|---|
 | 52 |   AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
 | 
|---|
 | 53 |   have_debug="yes"
 | 
|---|
 | 54 | elif test "x$enable_debug" = "xfull"; then
 | 
|---|
 | 55 |   AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
 | 
|---|
 | 56 |   AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
 | 
|---|
 | 57 |   AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
 | 
|---|
 | 58 |   have_debug="full"
 | 
|---|
 | 59 | else
 | 
|---|
 | 60 |   AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
 | 
|---|
 | 61 |   AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
 | 
|---|
 | 62 |   have_debug="no"
 | 
|---|
 | 63 | fi
 | 
|---|
 | 64 | AC_MSG_RESULT($have_debug)
 | 
|---|
 | 65 | AC_SUBST(HAVE_DEBUG)
 | 
|---|
 | 66 | 
 | 
|---|
 | 67 | dnl this macro is used to get the arguments supplied
 | 
|---|
 | 68 | dnl to the configure script (./configure --enable-debug)
 | 
|---|
 | 69 | dnl Check if we have enable debug support.
 | 
|---|
 | 70 | AC_MSG_CHECKING([whether to enable internal caching of values (speedup!)])
 | 
|---|
 | 71 | default="yes"
 | 
|---|
 | 72 | AC_ARG_ENABLE(cache, [  --enable-cache=[no/yes] turn on caching
 | 
|---|
 | 73 |                      [default=$default]],, enable_cache=$default)
 | 
|---|
 | 74 | if test "x$enable_cache" = "xno"; then
 | 
|---|
 | 75 |   AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
 | 
|---|
 | 76 |   AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
 | 
|---|
 | 77 |   AC_MSG_RESULT(no)
 | 
|---|
 | 78 | else
 | 
|---|
 | 79 |   AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
 | 
|---|
 | 80 |   AC_MSG_RESULT(yes)
 | 
|---|
 | 81 | fi
 | 
|---|
 | 82 | AC_SUBST(HAVE_CACHE)
 | 
|---|
 | 83 | 
 | 
|---|
 | 84 | #AC_MSG_CHECKING(whether to enable profiling)
 | 
|---|
 | 85 | #default="no"
 | 
|---|
 | 86 | #AC_ARG_ENABLE(debug, [  --enable-profile=[no/yes] turn on profiling
 | 
|---|
 | 87 | #                       [default=$default]],, enable_profile=$default)
 | 
|---|
 | 88 | #if test "x$enable_profile" = "xyes"; then
 | 
|---|
 | 89 | #  CXXFLAGS="$CXXFLAGS -g -DDEBUG -pg"
 | 
|---|
 | 90 | #  DEBUG=-pg;
 | 
|---|
 | 91 | #  AC_MSG_RESULT(yes)
 | 
|---|
 | 92 | #else
 | 
|---|
 | 93 | #  AC_MSG_RESULT(no)
 | 
|---|
 | 94 | #fi
 | 
|---|
 | 95 | 
 | 
|---|
 | 96 | #AC_MSG_CHECKING(whether to enable serialization)
 | 
|---|
 | 97 | #default="no"
 | 
|---|
 | 98 | #AC_ARG_ENABLE(debug, [  --enable-serialization=[no/yes] turn on serialization support
 | 
|---|
 | 99 | #                       [default=$default]],, enable_serialization=$default)
 | 
|---|
 | 100 | #if test "x$enable_serialization" = "xyes"; then
 | 
|---|
 | 101 | #  CXXFLAGS="$CXXFLAGS -DSERIALIZATION"
 | 
|---|
 | 102 | #  serialization=yes;
 | 
|---|
 | 103 | #  AC_MSG_RESULT(yes)
 | 
|---|
 | 104 | #else
 | 
|---|
 | 105 | #  serialization=no;
 | 
|---|
 | 106 | #  AC_MSG_RESULT(no)
 | 
|---|
 | 107 | #fi
 | 
|---|
 | 108 | 
 | 
|---|
| [14de469] | 109 | # Checks for libraries.
 | 
|---|
| [861874] | 110 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
 | 
|---|
| [14de469] | 111 | 
 | 
|---|
| [fa861b] | 112 | # Boost libraries
 | 
|---|
| [79de12] | 113 | BOOST_REQUIRE([1.40])
 | 
|---|
 | 114 | BOOST_EXCEPTION
 | 
|---|
 | 115 | BOOST_FILESYSTEM
 | 
|---|
 | 116 | BOOST_PROGRAM_OPTIONS
 | 
|---|
 | 117 | BOOST_RANDOM
 | 
|---|
 | 118 | BOOST_THREADS
 | 
|---|
| [fa861b] | 119 | 
 | 
|---|
| [3027f8] | 120 | #QT4 libraries
 | 
|---|
 | 121 | gw_CHECK_QT4
 | 
|---|
| [cef1d7] | 122 | AX_CHECK_GLU
 | 
|---|
| [dc031c] | 123 | #AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
 | 
|---|
| [cef1d7] | 124 | 
 | 
|---|
| [300220] | 125 | # CodePatterns library (needs operator<<(.., range<>) ) 
 | 
|---|
 | 126 | AM_PATH_CODEPATTERNS([1.0.13], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
 | 
|---|
| [3027f8] | 127 | 
 | 
|---|
| [14de469] | 128 | # Checks for header files.
 | 
|---|
 | 129 | AC_HEADER_STDC
 | 
|---|
 | 130 | AC_CHECK_HEADERS([sys/time.h])
 | 
|---|
 | 131 | AC_HEADER_STDBOOL
 | 
|---|
 | 132 | 
 | 
|---|
| [d3a46d] | 133 | AC_FUNC_MALLOC
 | 
|---|
 | 134 | AC_FUNC_REALLOC
 | 
|---|
 | 135 | AC_CHECK_FUNCS([floor pow sqrt strchr])
 | 
|---|
 | 136 | 
 | 
|---|
| [14de469] | 137 | # Checks for typedefs, structures, and compiler characteristics.
 | 
|---|
 | 138 | AC_C_CONST
 | 
|---|
 | 139 | AC_C_INLINE
 | 
|---|
 | 140 | AC_C_RESTRICT
 | 
|---|
 | 141 | AC_TYPE_SIZE_T
 | 
|---|
 | 142 | 
 | 
|---|
 | 143 | # Checks for library functions.
 | 
|---|
 | 144 | # check for GNU Scientific Library
 | 
|---|
| [bd3e55] | 145 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
 | 
|---|
 | 146 | AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas)
 | 
|---|
 | 147 | AC_CHECK_LIB(gsl, main, [], 
 | 
|---|
 | 148 |         [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)])
 | 
|---|
 | 149 | AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
 | 
|---|
| [14de469] | 150 | 
 | 
|---|
 | 151 | # add replacement/saturation hydrogen or not 
 | 
|---|
 | 152 | AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]),
 | 
|---|
 | 153 |               [enable_hydrogen=$enableval], [enable_hydrogen=yes])
 | 
|---|
 | 154 | if test x"$enable_hydrogen" = xyes; then
 | 
|---|
 | 155 |   AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"])
 | 
|---|
 | 156 |   AC_SUBST(ADDHYDROGEN)
 | 
|---|
 | 157 | fi
 | 
|---|
 | 158 | 
 | 
|---|
| [490038] | 159 | # use CppUnit TestRunner or not
 | 
|---|
| [6ac15b] | 160 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
 | 
|---|
 | 161 |               [enable_ecut=$enableval], [enable_ecut=no])
 | 
|---|
| [9b6b2f] | 162 | if test x"$enable_ecut" = xyes; then
 | 
|---|
 | 163 |   AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
 | 
|---|
 | 164 |   AC_SUBST(HAVE_ECUT)
 | 
|---|
 | 165 | fi
 | 
|---|
 | 166 | 
 | 
|---|
| [490038] | 167 | # with valgrinding testsuite or not
 | 
|---|
 | 168 | AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
 | 
|---|
 | 169 |               [with_valgrind=$withval], [with_valgrind=no])
 | 
|---|
 | 170 | if test x"$with_valgrind" = xyes; then
 | 
|---|
 | 171 |   AC_CHECK_HEADER([valgrind/valgrind.h],
 | 
|---|
 | 172 |     [
 | 
|---|
 | 173 |       # check header
 | 
|---|
 | 174 |       AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
 | 
|---|
 | 175 |       # check path
 | 
|---|
 | 176 |       AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
 | 
|---|
 | 177 |       # set variables 
 | 
|---|
 | 178 |       AC_SUBST(HAVE_VALGRIND_TESTSUITE)
 | 
|---|
 | 179 |       AC_SUBST(VALGRIND)
 | 
|---|
 | 180 |     ],
 | 
|---|
 | 181 |     [
 | 
|---|
 | 182 |       AC_MSG_ERROR(["Valgrind support requested but headers not available."])
 | 
|---|
 | 183 |     ]
 | 
|---|
 | 184 |   )
 | 
|---|
 | 185 | fi
 | 
|---|
 | 186 | 
 | 
|---|
| [14de469] | 187 | # Check for "extern inline", using a modified version
 | 
|---|
 | 188 | # of the test for AC_C_INLINE from acspecific.mt
 | 
|---|
 | 189 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
 | 
|---|
 | 190 | [ac_cv_c_extern_inline=no
 | 
|---|
 | 191 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
 | 
|---|
 | 192 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
 | 
|---|
 | 193 | double foo (double x) { return x + 1.0; };], 
 | 
|---|
 | 194 | [  foo(1.0)  ],
 | 
|---|
 | 195 | [ac_cv_c_extern_inline="yes"])
 | 
|---|
 | 196 | ])
 | 
|---|
 | 197 | 
 | 
|---|
 | 198 | if test "$ac_cv_c_inline" != no ; then
 | 
|---|
 | 199 |   AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
 | 
|---|
 | 200 |   AC_SUBST(HAVE_INLINE)
 | 
|---|
 | 201 | fi
 | 
|---|
 | 202 | 
 | 
|---|
| [bd3e55] | 203 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
 | 
|---|
| [a19da5d] | 204 | 
 | 
|---|
| [0ca39c] | 205 | # test suite
 | 
|---|
| [b2b47f] | 206 | AC_CONFIG_TESTDIR(tests/regression)
 | 
|---|
| [5079a0] | 207 | AC_CONFIG_FILES([
 | 
|---|
| [b2b47f] | 208 |         tests/Makefile
 | 
|---|
 | 209 |         tests/regression/atlocal 
 | 
|---|
 | 210 |         tests/regression/Makefile])
 | 
|---|
 | 211 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
 | 
|---|
| [d0a719] | 212 | AC_CONFIG_FILES([
 | 
|---|
 | 213 |         tests/CodeChecks/atlocal 
 | 
|---|
 | 214 |         tests/CodeChecks/Makefile])
 | 
|---|
| [038713] | 215 | AC_CONFIG_FILES([
 | 
|---|
 | 216 |         tests/Fragmentations/Makefile 
 | 
|---|
 | 217 |         tests/Fragmentations/defs])
 | 
|---|
| [5079a0] | 218 | AC_CONFIG_FILES([
 | 
|---|
 | 219 |         tests/Tesselations/Makefile 
 | 
|---|
 | 220 |         tests/Tesselations/defs])
 | 
|---|
 | 221 | AC_CONFIG_FILES([
 | 
|---|
 | 222 |         doc/molecuilder.xml])
 | 
|---|
| [861874] | 223 | AC_CONFIG_FILES([
 | 
|---|
| [acbe1b] | 224 |   MoleCuilder.pc:MoleCuilder.pc.in])
 | 
|---|
| [5079a0] | 225 | AC_CONFIG_FILES([
 | 
|---|
 | 226 |         Makefile 
 | 
|---|
| [ec188c] | 227 |         doc/Makefile
 | 
|---|
| [5079a0] | 228 |         src/Makefile 
 | 
|---|
| [85949a] | 229 | ])
 | 
|---|
 | 230 | AC_CONFIG_FILES([
 | 
|---|
| [455573] | 231 |   src/unittests/Makefile
 | 
|---|
| [85949a] | 232 | ])
 | 
|---|
| [14de469] | 233 | AC_OUTPUT
 | 
|---|