license
[oweals/gnunet.git] / configure.ac
index 87a60cb040b3d2ad4d19f992335f2d035ccca153..5bfb4ce726bd0866c5adda6d6d246a9c7afccef0 100644 (file)
@@ -21,7 +21,7 @@
 #
 AC_PREREQ(2.61)
 # Checks for programs.
-AC_INIT([gnunet], [0.11.0pre66], [bug-gnunet@gnu.org])
+AC_INIT([gnunet], [0.11.0], [bug-gnunet@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
 
 AC_CANONICAL_TARGET
@@ -208,12 +208,17 @@ AM_CONDITIONAL(HAVE_SSH_KEY,  ssh -D 12345 -o "BatchMode yes" -o "UserKnownHosts
 rm -f /tmp/gnunet_test_cosks_ssh_garbage
 
 # autotools' m4 for python has no maximum version!
-# python3.7 for tests
-m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.7 python])
-AM_PATH_PYTHON([3.7],, [:])
+# python3.4 - python3.7 for tests
+m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python])
+AM_PATH_PYTHON([3.4],, [:])
 AC_SUBST([PYTHON])
 AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 
+# perl
+AC_PATH_PROG( PERL, perl, ,
+              $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
+AC_SUBST([PERL])
+
 # iptables is a soft requirement to run tests
 AC_PATH_TARGET_TOOL(VAR_IPTABLES_BINARY, iptables, false)
 
@@ -282,6 +287,7 @@ have_addrinfo_a=0
 AC_CHECK_LIB(anl, getaddrinfo_a, [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A,1,[getaddrinfo_a supported])])
 AM_CONDITIONAL(HAVE_GETADDRINFO_A, [test "$have_addrinfo_a" = 1])
 
+
 # tests only run on Windows
 if test "x$build_target" = "xmingw"
 then
@@ -311,6 +317,10 @@ then
 fi
 AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
 
+AC_CHECK_DECLS([struct in6_ifreq], [], [], [[#include <linux/if_tun.h>]])
+
+
+
 # should the build process be building the documentation?
 AC_MSG_CHECKING(whether to build documentation)
 AC_ARG_ENABLE([documentation],
@@ -327,13 +337,14 @@ else
   AC_DEFINE([DOCUMENTATION],[0],[Not building the documentation])
 fi
 
+# FIXME: Something is wrong about this in the output of ./configure runs
 AC_MSG_CHECKING(wether to include generated texi2mdoc output in installation)
 AC_ARG_ENABLE([texi2mdoc-generation],
-[AS_HELP_STRING([--disable-texi2mdoc-generation], [do not include generated texi2mdoc output in installation])],
-[texi2mdoc-generation=${enableval}],
-[texi2mdoc-generation=yes])
-AC_MSG_RESULT($texi2mdoc-generation)
-if test "x$texi2mdoc-generation" = "xyes"
+    [AS_HELP_STRING([--disable-texi2mdoc-generation], [do not include generated texi2mdoc output in installation])],
+    [texi2mdoc_generation=${enableval}],
+    [texi2mdoc_generation=yes])
+AC_MSG_RESULT($texi2mdoc_generation)
+if test "x$texi2mdoc_generation" = "xyes"
 then
   if test "$texi2mdoc" = 0
   then
@@ -365,6 +376,21 @@ else
   AC_DEFINE([DOCUMENTATION_ONLY],[0],[Not building only the documentation])
 fi
 
+# should the build process be including the manpages? (default: yes)
+AC_MSG_CHECKING(whether to include man pages)
+AC_ARG_ENABLE([include-manpages],
+   [AS_HELP_STRING([--disable-include-manpages], [Do not include the man pages in build and installation])],
+   [include_manpages=${enableval}],
+   [include_manpages=yes])
+AC_MSG_RESULT($include_manpages)
+if test "x$include_manpages" = "xyes"
+then
+  AM_CONDITIONAL([INCLUDE_MANPAGES],true)
+  AC_DEFINE([INCLUDE_MANPAGES],[1],[Including the man pages in the build and installation])
+else
+  AM_CONDITIONAL([INCLUDE_MANPAGES],false)
+  AC_DEFINE([INCLUDE_MANPAGES],[0],[Not including the man pages in the build and installation])
+fi
 
 # Adam shostack suggests the following for Windows:
 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
@@ -676,17 +702,19 @@ else
        AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL])
 fi
 
+AC_SEARCH_LIBS(__atomic_load_8, atomic, [have_libatomic=1 AC_DEFINE(HAVE_LIBATOMIC,1,[external libatomic])])
+AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1])
 
 # restore LIBS & CPPFLAGS
 LIBS=$SAVE_LIBS
 CPPFLAGS=$SAVE_CPPFLAGS
 
-AC_CHECK_HEADERS([glpk.h],[glpk=true],[gplk=false])
+AC_CHECK_HEADERS([glpk.h],[glpk=true],[glpk=false])
 # GLPK must support glpk_init_env, version >= 4.43
-AC_CHECK_LIB([glpk],[glp_init_env],,[gplk=false])
+AC_CHECK_LIB([glpk],[glp_init_env],,[glpk=false])
 # GLPK must support atm MLP presolving, version >= 4.32
-AC_CHECK_MEMBERS(glp_iocp.presolve,,[gplk=false],[[#include <glpk.h>]])
-if test x$gplk = xfalse
+AC_CHECK_MEMBERS(glp_iocp.presolve,,[glpk=false],[[#include <glpk.h>]])
+if test "x$glpk" = xfalse
 then
        AM_CONDITIONAL(HAVE_LIBGLPK, false)
        AC_MSG_WARN([ERROR: GNUnet requires GLPK  >= 4.32])
@@ -702,7 +730,14 @@ then
        AM_CONDITIONAL(HAVE_GLIBCNSS, false)
        AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin])
 else
-       AM_CONDITIONAL(HAVE_GLIBCNSS, true)
+       NSS_INCLUDES="
+       #include <nss.h>
+       "
+       AC_CHECK_DECL([NSS_STATUS_UNAVAIL],
+               [AM_CONDITIONAL(HAVE_GLIBCNSS, true)],
+               [AM_CONDITIONAL(HAVE_GLIBCNSS, false)
+                AC_MSG_WARN([No nss header fails to define NSS_STATUS_UNAVAIl, will not build NSS plugin])],
+               [$NSS_INCLUDES])
 fi
 
 
@@ -895,6 +930,9 @@ AS_IF([test x$working_libidn2 = x0],
                                      * --with-libidn])])])])
 AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1)
 
+AS_IF([test "$working_libidn1" = 0 -a "$working_libidn2" = 0],
+      [AC_MSG_ERROR([GNUnet requires libidn (or libidn2)])])
+
 AS_IF([test x$there_can_only_be_one = x0],
       [AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS])])
 
@@ -967,7 +1005,7 @@ AC_HEADER_DIRENT
 AC_HEADER_STDC
 
 # Check for headers that are ALWAYS required
-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]))
+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]))
 
 
 
@@ -1148,7 +1186,7 @@ AC_ARG_WITH(microhttpd,
         AC_CHECK_HEADERS([microhttpd.h],
          AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
-              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
+              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                 #include <microhttpd.h>
@@ -1171,7 +1209,7 @@ AC_ARG_WITH(microhttpd,
          AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
             AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
               EXT_LIB_PATH="-L$with_microhttpd/lib $EXT_LIB_PATH"
-              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
+              [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
                AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                 #include <microhttpd.h>
@@ -1193,12 +1231,12 @@ AC_ARG_WITH(microhttpd,
     AC_CHECK_HEADERS([microhttpd.h],
       AC_CHECK_DECL(MHD_OPTION_PER_IP_CONNECTION_LIMIT,
         AC_CHECK_LIB([microhttpd], [MHD_get_fdset2],
-          [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.42])
+          [AC_MSG_CHECKING([for libmicrohttpd >= 0.9.52])
               AC_COMPILE_IFELSE([AC_LANG_SOURCE([
                 #include "$native_srcdir/src/include/platform.h"
                #include <microhttpd.h>
                 #if (MHD_VERSION < 0x0094200)
-                #error needs at least version 0.9.42
+                #error needs at least version 0.9.52
                 #endif
                ])],
                [AC_MSG_RESULT(ok)
@@ -1304,6 +1342,7 @@ DATAROOTDIR=$datarootdir
 AC_SUBST(DATAROOTDIR)
 
 # test for sudo
+# TODO: do we need to change anything for "doas" on openbsd?
 AC_MSG_CHECKING(for sudo)
 AC_ARG_WITH(sudo,
   [  --with-sudo=PATH       path to sudo binary (or just yes)],
@@ -1705,11 +1744,14 @@ AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball ve
 AC_CONFIG_FILES([
 Makefile
 contrib/Makefile
+contrib/scripts/Makefile
+contrib/scripts/gnunet-logread/Makefile
 doc/Makefile
 doc/man/Makefile
 doc/doxygen/Makefile
 doc/handbook/Makefile
 doc/tutorial/Makefile
+lint/Makefile
 m4/Makefile
 po/Makefile.in
 src/Makefile
@@ -1805,7 +1847,6 @@ src/vpn/vpn.conf
 src/zonemaster/Makefile
 src/zonemaster/zonemaster.conf
 src/rest/Makefile
-src/rest-plugins/Makefile
 src/abe/Makefile
 src/reclaim-attribute/Makefile
 src/reclaim/Makefile