aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac154
1 files changed, 154 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 00000000..d013ab2e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,154 @@
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.69])
5AC_INIT([taler], [0.0.0], [taler-bug@gnunet.org])
6AC_CONFIG_SRCDIR([src/merchant/merchant.c])
7AC_CONFIG_HEADERS([taler_config.h])
8# support for non-recursive builds
9AM_INIT_AUTOMAKE([subdir-objects])
10
11# pretty build rules
12AM_SILENT_RULES([yes])
13
14AC_CONFIG_MACRO_DIR([m4])
15
16LT_INIT
17
18# Checks for programs.
19AC_PROG_CC
20
21CFLAGS="-Wall $CFLAGS"
22
23# Checks for header files.
24AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h])
25
26# Check for GNUnet's libgnunetutil.
27libgnunetutil=0
28AC_MSG_CHECKING([for libgnunetutil])
29AC_ARG_WITH(gnunet,
30 [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])],
31 [AC_MSG_RESULT([given as $with_gnunet])],
32 [AC_MSG_RESULT(not given)
33 with_gnunet=yes])
34AS_CASE([$with_gnunet],
35 [yes], [],
36 [no], [AC_MSG_ERROR([--with-gnunet is required])],
37 [LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
38 CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
39AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
40 [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)],
41 [], [#ifdef HAVE_GNUNET_PLATFORM_H
42 #include <gnunet/platform.h>
43 #endif])
44AS_IF([test $libgnunetutil != 1],
45 [AC_MSG_ERROR([[
46***
47*** You need libgnunetutil to build this program.
48*** This library is part of GNUnet, available at
49*** https://gnunet.org
50*** ]])])
51
52
53# check for libmicrohttpd
54microhttpd=0
55AC_MSG_CHECKING([for microhttpd])
56AC_ARG_WITH([microhttpd],
57 [AS_HELP_STRING([--with-microhttpd=PFX], [base of microhttpd installation])],
58 [AC_MSG_RESULT([given as $with_microhttpd])],
59 [AC_MSG_RESULT([not given])
60 with_microhttpd=yes])
61AS_CASE([$with_microhttpd],
62 [yes], [],
63 [no], [AC_MSG_ERROR([--with-microhttpd is required])],
64 [LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
65 CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"])
66AC_CHECK_LIB(microhttpd,MHD_start_daemon,
67 [AC_CHECK_HEADER([microhttpd.h],[microhttpd=1])])
68AS_IF([test $microhttpd = 0],
69 [AC_MSG_ERROR([[
70***
71*** You need libmicrohttpd to build this program.
72*** ]])])
73
74
75# check for libpq (postgresql)
76AX_LIB_POSTGRESQL([9.3])
77AS_IF([test ! "$found_postgresql" = "yes"],
78 [AC_MSG_ERROR([[
79***
80*** You need postgresql / libpq to build this program.
81*** ]])])
82
83
84# check for libjansson (Jansson JSON library)
85jansson=0
86AC_MSG_CHECKING([for jansson])
87AC_ARG_WITH([jansson],
88 [AS_HELP_STRING([--with-jansson=PFX], [base of jansson installation])],
89 [AC_MSG_RESULT([given as $with_jansson])],
90 [AC_MSG_RESULT([not given])
91 with_jansson=yes])
92AS_CASE([$with_jansson],
93 [yes], [],
94 [no], [AC_MSG_ERROR([--with-jansson is required])],
95 [LDFLAGS="-L$with_jansson/lib $LDFLAGS"
96 CPPFLAGS="-I$with_jansson/include $CPPFLAGS"])
97AC_CHECK_LIB(jansson,json_pack,
98 [AC_CHECK_HEADER([jansson.h],[jansson=1])])
99AS_IF([test $jansson = 0],
100 [AC_MSG_ERROR([[
101***
102*** You need libjansson to build this program.
103*** ]])])
104
105# check for libgnurl
106LIBGNURL_CHECK_CONFIG([], [7.34.0], [gnurl=1], [gnurl=0])
107if test "$gnurl" = 1
108then
109 AM_CONDITIONAL(HAVE_LIBGNURL, true)
110 AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
111else
112 AM_CONDITIONAL(HAVE_LIBGNURL, false)
113fi
114AS_IF([test $gnurl = 0],
115 [AC_MSG_ERROR([[
116***
117*** You need libgnurl to build this program.
118*** ]])])
119
120# Require minimum libgcrypt version
121need_libgcrypt_version=1.6.1
122AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], ["$need_libgcrypt_version"],
123 [minimum version of libgcrypt required])
124AM_PATH_LIBGCRYPT([$need_libgcrypt_version])
125
126# logging
127extra_logging=0
128AC_ARG_ENABLE([logging],
129 AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose ('yes' is the default)]),
130 [AS_IF([test "x$enableval" = "xyes"], [],
131 [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
132 [test "x$enableval" = "xverbose"], [extra_logging=1]
133 [test "x$enableval" = "xveryverbose"], [extra_logging=2])
134 ], [])
135AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
136
137# Checks for typedefs, structures, and compiler characteristics.
138AC_TYPE_PID_T
139AC_TYPE_SIZE_T
140AC_TYPE_UINT16_T
141AC_TYPE_UINT32_T
142AC_TYPE_UINT64_T
143AC_TYPE_INTMAX_T
144AC_TYPE_UINTMAX_T
145
146# Checks for library functions.
147AC_CHECK_FUNCS([strdup])
148
149AC_CONFIG_FILES([Makefile
150 doc/Makefile
151 src/Makefile
152 src/include/Makefile
153 src/merchant/Makefile])
154AC_OUTPUT