| 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.8, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/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([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], [2:0:0]) | 
|---|
| 32 | AC_SUBST([MOLECUILDER_API_VERSION], [1.0.8]) | 
|---|
| 33 |  | 
|---|
| 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 |  | 
|---|
| 101 | # Checks for libraries. | 
|---|
| 102 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) | 
|---|
| 103 |  | 
|---|
| 104 | # Boost libraries | 
|---|
| 105 | AX_BOOST_BASE([1.40]) | 
|---|
| 106 | AX_BOOST_PROGRAM_OPTIONS | 
|---|
| 107 | AX_BOOST_SYSTEM | 
|---|
| 108 | AX_BOOST_FILESYSTEM | 
|---|
| 109 | AX_BOOST_THREAD | 
|---|
| 110 | #AX_BOOST_SERIALIZATION | 
|---|
| 111 |  | 
|---|
| 112 | #QT4 libraries | 
|---|
| 113 | gw_CHECK_QT4 | 
|---|
| 114 | AX_CHECK_GLU | 
|---|
| 115 | #AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"]) | 
|---|
| 116 |  | 
|---|
| 117 | # CodePatterns library (needs ObservedIterator<> operator==,!= to be const) | 
|---|
| 118 | AM_PATH_CODEPATTERNS([1.0.11], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])]) | 
|---|
| 119 |  | 
|---|
| 120 | # Checks for header files. | 
|---|
| 121 | AC_HEADER_STDC | 
|---|
| 122 | AC_CHECK_HEADERS([sys/time.h]) | 
|---|
| 123 | AC_HEADER_STDBOOL | 
|---|
| 124 |  | 
|---|
| 125 | AC_FUNC_MALLOC | 
|---|
| 126 | AC_FUNC_REALLOC | 
|---|
| 127 | AC_CHECK_FUNCS([floor pow sqrt strchr]) | 
|---|
| 128 |  | 
|---|
| 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 | 
|---|
| 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."])]) | 
|---|
| 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 |  | 
|---|
| 151 | # use CppUnit TestRunner or not | 
|---|
| 152 | AC_ARG_ENABLE([ecut],AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient (default is no)]), | 
|---|
| 153 | [enable_ecut=$enableval], [enable_ecut=no]) | 
|---|
| 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 |  | 
|---|
| 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 |  | 
|---|
| 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 |  | 
|---|
| 195 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"]) | 
|---|
| 196 |  | 
|---|
| 197 | # test suite | 
|---|
| 198 | AC_CONFIG_TESTDIR(tests/regression) | 
|---|
| 199 | AC_CONFIG_FILES([ | 
|---|
| 200 | tests/Makefile | 
|---|
| 201 | tests/regression/atlocal | 
|---|
| 202 | tests/regression/Makefile]) | 
|---|
| 203 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder]) | 
|---|
| 204 | AC_CONFIG_FILES([ | 
|---|
| 205 | tests/CodeChecks/atlocal | 
|---|
| 206 | tests/CodeChecks/Makefile]) | 
|---|
| 207 | AC_CONFIG_FILES([ | 
|---|
| 208 | tests/Fragmentations/Makefile | 
|---|
| 209 | tests/Fragmentations/defs]) | 
|---|
| 210 | AC_CONFIG_FILES([ | 
|---|
| 211 | tests/Tesselations/Makefile | 
|---|
| 212 | tests/Tesselations/defs]) | 
|---|
| 213 | AC_CONFIG_FILES([ | 
|---|
| 214 | doc/molecuilder.xml]) | 
|---|
| 215 | AC_CONFIG_FILES([ | 
|---|
| 216 | MoleCuilder.pc:MoleCuilder.pc.in]) | 
|---|
| 217 | AC_CONFIG_FILES([ | 
|---|
| 218 | Makefile | 
|---|
| 219 | doc/Makefile | 
|---|
| 220 | src/Makefile | 
|---|
| 221 | src/Actions/Makefile | 
|---|
| 222 | src/Exceptions/Makefile | 
|---|
| 223 | src/LinearAlgebra/Makefile | 
|---|
| 224 | src/Parser/Makefile | 
|---|
| 225 | src/RandomNumbers/Makefile | 
|---|
| 226 | src/Shapes/Makefile | 
|---|
| 227 | src/UIElements/Makefile | 
|---|
| 228 | ]) | 
|---|
| 229 | AC_CONFIG_FILES([ | 
|---|
| 230 | src/unittests/Makefile | 
|---|
| 231 | src/Actions/unittests/Makefile | 
|---|
| 232 | src/Descriptors/unittests/Makefile | 
|---|
| 233 | src/LinearAlgebra/unittests/Makefile | 
|---|
| 234 | src/Parser/unittests/Makefile | 
|---|
| 235 | src/RandomNumbers/unittests/Makefile | 
|---|
| 236 | src/Shapes/unittests/Makefile | 
|---|
| 237 | src/UIElements/Menu/unittests/Makefile | 
|---|
| 238 | ]) | 
|---|
| 239 | AC_OUTPUT | 
|---|