bump version requirement for MHD to 0.9.63
[oweals/gnunet.git] / configure.ac
1 # This file is part of GNUnet.
2 # (C) 2001--2019 GNUnet e.V.
3 #
4 # GNUnet is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU Affero General Public License as published
6 # by the Free Software Foundation, either version 3 of the License,
7 # or (at your option) any later version.
8 #
9 # GNUnet is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Affero General Public License for more details.
13 #
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 #
17 # SPDX-License-Identifier: AGPL3.0-or-later
18 #
19 # Process this file with autoconf to produce a configure script.
20 #
21 #
22 AC_PREREQ(2.61)
23 # Checks for programs.
24 AC_INIT([gnunet], [0.11.3], [bug-gnunet@gnu.org])
25 AC_CONFIG_AUX_DIR([build-aux])
26
27 # check for legacy option that is no longer supported (#5627) and fail hard
28 AC_ARG_WITH(nssdir,
29    [  --with-nssdir=DIR    legacy switch, no longer supported, do not use],
30    [AC_MSG_RESULT([$with_nssdir])
31     case $with_nssdir in
32       no)
33         ;;
34       *)
35         AC_MSG_ERROR([--with-nssdir is no longer supported])
36         ;;
37      esac
38    ])
39
40 AC_CANONICAL_TARGET
41 AC_CANONICAL_HOST
42 AC_CANONICAL_SYSTEM
43 AM_INIT_AUTOMAKE
44 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
45 AC_CONFIG_HEADERS([gnunet_config.h])
46 AH_TOP([#define _GNU_SOURCE  1])
47 AC_CONFIG_MACRO_DIR([m4])
48 AC_PROG_AWK
49 AC_PROG_CC_C99
50 AC_PROG_CPP
51 AC_PROG_CXX
52 AC_PROG_OBJC
53 AC_PROG_INSTALL
54 AC_PROG_LN_S
55 AC_PROG_MAKE_SET
56 AM_PROG_CC_C_O
57 LT_INIT([disable-static dlopen win32-dll])
58 AC_SUBST(MKDIR_P)
59
60 # large file support
61 AC_SYS_LARGEFILE
62 AC_FUNC_FSEEKO
63
64
65 CFLAGS="-Wall $CFLAGS"
66 # use '-fno-strict-aliasing', but only if the compiler can take it
67 if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
68 then
69  CFLAGS="-fno-strict-aliasing $CFLAGS"
70 fi
71
72 # Use Linux interface name unless the OS has a different preference
73 DEFAULT_INTERFACE="\"eth0\""
74
75 funcstocheck="getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo getaddrinfo_a"
76
77 # Srcdir in a form that native compiler understands (i.e. DOS path on W32)
78 native_srcdir=$srcdir
79
80 OLD_LDFLAGS="$LDFLAGS"
81 LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all"
82
83 # Check system type
84 case "$host_os" in
85 *darwin* | *rhapsody* | *macosx*)
86      AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system])
87      CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS"
88      CFLAGS="-fno-common $CFLAGS"
89      LDFLAGS="$OLD_LDFLAGS"
90      AC_MSG_WARN([WARNING: The VPN application cannot be compiled on your OS])
91      AC_CHECK_LIB(intl, gettext)
92      build_target="darwin"
93      DEFAULT_INTERFACE="\"en0\""
94      LIBPREFIX=
95      DLLDIR=lib
96      UNIXONLY="#"
97      ;;
98 linux*)
99      AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
100      build_target="linux"
101      LIBPREFIX=
102      DLLDIR=lib
103      UNIXONLY="#"
104      AC_PATH_XTRA
105      ;;
106 *freebsd*)
107      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
108      AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
109      CFLAGS="-D_THREAD_SAFE $CFLAGS"
110      build_target="freebsd"
111      LIBPREFIX=
112      DLLDIR=lib
113      UNIXONLY="#"
114      ;;
115 *openbsd*)
116      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
117      AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
118      LIBS=`echo $LIBS | sed -e "s/-ldl//"`
119      build_target="openbsd"
120      LIBPREFIX=
121      DLLDIR=lib
122      UNIXONLY="#"
123      ;;
124 *netbsd*)
125      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
126      AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
127      LIBPREFIX=
128      DLLDIR=lib
129      UNIXONLY="#"
130      ;;
131 *solaris*)
132      AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
133      AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
134      AC_CHECK_LIB(resolv, res_init)
135      AC_CHECK_LIB(rt, nanosleep)
136      build_target="solaris"
137      LIBPREFIX=
138      DLLDIR=lib
139      UNIXONLY="#"
140      ;;
141 *arm-linux*)
142      AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel])
143      CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS"
144      build_target="linux"
145      LIBPREFIX=
146      DLLDIR=lib
147      UNIXONLY="#"
148      ;;
149 *cygwin*)
150      AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
151      AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
152      AC_CHECK_LIB(intl, gettext)
153      CFLAGS="-mms-bitfields $CFLAGS"
154      build_target="cygwin"
155      LIBPREFIX=lib
156      DLLDIR=bin
157      AC_PROG_CXX
158      UNIXONLY=""
159      ;;
160 *mingw*)
161      AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
162      AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
163      AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
164      AC_CHECK_LIB(intl, gettext)
165      LDFLAGS="$LDFLAGS -Wl,--export-all-symbols"
166      LIBS="$LIBS -lws2_32 -lplibc -lgnurx -lole32"
167      CFLAGS="-mms-bitfields $CFLAGS"
168      CPPFLAGS="-D_WIN32_WINNT=0x0501 -DHAVE_STAT64=1 -D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
169      build_target="mingw"
170      AC_PROG_CXX
171      LIBPREFIX=lib
172      DLLDIR=bin
173      UNIXONLY=""
174      funcstocheck=""
175      native_srcdir=$(cd $srcdir; pwd -W)
176      ;;
177 gnu*)
178      AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system])
179      build_target="gnu"
180      UNIXONLY="#"
181      ;;
182 *)
183      AC_MSG_RESULT(Unrecognised OS $host_os)
184      AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
185      UNIXONLY=""
186 ;;
187 esac
188 AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should be the default choice for the name of the first network interface])
189 AC_SUBST(DEFAULT_INTERFACE)
190
191 # Disable TCP-based IPC on systems that support UNIX domain
192 # sockets in default configuratin:
193 AC_SUBST(UNIXONLY)
194
195
196 AC_MSG_CHECKING([for build target])
197 AM_CONDITIONAL(DARWIN,  test "$build_target" = "darwin")
198 AM_CONDITIONAL(CYGWIN,  test "$build_target" = "cygwin")
199 AM_CONDITIONAL(MINGW,   test "$build_target" = "mingw")
200 AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris")
201 AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd")
202 AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd")
203 AM_CONDITIONAL(LINUX, test "$build_target" = "linux")
204 AM_CONDITIONAL(GNU, test "$build_target" = "gnu")
205
206 AC_MSG_RESULT([$build_target])
207 AC_SUBST(build_target)
208 AM_CONDITIONAL([am__fastdepOBJC], false)
209 AC_UNALIGNED_64_ACCESS
210
211 # some other checks for standard libs
212 AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32])
213 AC_SEARCH_LIBS([memrchr], [],
214                AC_DEFINE(HAVE_MEMRCHR,1,[memrchr supported]), [])
215 AC_SEARCH_LIBS([memset_s], [],
216                AC_DEFINE(HAVE_MEMSET_S,1,[memset_s supported]), [])
217 AC_SEARCH_LIBS([memset_s], [],
218                AC_DEFINE(HAVE_EXPLICIT_BZERO,1,[explicit_bzero supported]), [])
219 AC_CHECK_LIB(socket, socket)
220 AC_CHECK_LIB(m, log)
221 AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported]))
222
223 AC_CHECK_PROG(VAR_GETOPT_BINARY, getopt, true, false)
224 AM_CONDITIONAL(HAVE_GETOPT_BINARY, $VAR_GETOPT_BINARY)
225
226 AC_CHECK_PROG(VAR_SSH_BINARY, ssh, true, false)
227 AM_CONDITIONAL(HAVE_SSH_BINARY, $VAR_SSH_BINARY)
228 AM_CONDITIONAL(HAVE_SSH_KEY,  ssh -D 12345 -o "BatchMode yes" -o "UserKnownHostsFile /tmp/gnunet_test_cosks_ssh_garbage" -o "StrictHostKeyChecking no" 127.0.0.1 echo -n)
229 rm -f /tmp/gnunet_test_cosks_ssh_garbage
230
231 # autotools' m4 for python has no maximum version!
232 # python3.4 - python3.7 for tests
233 m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python])
234 AM_PATH_PYTHON([3.4],, [:])
235 AC_SUBST([PYTHON])
236 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
237
238 # perl
239 AC_PATH_PROG( PERL, perl, ,
240               $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
241 AC_SUBST([PERL])
242
243 # iptables is a soft requirement to run tests
244 AC_PATH_TARGET_TOOL(VAR_IPTABLES_BINARY, iptables, false)
245
246 if test x"$VAR_IPTABLES_BINARY" = x"false"
247 then
248   if test -x "/sbin/iptables"
249   then
250     VAR_IPTABLES_BINARY="/sbin/iptables"
251   elif test -x "/usr/sbin/iptables"
252   then
253     VAR_IPTABLES_BINARY="/usr/sbin/iptables"
254   fi
255 fi
256
257 if test x"$VAR_IPTABLES_BINARY" != x"false"
258 then
259 AC_DEFINE_UNQUOTED([IPTABLES], "$VAR_IPTABLES_BINARY", [Path to iptables])
260 else
261 AC_MSG_WARN([warning: 'iptables' not found.])
262 fi
263
264 # ip6tables is a soft requirement for some features
265 AC_PATH_TARGET_TOOL(VAR_IP6TABLES_BINARY, ip6tables, false)
266
267 if test x"$VAR_IP6TABLES_BINARY" = x"false"
268 then
269   if test -x "/sbin/ip6tables"
270   then
271     VAR_IP6TABLES_BINARY="/sbin/ip6tables"
272   elif test -x "/usr/sbin/ip6tables"
273   then
274     VAR_IP6TABLES_BINARY="/usr/sbin/ip6tables"
275   fi
276 fi
277
278 if test x"$VAR_IP6TABLES_BINARY" != x"false"
279 then
280 AC_DEFINE_UNQUOTED([IP6TABLES], "$VAR_IP6TABLES_BINARY", [Path to ip6tables])
281 else
282 AC_MSG_WARN([warning: 'ip6tables' not found.])
283 fi
284
285 # ip is a soft requirement for some features
286 AC_PATH_TARGET_TOOL(VAR_IP_BINARY, ip, false)
287
288 if test x"$VAR_IP_BINARY" = x"false"
289 then
290   if test -x "/sbin/ip"
291   then
292     VAR_IP_BINARY="/sbin/ip"
293   elif test -x "/usr/sbin/ip"
294   then
295     VAR_IP_BINARY="/usr/sbin/ip"
296   fi
297 fi
298
299 if test x"$VAR_IP_BINARY" != x"false"
300 then
301 AC_DEFINE_UNQUOTED([PATH_TO_IP], "$VAR_IP_BINARY", [Path to ip])
302 else
303 AC_MSG_WARN([warning: 'ip' not found.])
304 fi
305
306 # locate 'ifconfig'
307 AC_PATH_TARGET_TOOL(VAR_IFCONFIG_BINARY, ifconfig, false)
308
309 AC_CHECK_PROG(VAR_IFCONFIG_BINARY, ifconfig, true, false)
310 if test x"$VAR_IFCONFIG_BINARY" = x"false"
311 then
312   if test -x "/sbin/ifconfig"
313   then
314     VAR_IFCONFIG_BINARY="/sbin/ifconfig"
315   elif test -x "/usr/sbin/ifconfig"
316   then
317     VAR_IFCONFIG_BINARY="/usr/sbin/ifconfig"
318   fi
319 fi
320 if test x"$VAR_IFCONFIG_BINARY" != x"false"
321 then
322 AC_DEFINE_UNQUOTED([IFCONFIG], "$VAR_IFCONFIG_BINARY", [Path to ifconfig])
323 else
324 AC_MSG_WARN(['ifconfig' not found.])
325 fi
326
327
328 AC_PATH_TARGET_TOOL(VAR_SYSCTL_BINARY, sysctl, false)
329
330 AC_CHECK_PROG(VAR_SYSCTL_BINARY, sysctl, true, false)
331 AS_IF([test x"$VAR_SYSCTL_BINARY" = x"false"],
332       [AS_IF([test -x "/sbin/sysctl"],
333              [VAR_SYSCTL_BINARY="/sbin/sysctl"],
334              [AS_IF([test -x "/usr/sbin/sysctl"],
335                     [VAR_SYSCTL_BINARY="/usr/sbin/sysctl"])])])
336 AS_IF([test x"$VAR_SYSCTL_BINARY" != x"false"],
337       [AC_DEFINE_UNQUOTED([SYSCTL], "$VAR_SYSCTL_BINARY", [Path to sysctl])],
338       [AC_MSG_WARN(['sysctl' not found.])])
339
340 # miniupnpc / upnpc binary is a soft runtime requirement
341 AC_PATH_TARGET_TOOL(VAR_UPNPC_BINARY, upnpc, false)
342
343 if test x"$VAR_UPNPC_BINARY" != x"false"
344 then
345 AC_DEFINE_UNQUOTED([UPNPC], "$VAR_UPNPC_BINARY", [Path to upnpc binary])
346 else
347 AC_MSG_WARN([warning: 'upnpc' binary not found.])
348 fi
349
350 AC_CHECK_MEMBER(struct tm.tm_gmtoff,
351   [AC_DEFINE(HAVE_TM_GMTOFF, 1,
352      [Define if struct tm has the tm_gmtoff member.])],
353      ,
354      [#include <time.h>])
355
356 AC_CHECK_DECLS([_stati64])
357
358 # 'save' libs; only those libs found so far will be
359 # linked against _everywhere_.  For the others, we
360 # will be more selective!
361 SAVE_LIBS=$LIBS
362
363 have_addrinfo_a=0
364 AC_CHECK_LIB(anl, getaddrinfo_a, [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A,1,[getaddrinfo_a supported])])
365 AM_CONDITIONAL(HAVE_GETADDRINFO_A, [test "$have_addrinfo_a" = 1])
366
367
368 # tests only run on Windows
369 if test "x$build_target" = "xmingw"
370 then
371   AC_CHECK_LIB(plibc, plibc_init, [], [AC_MSG_ERROR([GNUnet requires PlibC on Windows])])
372   AC_CHECK_LIB(gnurx, regexec, [], [AC_MSG_ERROR([GNUnet requires libgnurx on Windows])])
373 fi
374
375 # libgcrypt
376 gcrypt=0
377 NEED_LIBGCRYPT_API=1
378 NEED_LIBGCRYPT_VERSION=1.6.0
379
380
381 AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)
382 AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include <gcrypt.h>]])
383
384 if test $gcrypt = 0
385 then
386   AC_MSG_ERROR([[
387 ***
388 *** You need libgcrypt to build this program.
389 **  This library is for example available at
390 ***   ftp://ftp.gnupg.org/gcrypt/libgcrypt/
391 *** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API)
392 ***  is required.)
393 ***]])
394 fi
395 AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
396
397 AC_CHECK_DECLS([struct in6_ifreq], [], [], [[#include <linux/if_tun.h>]])
398
399
400
401 # should the build process be building the documentation?
402 AC_MSG_CHECKING(whether to build documentation)
403 AC_ARG_ENABLE([documentation],
404    [AS_HELP_STRING([--disable-documentation], [do not build the documentation])],
405    [documentation=${enableval}],
406    [documentation=yes])
407 AC_MSG_RESULT($documentation)
408 if test "x$documentation" = "xyes"
409 then
410   AM_CONDITIONAL([DOCUMENTATION],true)
411   AC_DEFINE([DOCUMENTATION],[1],[Building the documentation])
412 else
413   AM_CONDITIONAL([DOCUMENTATION],false)
414   AC_DEFINE([DOCUMENTATION],[0],[Not building the documentation])
415 fi
416
417 # FIXME: Something is wrong about this in the output of ./configure runs
418 AC_MSG_CHECKING(wether to include generated texi2mdoc output in installation)
419 AC_ARG_ENABLE([texi2mdoc-generation],
420     [AS_HELP_STRING([--enable-texi2mdoc-generation], [include generated texi2mdoc output in installation])],
421     [texi2mdoc_generation=${enableval}],
422     [texi2mdoc_generation=no])
423 AC_MSG_RESULT($texi2mdoc_generation)
424 if test "x$texi2mdoc_generation" = "xyes"
425 then
426   if test "$texi2mdoc" = 0
427   then
428   AC_MSG_WARN([ERROR: mdoc output currently requires texi2mdoc.])
429   AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your Operating System])
430   AC_MSG_WARN([ERROR: package manager or from https://mandoc.bsd.lv/texi2mdoc/])
431   else
432   AM_CONDITIONAL([TEXI2MDOC_GENERATION],true)
433   AC_DEFINE([TEXI2MDOC_GENERATION],[1],[Building section 7 mdoc output])
434   fi
435 else
436   AM_CONDITIONAL([TEXI2MDOC_GENERATION],false)
437   AC_DEFINE([TEXI2MDOC_GENERATION],[0],[Not building section 7 mdoc output])
438 fi
439
440 # should the build process be building only the documentation?
441 AC_MSG_CHECKING(whether to build only documentation)
442 AC_ARG_ENABLE([documentation-only],
443    [AS_HELP_STRING([--enable-documentation-only], [build only the documentation])],
444    [documentation_only=${enableval}],
445    [documentation_only=no])
446 AC_MSG_RESULT($documentation_only)
447 if test "x$documentation_only" = "xyes"
448 then
449   AM_CONDITIONAL([DOCUMENTATION_ONLY],true)
450   AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation])
451 else
452   AM_CONDITIONAL([DOCUMENTATION_ONLY],false)
453   AC_DEFINE([DOCUMENTATION_ONLY],[0],[Not building only the documentation])
454 fi
455
456 # should the build process be including the manpages? (default: yes)
457 AC_MSG_CHECKING(whether to include man pages)
458 AC_ARG_ENABLE([include-manpages],
459    [AS_HELP_STRING([--disable-include-manpages], [Do not include the man pages in build and installation])],
460    [include_manpages=${enableval}],
461    [include_manpages=yes])
462 AC_MSG_RESULT($include_manpages)
463 if test "x$include_manpages" = "xyes"
464 then
465   AM_CONDITIONAL([INCLUDE_MANPAGES],true)
466   AC_DEFINE([INCLUDE_MANPAGES],[1],[Including the man pages in the build and installation])
467 else
468   AM_CONDITIONAL([INCLUDE_MANPAGES],false)
469   AC_DEFINE([INCLUDE_MANPAGES],[0],[Not including the man pages in the build and installation])
470 fi
471
472 # Adam shostack suggests the following for Windows:
473 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
474 AC_ARG_ENABLE(gcc-hardening,
475    AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
476 [if test x$enableval = xyes; then
477     CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all"
478     CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
479     CFLAGS="$CFLAGS --param ssp-buffer-size=1"
480     LDFLAGS="$LDFLAGS -pie"
481 fi])
482
483 # Linker hardening options
484 # Currently these options are ELF specific - you can't use this with MacOSX
485 AC_ARG_ENABLE(linker-hardening,
486   AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
487 [if test x$enableval = xyes; then
488    LDFLAGS="$LDFLAGS -z relro -z now"
489 fi])
490
491
492 AC_ARG_ENABLE(sanitizer,
493   AS_HELP_STRING(--enable-sanitizer, enable Address Sanitizer and Undefined Behavior Sanitizer),
494 [if test x$enableval = xyes; then
495    LDFLAGS="$CFLAGS -fsanitize=address,undefined -fno-omit-frame-pointer"
496 fi])
497
498
499 extra_logging=GNUNET_NO
500 AC_ARG_ENABLE([logging],
501    AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
502    [AS_IF([test "x$enableval" = "xyes"], [],
503           [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
504           [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
505           [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
506    ], [])
507 AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
508
509 # should memory poisoning be enabled?
510 AC_MSG_CHECKING(whether to poison freed memory)
511 AC_ARG_ENABLE([poisoning],
512    [AS_HELP_STRING([--enable-poisoning], [enable poisoning of freed memory (good for debugging)])],
513    [enable_poisoning=${enableval}],
514    [
515      if test "x$extra_logging" != "xGNUNET_NO"; then
516        enable_poisoning="defaults to yes (extra logging is enabled)"
517      else
518        enable_poisoning=no
519      fi
520    ])
521 AC_MSG_RESULT($enable_poisoning)
522 if test ! "x$enable_poisoning" = "xno"; then
523   enable_poisoning=1
524 else
525   enable_poisoning=0
526 fi
527 AC_DEFINE_UNQUOTED([ENABLE_POISONING],[$enable_poisoning],[1 if freed memory should be poisoned, 0 otherwise])
528
529 if test $build = $target
530 then
531 AC_MSG_CHECKING([for working HMAC])
532 AC_LANG_PUSH(C)
533 LIBS="$LIBS $LIBGCRYPT_LIBS"
534 CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
535 AC_RUN_IFELSE(
536   [AC_LANG_PROGRAM([#include <gcrypt.h>
537         #include <stdio.h>], [[
538         gcry_md_hd_t mac;
539
540         unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
541             0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe,
542             0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde };
543         unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 };
544         unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80,
545             0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0,
546             0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b,
547             0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb,
548             0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b,
549             0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3};
550
551         if (!gcry_check_version (GCRYPT_VERSION))
552         {
553           fprintf (stderr, "Version mismatch %s <-> %s \n", gcry_check_version (NULL), GCRYPT_VERSION);
554           return 1;
555         }
556
557         gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
558         gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
559
560         if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
561         {
562           fprintf (stderr, "gcry_md_open error\n");
563           return 2;
564         }
565
566         gcry_md_setkey (mac, key, sizeof (key));
567         gcry_md_write (mac, data, sizeof (data));
568
569         if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0)
570         {
571           fprintf (stderr, "memcmp error\n");
572           return 3;
573         }
574
575         gcry_md_close (mac);
576
577         return 0;
578     ]])],
579   [AC_MSG_RESULT([yes])],
580   [
581    RESULT=$?
582    if test $RESULT = 3
583    then
584      AC_MSG_FAILURE([HMAC test vector does not match. This is a known problem with libgcrypt 1.2.2 on Windows and fixed in 1.4.6.])
585    fi
586    if test $RESULT = 2
587    then
588      AC_MSG_FAILURE([HMAC test failed])
589    fi
590    if test $RESULT = 1
591    then
592      AC_MSG_FAILURE([libgcrypt header version does not match library version])
593    fi
594   ],
595   [AC_MSG_RESULT([cross compiling, test skipped])])
596 AC_LANG_POP(C)
597 fi      # $build = $target
598
599 # check for bluetooth library
600 bluetooth=0
601 AC_CHECK_LIB(bluetooth, ba2str,[AC_CHECK_HEADER([bluetooth/bluetooth.h],bluetooth=1)])
602 if test "$build_target" = "mingw"
603 then
604   bluetooth=1
605 fi
606 AM_CONDITIONAL(HAVE_LIBBLUETOOTH, [test "$bluetooth" = 1])
607 if test "$bluetooth" = 1
608 then
609   AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])
610 else
611   AC_DEFINE([HAVE_LIBBLUETOOTH],[0],[Lacking bluetooth library])
612 fi
613
614 # check for zbar library
615 zbar=0
616 AC_MSG_CHECKING(for libzbar)
617 AC_ARG_WITH(zbar,
618    [  --with-zbar=PFX    base of libzbar installation],
619    [AC_MSG_RESULT([$with_zbar])
620     case $with_zbar in
621       no)
622         ;;
623       yes)
624         AC_CHECK_HEADERS(zbar.h,
625           AC_CHECK_LIB([zbar], [zbar_processor_create],
626             zbar=1))
627         ;;
628       *)
629         LDFLAGS="-L$with_zbar/lib $LDFLAGS"
630         CPPFLAGS="-I$with_zbar/include $CPPFLAGS"
631         AC_CHECK_HEADERS(zbar.h,
632           AC_CHECK_LIB([zbar], [zbar_processor_create],
633             EXT_LIB_PATH="-L$with_zbar/lib $EXT_LIB_PATH"
634             zbar=1))
635         ;;
636     esac
637    ],
638    [AC_MSG_RESULT([--with-zbar not specified])
639     AC_CHECK_HEADERS(zbar.h,
640      AC_CHECK_LIB([zbar], [zbar_processor_create],
641       zbar=1))])
642 AM_CONDITIONAL(HAVE_ZBAR, [test "$zbar" = 1])
643 AS_IF([test "x$zbar" = x1],
644       [AC_DEFINE([HAVE_ZBAR],[1],[Have zbar library])],
645       [AC_DEFINE([HAVE_ZBAR],[0],[Lacking zbar library])])
646
647 # check for jansson library
648 jansson=0
649 AC_MSG_CHECKING(for libjansson)
650 AC_ARG_WITH(jansson,
651    [  --with-jansson=PFX    base of libjansson installation],
652    [AC_MSG_RESULT([$with_jansson])
653     case $with_jansson in
654       no)
655         ;;
656       yes)
657         AC_CHECK_HEADERS(jansson.h,
658           AC_CHECK_LIB([jansson], [json_loads],
659             jansson=1))
660         ;;
661       *)
662         LDFLAGS="-L$with_jansson/lib $LDFLAGS"
663         CPPFLAGS="-I$with_jansson/include $CPPFLAGS"
664         AC_CHECK_HEADERS(jansson.h,
665           AC_CHECK_LIB([jansson], [json_loads],
666             EXT_LIB_PATH="-L$with_jansson/lib $EXT_LIB_PATH"
667             jansson=1))
668         ;;
669     esac
670    ],
671    [AC_MSG_RESULT([--with-jansson not specified])
672     AC_CHECK_HEADERS(jansson.h,
673      AC_CHECK_LIB([jansson], [json_loads],
674       jansson=1))])
675 AM_CONDITIONAL(HAVE_JANSSON, [test "$jansson" = 1])
676 AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1])
677 AS_IF([test "x$jansson" = x1],
678       [AC_DEFINE([HAVE_JANSSON],[1],[Have jansson library])],
679       [AC_DEFINE([HAVE_JANSSON],[0],[Lacking jansson library])])
680
681
682 # check for libpulse(audio) library
683 pulse=0
684 AC_CHECK_LIB(pulse,pa_stream_peek,
685   [AC_CHECK_HEADER([pulse/simple.h],pulse=1)])
686 AS_IF([test "$build_target" = "mingw"],
687       [pulse=0])
688 AS_IF([test "$pulse" = 1],
689       [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library])])
690
691 # check for libopus(audio) library
692 opus=0
693 AC_CHECK_LIB(opus,opus_decode_float,
694   [AC_CHECK_HEADER([opus/opus.h],
695     [AC_CHECK_DECL([OPUS_SET_GAIN],[opus=1],[],[[#include <opus/opus.h>]]
696     )]
697   )]
698 )
699 AS_IF([test "x$opus" = x1],
700       [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library])])
701
702 # libogg
703 AC_CHECK_LIB(ogg, ogg_stream_flush_fill,
704         [AC_CHECK_HEADERS([ogg/ogg.h],
705           AM_CONDITIONAL(HAVE_OGG, true)
706           ogg=1
707           AC_DEFINE(HAVE_OGG,1,[Have ogg]),
708           AM_CONDITIONAL(HAVE_OGG, false)
709           ogg=0
710           AC_DEFINE(HAVE_OGG,0,[lacking ogg]))],
711         AM_CONDITIONAL(HAVE_OGG, false)
712         ogg=0)
713
714
715 PKG_CHECK_MODULES([GLIB],
716                   [glib-2.0],
717   [# check for pbc library
718   pbc=0
719    AC_CHECK_HEADER([pbc/pbc.h],pbc=1)
720    AC_CHECK_HEADER([gabe.h],abe=1)
721    AM_CONDITIONAL(HAVE_PBC, [test "x$pbc" = x1])
722    AM_CONDITIONAL(HAVE_ABE, [test "x$abe" = x1])
723    AS_IF([test "x$pbc" = x1],
724      [AC_DEFINE([HAVE_PBC],[1],[Have pbc library])],
725      [AC_DEFINE([HAVE_PBC],[0],[Lacking pbc library])])
726    AS_IF([test "x$abe" = x1],
727     [AC_DEFINE([HAVE_ABE],[1],[Have ABE library])],
728     [AC_DEFINE([HAVE_ABE],[0],[Lacking ABE library])])],
729   [# glib-2 not found
730    AM_CONDITIONAL(HAVE_PBC, [false])
731    AM_CONDITIONAL(HAVE_ABE, [false])
732    AC_DEFINE([HAVE_PBC],[0],[Lacking glib library])])
733
734 gst=0
735 PKG_CHECK_MODULES(
736   [GST],
737   [glib-2.0 gobject-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0],
738   [gst=1],
739   [gst=0])
740
741 # Pulse Audio
742 if test "x$pulse" != "x1" -o "x$opus" != "x1" -o "x$ogg" != "x1"
743 then
744  if test "x$gst" != "x1"
745  then
746   conversation_backend=none
747   AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
748   AM_CONDITIONAL(BUILD_GST_HELPERS, false)
749   AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
750  else
751    conversation_backend=gst
752    AM_CONDITIONAL(BUILD_PULSE_HELPERS, false)
753    AM_CONDITIONAL(BUILD_GST_HELPERS, true)
754    AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
755  fi
756 else
757
758  conversation_backend=pulse
759  AM_CONDITIONAL(BUILD_PULSE_HELPERS, true)
760  AM_CONDITIONAL(BUILD_GST_HELPERS, false)
761  AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false)
762 fi
763
764 # libgnurl
765 LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)
766 if test "$gnurl" = 1
767 then
768         AM_CONDITIONAL(HAVE_LIBGNURL, true)
769         AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl])
770 else
771         AM_CONDITIONAL(HAVE_LIBGNURL, false)
772         AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl])
773 fi
774
775 SAVE_CPPFLAGS=$CPPFLAGS
776 CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS"
777 LIBS="$LIBGNURL $LIBCURL $LIBS"
778
779 # libcurl-gnutls
780 LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false])
781 if test "x$curl" = xtrue
782 then
783
784  AC_CHECK_HEADERS([curl/curl.h],
785   AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]),
786   [curl=false])
787  AC_CHECK_HEADERS([gnurl/curl.h],
788   AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],,[[#include <gnurl/curl.h>]]))
789  # need libcurl-gnutls.so, everything else is not acceptable
790  AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],,[curl=false])
791  # cURL must support CURLINFO_TLS_SESSION, version >= 7.34
792 fi
793
794 # Check for curl/curl.h and gnurl/curl.h so we can use #ifdef
795 # HAVE_CURL_CURL_H later (the above LIBCURL_CHECK_CONFIG accepted
796 # *either* header set).
797 AC_CHECK_HEADERS([curl/curl.h],,
798   curl=false
799   AC_CHECK_HEADERS([gnurl/curl.h],,
800   gnurl=false))
801
802
803
804 if test x$curl = xfalse
805 then
806         AM_CONDITIONAL(HAVE_LIBCURL, false)
807 if test "$gnurl" = 0
808 then
809         AC_MSG_WARN([ERROR: GNUnet requires libcurl-gnutls or gnurl >= 7.34])
810 fi
811 else
812         AM_CONDITIONAL(HAVE_LIBCURL, true)
813         AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])
814 fi
815
816 AC_SEARCH_LIBS(__atomic_load_8, atomic, [have_libatomic=1 AC_DEFINE(HAVE_LIBATOMIC,1,[external libatomic])])
817 AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1])
818
819 # restore LIBS & CPPFLAGS
820 LIBS=$SAVE_LIBS
821 CPPFLAGS=$SAVE_CPPFLAGS
822
823 AC_CHECK_HEADERS([glpk.h],[glpk=true],[glpk=false])
824 # GLPK must support glpk_init_env, version >= 4.43
825 AC_CHECK_LIB([glpk],[glp_init_env],,[glpk=false])
826 # GLPK must support atm MLP presolving, version >= 4.32
827 AC_CHECK_MEMBERS(glp_iocp.presolve,,[glpk=false],[[#include <glpk.h>]])
828 if test "x$glpk" = xfalse
829 then
830         AM_CONDITIONAL(HAVE_LIBGLPK, false)
831         AC_MSG_WARN([ERROR: GNUnet requires GLPK  >= 4.32])
832 else
833         AM_CONDITIONAL(HAVE_LIBGLPK, true)
834         AC_DEFINE([HAVE_LIBGLPK],[1],[Have GLPK])
835 fi
836
837
838 AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false])
839 if test x$nss = xfalse
840 then
841         AM_CONDITIONAL(HAVE_GLIBCNSS, false)
842         AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin])
843 else
844         NSS_INCLUDES="
845         #include <nss.h>
846         "
847         AC_CHECK_DECL([NSS_STATUS_UNAVAIL],
848                 [AM_CONDITIONAL(HAVE_GLIBCNSS, true)],
849                 [AM_CONDITIONAL(HAVE_GLIBCNSS, false)
850                  AC_MSG_WARN([No nss header fails to define NSS_STATUS_UNAVAIl, will not build NSS plugin])],
851                 [$NSS_INCLUDES])
852 fi
853
854
855
856 # test for kvm and kstat (for CPU stats under BSD/Solaris)
857 AC_CHECK_LIB([kvm],[kvm_open])
858 AC_CHECK_LIB([kstat],[kstat_open])
859
860
861 # should the build process be restricted to the code required
862 # for GNU Taler wallets?
863 AC_MSG_CHECKING(whether to compile GNU Taler Wallet library ONLY)
864 AC_ARG_ENABLE([taler-wallet],
865    [AS_HELP_STRING([--enable-taler-wallet], [only compile for Taler wallet])],
866    [taler_only=${enableval}],
867    [taler_only=no])
868 AC_MSG_RESULT($taler_only)
869 if test "x$taler_only" = "xyes"
870 then
871   AM_CONDITIONAL([TALER_ONLY],true)
872   AC_DEFINE([TALER_WALLET_ONLY],[1],[Compiling for Taler wallet])
873 else
874   AM_CONDITIONAL([TALER_ONLY],false)
875   AC_DEFINE([TALER_WALLET_ONLY],[0],[Canonical compilation])
876 fi
877
878 # test for libextractor
879 extractor=0
880 AC_MSG_CHECKING(for libextractor)
881 AC_ARG_WITH(extractor,
882    [  --with-extractor=PFX    base of libextractor installation],
883    [AC_MSG_RESULT([$with_extractor])
884     case $with_extractor in
885       no)
886         ;;
887       yes)
888         AC_CHECK_HEADERS([extractor.h],
889           AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
890             extractor=1))
891         ;;
892       *)
893         LDFLAGS="-L$with_extractor/lib $LDFLAGS"
894         CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
895         AC_CHECK_HEADERS([extractor.h],
896           AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
897             EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
898             extractor=1))
899         ;;
900     esac
901    ],
902    [AC_MSG_RESULT([--with-extractor not specified])
903     AC_CHECK_HEADERS([extractor.h],
904      AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
905       extractor=1))])
906 # restore LIBS
907 LIBS=$SAVE_LIBS
908
909 if test "$extractor" != 1
910 then
911  AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false)
912  AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor])
913 else
914  AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true)
915  AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor])
916 fi
917
918
919 if test "$taler_only" != yes
920 then
921
922 # Check for libltdl header (#2999)
923 ltdl=0
924 AC_MSG_CHECKING(for libltdl)
925 AC_ARG_WITH(ltdl,
926    [  --with-ltdl=PFX    base of libltdl installation],
927    [AC_MSG_RESULT([$with_ltdl])
928     case $with_ltdl in
929       no)
930         ;;
931       yes)
932         AC_CHECK_HEADERS(ltdl.h,
933           AC_CHECK_LIB([ltdl], [lt_dlopenext],
934             ltdl=1))
935         ;;
936       *)
937         LDFLAGS="-L$with_ltdl/lib $LDFLAGS"
938         CPPFLAGS="-I$with_ltdl/include $CPPFLAGS"
939         AC_CHECK_HEADERS(ltdl.h,
940           AC_CHECK_LIB([ltdl], [lt_dlopenext],
941             EXT_LIB_PATH="-L$with_ltdl/lib $EXT_LIB_PATH"
942             ltdl=1))
943         ;;
944     esac
945    ],
946    [AC_MSG_RESULT([--with-ltdl not specified])
947     AC_CHECK_HEADERS(ltdl.h,
948      AC_CHECK_LIB([ltdl], [lt_dlopenext],
949       ltdl=1))])
950 if test x$ltdl = x1
951 then
952  AC_MSG_RESULT([libltdl found])
953 else
954  AC_MSG_ERROR([GNUnet requires libltdl (from GNU libtool), try installing libltdl-dev])
955 fi
956 # restore LIBS
957 LIBS=$SAVE_LIBS
958
959 # libidn and libidn2. The ideal goal is this:
960 # check for libidn2, if it doesn't exist check for libidn
961 # if both exist, prefer libidn2
962 # if none exist, fail and message that libidn or libidn2
963 # is required with a preference for libidn2.
964 # TODO: What we have right here can probably be improved.
965 my_with_libidn=1
966 AC_ARG_WITH(libidn,
967             AS_HELP_STRING([--with-libidn=pathname],
968                            [Support IDN (needs libidn)]),
969             [],
970             [withval="yes"])
971 AS_IF([test x_$withval = x_yes],
972       [AC_CHECK_HEADERS([idna.h],
973           AC_MSG_NOTICE([Found idna.h]),
974           AC_CHECK_HEADERS([idn/idna.h],
975                AC_MSG_NOTICE([Found idn/idna.h]),
976                my_with_libidn=0))],
977       [AS_IF([test x_$withval != x_no],
978              [CFLAGS="$CFLAGS -I$withval/include"
979               LDFLAGS="$LDFLAGS -L$withval/lib"
980               AC_CHECK_HEADERS([idna.h],
981                 AC_MSG_NOTICE([Found idna.h]),
982                 [AC_MSG_NOTICE([Failed to find idna.h])
983                  my_with_libidn=0])],
984              [my_with_libidn=0])])
985
986 my_with_libidn2=1
987 AC_ARG_WITH(libidn2,
988             AS_HELP_STRING([--with-libidn2=pathname],
989                            [Support IDN (needs libidn2)]),
990             [],
991             [withval="yes"])
992 AS_IF([test x_$withval = x_yes],
993       [AC_CHECK_HEADERS([idn2.h],
994        AC_MSG_NOTICE([Found idn2.h]),
995        AC_CHECK_HEADERS([idn2/idn2.h],
996           AC_MSG_NOTICE([Found idn2/idn2.h]),
997           [AC_MSG_NOTICE([Failed to find idn2.h])
998            my_with_libidn2=0]))],
999       [AS_IF([test x_$withval != x_no],
1000              [CFLAGS="$CFLAGS -I$withval/include"
1001               LDFLAGS="$LDFLAGS -L$withval/lib"],
1002              [my_with_libidn2=0])])
1003
1004 AC_MSG_CHECKING([if libidn can be used])
1005 # Check for LIBIDNs
1006 there_can_only_be_one=1
1007
1008 working_libidn1=0
1009 working_libidn2=0
1010 AS_IF([test x$my_with_libidn2 = x1],
1011       [AC_MSG_NOTICE([Checking for libidn2])
1012        AC_CHECK_LIB([idn2],
1013                     [idn2_to_unicode_8z8z],
1014                     [working_libidn2=1
1015                     LIBS="-lidn2 $LIBS"
1016                     AC_DEFINE_UNQUOTED([HAVE_LIBIDN2],
1017                                        [1],
1018                                         [Define to 1 if you have 'libidn2' (-lidn2).])],
1019                      [MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2"
1020                      MISSING_SEP=", "])])
1021 AM_CONDITIONAL(HAVE_LIBIDN2, test x$working_libidn2 = x1)
1022 AS_IF([test x$working_libidn2 = x0],
1023       [AS_IF([test x$my_with_libidn = x1],
1024              [AC_MSG_NOTICE([Checking for libidn])
1025               AC_CHECK_LIB([idn],
1026                            [idna_to_ascii_8z],
1027                            [working_libidn1=1
1028                            LIBS="-lidn $LIBS"
1029                              AC_DEFINE_UNQUOTED([HAVE_LIBIDN],
1030                                                 [1],
1031                                                 [Define to 1 if you have 'libidn' (-lidn).])],
1032                              [there_can_only_be_one=0])],
1033              [AS_IF([test x$my_with_libidn2 = x1],
1034                     [there_can_only_be_one=0
1035                      AC_MSG_FAILURE([* There can only be one libidn.
1036                                      * Provide either libidn >= 1.13
1037                                      * or
1038                                      * libidn2 to the configure
1039                                      * script via
1040                                      * --with-libidn2
1041                                      * --with-libidn])])])])
1042 AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1)
1043
1044 AS_IF([test "$working_libidn1" = 0 -a "$working_libidn2" = 0],
1045       [AC_MSG_ERROR([GNUnet requires libidn (or libidn2)])])
1046
1047 AS_IF([test x$there_can_only_be_one = x0],
1048       [AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS])])
1049
1050 # test for zlib
1051 SAVE_LDFLAGS=$LDFLAGS
1052 SAVE_CPPFLAGS=$CPPFLAGS
1053 AC_ARG_WITH(zlib,
1054             [  --with-zlib[[=DIR]]       use libz in DIR],
1055             [AS_IF([test "$withval" = "no"],
1056                    [AC_MSG_ERROR([GNUnet requires zlib])],
1057                    [test "$withval" != "yes"],
1058                    [
1059                      Z_DIR=$withval
1060                      CPPFLAGS="${CPPFLAGS} -I$withval/include"
1061                      LDFLAGS="${LDFLAGS} -L$withval/lib"
1062                    ])
1063             ])
1064 AC_CHECK_HEADER(zlib.h,
1065                 [],
1066                 [AC_MSG_ERROR([GNUnet requires zlib])])
1067 AC_CHECK_LIB(z, compress2,
1068              [
1069               AC_DEFINE([HAVE_ZLIB], [], [Have compression library])
1070               if test "x${Z_DIR}" != "x"; then
1071                       Z_CFLAGS="-I${Z_DIR}/include"
1072                       Z_LIBS="-L${Z_DIR}/lib -lz"
1073               else
1074                       Z_LIBS="-lz"
1075               fi],
1076               [AC_MSG_ERROR([GNUnet requires zlib])])
1077 AC_SUBST(Z_CFLAGS)
1078 AC_SUBST(Z_LIBS)
1079
1080 if test "$enable_shared" = "no"
1081 then
1082  AC_MSG_ERROR([GNUnet only works with shared libraries. Sorry.])
1083 fi
1084
1085
1086
1087 # restore LIBS
1088 LIBS=$SAVE_LIBS
1089
1090
1091 fi
1092
1093 # check for iconv
1094 AM_ICONV
1095
1096 # test for libunistring
1097 gl_LIBUNISTRING
1098 if test $HAVE_LIBUNISTRING != yes; then
1099  AC_MSG_ERROR([GNUnet requires libunistring])
1100 fi
1101 # under emscripten, $gl_libunistring_hexversion is undefined
1102 if test "$taler_only" != yes; then
1103 if test "x$gl_libunistring_hexversion" = "x" || test "$gl_libunistring_hexversion" -le 2305; then
1104  AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1])
1105 fi
1106 fi
1107 AC_CHECK_HEADERS([unistr.h],,AC_MSG_ERROR([Compiling GNUnet requires unistr.h (from libunistring) to be installed]))
1108
1109 # restore LIBS
1110 LIBS=$SAVE_LIBS
1111
1112
1113
1114 # Checks for standard header files.
1115 AC_HEADER_DIRENT
1116 AC_HEADER_STDC
1117
1118 # Check for headers that are ALWAYS required
1119 AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h string.h unistd.h stdarg.h signal.h locale.h sys/stat.h sys/types.h],,AC_MSG_ERROR([Compiling GNUnet requires standard UNIX headers files: fcntl.h math.h errno.h ctype.h limits.h stdio.h stdlib.h string.h unistd.h stdarg.h signal.h locale.h sys/stat.h sys/types.h]))
1120
1121
1122
1123 # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
1124 AC_CHECK_HEADERS([stdatomic.h malloc.h malloc/malloc.h malloc/malloc_np.h langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h fcntl.h libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h sys/time.h unistd.h kstat.h sys/sysinfo.h kvm.h sys/file.h sys/resource.h ifaddrs.h mach/mach.h stddef.h sys/timeb.h terminos.h argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h])
1125
1126 # FreeBSD requires something more funky for netinet/in_systm.h and netinet/ip.h...
1127 AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,,
1128 [#ifdef HAVE_SYS_TYPES_H
1129 #include <sys/types.h>
1130 #endif
1131 #ifdef HAVE_NETINET_IN_SYSTM_H
1132 #include <netinet/in_systm.h>
1133 #endif
1134 #ifdef HAVE_NETINET_IN_H
1135 #include <netinet/in.h>
1136 #endif
1137 ])
1138
1139 SAVE_LDFLAGS=$LDFLAGS
1140 SAVE_CPPFLAGS=$CPPFLAGS
1141
1142 # test for sqlite
1143 sqlite=false
1144 AC_MSG_CHECKING(for SQLite)
1145 AC_ARG_WITH(sqlite,
1146   [  --with-sqlite=PFX       base of SQLite installation],
1147   [AC_MSG_RESULT("$with_sqlite")
1148    case $with_sqlite in
1149    no)
1150      ;;
1151    yes)
1152     AC_CHECK_HEADERS(sqlite3.h,
1153      sqlite=true)
1154      ;;
1155    *)
1156     LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
1157     CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
1158     AC_CHECK_HEADERS(sqlite3.h,
1159      EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH"
1160      SQLITE_LDFLAGS="-L$with_sqlite/lib"
1161      SQLITE_CPPFLAGS="-I$with_sqlite/include"
1162      sqlite=true)
1163     LDFLAGS=$SAVE_LDFLAGS
1164     CPPFLAGS=$SAVE_CPPFLAGS
1165     ;;
1166    esac
1167   ],
1168   [AC_MSG_RESULT([--with-sqlite not specified])
1169     AC_CHECK_HEADERS(sqlite3.h, sqlite=true)])
1170 AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue)
1171 AC_SUBST(SQLITE_CPPFLAGS)
1172 AC_SUBST(SQLITE_LDFLAGS)
1173
1174 LDFLAGS=$SAVE_LDFLAGS
1175 CPPFLAGS=$SAVE_CPPFLAGS
1176
1177 # test for postgres
1178 postgres=false
1179 # even running the check for postgres breaks emscripten ...
1180 AS_IF([test "$taler_only" != yes],
1181       [AX_LIB_POSTGRESQL([9.5],
1182         [CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS"
1183          AC_CHECK_HEADERS([libpq-fe.h],
1184          postgres=true)
1185         ],
1186         [AC_MSG_RESULT([no postgres])])])
1187 AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
1188
1189
1190 LDFLAGS=$SAVE_LDFLAGS
1191 CPPFLAGS=$SAVE_CPPFLAGS
1192
1193 # mysql & windows
1194 AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1195 AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
1196
1197 if test "$build_target" = "mingw"
1198 then
1199   CYGWIN_MYSQL_MAGIC="#include <mysql/my_global.h>"
1200 fi
1201
1202 # test for mysql
1203 mysql=false
1204 mysqlfail=false
1205 SAVE_LDFLAGS=$LDFLAGS
1206 SAVE_CPPFLAGS=$CPPFLAGS
1207 AC_MSG_CHECKING(for mysql)
1208 AC_ARG_WITH(mysql,
1209   [  --with-mysql=PFX        base of MySQL installation],
1210   [AC_MSG_RESULT([$with_mysql])
1211    case $with_mysql in
1212    no)
1213       ;;
1214    yes|"")
1215       AC_CHECK_HEADERS(mysql/mysql.h,
1216        AC_CHECK_LIB(mysqlclient, mysql_init,
1217
1218        mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
1219       ;;
1220    *)
1221       LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS"
1222       CPPFLAGS="-I$with_mysql/include $CPPFLAGS"
1223       AC_CHECK_HEADERS(mysql/mysql.h,
1224        AC_CHECK_LIB(mysqlclient, mysql_init,
1225         MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql"
1226         MYSQL_CPPFLAGS="-I$with_mysql/include"
1227
1228         mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
1229       ;;
1230    esac
1231   ],
1232   [AC_MSG_RESULT([--with-mysql not specified])
1233    if test -d "/usr/lib64/mysql"; then
1234     MYSQL_LIBDIR="/usr/lib64/mysql"
1235    elif test -d "/usr/lib/mysql"; then
1236     MYSQL_LIBDIR="/usr/lib/mysql"
1237    else
1238     MYSQL_LIBDIR="/usr/lib"
1239    fi
1240    LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS"
1241    AC_CHECK_LIB(mysqlclient, mysql_init,
1242     [AC_CHECK_HEADERS(mysql/mysql.h,
1243       MYSQL_LDFLAGS="-L$MYSQL_LIBDIR"
1244       mysql=true
1245
1246      , [], [$CYGWIN_MYSQL_MAGIC])])
1247   ])
1248
1249 AC_SUBST(MYSQL_LDFLAGS)
1250 AC_SUBST(MYSQL_CPPFLAGS)
1251
1252 # additional version check for mysql
1253 AC_ARG_ENABLE(mysql-version-check, [  --disable-mysql-version-check  do not check MySQL version],, enable_mysql_version_check=yes)
1254 if test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"
1255 then
1256   AC_MSG_CHECKING(mysql version)
1257   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
1258     [[$CYGWIN_MYSQL_MAGIC
1259       #include <mysql/mysql.h>]],
1260     [[
1261       #if (MYSQL_VERSION_ID < 40100)
1262       #error needs at least version >= 4.1
1263       #endif
1264       int main () { return 0; }
1265     ]])
1266     ],mysql=true,mysql=false)
1267   if test "$mysql" = "false"
1268   then
1269     mysqlfail=true
1270     AC_MSG_RESULT([fail, >= 4.1 required])
1271   else
1272     AC_MSG_RESULT(ok)
1273   fi
1274 fi
1275 AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue)
1276 AM_CONDITIONAL(HAVE_MYSQLE, false)
1277 # restore LIBS
1278 LIBS=$SAVE_LIBS
1279 LDFLAGS=$SAVE_LDFLAGS
1280 CPPFLAGS=$SAVE_CPPFLAGS
1281
1282 if test "$sqlite" = 0 -a "$mysql" = 0
1283 then
1284  AC_MSG_ERROR([GNUnet requires SQLite or MySQL])
1285 fi
1286
1287 # libmicrohttpd
1288 lmhd=0
1289 AC_MSG_CHECKING([for libmicrohttpd])
1290 AC_ARG_WITH(microhttpd,
1291    [  --with-microhttpd=PFX   base of libmicrohttpd installation],
1292    [AC_MSG_RESULT([$with_microhttpd])
1293     case $with_microhttpd in
1294       no)
1295         ;;
1296       yes|"")
1297         AC_CHECK_HEADERS([microhttpd.h],
1298           AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
1299             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
1300               [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.63])
1301               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1302                 #include "$native_srcdir/src/include/platform.h"
1303                 #include <microhttpd.h>
1304                 #if (MHD_VERSION < 0x0096300)
1305                 #error needs at least version 0.9.63
1306                 #endif
1307                 int main () { return 0; }
1308                ])],
1309                [AC_MSG_RESULT(ok)
1310                 lmhd=1],
1311                [AC_MSG_RESULT(failed)])]),
1312             [],[#include "$native_srcdir/src/include/platform.h"
1313                 #include <microhttpd.h>]),,
1314             [#include "$native_srcdir/src/include/platform.h"])
1315         ;;
1316       *)
1317         LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
1318         CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"
1319         AC_CHECK_HEADERS(microhttpd.h,
1320           AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
1321             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
1322               EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
1323               [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
1324                AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1325                 #include "$native_srcdir/src/include/platform.h"
1326                 #include <microhttpd.h>
1327                 #if (MHD_VERSION < 0x0094200)
1328                 #error needs at least version 0.9.42
1329                 #endif
1330                 int main () { return 0; }
1331                ])],
1332                [AC_MSG_RESULT(ok)
1333                 lmhd=1],
1334                [AC_MSG_RESULT(failed)])]),
1335             [],[#include "$native_srcdir/src/include/platform.h"
1336                 #include <microhttpd.h>]),,
1337             [#include "$native_srcdir/src/include/platform.h"])
1338         ;;
1339     esac
1340    ],
1341    [AC_MSG_RESULT([--with-microhttpd not specified])
1342     AC_CHECK_HEADERS([microhttpd.h],
1343       AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
1344         AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
1345           [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
1346               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
1347                 #include "$native_srcdir/src/include/platform.h"
1348                 #include <microhttpd.h>
1349                 #if (MHD_VERSION < 0x0094200)
1350                 #error needs at least version 0.9.52
1351                 #endif
1352                ])],
1353                [AC_MSG_RESULT(ok)
1354                 lmhd=1],
1355                [AC_MSG_RESULT(failed)])]),
1356         [],[#include "$native_srcdir/src/include/platform.h"
1357             #include <microhttpd.h>]),,
1358        [#include "$native_srcdir/src/include/platform.h"])])
1359 AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
1360 AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
1361
1362 AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1])
1363
1364 # restore LIBS
1365 LIBS=$SAVE_LIBS
1366
1367 # check for gettext
1368 AM_GNU_GETTEXT([external])
1369 AM_GNU_GETTEXT_VERSION([0.18.1])
1370
1371 # Checks for standard typedefs, structures, and compiler characteristics.
1372 AC_TYPE_PID_T
1373 AC_TYPE_SIZE_T
1374 AC_TYPE_MODE_T
1375 AC_HEADER_TIME
1376 AC_HEADER_STAT
1377 AC_HEADER_STDBOOL
1378 AC_STRUCT_TM
1379
1380 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
1381    [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?])
1382    ],
1383    [],
1384    [
1385       #include <sys/types.h>
1386       #include <sys/socket.h>
1387       #include <netinet/in.h>
1388    ])
1389
1390 AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
1391    [ AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN, 1, [Do we have sockaddr_un.sun_len?])
1392    ],
1393    [],
1394    [
1395       #include <sys/types.h>
1396       #include <sys/socket.h>
1397       #include <sys/un.h>
1398    ])
1399
1400
1401
1402 # Checks for library functions.
1403 AC_FUNC_CLOSEDIR_VOID
1404 AC_FUNC_FORK
1405 AC_PROG_GCC_TRADITIONAL
1406 AC_FUNC_MEMCMP
1407 AC_FUNC_SELECT_ARGTYPES
1408 AC_FUNC_CHOWN
1409
1410 AC_TYPE_SIGNAL
1411 AC_FUNC_STAT
1412 AC_FUNC_STRFTIME
1413 AC_FUNC_VPRINTF
1414 AC_HEADER_SYS_WAIT
1415 AC_TYPE_OFF_T
1416 AC_TYPE_UID_T
1417 AC_CHECK_FUNCS([atoll stat64 strnlen mremap getrlimit setrlimit sysconf initgroups strndup gethostbyname2 getpeerucred getpeereid setresuid $funcstocheck getifaddrs freeifaddrs getresgid mallinfo malloc_size malloc_usable_size getrusage random srandom stat statfs statvfs wait4])
1418
1419 # restore LIBS
1420 LIBS=$SAVE_LIBS
1421
1422 GN_INTLINCL=""
1423 GN_LIBINTL="$LTLIBINTL"
1424 AC_ARG_ENABLE(framework, [  --enable-framework      enable Mac OS X framework build helpers],enable_framework_build=$enableval)
1425 AM_CONDITIONAL(WANT_FRAMEWORK, test x$enable_framework_build = xyes)
1426 if test x$enable_framework_build = xyes
1427 then
1428   AC_DEFINE([FRAMEWORK_BUILD], 1, [Build a Mac OS X Framework])
1429   GN_INTLINCL='-I$(top_srcdir)/src/intlemu'
1430   GN_LIBINTL='$(top_builddir)/src/intlemu/libintlemu.la -framework CoreFoundation'
1431   AC_LIB_APPENDTOVAR([CPPFLAGS], [$GN_INTLINCL])
1432 fi
1433
1434 GN_LIB_LDFLAGS="-export-dynamic -no-undefined"
1435 GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
1436
1437 AC_SUBST(GN_LIB_LDFLAGS)
1438 AC_SUBST(GN_PLUGIN_LDFLAGS)
1439 AC_SUBST(GN_INTLINCL)
1440 AC_SUBST(GN_LIBINTL)
1441
1442 AC_SUBST(CPPFLAGS)
1443 AC_SUBST(LIBS)
1444 AC_SUBST(LDFLAGS)
1445 AC_SUBST(EXT_LIB_PATH)
1446 AC_SUBST(EXT_LIBS)
1447
1448 AC_SUBST(LIBPREFIX)
1449 AC_SUBST(DLLDIR)
1450 AC_SUBST(EXT_LIB_PATH)
1451
1452 DATAROOTDIR=$datarootdir
1453 AC_SUBST(DATAROOTDIR)
1454
1455 # test for sudo
1456 # TODO: do we need to change anything for "doas" on openbsd?
1457 AC_MSG_CHECKING(for sudo)
1458 AC_ARG_WITH(sudo,
1459   [  --with-sudo=PATH       path to sudo binary (or just yes)],
1460   [AC_MSG_RESULT("$with_sudo")
1461    case $with_sudo in
1462    no)
1463      SUDO_BINARY=
1464      ;;
1465    yes)
1466      SUDO_BINARY=sudo
1467      ;;
1468    *)
1469      SUDO_BINARY=$with_sudo
1470     ;;
1471    esac
1472   ],
1473   [AC_MSG_RESULT([no])])
1474 AC_SUBST(SUDO_BINARY)
1475 AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "x" -o -w /])
1476
1477
1478 # test for gnunetdns group name
1479 GNUNETDNS_GROUP=gnunetdns
1480 AC_MSG_CHECKING(for gnunetdns group name)
1481 AC_ARG_WITH(gnunetdns,
1482   [  --with-gnunetdns=GRPNAME       name for gnunetdns group],
1483   [AC_MSG_RESULT("$with_gnunetdns")
1484    case $with_gnunetdns in
1485    no)
1486      GNUNETDNS_GROUP=gnunet
1487      ;;
1488    yes)
1489      GNUNETDNS_GROUP=gnunetdns
1490      ;;
1491    *)
1492      GNUNETDNS_GROUP=$with_gnunetdns
1493     ;;
1494    esac
1495   ],
1496   [AC_MSG_RESULT([gnunetdns])])
1497 AC_SUBST(GNUNETDNS_GROUP)
1498
1499
1500
1501 # gnutls
1502 gnutls=0
1503 gnutls_dane=0
1504 AC_MSG_CHECKING(for gnutls)
1505 AC_ARG_WITH(gnutls,
1506    [  --with-gnutls=PFX   base of gnutls installation],
1507    [AC_MSG_RESULT([$with_gnutls])
1508     case $with_gnutls in
1509       no)
1510         ;;
1511       yes)
1512         AC_CHECK_HEADERS([gnutls/abstract.h],
1513             AC_CHECK_LIB([gnutls], [gnutls_priority_set],
1514              gnutls=true))
1515         AC_CHECK_HEADERS([gnutls/dane.h],
1516             AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
1517               gnutls_dane=1))
1518         ;;
1519       *)
1520         LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
1521         CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
1522         AC_CHECK_HEADERS([gnutls/abstract.h],
1523             AC_CHECK_LIB([gnutls], [gnutls_priority_set],
1524               EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH"
1525               gnutls=true))
1526         AC_CHECK_HEADERS([gnutls/dane.h],
1527             AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
1528               gnutls_dane=1))
1529         ;;
1530     esac
1531    ],
1532    [AC_MSG_RESULT([--with-gnutls not specified])
1533     AC_CHECK_HEADERS([gnutls/abstract.h],
1534         AC_CHECK_LIB([gnutls], [gnutls_priority_set],
1535           gnutls=true))
1536     AC_CHECK_HEADERS([gnutls/dane.h],
1537         AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw],
1538                      gnutls_dane=1))
1539    ])
1540 AM_CONDITIONAL(HAVE_GNUTLS, test x$gnutls = xtrue)
1541 AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have GnuTLS])
1542 AM_CONDITIONAL(HAVE_GNUTLS_DANE, test x$gnutls_dane = x1)
1543 AC_DEFINE_UNQUOTED([HAVE_GNUTLS_DANE], $gnutls_dane, [We have GnuTLS with DANE support])
1544
1545
1546
1547 # Test if we are building for superMUC
1548 AC_MSG_CHECKING(if GNUnet is being configured to run on the SuperMUC)
1549 AC_ARG_ENABLE([supermuc],
1550     [AS_HELP_STRING([--enable-supermuc],
1551        [build GNUnet with support to run on the SuperMUC (default is NO)])],
1552     [if test "x$enable_supermuc" = "xno"
1553      then
1554        supermuc=0
1555      else
1556        supermuc=1
1557      fi],
1558     [supermuc=0
1559      enable_supermuc=no])
1560 AC_MSG_RESULT($enable_SUPERMUC)
1561 AM_CONDITIONAL([ENABLE_SUPERMUC], [test "x$supermuc" = "x1"])
1562 AC_DEFINE_UNQUOTED([ENABLE_SUPERMUC], [$supermuc], [Build with support for SuperMUC])
1563
1564 # Check if NSE has to send timestamp information to testbed logger for
1565 # generating histogram of messages received
1566 AC_MSG_CHECKING(if NSE has to send timestamp information to testbed logger)
1567 AC_ARG_ENABLE([nse-histogram],
1568     [AS_HELP_STRING([--enable-nse-histogram],
1569        [have NSE send timestamp information to testbed logger for generating
1570        histogram of received messages.  NOT useful for production (default is
1571        NO)])],
1572     [if test "x$enableval" = "xno"
1573      then
1574        nse_histogram=0
1575      else
1576        nse_histogram=1
1577      fi],
1578     [nse_histogram=0
1579      enable_nse_histogram=no])
1580 AC_MSG_RESULT($enable_nse_histogram)
1581 AM_CONDITIONAL([ENABLE_NSE_HISTOGRAM], [test "x$nse_histogram" = "x1"])
1582 AC_DEFINE_UNQUOTED([ENABLE_NSE_HISTOGRAM], [$nse_histogram],
1583                    [have NSE send timestamp information to testbed logger])
1584
1585 # should 'make check' run tests?
1586 AC_MSG_CHECKING(whether to run tests)
1587 AC_ARG_ENABLE([testruns],
1588    [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
1589    [enable_tests_run=${enableval}],
1590    [enable_tests_run=yes])
1591 AC_MSG_RESULT($enable_test_run)
1592 AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
1593
1594
1595 AC_MSG_CHECKING([whether to compile in benchmarks (currently for http and crypto)])
1596 AC_ARG_ENABLE([benchmark],
1597    [AS_HELP_STRING([--enable-benchmark], [enable benchmarking])],
1598    [enable_benchmark=${enableval}],
1599    [enable_benchmark=no])
1600 AC_MSG_RESULT($enable_benchmark)
1601 AS_IF([test "x$enable_benchmark" = "xyes"],
1602       [AC_DEFINE_UNQUOTED(ENABLE_BENCHMARK,1,[Benchmarks are enabled])])
1603 AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmark" = "xyes"])
1604
1605
1606 # should expensive tests be run?
1607 AC_MSG_CHECKING(whether to run expensive tests)
1608 AC_ARG_ENABLE([expensivetests],
1609    [AS_HELP_STRING([--enable-expensivetests], [enable running expensive testcases])],
1610    [enable_expensive=${enableval}],
1611    [enable_expensive=no])
1612 AC_MSG_RESULT($enable_expensive)
1613 AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [test "x$enable_expensive" = "xyes"])
1614
1615 # should ports be open for Java services?
1616 AC_MSG_CHECKING(whether to enable ports for gnunet-java)
1617 AC_ARG_ENABLE([javaports],
1618    [AS_HELP_STRING([--enable-javaports], [use non-zero ports for services with Java bindings (default is NO)])],
1619    [enable_java_ports=${enableval}],
1620    [enable_java_ports=no])
1621 AC_MSG_RESULT($enable_java_ports)
1622 if test "x$enable_java_ports" = "xyes"
1623 then
1624   JAVAPORT=""
1625 else
1626   JAVAPORT="$UNIXONLY"
1627 fi
1628 AC_SUBST(JAVAPORT)
1629
1630 # should benchmarks be run?
1631 AC_MSG_CHECKING(whether to run benchmarks during make check)
1632 AC_ARG_ENABLE([benchmarks],
1633    [AS_HELP_STRING([--enable-benchmarks], [enable running benchmarks during make check])],
1634    [enable_benchmarks=${enableval}],
1635    [enable_benchmarks=no])
1636 AC_MSG_RESULT($enable_benchmarks)
1637 AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"])
1638
1639 # should gnunet-testing be compiled
1640 AC_MSG_CHECKING(wether to compile gnunet-testing)
1641 AC_ARG_ENABLE([testing],
1642    [AS_HELP_STRING([--disable-testing], [do not build gnunet-testing])],
1643    [enable_testing=${enableval}],
1644    [enable_testing=yes])
1645 AC_MSG_RESULT($enable_testing)
1646 AM_CONDITIONAL([HAVE_TESTING], [test "x$enable_testing" = "xyes"])
1647
1648 # should experimental code be compiled (code that may not yet compile)?
1649 AC_MSG_CHECKING(whether to compile experimental code)
1650 AC_ARG_ENABLE([experimental],
1651    [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
1652    [enable_experimental=${enableval}],
1653    [enable_experimental=no])
1654 AC_MSG_RESULT($enable_experimental)
1655 AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
1656
1657 # should malicious code be compiled (should only be used for testing)?
1658 AC_MSG_CHECKING(whether to compile malicious code)
1659 AC_ARG_ENABLE([malicious],
1660    [AS_HELP_STRING([--enable-malicious], [enable compiling malicious code])],
1661    [if test "x$enableval" = "xno"
1662      then
1663        malicious=0
1664      else
1665        malicious=1
1666      fi],
1667    [malicious=0
1668     enable_malicious=no])
1669 AC_MSG_RESULT($enable_malicious)
1670 AM_CONDITIONAL([ENABLE_MALICIOUS], [test 1=$malicious])
1671 AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious],
1672                    [enable compilation of malicious code])
1673
1674 # should services be started on demand when needed?  Some services may choose to
1675 # never start by default and it is up to the service/module developer to decide
1676 # by having "START_ON_DEMAND = NO" instead of "START_ON_DEMAND = @START_ON_DEMAND@"
1677 # in the service/module's conf.in file.
1678 # See also IMMEDIATE_START for an unconditional immediate start.
1679 START_ON_DEMAND="YES"
1680 AC_MSG_CHECKING(whether to start peer's services on demand by default)
1681 AC_ARG_ENABLE([autostart],
1682    [AS_HELP_STRING([--disable-autostart], [do not start peer's services by default])],
1683    [enable_autostart=${enableval}
1684     if test "x$enable_autostart" = "xno"
1685     then
1686         START_ON_DEMAND="NO"
1687     fi
1688    ],
1689    [enable_autostart=yes])
1690 AC_MSG_RESULT($enable_autostart)
1691 #AM_CONDITIONAL([HAVE_START_ON_DEMAND], [test "x$enable_autostart" = "xyes"])
1692 AC_SUBST(START_ON_DEMAND)
1693
1694 # should memory statistics be kept (very expensive CPU-wise!)
1695 AC_MSG_CHECKING(whether to create expensive statistics on memory use)
1696 AC_ARG_ENABLE([heapstats],
1697    [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])],
1698    [enable_heapstats=1],
1699    [enable_heapstats=0])
1700 AC_MSG_RESULT($enable_heapstats)
1701 AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS],$enable_heapstats,[enable expensive heap statistics])
1702
1703 # should code be enabled that works around missing OS functionality on Windows?
1704 # used for test cases
1705 if test $build_target = "mingw"
1706 then
1707         workarounds=1
1708
1709 AC_LINK_IFELSE(
1710  [AC_LANG_PROGRAM(
1711   [#include <ws2tcpip.h>
1712   ],[
1713   int s = socket (0, 0, 0);])
1714  ],[
1715   AC_DEFINE_UNQUOTED([HAVE_SOCKET],1,[Define this if socket() is available])
1716  ],[
1717   AC_DEFINE_UNQUOTED([HAVE_SOCKET],0,[Define this if socket() is available])
1718  ])
1719
1720 AC_LINK_IFELSE(
1721  [AC_LANG_PROGRAM(
1722   [#include <ws2tcpip.h>
1723   ],[
1724   int s = select (0, NULL, NULL, NULL, NULL);])
1725  ],[
1726   AC_DEFINE_UNQUOTED([HAVE_SELECT],1,[Define this if select() is available])
1727  ],[
1728   AC_DEFINE_UNQUOTED([HAVE_SELECT],0,[Define this if select() is available])
1729  ])
1730
1731 AC_LINK_IFELSE(
1732  [AC_LANG_PROGRAM(
1733   [#include <ws2tcpip.h>
1734   ],[
1735   struct in_addr i;
1736   char *s = inet_ntoa (i);])
1737  ],[
1738   AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],1,[Define this if inet_ntoa() is available])
1739  ],[
1740   AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],0,[Define this if inet_ntoa() is available])
1741  ])
1742
1743 AC_LINK_IFELSE(
1744  [AC_LANG_PROGRAM(
1745   [#include <ws2tcpip.h>
1746   ],[
1747   int s = getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);])
1748  ],[
1749   AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],1,[Define this if getnameinfo() is available])
1750  ],[
1751   AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],0,[Define this if getnameinfo() is available])
1752  ])
1753
1754 AC_LINK_IFELSE(
1755  [AC_LANG_PROGRAM(
1756   [#include <ws2tcpip.h>
1757   ],[
1758   int s = gethostname (NULL, 0);])
1759  ],[
1760   AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],1,[Define this if gethostname() is available])
1761  ],[
1762   AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],0,[Define this if gethostname() is available])
1763  ])
1764
1765 AC_LINK_IFELSE(
1766  [AC_LANG_PROGRAM(
1767   [#include <ws2tcpip.h>
1768   ],[
1769   void *s = gethostbyname (NULL);])
1770  ],[
1771   AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],1,[Define this if gethostbyname() is available])
1772  ],[
1773   AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],0,[Define this if gethostbyname() is available])
1774  ])
1775
1776 AC_LINK_IFELSE(
1777  [AC_LANG_PROGRAM(
1778   [#include <ws2tcpip.h>
1779   ],[
1780   void *s = gethostbyaddr (NULL, 0, 0);])
1781  ],[
1782   AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],1,[Define this if gethostbyaddr() is available])
1783  ],[
1784   AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],0,[Define this if gethostbyaddr() is available])
1785  ])
1786
1787 AC_LINK_IFELSE(
1788  [AC_LANG_PROGRAM(
1789   [#include <ws2tcpip.h>
1790   ],[
1791   int s = getaddrinfo (NULL, NULL, NULL, NULL);])
1792  ],[
1793   AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
1794  ],[
1795   AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],0,[Define this if getaddrinfo() is available])
1796  ])
1797
1798 else
1799   AC_MSG_CHECKING(whether to enable windows workarounds)
1800   AC_ARG_ENABLE([windows_workarounds],
1801      [AS_HELP_STRING([--enable-windows_workarounds], [enable workarounds used on Windows (only useful for test cases)])],
1802      [enable_workarounds=${enableval}],
1803      [enable_workarounds=no])
1804   AC_MSG_RESULT($enable_workarounds)
1805   if test x$enable_windows_workarounds = "xyes"
1806   then
1807      workarounds=1
1808   else
1809      workarounds=0
1810    fi
1811 fi
1812 AC_DEFINE_UNQUOTED([ENABLE_WINDOWS_WORKAROUNDS], $workarounds, [enable workarounds used on Windows (only useful for test cases)])
1813
1814 # gcov compilation
1815 AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
1816 AC_ARG_ENABLE([coverage],
1817               AS_HELP_STRING([--enable-coverage],
1818                              [compile the library with code coverage support]),
1819               [use_gcov=${enableval}],
1820               [use_gcov=no])
1821 AC_MSG_RESULT($use_gcov)
1822 AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
1823
1824
1825 # version info
1826 # TODO: git blame says this predates our switch to git. git-svn should be adjusted to simply git, or
1827 # an external script that does the job.
1828 AC_PATH_PROG(svnversioncommand, svnversion)
1829 AC_PATH_PROG(gitcommand, git)
1830 AC_MSG_CHECKING(for source being under a VCS)
1831
1832
1833 # version info
1834 AC_PATH_PROG(gitcommand, git)
1835 AC_MSG_CHECKING(for source being under a VCS)
1836 git_version=
1837 AS_IF([test ! "X$gitcommand" = "X"],
1838 [
1839   git_version=$(cd $srcdir ; git rev-list --full-history --all --abbrev-commit | head -n 1 2>/dev/null)
1840 ])
1841 AS_IF([test "X$git_version" = "X"],
1842   [
1843     vcs_name="no"
1844     vcs_version="\"release\""
1845   ],
1846   [
1847     vcs_name="yes, git-svn"
1848     vcs_version="\"git-$git_version\""
1849   ])
1850 AC_MSG_RESULT($vcs_name)
1851
1852 AC_MSG_CHECKING(VCS version)
1853 AC_MSG_RESULT($vcs_version)
1854 AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version])
1855
1856 AC_CONFIG_FILES([
1857 Makefile
1858 contrib/Makefile
1859 contrib/hellos/Makefile
1860 contrib/services/Makefile
1861 contrib/services/openrc/Makefile
1862 contrib/services/systemd/Makefile
1863 contrib/scripts/Makefile
1864 contrib/scripts/gnunet-logread/Makefile
1865 doc/Makefile
1866 doc/man/Makefile
1867 doc/doxygen/Makefile
1868 doc/handbook/Makefile
1869 doc/tutorial/Makefile
1870 lint/Makefile
1871 m4/Makefile
1872 po/Makefile.in
1873 src/Makefile
1874 src/arm/Makefile
1875 src/arm/arm.conf
1876 src/ats/Makefile
1877 src/ats/ats.conf
1878 src/ats-tool/Makefile
1879 src/ats-tests/Makefile
1880 src/auction/Makefile
1881 src/block/Makefile
1882 src/cadet/Makefile
1883 src/cadet/cadet.conf
1884 src/core/Makefile
1885 src/core/core.conf
1886 src/consensus/Makefile
1887 src/consensus/consensus.conf
1888 src/conversation/Makefile
1889 src/conversation/conversation.conf
1890 src/curl/Makefile
1891 src/datacache/Makefile
1892 src/datastore/Makefile
1893 src/datastore/datastore.conf
1894 src/dht/Makefile
1895 src/dht/dht.conf
1896 src/dns/Makefile
1897 src/dns/dns.conf
1898 src/exit/Makefile
1899 src/fragmentation/Makefile
1900 src/fs/Makefile
1901 src/fs/fs.conf
1902 src/gns/Makefile
1903 src/gns/gns.conf
1904 src/gns/nss/Makefile
1905 src/gnsrecord/Makefile
1906 src/hello/Makefile
1907 src/identity/Makefile
1908 src/identity/identity.conf
1909 src/credential/Makefile
1910 src/credential/credential.conf
1911 src/include/Makefile
1912 src/integration-tests/Makefile
1913 src/json/Makefile
1914 src/hostlist/Makefile
1915 src/my/Makefile
1916 src/mysql/Makefile
1917 src/namecache/Makefile
1918 src/namecache/namecache.conf
1919 src/namestore/Makefile
1920 src/namestore/namestore.conf
1921 src/nat/Makefile
1922 src/nat/nat.conf
1923 src/nat-auto/Makefile
1924 src/nat-auto/nat-auto.conf
1925 src/nse/Makefile
1926 src/nse/nse.conf
1927 src/nt/Makefile
1928 src/peerinfo/Makefile
1929 src/peerinfo/peerinfo.conf
1930 src/peerinfo-tool/Makefile
1931 src/peerstore/Makefile
1932 src/peerstore/peerstore.conf
1933 src/pq/Makefile
1934 src/pt/Makefile
1935 src/regex/Makefile
1936 src/regex/regex.conf
1937 src/revocation/Makefile
1938 src/revocation/revocation.conf
1939 src/rps/Makefile
1940 src/rps/rps.conf
1941 src/secretsharing/Makefile
1942 src/secretsharing/secretsharing.conf
1943 src/scalarproduct/Makefile
1944 src/scalarproduct/scalarproduct.conf
1945 src/set/Makefile
1946 src/set/set.conf
1947 src/sq/Makefile
1948 src/statistics/Makefile
1949 src/statistics/statistics.conf
1950 src/template/Makefile
1951 src/testbed/Makefile
1952 src/testbed/testbed.conf
1953 src/testbed-logger/Makefile
1954 src/testbed-logger/testbed-logger.conf
1955 src/testing/Makefile
1956 src/topology/Makefile
1957 src/transport/Makefile
1958 src/transport/transport.conf
1959 src/util/Makefile
1960 src/util/resolver.conf
1961 src/vpn/Makefile
1962 src/vpn/vpn.conf
1963 src/zonemaster/Makefile
1964 src/zonemaster/zonemaster.conf
1965 src/rest/Makefile
1966 src/abe/Makefile
1967 src/reclaim-attribute/Makefile
1968 src/reclaim/Makefile
1969 pkgconfig/Makefile
1970 pkgconfig/gnunetarm.pc
1971 pkgconfig/gnunetats.pc
1972 pkgconfig/gnunetblock.pc
1973 pkgconfig/gnunetcadet.pc
1974 pkgconfig/gnunetconsensus.pc
1975 pkgconfig/gnunetconversation.pc
1976 pkgconfig/gnunetcore.pc
1977 pkgconfig/gnunetdatacache.pc
1978 pkgconfig/gnunetdatastore.pc
1979 pkgconfig/gnunetdht.pc
1980 pkgconfig/gnunetdns.pc
1981 pkgconfig/gnunetenv.pc
1982 pkgconfig/gnunetfragmentation.pc
1983 pkgconfig/gnunetfs.pc
1984 pkgconfig/gnunetgns.pc
1985 pkgconfig/gnunethello.pc
1986 pkgconfig/gnunetidentity.pc
1987 pkgconfig/gnunetmicrophone.pc
1988 pkgconfig/gnunetmysql.pc
1989 pkgconfig/gnunetnamestore.pc
1990 pkgconfig/gnunetnat.pc
1991 pkgconfig/gnunetnse.pc
1992 pkgconfig/gnunetpeerinfo.pc
1993 pkgconfig/gnunetpq.pc
1994 pkgconfig/gnunetregex.pc
1995 pkgconfig/gnunetrevocation.pc
1996 pkgconfig/gnunetrps.pc
1997 pkgconfig/gnunetscalarproduct.pc
1998 pkgconfig/gnunetset.pc
1999 pkgconfig/gnunetspeaker.pc
2000 pkgconfig/gnunetstatistics.pc
2001 pkgconfig/gnunettestbed.pc
2002 pkgconfig/gnunettesting.pc
2003 pkgconfig/gnunettransport.pc
2004 pkgconfig/gnunetutil.pc
2005 pkgconfig/gnunetvpn.pc
2006 ])
2007 AC_OUTPUT
2008
2009 # Finally: summary!
2010
2011 # warn user if mysql found but not used due to version
2012 AS_IF([test "$mysqlfail" = "true"]
2013       [AC_MSG_NOTICE([WARNING: optional MySQL not found (or too old)])])
2014
2015 # sqlite
2016 AS_IF([test "x$sqlite" = "x0"],
2017       [AC_MSG_ERROR([ERROR: sqlite3 not found, but sqlite3 is required.])])
2018
2019 # libgnurl
2020 AS_IF([test "$gnurl" = "0"],
2021   [AS_IF([test "x$curl" = "xfalse"],
2022     [AC_MSG_NOTICE([WARNING: libgnurl not found.  http client support will not be compiled.])
2023      AC_MSG_WARN([ERROR: libgnurl not found.  hostlist daemon will not be compiled, and you probably WANT the hostlist daemon])],
2024     [AC_MSG_NOTICE([WARNING: libgnurl not found, trying to use libcurl-gnutls instead.])])])
2025
2026 # bluetooth
2027 AS_IF([test "x$bluetooth" = "x0"],
2028       [AC_MSG_NOTICE([WARNING: optional bluetooth library not found.])])
2029
2030
2031 # jansson
2032 AS_IF([test "x$jansson" = "x0"],
2033       [AC_MSG_NOTICE([WARNING: optional jansson library not found.])])
2034
2035 #
2036 # FIXME: `some modules' -> be more specific which exact modules.
2037 #
2038
2039 # warn user if iptables is not found
2040 AS_IF([test "$VAR_IPTABLES_BINARY" = "false"],
2041  [AC_MSG_NOTICE([WARNING: optional iptables not found])])
2042
2043 # warn user if ifconfig is not found
2044 AS_IF([test "$VAR_IFCONFIG_BINARY" = "false"],
2045  [AC_MSG_NOTICE([WARNING: optional ifconfig not found])])
2046
2047 # warn user if upnpc binary is not found
2048 AS_IF([test "$VAR_UPNPC_BINARY" = "false"],
2049   [AC_MSG_NOTICE([WARNING: optional upnpc binary not found])])
2050
2051 #gnutls
2052 AS_IF([test x$gnutls != xtrue],
2053  [AC_MSG_NOTICE([WARNING: GnuTLS not found, gnunet-gns-proxy will not be built])],
2054  [AS_IF([test "x$gnutls_dane" != "x1"],
2055   [AC_MSG_NOTICE([WARNING: GnuTLS has no DANE support, DANE validation will not be possible])])])
2056
2057 # warn user if libzbar is not found
2058 AS_IF([test "$have_zbar" = 0],
2059       [AC_MSG_NOTICE([WARNING: zbar not found, gnunet-qr will not be built.])])
2060
2061 # java ports
2062 AS_IF([test "x$enable_java_ports" = "xyes"],
2063       [AC_MSG_NOTICE([NOTICE: Opening ports for gnunet-java bindings by default.])])
2064
2065 # MHD
2066 AS_IF([test "x$lmhd" != "x1"],
2067       [AC_MSG_NOTICE([WARNING: optional libmicrohttpd not found])])
2068
2069 # conversation
2070 AS_IF([test "x$conversation_backend" = "xnone"],
2071  [AS_IF([test "x$pulse" != "x1"],
2072    [AC_MSG_NOTICE([WARNING: libpulse(audio) not found, conversation will not be built.])])
2073   AS_IF([test "x$opus" != "x1"],
2074    [AC_MSG_NOTICE([WARNING: libopus not found, conversation will not be built.])])
2075   AS_IF([test "x$gst" != "x1"],
2076    [AC_MSG_NOTICE([WARNING: GStreamer not found, conversation will not be built.])])])
2077
2078 AS_IF([test "$extractor" != 1],
2079       [AC_MSG_WARN([ERROR: libextractor not found, but various file-sharing functions require it])])
2080
2081 AS_IF([test "x$working_libidn2" = x1],
2082       [AC_MSG_NOTICE([INFO: Using libidn2])])
2083 AS_IF([test "x$working_libidn1" = x1],
2084       [AC_MSG_NOTICE([INFO: Using libidn1])])
2085
2086 AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: $sqlite, Postgres: $postgres])
2087
2088 AS_IF([test "$enable_framework_build" = "yes"],
2089       [AC_MSG_NOTICE([Mac OS X framework build enabled.])])
2090
2091 AC_MSG_NOTICE([********************************************
2092 Please make sure NOW that you have created a user and group 'gnunet'
2093 and additionally a group 'gnunetdns'. On Debian and Ubuntu GNU/Linux, type:
2094         addgroup gnunetdns
2095         adduser --system --group --disabled-login --home /var/lib/gnunet gnunet
2096
2097 Make sure that '/var/lib/gnunet' is owned (and writable) by user
2098 'gnunet'.  Then, you can compile GNUnet with
2099         make
2100
2101 After that, run (if necessary as 'root')
2102         make install
2103 to install everything.
2104
2105 Each GNUnet user should be added to the 'gnunet' group (may
2106 require fresh login to come into effect):
2107         adduser USERNAME gnunet
2108 (run the above command as root once for each of your users, replacing
2109 "USERNAME" with the respective login names).  If you have a global IP
2110 address, no further configuration is required.
2111
2112 For more detailed setup instructions, see https://docs.gnunet.org/
2113
2114 Optionally, download and compile gnunet-gtk to get a GUI for
2115 file-sharing and configuration.  This is particularly recommended
2116 if your network setup is non-trivial, as gnunet-setup can be
2117 used to test in the GUI if your network configuration is working.
2118 gnunet-setup should be run as the "gnunet" user under X.  As it
2119 does very little with the network, running it as "root" is likely
2120 also harmless.  You can also run it as a normal user, but then
2121 you have to copy ~/.gnunet/gnunet.conf" over to the "gnunet" user's
2122 home directory in the end.
2123
2124 Once you have configured your peer, run (as the 'gnunet' user)
2125         gnunet-arm -s
2126 to start the peer.  You can then run the various GNUnet-tools as
2127 your "normal" user (who should only be in the group 'gnunet').
2128 ********************************************])