| 1 | #                                               -*- Autoconf -*- | 
|---|
| 2 | # Process this file with autoconf to produce a configure script. | 
|---|
| 3 |  | 
|---|
| 4 | AC_PREREQ(2.59) | 
|---|
| 5 | AC_INIT(LinearAlgebra, 1.0.4, [heber@ins.uni-bonn.de], [linearalgebra], [http://trac.ins.uni-bonn.de/projects/molecuilder/]) | 
|---|
| 6 | AC_CONFIG_AUX_DIR([build-aux]) | 
|---|
| 7 | AC_CONFIG_SRCDIR([src/LinearAlgebra/Vector.cpp]) | 
|---|
| 8 | AC_CONFIG_HEADER([config.h libLinearAlgebra_config.h]) | 
|---|
| 9 | AC_CONFIG_MACRO_DIR([m4]) | 
|---|
| 10 |  | 
|---|
| 11 | # parallel-tests: use parallel test druver | 
|---|
| 12 | # color-tests: us coloring to indicate success/failure when available | 
|---|
| 13 | # tar-pax: use newer tar implementation with longer filename (>99 chars) | 
|---|
| 14 | AM_INIT_AUTOMAKE([dist-bzip2 1.11 parallel-tests color-tests tar-pax]) | 
|---|
| 15 |  | 
|---|
| 16 | # Checks for programs. | 
|---|
| 17 | AC_PROG_CXX | 
|---|
| 18 | AC_PROG_CC | 
|---|
| 19 | AC_PROG_INSTALL | 
|---|
| 20 |  | 
|---|
| 21 | # check for cppunit (taken from svn.apache.org/../xmlbeanscxx) | 
|---|
| 22 | AM_PATH_CPPUNIT(1.9.6) | 
|---|
| 23 | AM_CONDITIONAL(CONDCPPUNIT, test "$CPPUNIT_LIBS") | 
|---|
| 24 |  | 
|---|
| 25 | DX_HTML_FEATURE(ON) | 
|---|
| 26 | DX_PS_FEATURE(OFF) | 
|---|
| 27 | DX_PDF_FEATURE(OFF) | 
|---|
| 28 | DX_INIT_DOXYGEN(LinearAlgebra, Doxyfile, ${docdir}) | 
|---|
| 29 |  | 
|---|
| 30 | LT_INIT([static]) | 
|---|
| 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 | 
|---|
| 36 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [3:2:0]) | 
|---|
| 37 | AC_SUBST([LINEARALGEBRA_API_VERSION], [1.0.5]) | 
|---|
| 38 |  | 
|---|
| 39 | dnl this macro is used to get the arguments supplied | 
|---|
| 40 | dnl to the configure script (./configure --enable-debug) | 
|---|
| 41 | dnl Check if we have enable debug support. | 
|---|
| 42 | AC_MSG_CHECKING(whether to enable debugging) | 
|---|
| 43 | have_debug="no" | 
|---|
| 44 | AC_ARG_ENABLE( | 
|---|
| 45 | [debug], | 
|---|
| 46 | AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]), | 
|---|
| 47 | enable_debug=$enableval, | 
|---|
| 48 | enable_debug="no") | 
|---|
| 49 | AC_MSG_RESULT($enable_debug) | 
|---|
| 50 | AS_IF([test x"$enable_debug" = x"yes"],[ | 
|---|
| 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 | ],[ | 
|---|
| 55 | AS_IF([test x"$enable_debug" = x"full"],[ | 
|---|
| 56 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) | 
|---|
| 57 | AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."]) | 
|---|
| 58 | AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."]) | 
|---|
| 59 | AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."]) | 
|---|
| 60 | have_debug="full" | 
|---|
| 61 | ],[ | 
|---|
| 62 | AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."]) | 
|---|
| 63 | AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."]) | 
|---|
| 64 | AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."]) | 
|---|
| 65 | have_debug="no" | 
|---|
| 66 | ]) | 
|---|
| 67 | ]) | 
|---|
| 68 | AC_SUBST(HAVE_DEBUG) | 
|---|
| 69 |  | 
|---|
| 70 | dnl this macro is used to get the arguments supplied | 
|---|
| 71 | dnl to the configure script (./configure --enable-debug) | 
|---|
| 72 | dnl Check if we have enable debug support. | 
|---|
| 73 | AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation) | 
|---|
| 74 | AC_ARG_ENABLE( | 
|---|
| 75 | [cache], | 
|---|
| 76 | AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]), | 
|---|
| 77 | enable_cache=$enableval, | 
|---|
| 78 | enable_cache="yes") | 
|---|
| 79 | AC_MSG_RESULT($enable_cache) | 
|---|
| 80 | AS_IF([test x"$enable_cache" != x"no"],[ | 
|---|
| 81 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."]) | 
|---|
| 82 | ],[ | 
|---|
| 83 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."]) | 
|---|
| 84 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."]) | 
|---|
| 85 | ]) | 
|---|
| 86 | AC_SUBST(HAVE_CACHE) | 
|---|
| 87 |  | 
|---|
| 88 | # Checks for libraries. | 
|---|
| 89 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) | 
|---|
| 90 |  | 
|---|
| 91 | # CodePatterns library (serialization header before MemDebug.hpp ) | 
|---|
| 92 | AM_PATH_CODEPATTERNS([1.1.5], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])]) | 
|---|
| 93 |  | 
|---|
| 94 | # boost | 
|---|
| 95 | BOOST_REQUIRE([1.40]) | 
|---|
| 96 |  | 
|---|
| 97 | # boost headers | 
|---|
| 98 | BOOST_BIND | 
|---|
| 99 | BOOST_EXCEPTION | 
|---|
| 100 |  | 
|---|
| 101 | # boost libraries | 
|---|
| 102 | BOOST_SERIALIZATION | 
|---|
| 103 |  | 
|---|
| 104 | # Checks for header files. | 
|---|
| 105 | AC_HEADER_STDC | 
|---|
| 106 | AC_CHECK_HEADERS([sys/time.h]) | 
|---|
| 107 | AC_HEADER_STDBOOL | 
|---|
| 108 |  | 
|---|
| 109 | AC_FUNC_MALLOC | 
|---|
| 110 | AC_FUNC_REALLOC | 
|---|
| 111 | AC_CHECK_FUNCS([floor pow sqrt strchr]) | 
|---|
| 112 |  | 
|---|
| 113 | # Checks for typedefs, structures, and compiler characteristics. | 
|---|
| 114 | AC_C_CONST | 
|---|
| 115 | AC_C_INLINE | 
|---|
| 116 | AC_C_RESTRICT | 
|---|
| 117 | AC_TYPE_SIZE_T | 
|---|
| 118 |  | 
|---|
| 119 | # Checks for library functions. | 
|---|
| 120 | # check for GNU Scientific Library | 
|---|
| 121 | AC_CHECK_HEADERS([gsl/gsl_blas.h]) | 
|---|
| 122 | AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas) | 
|---|
| 123 | AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas) | 
|---|
| 124 | AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl) | 
|---|
| 125 | #AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])]) | 
|---|
| 126 | AC_CHECK_LIB(gsl, main) | 
|---|
| 127 |  | 
|---|
| 128 | # use CppUnit TestRunner or not | 
|---|
| 129 | AC_MSG_CHECKING(whether to enable ECut TestRunnerClient) | 
|---|
| 130 | AC_ARG_ENABLE( | 
|---|
| 131 | [ecut], | 
|---|
| 132 | AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]), | 
|---|
| 133 | enable_ecut=$disableval, | 
|---|
| 134 | enable_ecut="no") | 
|---|
| 135 | AC_MSG_RESULT($enable_ecut) | 
|---|
| 136 | AS_IF([test x"$enable_ecut" = x"yes"],[ | 
|---|
| 137 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."]) | 
|---|
| 138 | AC_SUBST(HAVE_ECUT) | 
|---|
| 139 | ]) | 
|---|
| 140 | AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"]) | 
|---|
| 141 |  | 
|---|
| 142 | # with valgrinding testsuite or not | 
|---|
| 143 | AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite) | 
|---|
| 144 | AC_ARG_ENABLE( | 
|---|
| 145 | [valgrind], | 
|---|
| 146 | AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]), | 
|---|
| 147 | enable_valgrind=$enableval, | 
|---|
| 148 | enable_valgrind="no") | 
|---|
| 149 | AC_MSG_RESULT($enable_valgrind) | 
|---|
| 150 | AS_IF([test x"$enable_valgrind" = x"yes"], [ | 
|---|
| 151 | AC_CHECK_HEADER([valgrind/valgrind.h], | 
|---|
| 152 | [ | 
|---|
| 153 | # check header | 
|---|
| 154 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."]) | 
|---|
| 155 | # check path | 
|---|
| 156 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false]) | 
|---|
| 157 | # set variables | 
|---|
| 158 | AC_SUBST(HAVE_VALGRIND_TESTSUITE) | 
|---|
| 159 | AC_SUBST(VALGRIND) | 
|---|
| 160 | ], | 
|---|
| 161 | [ | 
|---|
| 162 | AC_MSG_ERROR(["Valgrind support requested but headers not available."]) | 
|---|
| 163 | ] | 
|---|
| 164 | ) | 
|---|
| 165 | ]) | 
|---|
| 166 |  | 
|---|
| 167 | # Check for "extern inline", using a modified version | 
|---|
| 168 | # of the test for AC_C_INLINE from acspecific.mt | 
|---|
| 169 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, | 
|---|
| 170 | [ac_cv_c_extern_inline=no | 
|---|
| 171 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); | 
|---|
| 172 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; }; | 
|---|
| 173 | double foo (double x) { return x + 1.0; };], | 
|---|
| 174 | [  foo(1.0)  ], | 
|---|
| 175 | [ac_cv_c_extern_inline="yes"]) | 
|---|
| 176 | ]) | 
|---|
| 177 |  | 
|---|
| 178 | if test "$ac_cv_c_inline" != no ; then | 
|---|
| 179 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"]) | 
|---|
| 180 | AC_SUBST(HAVE_INLINE) | 
|---|
| 181 | fi | 
|---|
| 182 |  | 
|---|
| 183 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"]) | 
|---|
| 184 |  | 
|---|
| 185 | # test suite | 
|---|
| 186 | AC_CONFIG_TESTDIR(tests/CodeChecks) | 
|---|
| 187 | AC_CONFIG_FILES([ | 
|---|
| 188 | tests/CodeChecks/atlocal | 
|---|
| 189 | tests/CodeChecks/Makefile]) | 
|---|
| 190 |  | 
|---|
| 191 | AC_CONFIG_FILES([ | 
|---|
| 192 | LinearAlgebra.pc:LinearAlgebra.pc.in | 
|---|
| 193 | LinearAlgebra-debug.pc:LinearAlgebra-debug.pc.in]) | 
|---|
| 194 |  | 
|---|
| 195 | AC_CONFIG_FILES([ | 
|---|
| 196 | Makefile | 
|---|
| 197 | doc/Makefile | 
|---|
| 198 | src/LinearAlgebra/Makefile | 
|---|
| 199 | ]) | 
|---|
| 200 |  | 
|---|
| 201 | AC_CONFIG_FILES([ | 
|---|
| 202 | src/unittests/Makefile | 
|---|
| 203 | ]) | 
|---|
| 204 | AC_OUTPUT | 
|---|