diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 349 |
1 files changed, 349 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..65ae2c8 --- /dev/null +++ b/configure.ac | |||
@@ -0,0 +1,349 @@ | |||
1 | # -*- Autoconf -*- | ||
2 | # Process this file with autoconf to produce a configure script. | ||
3 | # | ||
4 | # This configure file is in the public domain | ||
5 | |||
6 | AC_PREREQ([2.69]) | ||
7 | AC_INIT([anastasis], [0.0.0], [taler-bug@gnu.org]) | ||
8 | AC_CONFIG_SRCDIR([src/backend/anastasis-httpd.c]) | ||
9 | AC_CONFIG_HEADERS([anastasis_config.h]) | ||
10 | # support for non-recursive builds | ||
11 | AM_INIT_AUTOMAKE([subdir-objects 1.9 tar-pax]) | ||
12 | |||
13 | # pretty build rules | ||
14 | AM_SILENT_RULES([yes]) | ||
15 | |||
16 | AC_CONFIG_MACRO_DIR([m4]) | ||
17 | |||
18 | AC_PROG_AWK | ||
19 | AC_PROG_CC_C99 | ||
20 | AC_PROG_OBJC | ||
21 | AC_PROG_INSTALL | ||
22 | AC_PROG_LN_S | ||
23 | AC_PROG_MAKE_SET | ||
24 | AM_PROG_CC_C_O | ||
25 | |||
26 | LT_INIT([disable-static dlopen]) | ||
27 | |||
28 | DX_INIT_DOXYGEN([anastasis],,, | ||
29 | DX_PS_FEATURE(OFF), | ||
30 | DX_PDF_FEATURE(OFF), | ||
31 | DX_RTF_FEATURE(OFF), | ||
32 | DX_CHI_FEATURE(OFF), | ||
33 | DX_XML_FEATURE(OFF)) | ||
34 | |||
35 | AC_MSG_CHECKING([whether to compile documentation ONLY]) | ||
36 | AC_ARG_ENABLE([only-doc], | ||
37 | [AS_HELP_STRING([--enable-only-doc], [only compile Taler documentation])], | ||
38 | [doc_only=${enableval}], | ||
39 | [doc_only=no]) | ||
40 | AC_MSG_RESULT($doc_only) | ||
41 | AM_CONDITIONAL([DOC_ONLY], [test "$doc_only" = "yes"]) | ||
42 | |||
43 | |||
44 | # Not indented as it covers most of the file... | ||
45 | AS_IF([test "x$doc_only" != xyes],[ | ||
46 | |||
47 | |||
48 | # Checks for programs. | ||
49 | AC_PROG_CC | ||
50 | AC_PROG_CC_C99 | ||
51 | |||
52 | # check for gettext | ||
53 | AM_GNU_GETTEXT([external]) | ||
54 | AM_GNU_GETTEXT_VERSION([0.19.8]) | ||
55 | |||
56 | |||
57 | CFLAGS="-Wall $CFLAGS" | ||
58 | |||
59 | # Checks for header files. | ||
60 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) | ||
61 | |||
62 | ANASTASIS_LIB_LDFLAGS="-export-dynamic -no-undefined" | ||
63 | ANASTASIS_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined" | ||
64 | |||
65 | AC_SUBST(TALER_LIB_LDFLAGS) | ||
66 | AC_SUBST(TALER_PLUGIN_LDFLAGS) | ||
67 | |||
68 | |||
69 | # check for libgnurl | ||
70 | # libgnurl | ||
71 | LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0) | ||
72 | AS_IF([test "x$gnurl" = x1],[ | ||
73 | AM_CONDITIONAL(HAVE_LIBGNURL, true) | ||
74 | AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl]) | ||
75 | ],[ | ||
76 | AM_CONDITIONAL(HAVE_LIBGNURL, false) | ||
77 | ]) | ||
78 | |||
79 | # libcurl-gnutls | ||
80 | LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false]) | ||
81 | AS_IF([test "x$curl" = xtrue], | ||
82 | [LDFLAGS="-L$with_libcurl/lib $LDFLAGS" | ||
83 | CPPFLAGS="-I$with_libcurl/include $CPPFLAGS" | ||
84 | AC_CHECK_HEADERS([curl/curl.h], | ||
85 | [AC_CHECK_DECLS(CURLINFO_TLS_SESSION, | ||
86 | [curl=true], | ||
87 | [curl=false], | ||
88 | [[#include <curl/curl.h>]])], | ||
89 | [curl=false]) | ||
90 | # need libcurl-gnutls.so, everything else is not acceptable | ||
91 | AC_CHECK_LIB([curl-gnutls], | ||
92 | [curl_easy_getinfo],, | ||
93 | [curl=false])]) | ||
94 | # cURL must support CURLINFO_TLS_SESSION, version >= 7.34 | ||
95 | |||
96 | # Check for curl/curl.h and gnurl/curl.h so we can use #ifdef | ||
97 | # HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted | ||
98 | # *either* header set). | ||
99 | AC_CHECK_HEADERS([curl/curl.h],, | ||
100 | curl=false | ||
101 | AC_CHECK_HEADERS([gnurl/curl.h],, | ||
102 | gnurl=false)) | ||
103 | |||
104 | # libgnurl | ||
105 | AS_IF([test "x$gnurl" = "x0"], | ||
106 | [AS_IF([test "x$curl" = "x0"], | ||
107 | [AC_MSG_NOTICE([NOTICE: libgnurl not found. taler-bank support will not be compiled.])], | ||
108 | [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])])]) | ||
109 | |||
110 | AS_IF([test x$curl = xfalse], | ||
111 | [AM_CONDITIONAL(HAVE_LIBCURL, false) | ||
112 | AS_IF([test "x$gnurl" = "x0"], | ||
113 | [AC_MSG_WARN([GNU Taler requires libcurl-gnutls >= 7.34])])], | ||
114 | [AM_CONDITIONAL(HAVE_LIBCURL, true) | ||
115 | AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])]) | ||
116 | |||
117 | # gcov compilation | ||
118 | AC_MSG_CHECKING(whether to compile with support for code coverage analysis) | ||
119 | AC_ARG_ENABLE([coverage], | ||
120 | AS_HELP_STRING([--enable-coverage], | ||
121 | [compile the library with code coverage support]), | ||
122 | [use_gcov=${enableval}], | ||
123 | [use_gcov=no]) | ||
124 | AC_MSG_RESULT($use_gcov) | ||
125 | AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"]) | ||
126 | |||
127 | |||
128 | # Check for GNUnet's libgnunetutil. | ||
129 | libgnunetutil=0 | ||
130 | AC_MSG_CHECKING([for libgnunetutil]) | ||
131 | AC_ARG_WITH(gnunet, | ||
132 | [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], | ||
133 | [AC_MSG_RESULT([given as $with_gnunet])], | ||
134 | [AC_MSG_RESULT(not given) | ||
135 | with_gnunet=yes]) | ||
136 | AS_CASE([$with_gnunet], | ||
137 | [yes], [], | ||
138 | [no], [AC_MSG_ERROR([--with-gnunet is required])], | ||
139 | [LDFLAGS="-L$with_gnunet/lib $LDFLAGS" | ||
140 | CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"]) | ||
141 | AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h], | ||
142 | [AC_CHECK_LIB([gnunetutil], | ||
143 | [GNUNET_SCHEDULER_run], | ||
144 | [libgnunetutil=1])], | ||
145 | [], | ||
146 | [#ifdef HAVE_GNUNET_PLATFORM_H | ||
147 | #include <gnunet/platform.h> | ||
148 | #endif]) | ||
149 | AS_IF([test $libgnunetutil != 1], | ||
150 | [AC_MSG_ERROR([[ | ||
151 | *** | ||
152 | *** You need libgnunetutil to build this program. | ||
153 | *** This library is part of GNUnet, available at | ||
154 | *** https://gnunet.org | ||
155 | *** ]])]) | ||
156 | |||
157 | |||
158 | # test for postgres | ||
159 | AX_LIB_POSTGRESQL([9.3]) | ||
160 | AS_IF([test "x$found_postgresql" = "xyes"],[postgres=true]) | ||
161 | AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue) | ||
162 | |||
163 | |||
164 | |||
165 | |||
166 | # Check for Taler's libtalerutil | ||
167 | libtalerutil=0 | ||
168 | AC_MSG_CHECKING([for libtalerutil]) | ||
169 | AC_ARG_WITH(exchange, | ||
170 | [AS_HELP_STRING([--with-exchange=PFX], [base of Taler EXCHANGE installation])], | ||
171 | [AC_MSG_RESULT([given as $with_exchange])], | ||
172 | [AC_MSG_RESULT(not given) | ||
173 | with_exchange=yes]) | ||
174 | AS_CASE([$with_exchange], | ||
175 | [yes], [], | ||
176 | [no], [AC_MSG_ERROR([--with-exchange is required])], | ||
177 | [LDFLAGS="-L$with_exchange/lib $LDFLAGS" | ||
178 | CPPFLAGS="-I$with_exchange/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) | ||
179 | |||
180 | CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS" | ||
181 | LDFLAGS="$LDFLAGS -L/usr/local/lib" | ||
182 | |||
183 | AC_CHECK_HEADERS([taler/taler_util.h], | ||
184 | [AC_CHECK_LIB([talerutil], | ||
185 | [TALER_b2s], | ||
186 | [libtalerutil=1], | ||
187 | [AC_MSG_ERROR([libtalerutil not found])])], | ||
188 | [AC_MSG_ERROR([taler/taler_util.h not found])], | ||
189 | [#include <taler/platform.h>]) | ||
190 | |||
191 | # Check for Taler's libtalermerchant | ||
192 | libtalermerchant=0 | ||
193 | AC_MSG_CHECKING([for libtalermerchant]) | ||
194 | AC_ARG_WITH(merchant, | ||
195 | [AS_HELP_STRING([--with-merchant=PFX], [base of Taler MERCHANT installation])], | ||
196 | [AC_MSG_RESULT([given as $with_merchant])], | ||
197 | [AC_MSG_RESULT(not given) | ||
198 | with_merchant=yes]) | ||
199 | AS_CASE([$with_merchant], | ||
200 | [yes], [], | ||
201 | [no], [AC_MSG_ERROR([--with-merchant is required])], | ||
202 | [LDFLAGS="-L$with_merchant/lib $LDFLAGS" | ||
203 | CPPFLAGS="-I$with_merchant/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) | ||
204 | |||
205 | AC_CHECK_HEADERS([taler/taler_merchant_service.h], | ||
206 | [AC_CHECK_LIB([talermerchant], | ||
207 | [TALER_MERCHANT_parse_pay_uri], | ||
208 | [libtalermerchant=1], | ||
209 | [AC_MSG_ERROR([libtalermerchant not found])])], | ||
210 | [AC_MSG_ERROR([taler/taler_merchant_service.h found])], | ||
211 | [#include <taler/platform.h>]) | ||
212 | |||
213 | |||
214 | |||
215 | |||
216 | # check for libmicrohttpd | ||
217 | microhttpd=0 | ||
218 | AC_MSG_CHECKING([for microhttpd]) | ||
219 | AC_ARG_WITH([microhttpd], | ||
220 | [AS_HELP_STRING([--with-microhttpd=PFX], [base of microhttpd installation])], | ||
221 | [AC_MSG_RESULT([given as $with_microhttpd])], | ||
222 | [AC_MSG_RESULT([not given]) | ||
223 | with_microhttpd=yes]) | ||
224 | AS_CASE([$with_microhttpd], | ||
225 | [yes], [], | ||
226 | [no], [AC_MSG_ERROR([--with-microhttpd is required])], | ||
227 | [LDFLAGS="-L$with_microhttpd/lib $LDFLAGS" | ||
228 | CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"]) | ||
229 | AC_CHECK_LIB(microhttpd,MHD_start_daemon, | ||
230 | [AC_CHECK_HEADER([microhttpd.h],[microhttpd=1])]) | ||
231 | AS_IF([test $microhttpd = 0], | ||
232 | [AC_MSG_ERROR([[ | ||
233 | *** | ||
234 | *** You need libmicrohttpd to build this program. | ||
235 | *** ]])]) | ||
236 | |||
237 | jansson=0 | ||
238 | PKG_CHECK_MODULES([JANSSON], [jansson >= 2.3], | ||
239 | [LDFLAGS="$JANSSON_LIBS $LDFLAGS" | ||
240 | CPPFLAGS="$JANSSON_CFLAGS $CPPFLAGS"], | ||
241 | [AC_MSG_ERROR([[ | ||
242 | *** | ||
243 | *** You need libjansson to build this program. | ||
244 | ***]])]) | ||
245 | |||
246 | |||
247 | # Require minimum libgcrypt version | ||
248 | need_libgcrypt_version=1.6.1 | ||
249 | AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], ["$need_libgcrypt_version"], | ||
250 | [minimum version of libgcrypt required]) | ||
251 | AM_PATH_LIBGCRYPT([$need_libgcrypt_version]) | ||
252 | |||
253 | # logging | ||
254 | extra_logging=0 | ||
255 | AC_ARG_ENABLE([logging], | ||
256 | AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose ('yes' is the default)]), | ||
257 | [AS_IF([test "x$enableval" = "xyes"], [], | ||
258 | [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])], | ||
259 | [test "x$enableval" = "xverbose"], [extra_logging=1] | ||
260 | [test "x$enableval" = "xveryverbose"], [extra_logging=2]) | ||
261 | ], []) | ||
262 | AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise]) | ||
263 | |||
264 | # version info | ||
265 | AC_PATH_PROG(gitcommand, git) | ||
266 | AC_MSG_CHECKING(for source being under a VCS) | ||
267 | git_version= | ||
268 | AS_IF([test ! "X$gitcommand" = "X"], | ||
269 | [ | ||
270 | git_version=$(cd $srcdir ; git rev-list --full-history --all --abbrev-commit | head -n 1 2>/dev/null) | ||
271 | ]) | ||
272 | AS_IF([test "X$git_version" = "X"], | ||
273 | [ | ||
274 | vcs_name="no" | ||
275 | vcs_version="\"release\"" | ||
276 | ], | ||
277 | [ | ||
278 | vcs_name="yes, git-svn" | ||
279 | vcs_version="\"git-$git_version\"" | ||
280 | ]) | ||
281 | AC_MSG_RESULT($vcs_name) | ||
282 | |||
283 | AC_MSG_CHECKING(VCS version) | ||
284 | AC_MSG_RESULT($vcs_version) | ||
285 | AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version]) | ||
286 | |||
287 | # Checks for typedefs, structures, and compiler characteristics. | ||
288 | AC_TYPE_PID_T | ||
289 | AC_TYPE_SIZE_T | ||
290 | AC_TYPE_UINT16_T | ||
291 | AC_TYPE_UINT32_T | ||
292 | AC_TYPE_UINT64_T | ||
293 | AC_TYPE_INTMAX_T | ||
294 | AC_TYPE_UINTMAX_T | ||
295 | |||
296 | # Checks for library functions. | ||
297 | AC_CHECK_FUNCS([strdup]) | ||
298 | |||
299 | |||
300 | AC_ARG_ENABLE([[doc]], | ||
301 | [AS_HELP_STRING([[--disable-doc]], [do not build any documentation])], , | ||
302 | [enable_doc=yes]) | ||
303 | test "x$enable_doc" = "xno" || enable_doc=yes | ||
304 | AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"]) | ||
305 | |||
306 | |||
307 | ],[ # this is about the doc-only if on top of the file | ||
308 | |||
309 | # logic if doc_only is set, make sure conditionals are still defined | ||
310 | AM_CONDITIONAL([HAVE_POSTGRESQL], [false]) | ||
311 | AM_CONDITIONAL([HAVE_LIBCURL], [false]) | ||
312 | AM_CONDITIONAL([HAVE_LIBGNURL], [false]) | ||
313 | AM_CONDITIONAL([USE_COVERAGE], [false]) | ||
314 | AM_CONDITIONAL([ENABLE_DOC], [true]) | ||
315 | |||
316 | |||
317 | # end of 'doc_only' | ||
318 | ]) | ||
319 | |||
320 | |||
321 | # should experimental code be compiled (code that may not yet compile / have passing test cases)? | ||
322 | AC_MSG_CHECKING(whether to compile experimental code) | ||
323 | AC_ARG_ENABLE([experimental], | ||
324 | [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])], | ||
325 | [enable_experimental=${enableval}], | ||
326 | [enable_experimental=no]) | ||
327 | AC_MSG_RESULT($enable_experimental) | ||
328 | AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) | ||
329 | |||
330 | |||
331 | AC_CONFIG_FILES([ | ||
332 | Makefile | ||
333 | contrib/Makefile | ||
334 | doc/Makefile | ||
335 | doc/doxygen/Makefile | ||
336 | po/Makefile.in | ||
337 | src/Makefile | ||
338 | src/authorization/Makefile | ||
339 | src/backend/Makefile | ||
340 | src/cli/Makefile | ||
341 | src/include/Makefile | ||
342 | src/lib/Makefile | ||
343 | src/util/Makefile | ||
344 | src/reducer/Makefile | ||
345 | src/restclient/Makefile | ||
346 | src/stasis/Makefile | ||
347 | src/testing/Makefile | ||
348 | ]) | ||
349 | AC_OUTPUT | ||