1 # This file is part of GNUnet.
2 # (C) 2001--2012 Christian Grothoff (and other contributing authors)
4 # GNUnet is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published
6 # by the Free Software Foundation; either version 2, or (at your
7 # option) any later version.
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 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with GNUnet; see the file COPYING. If not, write to the
16 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 02111-1307, USA.
20 # Process this file with autoconf to produce a configure script.
24 # Checks for programs.
25 AC_INIT([gnunet], [0.9.3],[bug-gnunet@gnu.org])
31 AM_INIT_AUTOMAKE([gnunet], [0.9.3])
32 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
33 AC_CONFIG_HEADERS([gnunet_config.h])
34 AH_TOP([#define _GNU_SOURCE 1])
45 LT_INIT([disable-static dlopen win32-dll])
56 if test "$enable_shared" = "no"
58 AC_MSG_ERROR([GNUnet only works with shared libraries. Sorry.])
61 CFLAGS="-Wall $CFLAGS"
62 # use '-fno-strict-aliasing', but only if the compiler can take it
63 if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
65 CFLAGS="-fno-strict-aliasing $CFLAGS"
68 # Use Linux interface name unless the OS has a different preference
69 DEFAULT_INTERFACE="\"eth0\""
71 funcstocheck="getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo"
75 *darwin* | *rhapsody* | *macosx*)
76 AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system])
77 CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS"
78 CFLAGS="-no-cpp-precomp -fno-common $CFLAGS"
79 AC_MSG_WARN([The VPN application cannot be compiled on your OS])
81 DEFAULT_INTERFACE="\"en0\""
87 AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
95 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
96 AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
97 CFLAGS="-D_THREAD_SAFE $CFLAGS"
98 build_target="freebsd"
104 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
105 AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
106 LIBS=`echo $LIBS | sed -e "s/-ldl//"`
107 build_target="openbsd"
113 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
114 AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
120 AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
121 AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
122 AC_CHECK_LIB(resolv, res_init)
123 AC_CHECK_LIB(rt, nanosleep)
124 build_target="solaris"
130 AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
131 CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS"
138 AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
139 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
140 AC_CHECK_LIB(intl, gettext)
141 LDFLAGS="$LDFLAGS -no-undefined"
142 CFLAGS="-mms-bitfields $CFLAGS"
143 build_target="cygwin"
150 AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
151 AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
152 AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
153 AC_CHECK_LIB(intl, gettext)
154 LDFLAGS="$LDFLAGS -Wl,-no-undefined -Wl,--export-all-symbols"
155 LIBS="$LIBS -lws2_32 -lplibc -lgnurx -lole32"
156 CFLAGS="-mms-bitfields $CFLAGS"
157 CPPFLAGS="-D_WIN32_WINNT=0x0501 -DHAVE_STAT64=1 $CPPFLAGS"
166 AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system])
171 AC_MSG_RESULT(Unrecognised OS $host_os)
172 AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
176 AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should be the default choice for the name of the first network interface])
177 AC_SUBST(DEFAULT_INTERFACE)
179 # Disable TCP-based IPC on systems that support UNIX domain
180 # sockets in default configuratin:
184 AC_MSG_CHECKING([for build target])
185 AM_CONDITIONAL(DARWIN, test "$build_target" = "darwin")
186 AM_CONDITIONAL(CYGWIN, test "$build_target" = "cygwin")
187 AM_CONDITIONAL(MINGW, test "$build_target" = "mingw")
188 AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris")
189 AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd")
190 AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd")
191 AM_CONDITIONAL(LINUX, test "$build_target" = "linux")
192 AM_CONDITIONAL(GNU, test "$build_target" = "gnu")
194 AC_MSG_RESULT([$build_target])
195 AC_SUBST(build_target)
196 AM_CONDITIONAL([am__fastdepOBJC], false)
197 AC_UNALIGNED_64_ACCESS
199 # some other checks for standard libs
200 AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32])
201 AC_CHECK_LIB(socket, socket)
203 AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported]))
205 # 'save' libs; only those libs found so far will be
206 # linked against _everywhere_. For the others, we
207 # will be more selective!
210 # libgnurx (regex library for W32)
212 AC_CHECK_LIB(gnurx, regexec, gnurx=1)
213 if test "x$gnurx" = "x0" -a "x$build_target" = "xmingw"
215 AC_MSG_ERROR([on W32 GNUnet needs libgnurx])
220 AM_PATH_LIBGCRYPT(1.2.0, gcrypt=1)
221 AC_CHECK_DECLS([gcry_mpi_lshift], [], [], [[#include <gcrypt.h>]])
225 AC_MSG_ERROR([GNUnet needs libgcrypt])
228 # Adam shostack suggests the following for Windows:
229 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
230 AC_ARG_ENABLE(gcc-hardening,
231 AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
232 [if test x$enableval = xyes; then
233 CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
234 CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector"
235 CFLAGS="$CFLAGS --param ssp-buffer-size=1"
236 LDFLAGS="$LDFLAGS -pie"
240 # Linker hardening options
241 # Currently these options are ELF specific - you can't use this with MacOSX
242 AC_ARG_ENABLE(linker-hardening,
243 AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups),
244 [if test x$enableval = xyes; then
245 LDFLAGS="$LDFLAGS -z relro -z now"
249 extra_logging=GNUNET_NO
250 AC_ARG_ENABLE([logging],
251 AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
252 [AS_IF([test "x$enableval" = "xyes"], [],
253 [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
254 [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
255 [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)])
257 AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise])
259 if test $build = $target
261 AC_MSG_CHECKING([for working HMAC])
263 LIBS="$LIBS $LIBGCRYPT_LIBS"
264 CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
266 [AC_LANG_PROGRAM([#include <gcrypt.h>
267 #include <stdio.h>], [[
270 unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72,
271 0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe,
272 0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde };
273 unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 };
274 unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80,
275 0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0,
276 0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b,
277 0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb,
278 0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b,
279 0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3};
281 if (!gcry_check_version (GCRYPT_VERSION))
283 fprintf (stderr, "Version mismatch %s <-> %s \n", gcry_check_version (NULL), GCRYPT_VERSION);
287 gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
288 gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
290 if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR)
292 fprintf (stderr, "gcry_md_open error\n");
296 gcry_md_setkey (mac, key, sizeof (key));
297 gcry_md_write (mac, data, sizeof (data));
299 if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0)
301 fprintf (stderr, "memcmp error\n");
309 [AC_MSG_RESULT([yes])],
314 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.])
318 AC_MSG_FAILURE([HMAC test failed])
322 AC_MSG_FAILURE([libgcrypt header version does not match library version])
326 fi # $build = $target
329 LIBCURL_CHECK_CONFIG(,7.21.3,curl=1,curl=0)
332 AM_CONDITIONAL(HAVE_LIBCURL, true)
333 AC_DEFINE([HAVE_LIBCURL],[1],[Have libcurl])
335 AM_CONDITIONAL(HAVE_LIBCURL, false)
341 AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false])
342 AC_CHECK_LIB([glpk],[glp_create_prob],,[gplk=false])
343 # GLPK must support atm MLP presolving, version >= 4.32
344 AC_CHECK_MEMBERS(glp_iocp.presolve,,[gplk=false],[[#include <glpk.h>]])
345 if test x$gplk = xfalse
347 AM_CONDITIONAL(HAVE_LIBGLPK, false)
348 AC_MSG_WARN([GNUnet requires GLPK >= 4.32])
350 AM_CONDITIONAL(HAVE_LIBGLPK, true)
351 AC_DEFINE([HAVE_LIBGLPK],[1],[Have GLPK])
356 AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false])
357 if test x$nss = xfalse
359 AM_CONDITIONAL(HAVE_GLIBCNSS, false)
360 AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin])
362 AM_CONDITIONAL(HAVE_GLIBCNSS, true)
367 # test for kvm and kstat (for CPU stats under BSD/Solaris)
368 AC_CHECK_LIB([kvm],[kvm_open])
369 AC_CHECK_LIB([kstat],[kstat_open])
371 # test for libextractor
373 AC_MSG_CHECKING(for libextractor)
374 AC_ARG_WITH(extractor,
375 [ --with-extractor=PFX base of libextractor installation],
376 [AC_MSG_RESULT([$with_extractor])
377 case $with_extractor in
381 AC_CHECK_HEADERS(extractor.h,
382 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
386 LDFLAGS="-L$with_extractor/lib $LDFLAGS"
387 CPPFLAGS="-I$with_extractor/include $CPPFLAGS"
388 AC_CHECK_HEADERS(extractor.h,
389 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
390 EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH"
395 [AC_MSG_RESULT([--with-extractor not specified])
396 AC_CHECK_HEADERS(extractor.h,
397 AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults],
399 if test "$extractor" != 1
401 AC_MSG_ERROR([GNUnet requires libextractor])
406 # test for libunistring
408 if test $HAVE_LIBUNISTRING != yes; then
409 AC_MSG_ERROR([GNUnet requires libunistring])
411 if test $gl_libunistring_hexversion -le 2305; then
412 AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1])
419 # Checks for standard header files.
423 # Check for headers that are ALWAYS required
424 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]))
426 # Checks for headers that are only required on some systems or opional (and where we do NOT abort if they are not there)
427 AC_CHECK_HEADERS([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 netinet/in_systm.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 endian.h sys/endian.h execinfo.h])
429 SAVE_LDFLAGS=$LDFLAGS
430 SAVE_CPPFLAGS=$CPPFLAGS
434 AC_MSG_CHECKING(for SQLite)
436 [ --with-sqlite=PFX base of SQLite installation],
437 [AC_MSG_RESULT("$with_sqlite")
442 AC_CHECK_HEADERS(sqlite3.h,
446 LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
447 CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
448 AC_CHECK_HEADERS(sqlite3.h,
449 EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH"
450 SQLITE_LDFLAGS="-L$with_sqlite/lib"
451 SQLITE_CPPFLAGS="-I$with_sqlite/include"
453 LDFLAGS=$SAVE_LDFLAGS
454 CPPFLAGS=$SAVE_CPPFLAGS
458 [AC_MSG_RESULT([--with-sqlite not specified])
459 AC_CHECK_HEADERS(sqlite3.h, sqlite=true)])
460 AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue)
461 AC_SUBST(SQLITE_CPPFLAGS)
462 AC_SUBST(SQLITE_LDFLAGS)
466 AC_MSG_CHECKING(for postgres)
467 AC_ARG_WITH(postgres,
468 [ --with-postgres=PFX base of postgres installation],
469 [AC_MSG_RESULT("$with_postgres")
470 case $with_postgres in
474 AC_CHECK_HEADERS(postgresql/libpq-fe.h,
478 LDFLAGS="-L$with_postgres/lib $LDFLAGS"
479 CPPFLAGS="-I$with_postgres/include $CPPFLAGS"
480 AC_CHECK_HEADERS(postgresql/libpq-fe.h,
481 EXT_LIB_PATH="-L$with_postgres/lib $EXT_LIB_PATH"
482 POSTGRES_LDFLAGS="-L$with_postgres/lib"
483 POSTGRES_CPPFLAGS="-I$with_postgres/include"
485 LDFLAGS=$SAVE_LDFLAGS
486 CPPFLAGS=$SAVE_CPPFLAGS
490 [AC_MSG_RESULT([--with-postgres not specified])
491 AC_CHECK_HEADERS(postgresql/libpq-fe.h, postgres=true)])
492 AM_CONDITIONAL(HAVE_POSTGRES, test x$postgres = xtrue)
493 AC_SUBST(POSTGRES_CPPFLAGS)
494 AC_SUBST(POSTGRES_LDFLAGS)
496 # test for libz (maybe required for linking mysql)
498 AC_CHECK_LIB(z, compress,,zlib=0)
499 AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
502 AC_MSG_ERROR([GNUnet requires zlib])
506 AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
507 AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
509 if test "$build_target" = "mingw"
511 CYGWIN_MYSQL_MAGIC="#include <mysql/my_global.h>"
517 SAVE_LDFLAGS=$LDFLAGS
518 SAVE_CPPFLAGS=$CPPFLAGS
519 AC_MSG_CHECKING(for mysql)
521 [ --with-mysql=PFX base of MySQL installation],
522 [AC_MSG_RESULT("$with_mysql")
523 if test "$with_mysql" != "no"
525 if test "$with_mysql" != "yes"
527 LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS"
528 CPPFLAGS="-I$with_mysql/include $CPPFLAGS"
530 AC_CHECK_HEADERS(mysql/mysql.h,
531 AC_CHECK_LIB(mysqlclient, mysql_init,
532 MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql"
533 MYSQL_CPPFLAGS="-I$with_mysql/include"
535 mysql=true), [], [$CYGWIN_MYSQL_MAGIC])
538 [AC_MSG_RESULT([--with-mysql not specified])
539 LDFLAGS="-L/usr/lib/mysql $LDFLAGS $ZLIBS"
540 AC_CHECK_LIB(mysqlclient, mysql_init,
541 [AC_CHECK_HEADERS(mysql/mysql.h,
542 MYSQL_LDFLAGS="-L/usr/lib/mysql"
545 , [], [$CYGWIN_MYSQL_MAGIC])])
548 AC_SUBST(MYSQL_LDFLAGS)
549 AC_SUBST(MYSQL_CPPFLAGS)
551 # additional version check for mysql
552 AC_ARG_ENABLE(mysql-version-check, [ --disable-mysql-version-check do not check MySQL version],, enable_mysql_version_check=yes)
553 if test "$mysql" = "true" -a "x$enable_mysql_version_check" = "xyes"
555 AC_MSG_CHECKING(mysql version)
556 AC_RUN_IFELSE([AC_LANG_PROGRAM(
557 [[$CYGWIN_MYSQL_MAGIC
558 #include <mysql/mysql.h>]],
559 [[if (MYSQL_VERSION_ID < 40100)
564 ],mysql=true,mysql=false)
565 if test "$mysql" = "false"
568 AC_MSG_RESULT([fail, >= 4.1 required])
573 AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue)
574 AM_CONDITIONAL(HAVE_MYSQLE, test "0" = "1")
577 LDFLAGS=$SAVE_LDFLAGS
578 CPPFLAGS=$SAVE_CPPFLAGS
580 if test "$sqlite" = 0 -a "$mysql" = 0
582 AC_MSG_ERROR([GNUnet requires SQLite or MySQL])
587 AC_MSG_CHECKING([for libmicrohttpd])
588 AC_ARG_WITH(microhttpd,
589 [ --with-microhttpd=PFX base of libmicrohttpd installation],
590 [AC_MSG_RESULT([$with_microhttpd])
591 case $with_microhttpd in
595 AC_CHECK_HEADERS([microhttpd.h],
596 AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
597 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
598 [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.18])
600 #include "$srcdir/src/include/platform.h"
601 #include <microhttpd.h>
602 int main () { return MHD_VERSION >= 0x0091200 ? 0 : 1; }
605 lmhd=1],[AC_MSG_RESULT(failed)],lmhd=1)]),
606 [],[#include "$srcdir/src/include/platform.h"
607 #include <microhttpd.h>]),,
608 [#include "$srcdir/src/include/platform.h"])
611 LDFLAGS="-L$with_microhttpd/lib $LDFLAGS"
612 CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"
613 AC_CHECK_HEADERS(microhttpd.h,
614 AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
615 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
616 EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
617 [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.18])
619 #include "$srcdir/src/include/platform.h"
620 #include <microhttpd.h>
621 int main () { return MHD_VERSION >= 0x0091200 ? 0 : 1; }
624 lmhd=1],[AC_MSG_RESULT(failed)],lmhd=1)]),
625 [],[#include "$srcdir/src/include/platform.h"
626 #include <microhttpd.h>]),,
627 [#include "$srcdir/src/include/platform.h"])
631 [AC_MSG_RESULT([--with-microhttpd not specified])
632 AC_CHECK_HEADERS([microhttpd.h],
633 AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
634 AC_CHECK_LIB([microhttpd], [MHD_start_daemon],
635 [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.18])
637 #include "$srcdir/src/include/platform.h"
638 #include <microhttpd.h>
639 int main () { return MHD_VERSION >= 0x0091200 ? 0 : 1; }
642 lmhd=1],[AC_MSG_RESULT(failed)],lmhd=1)]),
643 [],[#include "$srcdir/src/include/platform.h"
644 #include <microhttpd.h>]),,
645 [#include "$srcdir/src/include/platform.h"])])
646 AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1)
647 AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd])
653 # check for python & pexpect (used for some testcases only)
654 AM_PATH_PYTHON([2.6],, [:])
655 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
658 AM_GNU_GETTEXT([external])
659 AM_GNU_GETTEXT_VERSION([0.16.1])
664 # Checks for standard typedefs, structures, and compiler characteristics.
673 AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
674 [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?])
678 #include <sys/types.h>
679 #include <sys/socket.h>
680 #include <netinet/in.h>
685 # Checks for library functions.
686 AC_FUNC_CLOSEDIR_VOID
688 AC_PROG_GCC_TRADITIONAL
690 AC_FUNC_SELECT_ARGTYPES
700 AC_CHECK_FUNCS([atoll stat64 strnlen mremap setrlimit sysconf initgroups strndup gethostbyname2 getpeerucred getpeereid setresuid $funcstocheck getifaddrs freeifaddrs getresgid mallinfo])
705 gn_user_home_dir="~/.gnunet"
706 AC_ARG_WITH(user-home-dir,
708 [--with-user-home-dir=DIR],
709 [default user home directory (~/.gnunet)]),
710 [gn_user_home_dir=$withval])
711 AC_SUBST(GN_USER_HOME_DIR, $gn_user_home_dir)
712 gn_daemon_home_dir="/var/lib/gnunet"
713 AC_ARG_WITH(daemon-home-dir,
715 [--with-daemon-home-dir=DIR],
716 [default daemon home directory (/var/lib/gnunet)]),
717 [gn_daemon_home_dir=$withval])
718 AC_SUBST(GN_DAEMON_HOME_DIR, $gn_daemon_home_dir)
719 gn_daemon_config_dir="/etc"
720 AC_ARG_WITH(daemon-config-dir,
722 [--with-daemon-config-dir=DIR],
723 [default daemon config directory (/etc)]),
724 [gn_daemon_config_dir=$withval])
725 AC_SUBST(GN_DAEMON_CONFIG_DIR, $gn_daemon_config_dir)
728 GN_LIBINTL="$LTLIBINTL"
729 AC_ARG_ENABLE(framework, [ --enable-framework enable Mac OS X framework build helpers],enable_framework_build=$enableval)
730 AM_CONDITIONAL(WANT_FRAMEWORK, test x$enable_framework_build = xyes)
731 if test x$enable_framework_build = xyes
733 AC_DEFINE([FRAMEWORK_BUILD], 1, [Build a Mac OS X Framework])
734 GN_INTLINCL='-I$(top_srcdir)/src/intlemu'
735 GN_LIBINTL='$(top_builddir)/src/intlemu/libintlemu.la -framework CoreFoundation'
736 AC_LIB_APPENDTOVAR([CPPFLAGS], [$GN_INTLINCL])
739 GN_LIB_LDFLAGS="-export-dynamic -no-undefined"
740 GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
742 AC_SUBST(GN_LIB_LDFLAGS)
743 AC_SUBST(GN_PLUGIN_LDFLAGS)
744 AC_SUBST(GN_INTLINCL)
750 AC_SUBST(EXT_LIB_PATH)
755 AC_SUBST(EXT_LIB_PATH)
759 AC_MSG_CHECKING(for sudo)
761 [ --with-sudo=PATH path to sudo binary (or just yes)],
762 [AC_MSG_RESULT("$with_sudo")
771 SUDO_BINARY=$with_sudo
775 [AC_MSG_RESULT([no])])
776 AC_SUBST(SUDO_BINARY)
777 AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "x" -o -w /])
779 # test for gnunetdns group name
780 GNUNETDNS_GROUP=gnunetdns
781 AC_MSG_CHECKING(for gnunetdns group name)
782 AC_ARG_WITH(gnunetdns,
783 [ --with-gnunetdns=GRPNAME name for gnunetdns group],
784 [AC_MSG_RESULT("$with_gnunetdns")
785 case $with_gnunetdns in
787 GNUNETDNS_GROUP=gnunet
790 GNUNETDNS_GROUP=gnunetdns
793 GNUNETDNS_GROUP=$with_gnunetdns
797 [AC_MSG_RESULT([gnunetdns])])
798 AC_SUBST(GNUNETDNS_GROUP)
804 AC_MSG_CHECKING(for gnutls)
806 [ --with-gnutls=PFX base of gnutls installation],
807 [AC_MSG_RESULT([$with_gnutls])
812 AC_CHECK_HEADERS([gnutls/abstract.h],
813 AC_CHECK_LIB([gnutls], [gnutls_priority_set],
817 LDFLAGS="-L$with_gnutls/lib $LDFLAGS"
818 CPPFLAGS="-I$with_gnutls/include $CPPFLAGS"
819 AC_CHECK_HEADERS([gnutls/abstract.h],
820 AC_CHECK_LIB([gnutls], [gnutls_priority_set],
821 EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH"
826 [AC_MSG_RESULT([--with-gnutls not specified])
827 AC_CHECK_HEADERS([gnutls/abstract.h],
828 AC_CHECK_LIB([gnutls], [gnutls_priority_set],
830 AM_CONDITIONAL(HAVE_GNUTLS, test x$gnutls = xtrue)
831 AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have gnutls])
835 # should 'make check' run tests?
836 AC_MSG_CHECKING(whether to run tests)
837 AC_ARG_ENABLE([testruns],
838 [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
839 [enable_tests_run=${enableval}],
840 [enable_tests_run=yes])
841 AC_MSG_RESULT($enable_test_run)
842 AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
845 # should monkey be used when running (certain) services?
846 AC_MSG_CHECKING(whether to run with monkey)
847 AC_ARG_ENABLE([monkey],
848 [AS_HELP_STRING([--enable-monkey], [enable running with monkey])],
849 [enable_monkey=${enableval}],
851 AC_MSG_RESULT($enable_monkey)
852 AM_CONDITIONAL([ENABLE_MONKEY], [test "x$enable_monkey" = "xyes"])
853 if test "x$enable_monkey" = "xyes"
855 MONKEYPREFIX="monkey"
859 AC_SUBST(MONKEYPREFIX)
862 # should expensive tests be run?
863 AC_MSG_CHECKING(whether to run expensive tests)
864 AC_ARG_ENABLE([expensivetests],
865 [AS_HELP_STRING([--enable-expensivetests], [enable running expensive testcases])],
866 [enable_expensive=${enableval}],
867 [enable_expensive=no])
868 AC_MSG_RESULT($enable_expensive)
869 AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [test "x$enable_expensive" = "xyes"])
871 # should ports be open for Java services?
872 AC_MSG_CHECKING(whether to enable ports for gnunet-java)
873 AC_ARG_ENABLE([javaports],
874 [AS_HELP_STRING([--enable-javaports], [use non-zero ports for services with Java bindings (default is NO)])],
875 [enable_java_ports=${enableval}],
876 [enable_java_ports=no])
877 AC_MSG_RESULT($enable_java_ports)
878 if test "x$enable_java_ports" = "xyes"
886 # should benchmarks be run?
887 AC_MSG_CHECKING(whether to run benchmarks during make check)
888 AC_ARG_ENABLE([benchmarks],
889 [AS_HELP_STRING([--enable-benchmarks], [enable running benchmarks during make check])],
890 [enable_benchmarks=${enableval}],
891 [enable_benchmarks=no])
892 AC_MSG_RESULT($enable_benchmarks)
893 AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"])
895 # should experimental code be compiled (code that may not yet compile)?
896 AC_MSG_CHECKING(whether to compile experimental code)
897 AC_ARG_ENABLE([experimental],
898 [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
899 [enable_experimental=${enableval}],
900 [enable_experimental=no])
901 AC_MSG_RESULT($enable_experimental)
902 AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
904 # should code be enabled that works around missing OS functionality on Windows?
905 # used for test cases
906 if test $build_target = "mingw"
912 [#include <ws2tcpip.h>
914 int s = socket (0, 0, 0);])
916 AC_DEFINE_UNQUOTED([HAVE_SOCKET],1,[Define this if socket() is available])
918 AC_DEFINE_UNQUOTED([HAVE_SOCKET],0,[Define this if socket() is available])
923 [#include <ws2tcpip.h>
925 int s = select (0, NULL, NULL, NULL, NULL);])
927 AC_DEFINE_UNQUOTED([HAVE_SELECT],1,[Define this if select() is available])
929 AC_DEFINE_UNQUOTED([HAVE_SELECT],0,[Define this if select() is available])
934 [#include <ws2tcpip.h>
937 char *s = inet_ntoa (i);])
939 AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],1,[Define this if inet_ntoa() is available])
941 AC_DEFINE_UNQUOTED([HAVE_INET_NTOA],0,[Define this if inet_ntoa() is available])
946 [#include <ws2tcpip.h>
948 int s = getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);])
950 AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],1,[Define this if getnameinfo() is available])
952 AC_DEFINE_UNQUOTED([HAVE_GETNAMEINFO],0,[Define this if getnameinfo() is available])
957 [#include <ws2tcpip.h>
959 int s = gethostname (NULL, 0);])
961 AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],1,[Define this if gethostname() is available])
963 AC_DEFINE_UNQUOTED([HAVE_GETHOSTNAME],0,[Define this if gethostname() is available])
968 [#include <ws2tcpip.h>
970 void *s = gethostbyname (NULL);])
972 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],1,[Define this if gethostbyname() is available])
974 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYNAME],0,[Define this if gethostbyname() is available])
979 [#include <ws2tcpip.h>
981 void *s = gethostbyaddr (NULL, 0, 0);])
983 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],1,[Define this if gethostbyaddr() is available])
985 AC_DEFINE_UNQUOTED([HAVE_GETHOSTBYADDR],0,[Define this if gethostbyaddr() is available])
990 [#include <ws2tcpip.h>
992 int s = getaddrinfo (NULL, NULL, NULL, NULL);])
994 AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
996 AC_DEFINE_UNQUOTED([HAVE_GETADDRINFO],1,[Define this if getaddrinfo() is available])
1000 AC_MSG_CHECKING(whether to enable windows workarounds)
1001 AC_ARG_ENABLE([windows_workarounds],
1002 [AS_HELP_STRING([--enable-windows_workarounds], [enable workarounds used on Windows (only useful for test cases)])],
1003 [enable_workarounds=${enableval}],
1004 [enable_workarounds=no])
1005 AC_MSG_RESULT($enable_workarounds)
1006 if test x$enable_windows_workarounds = "xyes"
1013 AC_DEFINE_UNQUOTED([ENABLE_WINDOWS_WORKAROUNDS], $workarounds, [enable workarounds used on Windows (only useful for test cases)])
1016 AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
1017 AC_ARG_ENABLE([coverage],
1018 AS_HELP_STRING([--enable-coverage],
1019 [compile the library with code coverage support]),
1020 [use_gcov=${enableval}],
1022 AC_MSG_RESULT($use_gcov)
1023 AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
1043 src/datacache/Makefile
1044 src/datastore/Makefile
1045 src/datastore/datastore.conf
1053 src/fragmentation/Makefile
1058 src/gns/nss/Makefile
1060 src/include/Makefile
1061 src/include/gnunet_directories.h
1062 src/hostlist/Makefile
1063 src/lockmanager/Makefile
1064 src/lockmanager/lockmanager.conf
1068 src/namestore/Makefile
1069 src/namestore/namestore.conf
1073 src/peerinfo/Makefile
1074 src/peerinfo/peerinfo.conf
1075 src/peerinfo-tool/Makefile
1076 src/postgres/Makefile
1079 src/statistics/Makefile
1080 src/statistics/statistics.conf
1082 src/template/Makefile
1083 src/testbed/Makefile
1084 src/testbed/testbed.conf
1085 src/testing/Makefile
1086 src/testing_old/Makefile
1087 src/topology/Makefile
1088 src/transport/Makefile
1089 src/transport/transport.conf
1092 src/util/resolver.conf
1095 src/integration-tests/Makefile
1097 pkgconfig/gnunetarm.pc
1098 pkgconfig/gnunetblock.pc
1099 pkgconfig/gnunetcore.pc
1100 pkgconfig/gnunetdatacache.pc
1101 pkgconfig/gnunetdatastore.pc
1102 pkgconfig/gnunetdht.pc
1103 pkgconfig/gnunetdhtlog.pc
1104 pkgconfig/gnunetdv.pc
1105 pkgconfig/gnunetfragmentation.pc
1106 pkgconfig/gnunetfs.pc
1107 pkgconfig/gnunethello.pc
1108 pkgconfig/gnunetnat.pc
1109 pkgconfig/gnunetnse.pc
1110 pkgconfig/gnunetpeerinfo.pc
1111 pkgconfig/gnunetregex.pc
1112 pkgconfig/gnunetstatistics.pc
1113 pkgconfig/gnunettesting.pc
1114 pkgconfig/gnunettransport.pc
1115 pkgconfig/gnunetutil.pc
1121 # warn user if mysql found but not used due to version
1122 if test "$mysqlfail" = "true"
1124 AC_MSG_NOTICE([NOTICE: MySQL found, but too old. MySQL support will not be compiled.])
1128 if test "x$sqlite" = "x0"
1130 AC_MSG_NOTICE([NOTICE: sqlite not found. sqLite support will not be compiled.])
1134 if test "x$curl" = "x0"
1136 AC_MSG_NOTICE([NOTICE: libcurl not found. http client support will not be compiled.])
1140 if test x$gnutls != xtrue
1142 AC_MSG_NOTICE([NOTICE: gnutls not found, gnunet-gns-proxy will not be built])
1146 if test "x$enable_java_ports" = "xyes"
1148 AC_MSG_NOTICE([NOTICE: opening ports for gnunet-java bindings by default.])
1151 if test "x$lmhd" != "x1"
1153 AC_MSG_NOTICE([NOTICE: libmicrohttpd not found, http transport will not be installed.])
1156 AC_MSG_NOTICE([NOTICE: Database support is set to MySQL: $mysql, SQLite: $sqlite, Postgres: $postgres])
1158 if test "$enable_framework_build" = "yes"
1160 AC_MSG_NOTICE([NOTICE: Mac OS X framework build enabled.])
1163 if test "x$SUDO_BINARY" = "x" -a ! -w /
1165 AC_MSG_NOTICE([NOTICE: --with-sudo not specified and not running as 'root', will not install GNS NSS library])
1169 AC_MSG_NOTICE([********************************************
1170 You can compile GNUnet with
1172 now. After that, run (if necessary as 'root')
1174 to install everything. You may want to create a new user account
1175 to run the GNUnet service:
1177 You also need to create an configuration file that should
1178 specify the path where GNUnet should store data. For example,
1179 you could store in "/etc/gnunet.conf" the following lines:
1182 SERVICEHOME = /var/lib/gnunet
1183 DEFAULTCONFIG = /etc/gnunet.conf
1185 Now, in order to start your peer, run as the 'gnunet' user
1188 Each GNUnet user should also create an (at least initially) empty
1190 mkdir $HOME/.gnunet/
1191 touch $HOME/.gnunet/gnunet.conf
1193 Optionally, download and compile:
1194 - gnunet-gtk to get a GUI for file-sharing and configuration.
1195 ********************************************])