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