| 1 | # -*- Autoconf -*-
|
|---|
| 2 | # Process this file with autoconf to produce a configure script.
|
|---|
| 3 |
|
|---|
| 4 | AC_PREREQ(2.59)
|
|---|
| 5 | AC_INIT(MoleCuilder, 1.2.0, [heber@ins.uni-bonn.de], [molecuilder], [http://trac.ins.uni-bonn.de/projects/molecuilder/])
|
|---|
| 6 | AC_CONFIG_AUX_DIR([build-aux])
|
|---|
| 7 | AC_CONFIG_SRCDIR([src/builder.cpp])
|
|---|
| 8 | AC_CONFIG_HEADER([config.h libmolecuilder_config.h])
|
|---|
| 9 | AC_CONFIG_MACRO_DIR([m4])
|
|---|
| 10 | AC_CONFIG_SUBDIRS([LinearAlgebra])
|
|---|
| 11 |
|
|---|
| 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)
|
|---|
| 15 | AM_INIT_AUTOMAKE([dist-bzip2 1.5 parallel-tests color-tests tar-pax])
|
|---|
| 16 |
|
|---|
| 17 | # Checks for programs.
|
|---|
| 18 | AM_PATH_CPPUNIT(1.9.6)
|
|---|
| 19 | AC_PROG_CXX
|
|---|
| 20 | AC_PROG_CC
|
|---|
| 21 | AC_PROG_INSTALL
|
|---|
| 22 |
|
|---|
| 23 | dnl Check if we have enable python
|
|---|
| 24 | # python module
|
|---|
| 25 | AC_MSG_CHECKING(whether to enable python module)
|
|---|
| 26 | AC_ARG_ENABLE(
|
|---|
| 27 | [python],
|
|---|
| 28 | AS_HELP_STRING([--enable-python],[turn on python module [default=yes]]),
|
|---|
| 29 | enable_python=$enableval,
|
|---|
| 30 | enable_python="yes")
|
|---|
| 31 | AC_MSG_RESULT($enable_python)
|
|---|
| 32 | AS_IF([test x"$enable_python" != x"no"],[
|
|---|
| 33 | # Python (for boost::python)
|
|---|
| 34 | AM_PATH_PYTHON([2.2])
|
|---|
| 35 | AX_PYTHON
|
|---|
| 36 | AC_DEFINE(HAVE_PYTHON,1, ["Build python module and scripts."])
|
|---|
| 37 | ])
|
|---|
| 38 | AM_CONDITIONAL([CONDPYTHON], [test x"$enable_python" != x"no"])
|
|---|
| 39 | AC_SUBST(HAVE_PYTHON)
|
|---|
| 40 |
|
|---|
| 41 | dnl Check if we have enable qtgui
|
|---|
| 42 | # Qt programs
|
|---|
| 43 | AC_ARG_WITH(
|
|---|
| 44 | [Qt-bin],
|
|---|
| 45 | [AS_HELP_STRING([--with-Qt-bin], [give path to Qt binaries])],
|
|---|
| 46 | [have_qtgui_path=$withval
|
|---|
| 47 | enable_qtgui="yes"],
|
|---|
| 48 | have_qtgui_path="")
|
|---|
| 49 | AC_MSG_CHECKING(whether to enable Qt-based GUI)
|
|---|
| 50 | AC_ARG_ENABLE(
|
|---|
| 51 | [qtgui],
|
|---|
| 52 | AS_HELP_STRING([--enable-qtgui],[turn on Qt GUI compilation [default=yes]]),
|
|---|
| 53 | enable_qtgui=$enableval,
|
|---|
| 54 | enable_qtgui="yes")
|
|---|
| 55 | AC_MSG_RESULT($enable_qtgui)
|
|---|
| 56 | AS_IF([test x"$enable_qtgui" != x"no"],[
|
|---|
| 57 | AC_PATH_PROGS([QT_MOC],
|
|---|
| 58 | [moc-qt4 moc],
|
|---|
| 59 | [AC_MSG_ERROR(["Qts moc not found, please use --with-Qt-bin."])],
|
|---|
| 60 | [$have_qtgui_path]
|
|---|
| 61 | )
|
|---|
| 62 | AC_PATH_PROGS([QT_UIC],
|
|---|
| 63 | [uic-qt4 uic],
|
|---|
| 64 | [AC_MSG_ERROR(["Qts uic not found, please use --with-Qt-bin."])],
|
|---|
| 65 | [$have_qtgui_path]
|
|---|
| 66 | )
|
|---|
| 67 | PKG_CHECK_MODULES([QT], [QtCore QtGui Qt3D], [
|
|---|
| 68 | ])
|
|---|
| 69 | AC_SUBST([QT_CFLAGS])
|
|---|
| 70 | AC_SUBST([QT_LIBS])
|
|---|
| 71 | AC_DEFINE(HAVE_QTGUI,1, ["Build Qt-based GUI"])
|
|---|
| 72 | ])
|
|---|
| 73 | AM_CONDITIONAL([CONDQTGUI], [test x"$enable_qtgui" != x"no"])
|
|---|
| 74 | AC_SUBST(HAVE_QTGUI)
|
|---|
| 75 |
|
|---|
| 76 | # use doxygen
|
|---|
| 77 | DX_HTML_FEATURE(ON)
|
|---|
| 78 | DX_PS_FEATURE(OFF)
|
|---|
| 79 | DX_PDF_FEATURE(OFF)
|
|---|
| 80 | DX_INIT_DOXYGEN(MoleCuilder, Doxyfile, ${docdir})
|
|---|
| 81 |
|
|---|
| 82 | # use libtool
|
|---|
| 83 | LT_INIT([static])
|
|---|
| 84 |
|
|---|
| 85 | # Define these substitions here to keep all version information in one place.
|
|---|
| 86 | # For information on how to properly maintain the library version information,
|
|---|
| 87 | # refer to the libtool manual, section "Updating library version information":
|
|---|
| 88 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
|---|
| 89 | AC_SUBST([MOLECUILDER_SO_VERSION], [6:0:0])
|
|---|
| 90 | AC_SUBST([MOLECUILDER_API_VERSION], [1.2.0])
|
|---|
| 91 |
|
|---|
| 92 | dnl this macro is used to get the arguments supplied
|
|---|
| 93 | dnl to the configure script (./configure --enable-debug)
|
|---|
| 94 | dnl Check if we have enable debug support.
|
|---|
| 95 | AC_MSG_CHECKING(whether to enable debugging)
|
|---|
| 96 | have_debug="no"
|
|---|
| 97 | AC_ARG_ENABLE(
|
|---|
| 98 | [debug],
|
|---|
| 99 | AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]),
|
|---|
| 100 | enable_debug=$enableval,
|
|---|
| 101 | enable_debug="no")
|
|---|
| 102 | AC_MSG_RESULT($enable_debug)
|
|---|
| 103 | AS_IF([test x"$enable_debug" = x"yes"],[
|
|---|
| 104 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
|---|
| 105 | AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."])
|
|---|
| 106 | have_debug="yes"
|
|---|
| 107 | ],[
|
|---|
| 108 | AS_IF([test x"$enable_debug" = x"full"],[
|
|---|
| 109 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."])
|
|---|
| 110 | AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."])
|
|---|
| 111 | AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."])
|
|---|
| 112 | AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."])
|
|---|
| 113 | have_debug="full"
|
|---|
| 114 | ],[
|
|---|
| 115 | AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."])
|
|---|
| 116 | AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."])
|
|---|
| 117 | AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."])
|
|---|
| 118 | have_debug="no"
|
|---|
| 119 | ])
|
|---|
| 120 | ])
|
|---|
| 121 | AC_SUBST(HAVE_DEBUG)
|
|---|
| 122 |
|
|---|
| 123 | dnl this macro is used to get the arguments supplied
|
|---|
| 124 | dnl to the configure script (./configure --enable-debug)
|
|---|
| 125 | dnl Check if we have enable debug support.
|
|---|
| 126 | AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation)
|
|---|
| 127 | AC_ARG_ENABLE(
|
|---|
| 128 | [cache],
|
|---|
| 129 | AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]),
|
|---|
| 130 | enable_cache=$enableval,
|
|---|
| 131 | enable_cache="yes")
|
|---|
| 132 | AC_MSG_RESULT($enable_cache)
|
|---|
| 133 | AS_IF([test x"$enable_cache" != x"no"],[
|
|---|
| 134 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."])
|
|---|
| 135 | ],[
|
|---|
| 136 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."])
|
|---|
| 137 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."])
|
|---|
| 138 | ])
|
|---|
| 139 | AC_SUBST(HAVE_CACHE)
|
|---|
| 140 |
|
|---|
| 141 | # Checks for libraries.
|
|---|
| 142 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found]))
|
|---|
| 143 |
|
|---|
| 144 | # Boost
|
|---|
| 145 | BOOST_REQUIRE([1.40])
|
|---|
| 146 |
|
|---|
| 147 | # Boost headers only
|
|---|
| 148 | BOOST_ANY
|
|---|
| 149 | BOOST_ARRAY
|
|---|
| 150 | BOOST_BIND
|
|---|
| 151 | BOOST_CONVERSION
|
|---|
| 152 | BOOST_EXCEPTION
|
|---|
| 153 | BOOST_FOREACH
|
|---|
| 154 | BOOST_FUNCTION
|
|---|
| 155 | BOOST_ITERATOR
|
|---|
| 156 | BOOST_MULTIARRAY
|
|---|
| 157 | BOOST_PREPROCESSOR
|
|---|
| 158 | BOOST_RANDOM
|
|---|
| 159 | BOOST_SMART_PTR
|
|---|
| 160 | BOOST_STRING_ALGO
|
|---|
| 161 | BOOST_TOKENIZER
|
|---|
| 162 |
|
|---|
| 163 | # Boost headers with libraries
|
|---|
| 164 | BOOST_FILESYSTEM
|
|---|
| 165 | BOOST_PROGRAM_OPTIONS
|
|---|
| 166 | AS_IF([test x"$enable_python" != x"no"], [BOOST_PYTHON])
|
|---|
| 167 | BOOST_SERIALIZATION
|
|---|
| 168 | BOOST_THREADS
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 | # CodePatterns library (needs Chronos clock time conversion bugfix)
|
|---|
| 172 | AM_PATH_CODEPATTERNS([1.2.1], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
|
|---|
| 173 |
|
|---|
| 174 | # Checks for header files.
|
|---|
| 175 | AC_HEADER_STDC
|
|---|
| 176 | AC_CHECK_HEADERS([sys/time.h])
|
|---|
| 177 | AC_HEADER_STDBOOL
|
|---|
| 178 |
|
|---|
| 179 | AC_FUNC_MALLOC
|
|---|
| 180 | AC_FUNC_REALLOC
|
|---|
| 181 | AC_CHECK_FUNCS([floor pow sqrt strchr])
|
|---|
| 182 |
|
|---|
| 183 | # Checks for typedefs, structures, and compiler characteristics.
|
|---|
| 184 | AC_C_CONST
|
|---|
| 185 | AC_C_INLINE
|
|---|
| 186 | AC_C_RESTRICT
|
|---|
| 187 | AC_TYPE_SIZE_T
|
|---|
| 188 |
|
|---|
| 189 | # Checks for library functions.
|
|---|
| 190 | # check for GNU Scientific Library
|
|---|
| 191 | AC_CHECK_HEADERS([gsl/gsl_blas.h])
|
|---|
| 192 | AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas)
|
|---|
| 193 | AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas)
|
|---|
| 194 | AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl)
|
|---|
| 195 | #AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])])
|
|---|
| 196 | AC_CHECK_LIB(gsl, main)
|
|---|
| 197 |
|
|---|
| 198 | # use CppUnit TestRunner or not
|
|---|
| 199 | AC_MSG_CHECKING(whether to enable ECut TestRunnerClient)
|
|---|
| 200 | AC_ARG_ENABLE(
|
|---|
| 201 | [ecut],
|
|---|
| 202 | AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]),
|
|---|
| 203 | enable_ecut=$disableval,
|
|---|
| 204 | enable_ecut="no")
|
|---|
| 205 | AC_MSG_RESULT($enable_ecut)
|
|---|
| 206 | AS_IF([test x"$enable_ecut" = x"yes"],[
|
|---|
| 207 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."])
|
|---|
| 208 | AC_SUBST(HAVE_ECUT)
|
|---|
| 209 | ])
|
|---|
| 210 |
|
|---|
| 211 | # with valgrinding testsuite or not
|
|---|
| 212 | AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite)
|
|---|
| 213 | AC_ARG_ENABLE(
|
|---|
| 214 | [valgrind],
|
|---|
| 215 | AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]),
|
|---|
| 216 | enable_valgrind=$enableval,
|
|---|
| 217 | enable_valgrind="no")
|
|---|
| 218 | AC_MSG_RESULT($enable_valgrind)
|
|---|
| 219 | AS_IF([test x"$enable_valgrind" = x"yes"], [
|
|---|
| 220 | AC_CHECK_HEADER([valgrind/valgrind.h],
|
|---|
| 221 | [
|
|---|
| 222 | # check header
|
|---|
| 223 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."])
|
|---|
| 224 | # check path
|
|---|
| 225 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false])
|
|---|
| 226 | # set variables
|
|---|
| 227 | AC_SUBST(HAVE_VALGRIND_TESTSUITE)
|
|---|
| 228 | AC_SUBST(VALGRIND)
|
|---|
| 229 | ],
|
|---|
| 230 | [
|
|---|
| 231 | AC_MSG_ERROR(["Valgrind support requested but headers not available."])
|
|---|
| 232 | ]
|
|---|
| 233 | )
|
|---|
| 234 | ])
|
|---|
| 235 |
|
|---|
| 236 | # Check for "extern inline", using a modified version
|
|---|
| 237 | # of the test for AC_C_INLINE from acspecific.mt
|
|---|
| 238 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline,
|
|---|
| 239 | [ac_cv_c_extern_inline=no
|
|---|
| 240 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x);
|
|---|
| 241 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; };
|
|---|
| 242 | double foo (double x) { return x + 1.0; };],
|
|---|
| 243 | [ foo(1.0) ],
|
|---|
| 244 | [ac_cv_c_extern_inline="yes"])
|
|---|
| 245 | ])
|
|---|
| 246 |
|
|---|
| 247 | if test "$ac_cv_c_inline" != no ; then
|
|---|
| 248 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"])
|
|---|
| 249 | AC_SUBST(HAVE_INLINE)
|
|---|
| 250 | fi
|
|---|
| 251 |
|
|---|
| 252 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"])
|
|---|
| 253 |
|
|---|
| 254 | # test suite
|
|---|
| 255 |
|
|---|
| 256 | AC_CONFIG_FILES([
|
|---|
| 257 | tests/Makefile])
|
|---|
| 258 |
|
|---|
| 259 | AC_CONFIG_TESTDIR(tests/CodeChecks)
|
|---|
| 260 | AC_CONFIG_FILES([
|
|---|
| 261 | tests/CodeChecks/atlocal
|
|---|
| 262 | tests/CodeChecks/Makefile])
|
|---|
| 263 |
|
|---|
| 264 | AC_CONFIG_TESTDIR(tests/Fragmentations)
|
|---|
| 265 | AC_CONFIG_FILES([
|
|---|
| 266 | tests/Fragmentations/atlocal
|
|---|
| 267 | tests/Fragmentations/Makefile])
|
|---|
| 268 | AC_CONFIG_FILES([tests/Fragmentations/analyzer], [chmod +x tests/Fragmentations/analyzer])
|
|---|
| 269 | AC_CONFIG_FILES([tests/Fragmentations/joiner], [chmod +x tests/Fragmentations/joiner])
|
|---|
| 270 | AC_CONFIG_FILES([tests/Fragmentations/molecuilder], [chmod +x tests/Fragmentations/molecuilder])
|
|---|
| 271 |
|
|---|
| 272 | AC_CONFIG_TESTDIR(tests/regression)
|
|---|
| 273 | AC_CONFIG_FILES([
|
|---|
| 274 | tests/regression/atlocal
|
|---|
| 275 | tests/regression/Makefile])
|
|---|
| 276 | AC_CONFIG_FILES([tests/regression/molecuilder], [chmod +x tests/regression/molecuilder])
|
|---|
| 277 |
|
|---|
| 278 | AC_CONFIG_TESTDIR(tests/Tesselations)
|
|---|
| 279 | AC_CONFIG_FILES([
|
|---|
| 280 | tests/Tesselations/atlocal
|
|---|
| 281 | tests/Tesselations/Makefile])
|
|---|
| 282 | AC_CONFIG_FILES([tests/Tesselations/molecuilder], [chmod +x tests/Tesselations/molecuilder])
|
|---|
| 283 |
|
|---|
| 284 | AC_CONFIG_FILES([
|
|---|
| 285 | doc/molecuilder.xml])
|
|---|
| 286 | AC_CONFIG_FILES([
|
|---|
| 287 | MoleCuilder.pc:MoleCuilder.pc.in])
|
|---|
| 288 | AC_CONFIG_FILES([
|
|---|
| 289 | Makefile
|
|---|
| 290 | doc/Makefile
|
|---|
| 291 | src/Makefile
|
|---|
| 292 | utils/Makefile
|
|---|
| 293 | ])
|
|---|
| 294 | AC_CONFIG_FILES([
|
|---|
| 295 | src/unittests/Makefile
|
|---|
| 296 | ])
|
|---|
| 297 | # produce python scripts and tests only when python's present
|
|---|
| 298 | AM_COND_IF([CONDPYTHON],[
|
|---|
| 299 | AC_CONFIG_TESTDIR([tests/Python])
|
|---|
| 300 | AC_CONFIG_FILES([utils/boxmaker.py:utils/boxmaker.py.in], [chmod +x utils/boxmaker.py])
|
|---|
| 301 | AC_CONFIG_FILES([utils/python_wrapper:utils/python_wrapper.in], [chmod +x utils/python_wrapper])
|
|---|
| 302 | AC_CONFIG_FILES([tests/Python/run], [chmod +x tests/Python/run])
|
|---|
| 303 | AC_CONFIG_FILES([tests/Python/atlocal])
|
|---|
| 304 | AC_CONFIG_FILES([tests/Python/Makefile])
|
|---|
| 305 | ])
|
|---|
| 306 | AC_OUTPUT
|
|---|