source: ThirdParty/LinearAlgebra/configure.ac@ f01bb3

Candidate_v1.7.0 stable
Last change on this file since f01bb3 was f01bb3, checked in by Frederik Heber <frederik.heber@…>, 5 years ago

CppUnit detected by pkg-config as fallback.

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