aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac349
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
6AC_PREREQ([2.69])
7AC_INIT([anastasis], [0.0.0], [taler-bug@gnu.org])
8AC_CONFIG_SRCDIR([src/backend/anastasis-httpd.c])
9AC_CONFIG_HEADERS([anastasis_config.h])
10# support for non-recursive builds
11AM_INIT_AUTOMAKE([subdir-objects 1.9 tar-pax])
12
13# pretty build rules
14AM_SILENT_RULES([yes])
15
16AC_CONFIG_MACRO_DIR([m4])
17
18AC_PROG_AWK
19AC_PROG_CC_C99
20AC_PROG_OBJC
21AC_PROG_INSTALL
22AC_PROG_LN_S
23AC_PROG_MAKE_SET
24AM_PROG_CC_C_O
25
26LT_INIT([disable-static dlopen])
27
28DX_INIT_DOXYGEN([anastasis],,,
29DX_PS_FEATURE(OFF),
30DX_PDF_FEATURE(OFF),
31DX_RTF_FEATURE(OFF),
32DX_CHI_FEATURE(OFF),
33DX_XML_FEATURE(OFF))
34
35AC_MSG_CHECKING([whether to compile documentation ONLY])
36AC_ARG_ENABLE([only-doc],
37 [AS_HELP_STRING([--enable-only-doc], [only compile Taler documentation])],
38 [doc_only=${enableval}],
39 [doc_only=no])
40AC_MSG_RESULT($doc_only)
41AM_CONDITIONAL([DOC_ONLY], [test "$doc_only" = "yes"])
42
43
44# Not indented as it covers most of the file...
45AS_IF([test "x$doc_only" != xyes],[
46
47
48# Checks for programs.
49AC_PROG_CC
50AC_PROG_CC_C99
51
52# check for gettext
53AM_GNU_GETTEXT([external])
54AM_GNU_GETTEXT_VERSION([0.19.8])
55
56
57CFLAGS="-Wall $CFLAGS"
58
59# Checks for header files.
60AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h])
61
62ANASTASIS_LIB_LDFLAGS="-export-dynamic -no-undefined"
63ANASTASIS_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
64
65AC_SUBST(TALER_LIB_LDFLAGS)
66AC_SUBST(TALER_PLUGIN_LDFLAGS)
67
68
69# check for libgnurl
70# libgnurl
71LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
72AS_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
80LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
81AS_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).
99AC_CHECK_HEADERS([curl/curl.h],,
100 curl=false
101 AC_CHECK_HEADERS([gnurl/curl.h],,
102 gnurl=false))
103
104# libgnurl
105AS_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
110AS_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
118AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
119AC_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])
124AC_MSG_RESULT($use_gcov)
125AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
126
127
128# Check for GNUnet's libgnunetutil.
129libgnunetutil=0
130AC_MSG_CHECKING([for libgnunetutil])
131AC_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])
136AS_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"])
141AC_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])
149AS_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
159AX_LIB_POSTGRESQL([9.3])
160AS_IF([test "x$found_postgresql" = "xyes"],[postgres=true])
161AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
162
163
164
165
166# Check for Taler's libtalerutil
167libtalerutil=0
168AC_MSG_CHECKING([for libtalerutil])
169AC_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])
174AS_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
180CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
181LDFLAGS="$LDFLAGS -L/usr/local/lib"
182
183AC_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
192libtalermerchant=0
193AC_MSG_CHECKING([for libtalermerchant])
194AC_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])
199AS_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
205AC_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
217microhttpd=0
218AC_MSG_CHECKING([for microhttpd])
219AC_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])
224AS_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"])
229AC_CHECK_LIB(microhttpd,MHD_start_daemon,
230 [AC_CHECK_HEADER([microhttpd.h],[microhttpd=1])])
231AS_IF([test $microhttpd = 0],
232 [AC_MSG_ERROR([[
233***
234*** You need libmicrohttpd to build this program.
235*** ]])])
236
237jansson=0
238PKG_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
248need_libgcrypt_version=1.6.1
249AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], ["$need_libgcrypt_version"],
250 [minimum version of libgcrypt required])
251AM_PATH_LIBGCRYPT([$need_libgcrypt_version])
252
253# logging
254extra_logging=0
255AC_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 ], [])
262AC_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
265AC_PATH_PROG(gitcommand, git)
266AC_MSG_CHECKING(for source being under a VCS)
267git_version=
268AS_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])
272AS_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 ])
281AC_MSG_RESULT($vcs_name)
282
283AC_MSG_CHECKING(VCS version)
284AC_MSG_RESULT($vcs_version)
285AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version])
286
287# Checks for typedefs, structures, and compiler characteristics.
288AC_TYPE_PID_T
289AC_TYPE_SIZE_T
290AC_TYPE_UINT16_T
291AC_TYPE_UINT32_T
292AC_TYPE_UINT64_T
293AC_TYPE_INTMAX_T
294AC_TYPE_UINTMAX_T
295
296# Checks for library functions.
297AC_CHECK_FUNCS([strdup])
298
299
300AC_ARG_ENABLE([[doc]],
301 [AS_HELP_STRING([[--disable-doc]], [do not build any documentation])], ,
302 [enable_doc=yes])
303test "x$enable_doc" = "xno" || enable_doc=yes
304AM_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
310AM_CONDITIONAL([HAVE_POSTGRESQL], [false])
311AM_CONDITIONAL([HAVE_LIBCURL], [false])
312AM_CONDITIONAL([HAVE_LIBGNURL], [false])
313AM_CONDITIONAL([USE_COVERAGE], [false])
314AM_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)?
322AC_MSG_CHECKING(whether to compile experimental code)
323AC_ARG_ENABLE([experimental],
324 [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
325 [enable_experimental=${enableval}],
326 [enable_experimental=no])
327AC_MSG_RESULT($enable_experimental)
328AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
329
330
331AC_CONFIG_FILES([
332Makefile
333contrib/Makefile
334doc/Makefile
335doc/doxygen/Makefile
336po/Makefile.in
337src/Makefile
338src/authorization/Makefile
339src/backend/Makefile
340src/cli/Makefile
341src/include/Makefile
342src/lib/Makefile
343src/util/Makefile
344src/reducer/Makefile
345src/restclient/Makefile
346src/stasis/Makefile
347src/testing/Makefile
348])
349AC_OUTPUT