| [bf4b9f] | 1 | #                                               -*- Autoconf -*- | 
|---|
|  | 2 | # Process this file with autoconf to produce a configure script. | 
|---|
|  | 3 |  | 
|---|
|  | 4 | AC_PREREQ(2.59) | 
|---|
| [d08ab3] | 5 | AC_INIT(LinearAlgebra, 1.0.4, [heber@ins.uni-bonn.de], [linearalgebra], [http://trac.ins.uni-bonn.de/projects/molecuilder/]) | 
|---|
| [bf4b9f] | 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 |  | 
|---|
| [dc322a] | 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]) | 
|---|
| [bf4b9f] | 15 |  | 
|---|
|  | 16 | # Checks for programs. | 
|---|
|  | 17 | AC_PROG_CXX | 
|---|
|  | 18 | AC_PROG_CC | 
|---|
|  | 19 | AC_PROG_INSTALL | 
|---|
| [ec188c] | 20 |  | 
|---|
| [0cfc27] | 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 |  | 
|---|
| [ec188c] | 25 | DX_HTML_FEATURE(ON) | 
|---|
|  | 26 | DX_PS_FEATURE(OFF) | 
|---|
|  | 27 | DX_PDF_FEATURE(OFF) | 
|---|
| [3158e6] | 28 | DX_INIT_DOXYGEN(LinearAlgebra, Doxyfile, ${docdir}) | 
|---|
| [bf4b9f] | 29 |  | 
|---|
|  | 30 | LT_INIT([static]) | 
|---|
| [4e8108] | 31 | AC_SUBST([LIBTOOL_DEPS]) | 
|---|
| [bf4b9f] | 32 |  | 
|---|
|  | 33 | # Define these substitions here to keep all version information in one place. | 
|---|
|  | 34 | # For information on how to properly maintain the library version information, | 
|---|
|  | 35 | # refer to the libtool manual, section "Updating library version information": | 
|---|
|  | 36 | # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html | 
|---|
| [31021ab] | 37 | AC_SUBST([LINEARALGEBRA_SO_VERSION], [3:2:0]) | 
|---|
|  | 38 | AC_SUBST([LINEARALGEBRA_API_VERSION], [1.0.5]) | 
|---|
| [bf4b9f] | 39 |  | 
|---|
|  | 40 | dnl this macro is used to get the arguments supplied | 
|---|
|  | 41 | dnl to the configure script (./configure --enable-debug) | 
|---|
|  | 42 | dnl Check if we have enable debug support. | 
|---|
|  | 43 | AC_MSG_CHECKING(whether to enable debugging) | 
|---|
| [f99714] | 44 | have_debug="no" | 
|---|
|  | 45 | AC_ARG_ENABLE( | 
|---|
|  | 46 | [debug], | 
|---|
|  | 47 | AS_HELP_STRING([--enable-debug],[turn on debugging [default=no]]), | 
|---|
|  | 48 | enable_debug=$enableval, | 
|---|
|  | 49 | enable_debug="no") | 
|---|
| [f3b8a5] | 50 | AC_MSG_RESULT($enable_debug) | 
|---|
| [f99714] | 51 | AS_IF([test x"$enable_debug" = x"yes"],[ | 
|---|
| [bf4b9f] | 52 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) | 
|---|
|  | 53 | AC_DEFINE(HAVE_DEBUG,1, ["Use debug setting to compile code."]) | 
|---|
| [f99714] | 54 | have_debug="yes" | 
|---|
|  | 55 | ],[ | 
|---|
|  | 56 | AS_IF([test x"$enable_debug" = x"full"],[ | 
|---|
|  | 57 | AC_DEFINE(MEMDEBUG,1, ["Use memory debugger."]) | 
|---|
|  | 58 | AC_DEFINE(LOG_OBSERVER,1, ["Use observer log."]) | 
|---|
|  | 59 | AC_DEFINE(HAVE_DEBUG,2, ["Use debug setting to compile code."]) | 
|---|
|  | 60 | AC_DEFINE(QT_DEBUG,, ["Enable Qt debug messages."]) | 
|---|
|  | 61 | have_debug="full" | 
|---|
|  | 62 | ],[ | 
|---|
|  | 63 | AC_DEFINE(NDEBUG,1, ["Don't compile in debugging code."]) | 
|---|
|  | 64 | AC_DEFINE(HAVE_DEBUG,0, ["Use debug setting to compile code."]) | 
|---|
|  | 65 | AC_DEFINE(QT_NO_DEBUG,, ["Disable Qt debug messages."]) | 
|---|
|  | 66 | have_debug="no" | 
|---|
|  | 67 | ]) | 
|---|
|  | 68 | ]) | 
|---|
| [bf4b9f] | 69 | AC_SUBST(HAVE_DEBUG) | 
|---|
|  | 70 |  | 
|---|
|  | 71 | dnl this macro is used to get the arguments supplied | 
|---|
|  | 72 | dnl to the configure script (./configure --enable-debug) | 
|---|
|  | 73 | dnl Check if we have enable debug support. | 
|---|
| [f99714] | 74 | AC_MSG_CHECKING(whether to enable internal caching/lazy evaluation) | 
|---|
|  | 75 | AC_ARG_ENABLE( | 
|---|
|  | 76 | [cache], | 
|---|
|  | 77 | AS_HELP_STRING([--enable-cache],[turn on internal lazy evaluation [default=yes]]), | 
|---|
|  | 78 | enable_cache=$enableval, | 
|---|
|  | 79 | enable_cache="yes") | 
|---|
| [f3b8a5] | 80 | AC_MSG_RESULT($enable_cache) | 
|---|
| [f99714] | 81 | AS_IF([test x"$enable_cache" != x"no"],[ | 
|---|
|  | 82 | AC_DEFINE(HAVE_CACHE,1, ["cache variables to speed up the code."]) | 
|---|
|  | 83 | ],[ | 
|---|
| [bf4b9f] | 84 | AC_DEFINE(NO_CACHING,1, ["Don't use caching code."]) | 
|---|
|  | 85 | AC_DEFINE(HAVE_CACHE,0, ["cache variables to speed up the code."]) | 
|---|
| [f99714] | 86 | ]) | 
|---|
| [bf4b9f] | 87 | AC_SUBST(HAVE_CACHE) | 
|---|
|  | 88 |  | 
|---|
|  | 89 | # Checks for libraries. | 
|---|
|  | 90 | AC_CHECK_LIB(m, sqrt, , AC_MSG_ERROR([compatible libc math library not found])) | 
|---|
|  | 91 |  | 
|---|
| [c2e567] | 92 | # CodePatterns library (serialization header before MemDebug.hpp ) | 
|---|
| [26dc12] | 93 | AM_PATH_CODEPATTERNS([1.3.2], $have_debug,,[ | 
|---|
|  | 94 | # compile from ThirdParty | 
|---|
|  | 95 | #AC_DEFINE(COMPILE_CODEPATTERNS,1, ["compile internal codepatterns library."]) | 
|---|
|  | 96 | [CodePatterns_LDFLAGS='-L$(top_builddir)/../CodePatterns/src'] | 
|---|
|  | 97 | [CodePatterns_CFLAGS='-I$(top_srcdir)/../CodePatterns/src'] | 
|---|
|  | 98 | AS_IF([test x"$enable_debug" != x"no"], [ | 
|---|
|  | 99 | [CodePatterns_LIBS='-lcodepatterns-debug'] | 
|---|
|  | 100 | ],[ | 
|---|
|  | 101 | [CodePatterns_LIBS='-lcodepatterns'] | 
|---|
|  | 102 | ]) | 
|---|
|  | 103 | AC_SUBST(CodePatterns_LDFLAGS) | 
|---|
|  | 104 | AC_SUBST(CodePatterns_CFLAGS) | 
|---|
|  | 105 | AC_SUBST(CodePatterns_LIBS) | 
|---|
|  | 106 | #AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...]) | 
|---|
|  | 107 | ]) | 
|---|
| [bf4b9f] | 108 |  | 
|---|
| [29cbe9] | 109 | # boost | 
|---|
| [f08ae7] | 110 | BOOST_REQUIRE([1.40]) | 
|---|
| [29cbe9] | 111 |  | 
|---|
|  | 112 | # boost headers | 
|---|
| [f08ae7] | 113 | BOOST_BIND | 
|---|
|  | 114 | BOOST_EXCEPTION | 
|---|
|  | 115 |  | 
|---|
| [29cbe9] | 116 | # boost libraries | 
|---|
|  | 117 | BOOST_SERIALIZATION | 
|---|
|  | 118 |  | 
|---|
| [bf4b9f] | 119 | # Checks for header files. | 
|---|
|  | 120 | AC_HEADER_STDC | 
|---|
|  | 121 | AC_CHECK_HEADERS([sys/time.h]) | 
|---|
|  | 122 | AC_HEADER_STDBOOL | 
|---|
|  | 123 |  | 
|---|
|  | 124 | AC_FUNC_MALLOC | 
|---|
|  | 125 | AC_FUNC_REALLOC | 
|---|
|  | 126 | AC_CHECK_FUNCS([floor pow sqrt strchr]) | 
|---|
|  | 127 |  | 
|---|
|  | 128 | # Checks for typedefs, structures, and compiler characteristics. | 
|---|
|  | 129 | AC_C_CONST | 
|---|
|  | 130 | AC_C_INLINE | 
|---|
|  | 131 | AC_C_RESTRICT | 
|---|
|  | 132 | AC_TYPE_SIZE_T | 
|---|
|  | 133 |  | 
|---|
|  | 134 | # Checks for library functions. | 
|---|
|  | 135 | # check for GNU Scientific Library | 
|---|
|  | 136 | AC_CHECK_HEADERS([gsl/gsl_blas.h]) | 
|---|
| [db1a72] | 137 | AC_SEARCH_LIBS(dnrm2, gslblas gslcblas goto blas cblas) | 
|---|
|  | 138 | AC_SEARCH_LIBS(cblas_dnrm2, gslblas gslcblas blas cblas) | 
|---|
|  | 139 | AC_SEARCH_LIBS(gsl_blas_dnrm2,, gsl) | 
|---|
|  | 140 | #AC_CHECK_LIB(gsl, gsl_blas_dnrm2, , [AC_MSG_ERROR(["No working BLAS found for GSL, stopping."])]) | 
|---|
|  | 141 | AC_CHECK_LIB(gsl, main) | 
|---|
| [bf4b9f] | 142 |  | 
|---|
|  | 143 | # use CppUnit TestRunner or not | 
|---|
| [f99714] | 144 | AC_MSG_CHECKING(whether to enable ECut TestRunnerClient) | 
|---|
|  | 145 | AC_ARG_ENABLE( | 
|---|
|  | 146 | [ecut], | 
|---|
|  | 147 | AS_HELP_STRING([--enable-ecut],[Use ECut TestRunnerClient [default=no]]), | 
|---|
|  | 148 | enable_ecut=$disableval, | 
|---|
|  | 149 | enable_ecut="no") | 
|---|
|  | 150 | AC_MSG_RESULT($enable_ecut) | 
|---|
|  | 151 | AS_IF([test x"$enable_ecut" = x"yes"],[ | 
|---|
| [bf4b9f] | 152 | AC_DEFINE(HAVE_ECUT,1, ["Use ECut TestRunnerClient instead of our own."]) | 
|---|
|  | 153 | AC_SUBST(HAVE_ECUT) | 
|---|
| [f99714] | 154 | ]) | 
|---|
| [fbbcde] | 155 | AM_CONDITIONAL([CONDECUT], [test x"$enable_ecut" = x"yes"]) | 
|---|
| [bf4b9f] | 156 |  | 
|---|
|  | 157 | # with valgrinding testsuite or not | 
|---|
| [f3b8a5] | 158 | AC_MSG_CHECKING(whether to enable valgrind memory checking in testsuite) | 
|---|
| [f99714] | 159 | AC_ARG_ENABLE( | 
|---|
|  | 160 | [valgrind], | 
|---|
|  | 161 | AS_HELP_STRING([--enable-valgrind],[Use Valgrind on the testsuite [default=no]]), | 
|---|
|  | 162 | enable_valgrind=$enableval, | 
|---|
|  | 163 | enable_valgrind="no") | 
|---|
|  | 164 | AC_MSG_RESULT($enable_valgrind) | 
|---|
|  | 165 | AS_IF([test x"$enable_valgrind" = x"yes"], [ | 
|---|
| [bf4b9f] | 166 | AC_CHECK_HEADER([valgrind/valgrind.h], | 
|---|
|  | 167 | [ | 
|---|
|  | 168 | # check header | 
|---|
|  | 169 | AC_DEFINE(HAVE_VALGRIND_TESTSUITE,1, ["Use Valgrind to check the testsuite."]) | 
|---|
|  | 170 | # check path | 
|---|
|  | 171 | AC_PATH_PROG(VALGRIND, [valgrind], [/bin/false]) | 
|---|
|  | 172 | # set variables | 
|---|
|  | 173 | AC_SUBST(HAVE_VALGRIND_TESTSUITE) | 
|---|
|  | 174 | AC_SUBST(VALGRIND) | 
|---|
|  | 175 | ], | 
|---|
|  | 176 | [ | 
|---|
|  | 177 | AC_MSG_ERROR(["Valgrind support requested but headers not available."]) | 
|---|
|  | 178 | ] | 
|---|
|  | 179 | ) | 
|---|
| [f3b8a5] | 180 | ]) | 
|---|
| [bf4b9f] | 181 |  | 
|---|
|  | 182 | # Check for "extern inline", using a modified version | 
|---|
|  | 183 | # of the test for AC_C_INLINE from acspecific.mt | 
|---|
|  | 184 | AC_CACHE_CHECK([for extern inline], ac_cv_c_extern_inline, | 
|---|
|  | 185 | [ac_cv_c_extern_inline=no | 
|---|
|  | 186 | AC_TRY_COMPILE([extern $ac_cv_c_inline double foo(double x); | 
|---|
|  | 187 | extern $ac_cv_c_inline double foo(double x) { return x+1.0; }; | 
|---|
|  | 188 | double foo (double x) { return x + 1.0; };], | 
|---|
|  | 189 | [  foo(1.0)  ], | 
|---|
|  | 190 | [ac_cv_c_extern_inline="yes"]) | 
|---|
|  | 191 | ]) | 
|---|
|  | 192 |  | 
|---|
|  | 193 | if test "$ac_cv_c_inline" != no ; then | 
|---|
|  | 194 | AC_DEFINE(HAVE_INLINE,1, ["May use inline routines"]) | 
|---|
|  | 195 | AC_SUBST(HAVE_INLINE) | 
|---|
|  | 196 | fi | 
|---|
|  | 197 |  | 
|---|
|  | 198 | #AC_MSG_NOTICE(["CFLAGS: $CFLAGS, CXXFLAGS: $CXXFLAGS, LDFLAGS: $LDFLAGS, CC: $CC, CXX:, $CXX, MPICC: $MPICC, MPILIBS: $MPILIBS, LIBS: $LIBS"]) | 
|---|
|  | 199 |  | 
|---|
|  | 200 | # test suite | 
|---|
| [689639] | 201 | AC_CONFIG_TESTDIR(tests/CodeChecks) | 
|---|
| [bf4b9f] | 202 | AC_CONFIG_FILES([ | 
|---|
|  | 203 | tests/CodeChecks/atlocal | 
|---|
|  | 204 | tests/CodeChecks/Makefile]) | 
|---|
| [689639] | 205 |  | 
|---|
| [bf4b9f] | 206 | AC_CONFIG_FILES([ | 
|---|
|  | 207 | LinearAlgebra.pc:LinearAlgebra.pc.in | 
|---|
|  | 208 | LinearAlgebra-debug.pc:LinearAlgebra-debug.pc.in]) | 
|---|
| [689639] | 209 |  | 
|---|
| [bf4b9f] | 210 | AC_CONFIG_FILES([ | 
|---|
|  | 211 | Makefile | 
|---|
|  | 212 | doc/Makefile | 
|---|
|  | 213 | src/LinearAlgebra/Makefile | 
|---|
|  | 214 | ]) | 
|---|
| [689639] | 215 |  | 
|---|
| [bf4b9f] | 216 | AC_CONFIG_FILES([ | 
|---|
|  | 217 | src/unittests/Makefile | 
|---|
|  | 218 | ]) | 
|---|
|  | 219 | AC_OUTPUT | 
|---|