| [14de469] | 1 | #                                               -*- Autoconf -*-
 | 
|---|
 | 2 | # Process this file with autoconf to produce a configure script.
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | AC_PREREQ(2.59)
 | 
|---|
| [c4cde1] | 5 | AC_INIT(MoleCuilder, 1.1.3, [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])
 | 
|---|
| [c4cde1] | 37 | AC_SUBST([MOLECUILDER_API_VERSION], [1.1.3])
 | 
|---|
| [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."])
 | 
|---|
| [060ba4] | 58 |   AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
 | 
|---|
| [dc031c] | 59 |   have_debug="full"
 | 
|---|
 | 60 | else
 | 
|---|
 | 61 |   AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
 | 
|---|
 | 62 |   AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
 | 
|---|
| [060ba4] | 63 |   AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."])
 | 
|---|
| [dc031c] | 64 |   have_debug="no"
 | 
|---|
 | 65 | fi
 | 
|---|
 | 66 | AC_MSG_RESULT($have_debug)
 | 
|---|
 | 67 | AC_SUBST(HAVE_DEBUG)
 | 
|---|
 | 68 | 
 | 
|---|
 | 69 | dnl this macro is used to get the arguments supplied
 | 
|---|
 | 70 | dnl to the configure script (./configure --enable-debug)
 | 
|---|
 | 71 | dnl Check if we have enable debug support.
 | 
|---|
 | 72 | AC_MSG_CHECKING([whether to enable internal caching of values (speedup!)])
 | 
|---|
 | 73 | default="yes"
 | 
|---|
 | 74 | AC_ARG_ENABLE(cache, [  --enable-cache=[no/yes] turn on caching
 | 
|---|
 | 75 |                      [default=$default]],, enable_cache=$default)
 | 
|---|
 | 76 | if test "x$enable_cache" = "xno"; then
 | 
|---|
 | 77 |   AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
 | 
|---|
 | 78 |   AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
 | 
|---|
 | 79 |   AC_MSG_RESULT(no)
 | 
|---|
 | 80 | else
 | 
|---|
 | 81 |   AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
 | 
|---|
 | 82 |   AC_MSG_RESULT(yes)
 | 
|---|
 | 83 | fi
 | 
|---|
 | 84 | AC_SUBST(HAVE_CACHE)
 | 
|---|
 | 85 | 
 | 
|---|
 | 86 | #AC_MSG_CHECKING(whether to enable profiling)
 | 
|---|
 | 87 | #default="no"
 | 
|---|
 | 88 | #AC_ARG_ENABLE(debug, [  --enable-profile=[no/yes] turn on profiling
 | 
|---|
 | 89 | #                       [default=$default]],, enable_profile=$default)
 | 
|---|
 | 90 | #if test "x$enable_profile" = "xyes"; then
 | 
|---|
 | 91 | #  CXXFLAGS="$CXXFLAGS -g -DDEBUG -pg"
 | 
|---|
 | 92 | #  DEBUG=-pg;
 | 
|---|
 | 93 | #  AC_MSG_RESULT(yes)
 | 
|---|
 | 94 | #else
 | 
|---|
 | 95 | #  AC_MSG_RESULT(no)
 | 
|---|
 | 96 | #fi
 | 
|---|
 | 97 | 
 | 
|---|
 | 98 | #AC_MSG_CHECKING(whether to enable serialization)
 | 
|---|
 | 99 | #default="no"
 | 
|---|
 | 100 | #AC_ARG_ENABLE(debug, [  --enable-serialization=[no/yes] turn on serialization support
 | 
|---|
 | 101 | #                       [default=$default]],, enable_serialization=$default)
 | 
|---|
 | 102 | #if test "x$enable_serialization" = "xyes"; then
 | 
|---|
 | 103 | #  CXXFLAGS="$CXXFLAGS -DSERIALIZATION"
 | 
|---|
 | 104 | #  serialization=yes;
 | 
|---|
 | 105 | #  AC_MSG_RESULT(yes)
 | 
|---|
 | 106 | #else
 | 
|---|
 | 107 | #  serialization=no;
 | 
|---|
 | 108 | #  AC_MSG_RESULT(no)
 | 
|---|
 | 109 | #fi
 | 
|---|
 | 110 | 
 | 
|---|
| [14de469] | 111 | # Checks for libraries.
 | 
|---|
| [861874] | 112 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
 | 
|---|
| [14de469] | 113 | 
 | 
|---|
| [fa861b] | 114 | # Boost libraries
 | 
|---|
| [79de12] | 115 | BOOST_REQUIRE([1.40])
 | 
|---|
 | 116 | BOOST_EXCEPTION
 | 
|---|
 | 117 | BOOST_FILESYSTEM
 | 
|---|
 | 118 | BOOST_PROGRAM_OPTIONS
 | 
|---|
 | 119 | BOOST_RANDOM
 | 
|---|
 | 120 | BOOST_THREADS
 | 
|---|
| [fa861b] | 121 | 
 | 
|---|
| [3027f8] | 122 | #QT4 libraries
 | 
|---|
| [060ba4] | 123 | BNV_HAVE_QT
 | 
|---|
 | 124 | #gw_CHECK_QT4
 | 
|---|
 | 125 | #AX_CHECK_GLU
 | 
|---|
| [dc031c] | 126 | #AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
 | 
|---|
| [cef1d7] | 127 | 
 | 
|---|
| [7188b1] | 128 | # CodePatterns library (needs Observer::Channels ) 
 | 
|---|
 | 129 | AM_PATH_CODEPATTERNS([1.1.5], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
 | 
|---|
| [3027f8] | 130 | 
 | 
|---|
| [14de469] | 131 | # Checks for header files.
 | 
|---|
 | 132 | AC_HEADER_STDC
 | 
|---|
 | 133 | AC_CHECK_HEADERS([sys/time.h])
 | 
|---|
 | 134 | AC_HEADER_STDBOOL
 | 
|---|
 | 135 | 
 | 
|---|
| [d3a46d] | 136 | AC_FUNC_MALLOC
 | 
|---|
 | 137 | AC_FUNC_REALLOC
 | 
|---|
 | 138 | AC_CHECK_FUNCS([floor pow sqrt strchr])
 | 
|---|
 | 139 | 
 | 
|---|
| [14de469] | 140 | # Checks for typedefs, structures, and compiler characteristics.
 | 
|---|
 | 141 | AC_C_CONST
 | 
|---|
 | 142 | AC_C_INLINE
 | 
|---|
 | 143 | AC_C_RESTRICT
 | 
|---|
 | 144 | AC_TYPE_SIZE_T
 | 
|---|
 | 145 | 
 | 
|---|
 | 146 | # Checks for library functions.
 | 
|---|
 | 147 | # check for GNU Scientific Library
 | 
|---|
| [bd3e55] | 148 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
 | 
|---|
 | 149 | AC_SEARCH_LIBS(dnrm2, goto blas cblas gslblas gslcblas)
 | 
|---|
 | 150 | AC_CHECK_LIB(gsl, main, [], 
 | 
|---|
 | 151 |         [AC_SEARCH_LIBS(cblas_dnrm2, blas cblas gslblas gslcblas)])
 | 
|---|
 | 152 | AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
 | 
|---|
| [14de469] | 153 | 
 | 
|---|
 | 154 | # add replacement/saturation hydrogen or not 
 | 
|---|
 | 155 | AC_ARG_ENABLE([hydrogen],AS_HELP_STRING([--enable-hydrogen],[Adding saturation hydrogen (default is yes)]),
 | 
|---|
 | 156 |               [enable_hydrogen=$enableval], [enable_hydrogen=yes])
 | 
|---|
 | 157 | if test x"$enable_hydrogen" = xyes; then
 | 
|---|
 | 158 |   AC_DEFINE(ADDHYDROGEN,1, ["Adding saturation hydrogen"])
 | 
|---|
 | 159 |   AC_SUBST(ADDHYDROGEN)
 | 
|---|
 | 160 | fi
 | 
|---|
 | 161 | 
 | 
|---|
| [490038] | 162 | # use CppUnit TestRunner or not
 | 
|---|
| [6ac15b] | 163 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]),
 | 
|---|
 | 164 |               [enable_ecut=$enableval], [enable_ecut=no])
 | 
|---|
| [9b6b2f] | 165 | if test x"$enable_ecut" = xyes; then
 | 
|---|
 | 166 |   AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
 | 
|---|
 | 167 |   AC_SUBST(HAVE_ECUT)
 | 
|---|
 | 168 | fi
 | 
|---|
 | 169 | 
 | 
|---|
| [490038] | 170 | # with valgrinding testsuite or not
 | 
|---|
 | 171 | AC_ARG_WITH([valgrind],AS_HELP_STRING([--with-valgrind],[Use Valgrind on the testsuite (default is no)]),
 | 
|---|
 | 172 |               [with_valgrind=$withval], [with_valgrind=no])
 | 
|---|
 | 173 | if test x"$with_valgrind" = xyes; then
 | 
|---|
 | 174 |   AC_CHECK_HEADER([valgrind/valgrind.h],
 | 
|---|
 | 175 |     [
 | 
|---|
 | 176 |       # check header
 | 
|---|
 | 177 |       AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
 | 
|---|
 | 178 |       # check path
 | 
|---|
 | 179 |       AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
 | 
|---|
 | 180 |       # set variables 
 | 
|---|
 | 181 |       AC_SUBST(HAVE_VALGRIND_TESTSUITE)
 | 
|---|
 | 182 |       AC_SUBST(VALGRIND)
 | 
|---|
 | 183 |     ],
 | 
|---|
 | 184 |     [
 | 
|---|
 | 185 |       AC_MSG_ERROR(["Valgrind support requested but headers not available."])
 | 
|---|
 | 186 |     ]
 | 
|---|
 | 187 |   )
 | 
|---|
 | 188 | fi
 | 
|---|
 | 189 | 
 | 
|---|
| [14de469] | 190 | # Check for "extern inline", using a modified version
 | 
|---|
 | 191 | # of the test for AC_C_INLINE from acspecific.mt
 | 
|---|
 | 192 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
 | 
|---|
 | 193 | [ac_cv_c_extern_inline=no
 | 
|---|
 | 194 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
 | 
|---|
 | 195 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
 | 
|---|
 | 196 | double foo (double x) { return x + 1.0; };], 
 | 
|---|
 | 197 | [  foo(1.0)  ],
 | 
|---|
 | 198 | [ac_cv_c_extern_inline="yes"])
 | 
|---|
 | 199 | ])
 | 
|---|
 | 200 | 
 | 
|---|
 | 201 | if test "$ac_cv_c_inline" != no ; then
 | 
|---|
 | 202 |   AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
 | 
|---|
 | 203 |   AC_SUBST(HAVE_INLINE)
 | 
|---|
 | 204 | fi
 | 
|---|
 | 205 | 
 | 
|---|
| [bd3e55] | 206 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
 | 
|---|
| [a19da5d] | 207 | 
 | 
|---|
| [0ca39c] | 208 | # test suite
 | 
|---|
| [5079a0] | 209 | AC_CONFIG_FILES([
 | 
|---|
| [689639] | 210 |         tests/Makefile])
 | 
|---|
 | 211 | 
 | 
|---|
 | 212 | AC_CONFIG_TESTDIR(tests/CodeChecks)
 | 
|---|
| [d0a719] | 213 | AC_CONFIG_FILES([
 | 
|---|
 | 214 |         tests/CodeChecks/atlocal 
 | 
|---|
 | 215 |         tests/CodeChecks/Makefile])
 | 
|---|
| [689639] | 216 | 
 | 
|---|
| [740d40] | 217 | AC_CONFIG_TESTDIR(tests/Fragmentations)
 | 
|---|
| [038713] | 218 | AC_CONFIG_FILES([
 | 
|---|
| [740d40] | 219 |         tests/Fragmentations/atlocal 
 | 
|---|
 | 220 |         tests/Fragmentations/Makefile])
 | 
|---|
 | 221 | AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder])
 | 
|---|
| [689639] | 222 | 
 | 
|---|
 | 223 | AC_CONFIG_TESTDIR(tests/regression)
 | 
|---|
 | 224 | AC_CONFIG_FILES([
 | 
|---|
 | 225 |         tests/regression/atlocal 
 | 
|---|
 | 226 |         tests/regression/Makefile])
 | 
|---|
 | 227 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
 | 
|---|
 | 228 | 
 | 
|---|
 | 229 | AC_CONFIG_TESTDIR(tests/Tesselations)
 | 
|---|
| [5079a0] | 230 | AC_CONFIG_FILES([
 | 
|---|
| [a85f45] | 231 |         tests/Tesselations/atlocal 
 | 
|---|
 | 232 |         tests/Tesselations/Makefile])
 | 
|---|
 | 233 | AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder])
 | 
|---|
| [689639] | 234 | 
 | 
|---|
| [5079a0] | 235 | AC_CONFIG_FILES([
 | 
|---|
 | 236 |         doc/molecuilder.xml])
 | 
|---|
| [861874] | 237 | AC_CONFIG_FILES([
 | 
|---|
| [acbe1b] | 238 |   MoleCuilder.pc:MoleCuilder.pc.in])
 | 
|---|
| [5079a0] | 239 | AC_CONFIG_FILES([
 | 
|---|
 | 240 |         Makefile 
 | 
|---|
| [ec188c] | 241 |         doc/Makefile
 | 
|---|
| [5079a0] | 242 |         src/Makefile 
 | 
|---|
| [85949a] | 243 | ])
 | 
|---|
 | 244 | AC_CONFIG_FILES([
 | 
|---|
| [455573] | 245 |   src/unittests/Makefile
 | 
|---|
| [85949a] | 246 | ])
 | 
|---|
| [14de469] | 247 | AC_OUTPUT
 | 
|---|