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