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