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