diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2021-11-11 00:56:30 +0100 |
---|---|---|
committer | Alessio Vanni <vannilla@firemail.cc> | 2021-11-21 18:42:34 +0100 |
commit | 20ffa0aa543853fb0d395167fb0a090c0e369db0 (patch) | |
tree | 0f6b0ae7414790cf6fc525c8b8e62446e37efc6d /configure.ac | |
parent | d744d49e13fa6175016e8dcfc0f9506b9f170759 (diff) | |
download | gnunet-20ffa0aa543853fb0d395167fb0a090c0e369db0.tar.gz gnunet-20ffa0aa543853fb0d395167fb0a090c0e369db0.zip |
Update configure.ac and a few macros used by it
The changes done to configure.ac are essentially divided in two categories:
the first is made of changes to improve existing checks, even if it's merely
in the message being printed during the check; the second category is made of
updates aimed at bringing this file closer to Autoconf 2.71, which deprecated
or even removed some stuff that was otherwise present either directly in
configure.ac or in one of the macros it includes, which have been updated in
this commit too.
Actually, the generated configure script was created by Autoconf 2.71 during
deveopment, so in a way it's already compatible with the latest version.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3067 |
1 files changed, 1251 insertions, 1816 deletions
diff --git a/configure.ac b/configure.ac index 2ec7fd6ee..0ea55a90f 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -20,332 +20,315 @@ | |||
20 | # | 20 | # |
21 | # | 21 | # |
22 | AC_PREREQ([2.69]) | 22 | AC_PREREQ([2.69]) |
23 | # Checks for programs. | 23 | AC_INIT([gnunet], m4_esyscmd_s([contrib/get_version.sh]), [bug-gnunet@gnu.org]) |
24 | AC_INIT([gnunet],m4_esyscmd([contrib/get_version.sh]),[bug-gnunet@gnu.org]) | 24 | |
25 | AC_CONFIG_AUX_DIR([build-aux]) | 25 | AC_CONFIG_AUX_DIR([build-aux]) |
26 | AC_CONFIG_MACRO_DIRS([m4]) | ||
26 | 27 | ||
27 | # check for legacy option that is no longer supported (#5627) and fail hard | 28 | AC_CONFIG_HEADERS([gnunet_config.h]) |
28 | AC_ARG_WITH(nssdir, | ||
29 | [ --with-nssdir=DIR legacy switch, no longer supported, do not use], | ||
30 | [AC_MSG_RESULT([$with_nssdir]) | ||
31 | AS_CASE([$with_nssdir], | ||
32 | [no],[], | ||
33 | [AC_MSG_ERROR([--with-nssdir is no longer supported])]) | ||
34 | ]) | ||
35 | 29 | ||
36 | AC_CANONICAL_TARGET | 30 | AC_CANONICAL_TARGET |
37 | AC_CANONICAL_HOST | 31 | AC_CANONICAL_HOST |
38 | AM_INIT_AUTOMAKE([1.9 tar-ustar]) | 32 | |
39 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AM_DEFAULT_VERBOSITY=1 AC_SUBST(AM_DEFAULT_VERBOSITY)]) | 33 | AM_INIT_AUTOMAKE([tar-ustar]) |
40 | AC_CONFIG_HEADERS([gnunet_config.h]) | 34 | AM_SILENT_RULES([yes]) |
41 | AH_TOP([#define _GNU_SOURCE 1]) | 35 | |
42 | AC_CONFIG_MACRO_DIR([m4]) | 36 | # maybe use AC_USE_SYSTEM_EXTENSIONS? |
37 | AH_TOP([#define _GNU_SOURCE 1]) | ||
38 | |||
43 | AC_PROG_AWK | 39 | AC_PROG_AWK |
44 | AC_PROG_CC | 40 | AC_PROG_CC |
45 | AC_PROG_OBJC | 41 | AC_PROG_CC_C_O |
46 | AC_PROG_INSTALL | 42 | AC_PROG_INSTALL |
47 | AC_PROG_LN_S | 43 | AC_PROG_LN_S |
48 | AC_PROG_MAKE_SET | 44 | AC_PROG_MAKE_SET |
49 | AM_PROG_CC_C_O | 45 | AC_PROG_MKDIR_P |
46 | |||
50 | LT_INIT([disable-static dlopen]) | 47 | LT_INIT([disable-static dlopen]) |
51 | AC_SUBST(MKDIR_P) | ||
52 | 48 | ||
53 | # allow for different autotools | 49 | AS_IF([test "x$enable_shared" = "xno"], |
50 | [AC_MSG_ERROR([GNUnet works only with shared libraries, sorry])]) | ||
51 | |||
54 | AS_AUTOTOOLS_ALTERNATE | 52 | AS_AUTOTOOLS_ALTERNATE |
55 | 53 | ||
56 | # large file support | ||
57 | AC_SYS_LARGEFILE | 54 | AC_SYS_LARGEFILE |
58 | AC_FUNC_FSEEKO | 55 | AC_FUNC_FSEEKO |
56 | AC_UNALIGNED_64_ACCESS | ||
59 | 57 | ||
60 | 58 | # Helper to check cflags for compiler | |
61 | CFLAGS="-Wall $CFLAGS" | 59 | # CC_CHECK_CFLAGS(FLAG, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]) |
62 | AC_MSG_CHECKING(whether cc can use -fno-strict-aliasing) | 60 | AC_DEFUN([CC_CHECK_CFLAGS_SILENT], |
63 | # use '-fno-strict-aliasing', but only if the compiler can take it | 61 | [AC_CACHE_VAL([AS_TR_SH([cc_cv_cflags_$1])], |
64 | AS_IF([$CC -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1], | 62 | [ac_save_CFLAGS="$CFLAGS" |
65 | [CFLAGS="-fno-strict-aliasing $CFLAGS"]) | 63 | CFLAGS="$CFLAGS $1 -Werror" |
66 | 64 | AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])], | |
67 | # A helper which allows us to check cflags if compiler | 65 | [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"], |
68 | AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [ | 66 | [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"]) |
69 | AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]), | 67 | CFLAGS="$ac_save_CFLAGS"]) |
70 | [ac_save_CFLAGS="$CFLAGS" | 68 | AS_IF([eval test "x$]AS_TR_SH([cc_cv_cflags_$1])[" = "xyes"], |
71 | CFLAGS="$CFLAGS $1 -Werror" | 69 | [$2], |
72 | AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])], | 70 | [$3]) |
73 | [eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"], | 71 | ])dnl |
74 | [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"]) | 72 | |
75 | CFLAGS="$ac_save_CFLAGS" | 73 | # Check for FLAG and append it to CFLAGS if supported |
76 | ]) | 74 | # CC_CHECK_CFLAG_APPEND(FLAG, [ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND]]) |
77 | 75 | AC_DEFUN([CC_CHECK_CFLAG_APPEND], | |
78 | AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes], | 76 | [AC_CACHE_CHECK([if $CC supports $1], |
79 | [$2], [$3]) | 77 | [AS_TR_SH([cc_cv_cflags_$1])], |
80 | ]) | 78 | [CC_CHECK_CFLAGS_SILENT([$1])]) |
81 | 79 | AS_IF([eval test "x$]AS_TR_SH([cc_cv_cflags_$1])[" = "xyes"], | |
82 | 80 | [CFLAGS="$CFLAGS $1"; $2], | |
83 | # CC_CHECK_CFLAG_APPEND(FLAG, [action-if-found], [action-if-not-found]) | 81 | [$3]) |
84 | # Check for CFLAG and appends them to CFLAGS if supported | 82 | ])dnl |
85 | AC_DEFUN([CC_CHECK_CFLAG_APPEND], [ | 83 | |
86 | AC_CACHE_CHECK([if $CC supports -Wno-$1 flag], | 84 | # Workaround for GCC not doing the proper thing when using a '-Wno' flag. |
87 | AS_TR_SH([cc_cv_cflags_-W$1]), | 85 | # Works like CC_CHECK_CFLAG_APPEND except that the '-Wno' prefix is omitted |
88 | CC_CHECK_CFLAGS_SILENT([-W$1]) #gcc is stupid. It does not fail with the -W-no option for backwards compat but then shows the error "in case something goes wrong". | 86 | # (e.g. '-Wno-foo' becomes 'foo') |
89 | ) | 87 | AC_DEFUN([CC_CHECK_CFLAG_WNO_APPEND], |
90 | 88 | [AC_CACHE_CHECK([if $CC supports -Wno-$1], | |
91 | AS_IF([eval test x$]AS_TR_SH([cc_cv_cflags_-W$1])[ = xyes], | 89 | [AS_TR_SH([cc_cv_cflags__W$1])], |
92 | [CFLAGS="$CFLAGS -Wno-$1"; $2], [$3]) | 90 | [CC_CHECK_CFLAGS_SILENT([-W$1])]) |
93 | ]) | 91 | AS_IF([eval test "x$]AS_TR_SH([cc_cv_cflags__W$1])[" = "xyes"], |
94 | 92 | [CFLAGS="$CFLAGS -Wno-$1"; $2], | |
95 | 93 | [$3]) | |
96 | # We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable. | 94 | ])dnl |
97 | CC_CHECK_CFLAG_APPEND([address-of-packed-member]) | 95 | |
98 | 96 | # Use no-strict-aliasing only if the compiler supports it | |
99 | # We make heavy use of this, llvm/gcc and gcc-9 give warnings so disable. | 97 | CC_CHECK_CFLAG_APPEND([-fno-strict-aliasing]) |
100 | CC_CHECK_CFLAG_APPEND([tautological-constant-out-of-range-compare]) | 98 | |
101 | 99 | # We make heavy use of these, gcc 9 gives warnings so disable them. | |
102 | # Use Linux interface name unless the OS has a different preference | 100 | CC_CHECK_CFLAG_WNO_APPEND([address-of-packed-member]) |
103 | DEFAULT_INTERFACE="\"eth0\"" | 101 | CC_CHECK_CFLAG_WNO_APPEND([tautological-constant-out-of-range-compare]) |
104 | |||
105 | AC_CHECK_FUNCS(getnameinfo gethostname gethostbyname gethostbyaddr getaddrinfo getaddrinfo_a) | ||
106 | |||
107 | # Srcdir in a form that native compiler understands (i.e. DOS path on W32) | ||
108 | native_srcdir=$srcdir | ||
109 | 102 | ||
110 | OLD_LDFLAGS="$LDFLAGS" | 103 | OLD_LDFLAGS="$LDFLAGS" |
111 | LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all" | 104 | LDFLAGS="$LDFLAGS -Wl,--unresolved-symbols=report-all" |
112 | 105 | ||
113 | # Check system type | ||
114 | AS_CASE(["$host_os"], | 106 | AS_CASE(["$host_os"], |
115 | [*darwin* | *rhapsody* | *macosx*],[ | 107 | [*darwin*|*rhapsody*|*macosx*], |
116 | AC_DEFINE_UNQUOTED(DARWIN,1,[This is an Apple Darwin system]) | 108 | [AC_DEFINE([DARWIN],[1],[Define to 1 if this is an Apple Darwin system]) |
117 | CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS" | 109 | CPPFLAGS="-D_APPLE_C_SOURCE $CPPFLAGS" |
118 | CFLAGS="-fno-common -D__APPLE_USE_RFC_3542 $CFLAGS" | 110 | CFLAGS="-fno-common -D__APPLE_USE_RFC_3542 $CFLAGS" |
119 | LDFLAGS="$OLD_LDFLAGS" | 111 | LDFLAGS="$OLD_LDFLAGS" |
120 | AC_MSG_WARN([WARNING: The VPN application cannot be compiled on your OS]) | 112 | build_target="darwin" |
121 | AC_CHECK_LIB(intl, gettext) | 113 | DEFAULT_INTERFACE="\"en0\"" |
122 | build_target="darwin" | 114 | LIBPREFIX= |
123 | DEFAULT_INTERFACE="\"en0\"" | 115 | DLLDIR=lib |
124 | LIBPREFIX= | 116 | UNIXONLY="#" |
125 | DLLDIR=lib | 117 | AC_CHECK_LIB([intl], [gettext])], |
126 | UNIXONLY="#" | 118 | [linux*], |
127 | ], | 119 | [AC_DEFINE([LINUX],[1],[Define to 1 if this is a system with a Linux kernel]) |
128 | [linux*],[ | 120 | build_target="linux" |
129 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) | 121 | DEFAULT_INTERFACE="\"eth0\"" |
130 | build_target="linux" | 122 | LIBPREFIX= |
131 | LIBPREFIX= | 123 | DLLDIR=lib |
132 | DLLDIR=lib | 124 | UNIXONLY="#" |
133 | UNIXONLY="#" | 125 | AC_PATH_XTRA |
134 | AC_PATH_XTRA | ||
135 | ], | 126 | ], |
136 | [*freebsd*],[ | 127 | [*freebsd*], |
137 | CFLAGS="-D_THREAD_SAFE $CFLAGS" | 128 | [CFLAGS="-D_THREAD_SAFE $CFLAGS" |
138 | build_target="freebsd" | 129 | build_target="freebsd" |
139 | LIBPREFIX= | 130 | xbsd="yes" |
140 | DLLDIR=lib | 131 | LIBPREFIX= |
141 | UNIXONLY="#" | 132 | DLLDIR=lib |
133 | UNIXONLY="#" | ||
142 | ], | 134 | ], |
143 | [*openbsd*],[ | 135 | [*openbsd*], |
144 | # We need to explicitly link libc | 136 | [# libc needs to be linked explicitly |
145 | LDFLAGS="$LDFLAGS -Wl,-lc" | 137 | LDFLAGS="$LDFLAGS -Wl -lc" |
146 | # We also need to enable PIC | 138 | # and PIC has to be enabled |
147 | CFLAGS="-fPIC $CFLAGS" | 139 | CFLAGS="-fPIC $CFLAGS" |
148 | build_target="openbsd" | 140 | build_target="openbsd" |
149 | LIBPREFIX= | 141 | xbsd="yes" |
150 | DLLDIR=lib | 142 | LIBPREFIX= |
151 | UNIXONLY="#" | 143 | DLLDIR=lib |
144 | UNIXONLY="#" | ||
152 | ], | 145 | ], |
153 | [*netbsd*],[ | 146 | [*netbsd*], |
154 | build_target="netbsd" | 147 | [build_target="netbsd" |
155 | LIBPREFIX= | 148 | xbsd="yes" |
156 | DLLDIR=lib | 149 | LIBPREFIX= |
157 | UNIXONLY="#" | 150 | DLLDIR=lib |
151 | UNIXONLY="#" | ||
158 | ], | 152 | ], |
159 | [*solaris*],[ | 153 | [*solaris*], |
160 | AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system]) | 154 | [AC_DEFINE([SOLARIS],[1],[Define to 1 if this is a Solaris system]) |
161 | AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno does not work]) | 155 | AC_DEFINE([_REENTRANT],[1],[Needed with Solaris or errno does not work]) |
162 | AC_CHECK_LIB(resolv, res_init) | 156 | AC_CHECK_LIB([resolv], [res_init]) |
163 | AC_CHECK_LIB(rt, nanosleep) | 157 | AC_CHECK_LIB([rt], [nanosleep]) |
164 | build_target="solaris" | 158 | build_target="solaris" |
165 | LIBPREFIX= | 159 | DEFAULT_INTERFACE="\"eth0\"" |
166 | DLLDIR=lib | 160 | LIBPREFIX= |
167 | UNIXONLY="#" | 161 | DLLDIR=lib |
162 | UNIXONLY="#" | ||
168 | ], | 163 | ], |
169 | [*arm-linux*],[ | 164 | [*arm-linux*], |
170 | AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux kernel]) | 165 | [AC_DEFINE([LINUX],[1],[Define to 1 if this is a system with a Linux kernel]) |
171 | CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS" | 166 | CFLAGS="-D_REENTRANT -fPIC -pipe $CFLAGS" |
172 | build_target="linux" | 167 | build_target="linux" |
173 | LIBPREFIX= | 168 | DEFAULT_INTERFACE="\"eth0\"" |
174 | DLLDIR=lib | 169 | LIBPREFIX= |
175 | UNIXONLY="#" | 170 | DLLDIR=lib |
171 | UNIXONLY="#" | ||
176 | ], | 172 | ], |
177 | [gnu*],[ | 173 | [gnu*], |
178 | AC_DEFINE_UNQUOTED(GNU,1,[This is a GNU system]) | 174 | [AC_DEFINE([GNU],[1],[Define to 1 if this is a GNU system]) |
179 | build_target="gnu" | 175 | build_target="gnu" |
180 | UNIXONLY="#" | 176 | DEFAULT_INTERFACE="\"eth0\"" |
177 | UNIXONLY="#" | ||
181 | ], | 178 | ], |
182 | [ | 179 | [AC_DEFINE([OTHEROS],[1],[Define to 1 if this is some strange OS]) |
183 | AC_MSG_RESULT(Unrecognised OS $host_os) | 180 | DEFAULT_INTERFACE="\"eth0\"" |
184 | AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS]) | 181 | ]) |
185 | UNIXONLY="" | ||
186 | ]) | ||
187 | AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], $DEFAULT_INTERFACE, [This should be the default choice for the name of the first network interface]) | ||
188 | AC_SUBST(DEFAULT_INTERFACE) | ||
189 | 182 | ||
190 | # Disable TCP-based IPC on systems that support UNIX domain | 183 | AC_DEFINE_UNQUOTED([GNUNET_DEFAULT_INTERFACE], [$DEFAULT_INTERFACE], |
191 | # sockets in default configuration: | 184 | [The default choice for the name of the first network interface]) |
192 | AC_SUBST(UNIXONLY) | 185 | AC_SUBST([DEFAULT_INTERFACE]) |
193 | 186 | ||
187 | # Disable TCP-based IPC on system supporting UNIX domain sockets | ||
188 | AC_SUBST([UNIXONLY]) | ||
194 | 189 | ||
195 | AC_MSG_CHECKING([for build target]) | 190 | AC_MSG_CHECKING([for build target]) |
196 | AM_CONDITIONAL(DARWIN, test "$build_target" = "darwin") | 191 | AM_CONDITIONAL([DARWIN], [test "$build_target" = "darwin"]) |
197 | AM_CONDITIONAL(SOLARIS, test "$build_target" = "solaris") | 192 | AM_CONDITIONAL([SOLARIS], [test "$build_target" = "solaris"]) |
198 | AM_CONDITIONAL(XNETBSD, test "$build_target" = "netbsd") | 193 | AM_CONDITIONAL([XNETBSD], [test "$build_target" = "netbsd"]) |
199 | AM_CONDITIONAL(XFREEBSD, test "$build_target" = "freebsd") | 194 | AM_CONDITIONAL([XFREEBSD], [test "$build_target" = "freebsd"]) |
200 | AM_CONDITIONAL(OPENBSD, test "$build_target" = "openbsd") | 195 | AM_CONDITIONAL([OPENBSD], [test "$build_target" = "openbsd"]) |
201 | # FIXME: We need a define BSD for some binaries like we | 196 | AM_CONDITIONAL([XBSD], [test "x$bsd" = "xyes"]) |
202 | # need define LINUX for some. This does not scale, how | 197 | AM_CONDITIONAL([LINUX], [test "$build_target" = "linux"]) |
203 | # can we solve this better? | 198 | AM_CONDITIONAL([GNU], [test "$build_target" = "gnu"]) |
204 | AM_CONDITIONAL(XBSD, test "$build_target" = "netbsd" -o "$build_target" = "freebsd" -o "$build_target" = "openbsd") | ||
205 | AM_CONDITIONAL(LINUX, test "$build_target" = "linux") | ||
206 | AM_CONDITIONAL(GNU, test "$build_target" = "gnu") | ||
207 | |||
208 | AC_MSG_RESULT([$build_target]) | 199 | AC_MSG_RESULT([$build_target]) |
209 | AC_SUBST(build_target) | ||
210 | AM_CONDITIONAL([am__fastdepOBJC], false) | ||
211 | AC_UNALIGNED_64_ACCESS | ||
212 | 200 | ||
213 | # some other checks for standard libs | 201 | AS_IF([test "$build_target" = "darwin"], |
214 | AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32]) | 202 | [AC_MSG_WARN([The VPN application cannot be compiled on your system])]) |
215 | AC_SEARCH_LIBS([memrchr], [], | ||
216 | AC_DEFINE(HAVE_MEMRCHR,1,[memrchr supported]), []) | ||
217 | AC_SEARCH_LIBS([memset_s], [], | ||
218 | AC_DEFINE(HAVE_MEMSET_S,1,[memset_s supported]), []) | ||
219 | AC_SEARCH_LIBS([explicit_bzero], [], | ||
220 | AC_DEFINE(HAVE_EXPLICIT_BZERO,1,[explicit_bzero supported]), []) | ||
221 | AC_CHECK_LIB(socket, socket) | ||
222 | AC_CHECK_LIB(m, log) | ||
223 | AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported])) | ||
224 | |||
225 | AC_CHECK_PROG(VAR_GETOPT_BINARY, getopt, true, false) | ||
226 | AM_CONDITIONAL(HAVE_GETOPT_BINARY, $VAR_GETOPT_BINARY) | ||
227 | |||
228 | AC_CHECK_PROGS(PKG_CONFIG, [pkgconf, pkg-config], false) | ||
229 | AM_CONDITIONAL(HAVE_PKG_CONFIG, test x$PKG_CONFIG != xfalse) | ||
230 | |||
231 | AC_CHECK_PROG(VAR_SSH_BINARY, ssh, true, false) | ||
232 | AM_CONDITIONAL(HAVE_SSH_BINARY, $VAR_SSH_BINARY) | ||
233 | AC_MSG_CHECKING(for SSH key) | ||
234 | 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) | ||
235 | if test -f /tmp/gnunet_test_cosks_ssh_garbage; then | ||
236 | rm -f /tmp/gnunet_test_cosks_ssh_garbage | ||
237 | fi | ||
238 | |||
239 | |||
240 | # autotools' m4 for python has no maximum version! | ||
241 | # python3.4 - python3.8 for tests (3.8 unchecked) | ||
242 | # TODO: document how to override the lowest version | ||
243 | # TODO: found by this. | ||
244 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST],[python3 python3.4 python3.5 python3.6 python3.7 python3.8 python]) | ||
245 | AM_PATH_PYTHON([3.4],, [:]) | ||
246 | AC_SUBST([PYTHON]) | ||
247 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) | ||
248 | 203 | ||
204 | AC_SUBST([build_target]) | ||
249 | 205 | ||
250 | # perl | 206 | # Other checks for standard libraries |
251 | AC_PATH_PROG( PERL, perl, , | 207 | AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32]) |
252 | $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) | 208 | AC_SEARCH_LIBS([memchr],[], |
209 | [AC_DEFINE([HAVE_MEMCHR],[1], | ||
210 | [Define to 1 if memchr is supported])], | ||
211 | []) | ||
212 | AC_SEARCH_LIBS([memset_s],[], | ||
213 | [AC_DEFINE([HAVE_MEMSET_S],[1], | ||
214 | [Define to 1 if memset_s is supported])], | ||
215 | []) | ||
216 | AC_SEARCH_LIBS([explicit_bzero],[], | ||
217 | [AC_DEFINE([HAVE_EXPLICIT_BZERO],[1], | ||
218 | [Define to 1 if explicit_bzero is supported])], | ||
219 | []) | ||
220 | |||
221 | AC_CHECK_LIB([socket], [socket]) | ||
222 | AC_CHECK_LIB([m], [log]) | ||
223 | AC_CHECK_FUNCS([getloadavg]) | ||
224 | |||
225 | AC_CHECK_PROG([GETOPT_BINARY], [getopt], [true], [false]) | ||
226 | AM_CONDITIONAL([HAVE_GETOPT_BINARY], [$GETOPT_BINARY]) | ||
227 | |||
228 | AC_CHECK_PROGS([PKG_CONFIG], [pkgconf pkg-config], [false]) | ||
229 | AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "xfalse"]) | ||
230 | |||
231 | AC_CHECK_PROG([SSH_BINARY], [ssh], [true], [false]) | ||
232 | AM_CONDITIONAL([HAVE_SSH_BINARY], [$SSH_BINARY]) | ||
233 | |||
234 | AC_MSG_CHECKING([for SSH key]) | ||
235 | AS_IF([ssh -D 12345 -o "BatchMode Yes" -o "UserKnownHostsFile /tmp/gnunet_test_cosks_ssh_garbage" -o "StrictHostKeyChecking no" 127.0.0.1 echo -n 2>/dev/null], | ||
236 | [has_ssh_key=yes], | ||
237 | [has_ssh_key=no]) | ||
238 | AM_CONDITIONAL([HAVE_SSH_KEY], [test "x$has_ssh_key" = "xyes"]) | ||
239 | AC_MSG_RESULT([$has_ssh_key]) | ||
240 | |||
241 | AS_IF([test -f /tmp/gnunet_test_cosks_ssh_garbage], | ||
242 | [rm -f /tmp/gnunet_test_cosks_ssh_garbage]) | ||
243 | |||
244 | AM_PATH_PYTHON([3.4],,[:]) | ||
245 | AC_SUBST([PYTHON]) | ||
246 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ':']) | ||
247 | |||
248 | AC_ARG_WITH([perl], | ||
249 | [AS_HELP_STRING([--with-perl=PATH], [Look for Perl in PATH])], | ||
250 | [AS_CASE([$withval], | ||
251 | [no], [AC_MSG_ERROR([Perl is required])], | ||
252 | [yes], [AC_PATH_PROG([PERL], [perl])], | ||
253 | [AC_PATH_PROG([PERL], [perl], [], ["$withval"])])], | ||
254 | [AC_PATH_PROG([PERL], [perl])]) | ||
253 | AC_SUBST([PERL]) | 255 | AC_SUBST([PERL]) |
254 | AM_CONDITIONAL([HAVE_PERL], [test -x "$PERL"]) | 256 | AM_CONDITIONAL([HAVE_PERL], [test -x "$PERL"]) |
255 | AS_IF([test -x "$PERL"], | 257 | AS_IF([test -x "$PERL"], |
256 | [AC_DEFINE_UNQUOTED([HAVE_PERL], [1], [Path to Perl])], | 258 | [AC_DEFINE([HAVE_PERL], [1], [Define to 1 if perl is available])], |
257 | [AC_DEFINE_UNQUOTED([HAVE_PERL], [0], [Path to Perl])]) | 259 | [AC_DEFINE([HAVE_PERL], [0], [Define to 1 if perl is available])]) |
258 | 260 | ||
259 | # awk | 261 | AWK_BINARY="$AWK" |
260 | AC_PATH_PROGS( AWK_BINARY, [awk gawk], ,$PATH:/usr/bin/:/usr/local/bin ) | ||
261 | AC_SUBST([AWK_BINARY]) | 262 | AC_SUBST([AWK_BINARY]) |
262 | AM_CONDITIONAL([HAVE_AWK], [test -x "$AWK_BINARY"]) | 263 | AM_CONDITIONAL([HAVE_AWK], [test -x "$AWK_BINARY"]) |
263 | AS_IF([test -x "$AWK_BINARY"], | 264 | AS_IF([test -x "$AWK_BINARY"], |
264 | [AC_DEFINE_UNQUOTED([HAVE_AWK], [1], [Path to awk])], | 265 | [AC_DEFINE([HAVE_AWK], [1], [Define to 1 if awk is available])], |
265 | [AC_DEFINE_UNQUOTED([HAVE_AWK], [0], [Path to awk])]) | 266 | [AC_DEFINE([HAVE_AWK], [0], [Define to 1 if awk is available])]) |
266 | 267 | ||
267 | # should we install gnunet-logread? | ||
268 | AC_MSG_CHECKING(whether to install gnunet-logread) | ||
269 | AC_ARG_WITH([gnunet-logread], | 268 | AC_ARG_WITH([gnunet-logread], |
270 | [AS_HELP_STRING([--with-gnunet-logread], | 269 | [AS_HELP_STRING([--with-gnunet-logread], [Install gnunet-logread])], |
271 | [Install gnunet-logread])], | 270 | [logread=yes], |
272 | [logread=${withval}], | 271 | [logread=no]) |
273 | [logread=no]) | ||
274 | AC_MSG_RESULT($logread) | ||
275 | AS_IF([test "x$logread" = "xyes"], | 272 | AS_IF([test "x$logread" = "xyes"], |
276 | [AM_CONDITIONAL([GNUNET_LOGREAD], true) | 273 | [AM_CONDITIONAL([GNUNET_LOGREAD], [true]) |
277 | AC_DEFINE([GNUNET_LOGREAD], | 274 | AC_DEFINE([GNUNET_LOGREAD], [1], |
278 | [1], | 275 | [Define to 1 if gnunet-logread is available])], |
279 | [Installing gnunet-logread])], | 276 | [AM_CONDITIONAL([GNUNET_LOGREAD], [false]) |
280 | [AM_CONDITIONAL([GNUNET_LOGREAD], | 277 | AC_DEFINE([GNUNET_LOGREAD], [0], |
281 | false) | 278 | [Define to 1 if gnunet-logread is available])]) |
282 | AC_DEFINE([GNUNET_LOGREAD], | ||
283 | [0], | ||
284 | [Not installing gnunet-logread])]) | ||
285 | 279 | ||
286 | # iptables is a soft requirement to run tests | 280 | # iptables is a soft requirement to run tests |
287 | AC_PATH_TARGET_TOOL(VAR_IPTABLES_BINARY, iptables, false) | 281 | AC_PATH_TARGET_TOOL([IPTABLES_BINARY], [iptables], [false]) |
288 | 282 | AS_IF([test "x$IPTABLES_BINARY" = "xfalse"], | |
289 | AS_IF([test x"$VAR_IPTABLES_BINARY" = x"false"], | 283 | [AS_IF([test -x "/sbin/iptables"], |
290 | [AS_IF([test -x "/sbin/iptables"], | 284 | [IPTABLES_BINARY="/sbin/iptables"], |
291 | [VAR_IPTABLES_BINARY="/sbin/iptables"], | 285 | [AS_IF([test -x "/usr/sbin/iptables"], |
292 | [AS_IF([test -x "/usr/sbin/iptables"], | 286 | [IPTABLES_BINARY="/usr/sbin/iptables"])])]) |
293 | [VAR_IPTABLES_BINARY="/usr/sbin/iptables"])])]) | 287 | |
294 | 288 | AS_IF([test "x$IPTABLES_BINARY" != "xfalse"], | |
295 | AS_IF([test x"$VAR_IPTABLES_BINARY" != x"false"], | 289 | [AC_DEFINE_UNQUOTED([IPTABLES], ["$IPTABLES_BINARY"], [Path to iptables])], |
296 | [AC_DEFINE_UNQUOTED([IPTABLES], "$VAR_IPTABLES_BINARY", [Path to iptables])], | 290 | [AC_MSG_WARN([iptables not found])]) |
297 | [AC_MSG_WARN([warning: 'iptables' not found.])]) | 291 | |
298 | 292 | # also check for ip6tables | |
299 | # ip6tables is a soft requirement for some features | 293 | AC_PATH_TARGET_TOOL([IP6TABLES_BINARY], [ip6tables], [false]) |
300 | AC_PATH_TARGET_TOOL(VAR_IP6TABLES_BINARY, ip6tables, false) | 294 | AS_IF([test "x$IP6TABLES_BINARY" = "xfalse"], |
301 | 295 | [AS_IF([test -x "/sbin/ip6tables"], | |
302 | AS_IF([test x"$VAR_IP6TABLES_BINARY" = x"false"], | 296 | [IP6TABLES_BINARY="/sbin/ip6tables"], |
303 | [AS_IF([test -x "/sbin/ip6tables"], | 297 | [AS_IF([test -x "/usr/sbin/ip6tables"], |
304 | [VAR_IP6TABLES_BINARY="/sbin/ip6tables"], | 298 | [IP6TABLES_BINARY="/usr/sbin/ip6tables"])])]) |
305 | [AS_IF([test -x "/usr/sbin/ip6tables"], | 299 | |
306 | [VAR_IP6TABLES_BINARY="/usr/sbin/ip6tables"])])]) | 300 | AS_IF([test "x$IP6TABLES_BINARY" != "xfalse"], |
307 | 301 | [AC_DEFINE_UNQUOTED([IP6TABLES], ["$IP6TABLES_BINARY"], | |
308 | 302 | [Path to ip6tables])], | |
309 | AS_IF([test x"$VAR_IP6TABLES_BINARY" != x"false"], | 303 | [AC_MSG_WARN([ip6tables not found])]) |
310 | [AC_DEFINE_UNQUOTED([IP6TABLES], "$VAR_IP6TABLES_BINARY", [Path to ip6tables])], | 304 | |
311 | [AC_MSG_WARN([warning: 'ip6tables' not found.])]) | 305 | # also check for ip |
312 | 306 | AC_PATH_TARGET_TOOL([IP_BINARY], [ip], [false]) | |
313 | # ip is a soft requirement for some features | 307 | AS_IF([test "x$IP_BINARY" = "xfalse"], |
314 | AC_PATH_TARGET_TOOL(VAR_IP_BINARY, ip, false) | 308 | [AS_IF([test -x "/sbin/ip"], |
315 | 309 | [IP_BINARY="/sbin/ip"], | |
316 | AS_IF([test x"$VAR_IP_BINARY" = x"false"], | 310 | [AS_IF([test -x "/usr/sbin/ip"], |
317 | [AS_IF([test -x "/sbin/ip"], | 311 | [IP_BINARY="/usr/sbin/ip"])])]) |
318 | [VAR_IP_BINARY="/sbin/ip"], | 312 | |
319 | [AS_IF([test -x "/usr/sbin/ip"], | 313 | AS_IF([test "x$IP_BINARY" != "xfalse"], |
320 | [VAR_IP_BINARY="/usr/sbin/ip"])])]) | 314 | [AC_DEFINE_UNQUOTED([PATH_TO_IP], ["$IP_BINARY"], [Path to ip])], |
321 | 315 | [AC_MSG_WARN([ip not found])]) | |
322 | AS_IF([test x"$VAR_IP_BINARY" != x"false"], | 316 | |
323 | [AC_DEFINE_UNQUOTED([PATH_TO_IP], "$VAR_IP_BINARY", [Path to ip])], | 317 | # locate ifconfig |
324 | [AC_MSG_WARN([warning: 'ip' not found.])]) | 318 | AC_PATH_TARGET_TOOL([IFCONFIG_BINARY], [ifconfig], [false]) |
325 | 319 | AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"], | |
326 | # locate 'ifconfig' | 320 | [AS_IF([test -x "/sbin/ifconfig"], |
327 | AC_PATH_TARGET_TOOL(VAR_IFCONFIG_BINARY, ifconfig, false) | 321 | [IFCONFIG_BINARY="/sbin/ifconfig"], |
328 | 322 | [AS_IF([test -x "/usr/sbin/ifconfig"], | |
329 | AC_CHECK_PROG(VAR_IFCONFIG_BINARY, ifconfig, true, false) | 323 | [IFCONFIG_BINARY="/usr/sbin/ifconfig"])])]) |
330 | AS_IF([test x"$VAR_IFCONFIG_BINARY" = x"false"], | 324 | |
331 | [AS_IF([test -x "/sbin/ifconfig"], | 325 | AS_IF([test "x$IFCONFIG_BINARY" != "xfalse"], |
332 | [VAR_IFCONFIG_BINARY="/sbin/ifconfig"], | 326 | [AC_DEFINE_UNQUOTED([IFCONFIG], ["$IFCONFIG_BINARY"], [Path to ifconfig])], |
333 | [AS_IF([test -x "/usr/sbin/ifconfig"], | 327 | [AC_MSG_WARN([ifconfig not found])]) |
334 | [VAR_IFCONFIG_BINARY="/usr/sbin/ifconfig"])])]) | 328 | |
335 | 329 | AC_PATH_PROG([MSG_USER_SETUP], [adduser], [false]) | |
336 | AS_IF([test x"$VAR_IFCONFIG_BINARY" != x"false"], | 330 | |
337 | [AC_DEFINE_UNQUOTED([IFCONFIG], "$VAR_IFCONFIG_BINARY", [Path to ifconfig])], | 331 | # test if the 'gnunet' user and groups exist |
338 | [AC_MSG_WARN(['ifconfig' not found.])]) | ||
339 | |||
340 | |||
341 | # Test if 'adduser' binary exists | ||
342 | MSG_USER_SETUP=true | ||
343 | AC_PATH_PROG([MSG_USER_SETUP], | ||
344 | [adduser], | ||
345 | false, | ||
346 | [path=$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin]) | ||
347 | |||
348 | # Test if 'gnunet' user and the groups exist | ||
349 | getent passwd gnunet > /dev/null | 332 | getent passwd gnunet > /dev/null |
350 | HAVE_GNUNET_USER=$? | 333 | HAVE_GNUNET_USER=$? |
351 | getent group gnunet > /dev/null | 334 | getent group gnunet > /dev/null |
@@ -355,201 +338,145 @@ getent group gnunetdns > /dev/null | |||
355 | AS_IF([test x$? != x0], | 338 | AS_IF([test x$? != x0], |
356 | [HAVE_GNUNET_USER=1]) | 339 | [HAVE_GNUNET_USER=1]) |
357 | 340 | ||
358 | AC_PATH_TARGET_TOOL(VAR_SYSCTL_BINARY, sysctl, false) | 341 | AC_PATH_TARGET_TOOL([SYSCTL_BINARY], [sysctl], [false]) |
359 | 342 | AS_IF([test "x$SYSCTL_BINARY" = "xfalse"], | |
360 | AC_CHECK_PROG(VAR_SYSCTL_BINARY, sysctl, true, false) | ||
361 | AS_IF([test x"$VAR_SYSCTL_BINARY" = x"false"], | ||
362 | [AS_IF([test -x "/sbin/sysctl"], | 343 | [AS_IF([test -x "/sbin/sysctl"], |
363 | [VAR_SYSCTL_BINARY="/sbin/sysctl"], | 344 | [SYSCTL_BINARY="/sbin/sysctl"], |
364 | [AS_IF([test -x "/usr/sbin/sysctl"], | 345 | [AS_IF([test -x "/usr/sbin/sysctl"], |
365 | [VAR_SYSCTL_BINARY="/usr/sbin/sysctl"])])]) | 346 | [SYSCTL_BINARY="/usr/sbin/sysctl"])])]) |
366 | AS_IF([test x"$VAR_SYSCTL_BINARY" != x"false"], | ||
367 | [AC_DEFINE_UNQUOTED([SYSCTL], "$VAR_SYSCTL_BINARY", [Path to sysctl])], | ||
368 | [AC_MSG_WARN(['sysctl' not found.])]) | ||
369 | 347 | ||
370 | # miniupnpc / upnpc binary is a soft runtime requirement | 348 | AS_IF([test "x$SYSCTL_BINARY" != "xfalse"], |
371 | AC_PATH_TARGET_TOOL(VAR_UPNPC_BINARY, upnpc, false) | 349 | [AC_DEFINE_UNQUOTED([SYSCTL], ["$SYSCTL_BINARY"], [Path to sysctl])], |
350 | [AC_MSG_WARN([sysctl not found])]) | ||
372 | 351 | ||
373 | AS_IF([test x"$VAR_UPNPC_BINARY" != x"false"], | 352 | # (mini)upnpc is a soft runtime requirement |
374 | [AC_DEFINE_UNQUOTED([UPNPC], "$VAR_UPNPC_BINARY", [Path to upnpc binary])], | 353 | AC_PATH_TARGET_TOOL([UPNPC_BINARY], [upnpc], [false]) |
375 | [AC_MSG_WARN([warning: 'upnpc' binary not found.])]) | 354 | AS_IF([test "x$UPNPC_BINARY" != "x$false"], |
355 | [AC_DEFINE_UNQUOTED([UPNPC], ["$UPNPC_BINARY"], [Path to upnpc binary])], | ||
356 | [AC_MSG_WARN([upnpc binary not found])]) | ||
376 | 357 | ||
358 | # the following tools might use a flag to specify their path or non-default | ||
359 | # name (e.g. a versioned string instead of simply the program name) | ||
377 | 360 | ||
378 | # checkbashisms | 361 | # checkbashisms |
379 | AC_CHECK_PROGS(CHECKBASHISMS_BINARY, [checkbashisms checkbashisms.pl], false) | 362 | AC_CHECK_PROGS([CHECKBASHISMS_BINARY], [checkbashisms checkbashisms.pl], [false]) |
380 | AM_CONDITIONAL(HAVE_CHECKBASHISMS, test x$CHECKBASHISMS_BINARY != xfalse) | 363 | AM_CONDITIONAL([HAVE_CHECKBASHISMS], [test "x$CHECKBASHISMS_BINARY" != "xfalse"]) |
381 | 364 | ||
382 | # uncrustify | 365 | # uncrustify |
383 | # TODO: maybe add flag to pass location | 366 | AC_CHECK_PROGS([UNCRUSTIFY_BINARY], [uncrustify], [true]) |
384 | AC_CHECK_PROG(UNCRUSTIFY_BINARY, uncrustify, true) | 367 | AM_CONDITIONAL([HAVE_UNCRUSTIFY_BINARY], [$UNCRUSTIFY_BINARY]) |
385 | AM_CONDITIONAL(HAVE_UNCRUSTIFY_BINARY, $UNCRUSTIFY_BINARY) | ||
386 | 368 | ||
387 | # yapf | 369 | # yapf |
388 | # TODO: less repetition, add flag to pass name | 370 | # check only the 'yapf' name for now |
389 | AC_CHECK_PROGS(YAPF_BINARY, [yapf yapf3.0 yapf3.1 yapf3.2 yapf3.3 yapf3.4 yapf3.5 yapf3.6 yapf3.7 yapf3.8 yapf3.9 yapf4.0], false) | 371 | AC_CHECK_PROGS([YAPF_BINARY], [yapf], [false]) |
390 | AM_CONDITIONAL(HAVE_YAPF_BINARY, test x$YAPF_BINARY != xfalse) | 372 | AM_CONDITIONAL([HAVE_YAPF_BINARY], [test "x$YAPF_BINARY" != "xfalse"]) |
391 | 373 | ||
374 | AC_CHECK_MEMBER([struct tm.tm_gmtoff], | ||
375 | [AC_DEFINE([HAVE_TM_GMTOFF], [1], | ||
376 | [Define to 1 if struct tm has the tm_gmtoff member])], | ||
377 | [], | ||
378 | [#include <time.h>]) | ||
392 | 379 | ||
393 | AC_CHECK_MEMBER(struct tm.tm_gmtoff, | 380 | # "save" libs; only those libs found so far will be |
394 | [AC_DEFINE(HAVE_TM_GMTOFF, 1, | ||
395 | [Define if struct tm has the tm_gmtoff member.])], | ||
396 | , | ||
397 | [#include <time.h>]) | ||
398 | |||
399 | # 'save' libs; only those libs found so far will be | ||
400 | # linked against _everywhere_. For the others, we | 381 | # linked against _everywhere_. For the others, we |
401 | # will be more selective! | 382 | # will be more selective! |
402 | SAVE_LIBS=$LIBS | 383 | SAVE_LIBS=$LIBS |
403 | 384 | ||
404 | have_addrinfo_a=0 | 385 | have_addrinfo_a=0 |
405 | AC_CHECK_LIB(anl, | 386 | AC_CHECK_LIB([anl], [getaddrinfo_a], |
406 | getaddrinfo_a, | 387 | [have_addrinfo_a=1 |
407 | [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A, | 388 | AC_DEFINE([HAVE_GETADDRINFO_A], [1], |
408 | 1, | 389 | [Define to 1 if getaddrinfo_a is supported])]) |
409 | [getaddrinfo_a supported])]) | 390 | AM_CONDITIONAL([HAVE_GETADDRINFO_A], [test "x$have_addrinfo_a" = "x1"]) |
410 | AM_CONDITIONAL(HAVE_GETADDRINFO_A, | ||
411 | [test "$have_addrinfo_a" = 1]) | ||
412 | 391 | ||
413 | # libgcrypt | 392 | # libgcrypt |
414 | gcrypt=0 | 393 | gcrypt=0 |
415 | NEED_LIBGCRYPT_API=1 | 394 | gcrypt_api=1 |
416 | NEED_LIBGCRYPT_VERSION=1.6.0 | 395 | gcrypt_version=1.6.0 |
417 | 396 | AM_PATH_LIBGCRYPT(["$gcrypt_api:$gcrypt_version"], [gcrypt=1]) | |
418 | AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1) | ||
419 | AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include <gcrypt.h>]]) | 397 | AC_CHECK_DECLS([gcry_mpi_set_opaque_copy], [], [], [[#include <gcrypt.h>]]) |
420 | 398 | ||
421 | AS_IF([test $gcrypt = 0], | 399 | AS_IF([test "$gcrypt" = "0"], |
422 | [ | 400 | [AC_MSG_ERROR([[You need libgcrypt to build this program. |
423 | AC_MSG_ERROR([[ | 401 | At least version $gcrypt_version (API $gcrypt_api) is required.]])]) |
424 | *** | ||
425 | *** You need libgcrypt to build this program. | ||
426 | *** This library is for example available at | ||
427 | *** ftp://ftp.gnupg.org/gcrypt/libgcrypt/. | ||
428 | *** At least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API) | ||
429 | *** is required. | ||
430 | ***]]) | ||
431 | ]) | ||
432 | AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version]) | ||
433 | 402 | ||
434 | AC_CHECK_DECLS([struct in6_ifreq], [], [], [[#include <linux/if_tun.h>]]) | 403 | AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], ["$gcrypt_version"], |
404 | [Required libgcrypt version]) | ||
435 | 405 | ||
436 | AC_CHECK_HEADER([if_tun.h], | 406 | AC_CHECK_HEADER([if_tun.h], |
437 | [AC_DEFINE([IF_TUN_HDR], ["if_tun.h"], [if_tun.h include path])], | 407 | [AC_DEFINE([IF_TUN_HDR], ["if_tun.h"], |
438 | [AC_CHECK_HEADER([linux/if_tun.h], | 408 | [How to include if_tun.h]) |
439 | [AC_DEFINE([IF_TUN_HDR], ["linux/if_tun.h"])], | 409 | AC_CHECK_DECLS([struct in6_ifreq], [], [], |
440 | [AC_CHECK_HEADER([net/if_tun.h], | 410 | [[#include <if_tun.h>]])], |
441 | [AC_DEFINE([IF_TUN_HDR], ["net/if_tun.h"])], | 411 | [AC_CHECK_HEADER([linux/if_tun.h], |
442 | [AC_CHECK_HEADER([net/tun/if_tun.h], | 412 | [AC_DEFINE([IF_TUN_HDR], ["linux/if_tun.h"], |
443 | [AC_DEFINE([IF_TUN_HDR], ["net/tun/if_tun.h"])])])])]) | 413 | [How to include if_tun.h]) |
444 | 414 | AC_CHECK_DECLS([struct in6_ifreq], [], [], | |
445 | 415 | [[#include <linux/if_tun.h>]])], | |
446 | # should the build process be building the documentation? | 416 | [AC_CHECK_HEADER([net/if_tun.h], |
447 | AC_MSG_CHECKING(whether to build documentation) | 417 | [AC_DEFINE([IF_TUN_HDR], ["net/if_tun.h"], |
418 | [How to include if_tun.h]) | ||
419 | AC_CHECK_DECLS([struct in6_ifreq], [], [], | ||
420 | [[#include <net/if_tun.h>]])], | ||
421 | [AC_CHECK_HEADER([net/tun/if_tun.h], | ||
422 | [AC_DEFINE([IF_TUN_HDR], ["net/tun/if_tun.h"], | ||
423 | [How to include if_tun.h]) | ||
424 | AC_CHECK_DECLS([struct in6_ifreq], [], [], | ||
425 | [[#include <net/tun/if_tun.h>]])])])])]) | ||
426 | |||
427 | # Should documentation be built? | ||
448 | AC_ARG_ENABLE([documentation], | 428 | AC_ARG_ENABLE([documentation], |
449 | [AS_HELP_STRING([--disable-documentation], | 429 | [AS_HELP_STRING([--disable-documentation], |
450 | [do not build the documentation])], | 430 | [do not build the documentation])], |
451 | [documentation=${enableval}], | 431 | [documentation=${enableval}], |
452 | [documentation=yes]) | 432 | [documentation=yes]) |
453 | AC_MSG_RESULT($documentation) | 433 | AM_CONDITIONAL([DOCUMENTATION], [test "x$documentation" = "xyes"]) |
454 | AS_IF([test "x$documentation" = "xyes"], | 434 | AS_IF([test "x$documentation" = "xyes"], |
455 | [AM_CONDITIONAL([DOCUMENTATION], | 435 | [AC_DEFINE([DOCUMENTATION], [1], [Define to 1 if documentation is built])], |
456 | true) | 436 | [AC_DEFINE([DOCUMENTATION], [0], [Define to 1 if documentation is built])]) |
457 | AC_DEFINE([DOCUMENTATION], | 437 | |
458 | [1], | ||
459 | [Building the documentation])], | ||
460 | [AM_CONDITIONAL([DOCUMENTATION], | ||
461 | false) | ||
462 | AC_DEFINE([DOCUMENTATION], | ||
463 | [0], | ||
464 | [Not building the documentation])]) | ||
465 | |||
466 | # COMMENT: Check whether to transpile texinfo to mdoc. | ||
467 | # COMMENT: This is TRUE when --enable-texi2mdoc-generation | ||
468 | # COMMENT: but ERRORS when texi2mdoc binary is missing in your $PATH | ||
469 | # COMMENT: and makes the configure fail if it is missing. | ||
470 | # COMMENT: Consequential the DEFINE and CONDITIONAL are set to true. | ||
471 | # COMMENT: This is FALSE when --disable-texi2mdoc-generation was set | ||
472 | # COMMENT: or nothing was set (this is the default). | ||
473 | # COMMENT: There are 2 nested AS_IFs because we need to catch the | ||
474 | # COMMENT: potential non-existence of the texi2mdoc binary. | ||
475 | # COMMENT: Default return value / setting: no | ||
476 | AC_MSG_CHECKING(whether to include generated texi2mdoc output in installation) | ||
477 | AC_ARG_ENABLE([texi2mdoc-generation], | 438 | AC_ARG_ENABLE([texi2mdoc-generation], |
478 | [AS_HELP_STRING([--enable-texi2mdoc-generation], | 439 | [AS_HELP_STRING([--enable-texi2mdoc-generation], |
479 | [include generated texi2mdoc output in installation])], | 440 | [generate and install texi2mdoc output])], |
480 | [texi2mdoc_generation=${enableval}], | 441 | [texi2mdoc_enabled=${enableval}], |
481 | [texi2mdoc_generation=no]) | 442 | [texi2mdoc_enabled=no]) |
482 | AC_MSG_RESULT($texi2mdoc_generation) | 443 | AM_CONDITIONAL([TEXI2MDOC_GENERATION], [test "x$texi2mdoc_enabled" = "xyes"]) |
483 | AS_IF([test "x$texi2mdoc_generation" = "xyes"], | 444 | AS_IF([test "x$texi2mdoc_enabled" = "xyes"], |
484 | [AS_IF([test "$texi2mdoc" = 0], | 445 | [AC_CHECK_PROGS([TEXI2MDOC_BINARY], [texi2mdoc], [false]) |
485 | [AC_MSG_WARN([ERROR: transpiled mdoc output requires texi2mdoc.]) | 446 | AS_IF([test "x$TEXI2MDOC_BINARY" != "xfalse"], |
486 | AC_MSG_WARN([ERROR: texi2mdoc can be obtained via your]) | 447 | [AC_DEFINE([TEXI2MDOC_GENERATION], [1], |
487 | AC_MSG_WARN([ERROR: Operating System package manager or from]) | 448 | [Define to 1 if mdoc output is generated])], |
488 | AC_MSG_WARN([ERROR: https://mandoc.bsd.lv/texi2mdoc/])], | 449 | [AC_DEFINE([TEXI2MDOC_GENERATION], [0], |
489 | [AM_CONDITIONAL([TEXI2MDOC_GENERATION],true) | 450 | [Define to 1 if mdoc output is generated])])], |
490 | AC_DEFINE([TEXI2MDOC_GENERATION], | 451 | [TEXI2MDOC_BINARY=false]) |
491 | [1], | 452 | AM_CONDITIONAL([HAVE_TEXI2MDOC], [test "x$TEXI2MDOC_BINARY" != "xfalse"]) |
492 | [Building section 7 mdoc output])])], | 453 | |
493 | [AM_CONDITIONAL([TEXI2MDOC_GENERATION], | 454 | AC_CHECK_PROGS([MANDOC_BINARY], [mandoc], [false]) |
494 | false) | 455 | AM_CONDITIONAL([HAVE_MANDOC], [test "x$MANDOC_BINARY" != "xfalse"]) |
495 | AC_DEFINE([TEXI2MDOC_GENERATION], | 456 | |
496 | [0], | 457 | # check if only the documentation should be build |
497 | [Not building section 7 mdoc output])]) | ||
498 | |||
499 | # test for texi2mdoc (the binary, not the script distributed | ||
500 | # with autogen) | ||
501 | # TODO: refactor this and the check above. | ||
502 | AC_MSG_CHECKING(for texi2mdoc binary) | ||
503 | AC_CHECK_PROGS(TEXI2MDOC_BINARY, [texi2mdoc], false) | ||
504 | AM_CONDITIONAL(HAVE_TEXI2MDOC, test x$TEXI2MDOC_BINARY != xfalse) | ||
505 | |||
506 | # texi2man is a tool which needs to be investigated and | ||
507 | # is probably incompatible to texi2mdoc in invocation. | ||
508 | # Detection at this point only serves as a reminder that | ||
509 | # I will work this into the build-system. | ||
510 | AC_MSG_CHECKING(for texi2man perl script) | ||
511 | AC_CHECK_PROGS(TEXI2MAN_SCRIPT, [texi2man], false) | ||
512 | AM_CONDITIONAL(HAVE_TEXI2MAN, test x$TEXI2MAN_SCRIPT != xfalse) | ||
513 | |||
514 | |||
515 | # test for mandoc | ||
516 | AC_MSG_CHECKING(for mandoc binary) | ||
517 | AC_CHECK_PROGS(MANDOC_BINARY, [mandoc], false) | ||
518 | AM_CONDITIONAL(HAVE_MANDOC, test x$MANDOC_BINARY != xfalse) | ||
519 | |||
520 | # should the build process be building only the documentation? | ||
521 | AC_MSG_CHECKING(whether to build only documentation) | ||
522 | AC_ARG_ENABLE([documentation-only], | 458 | AC_ARG_ENABLE([documentation-only], |
523 | [AS_HELP_STRING([--enable-documentation-only], | 459 | [AS_HELP_STRING([--enable-documentation-only], |
524 | [build only the documentation])], | 460 | [build only the documentation])], |
525 | [documentation_only=${enableval}], | 461 | [AS_IF([test "x${enableval}" = "xno"], |
526 | [documentation_only=no]) | 462 | [documentation_only="0"], |
527 | AC_MSG_RESULT($documentation_only) | 463 | [documentation_only="1"])], |
528 | AS_IF([test "x$documentation_only" = "xyes"], | 464 | [documentation_only="0"]) |
529 | [ | 465 | AC_DEFINE_UNQUOTED([DOCUMENTATION_ONLY], [$documentation_only], |
530 | AM_CONDITIONAL([DOCUMENTATION_ONLY],true) | 466 | [Define to 1 if only documentation is being built]) |
531 | AC_DEFINE([DOCUMENTATION_ONLY],[1],[Building only the documentation]) | 467 | AM_CONDITIONAL([DOCUMENTATION_ONLY], [test "x$documentation_only" = "x1"]) |
532 | ],[ | 468 | |
533 | AM_CONDITIONAL([DOCUMENTATION_ONLY],false) | 469 | # check if man pages should be included |
534 | AC_DEFINE([DOCUMENTATION_ONLY],[0],[Doing a normal build, more than only documentation]) | ||
535 | ]) | ||
536 | |||
537 | # should the build process be including the manpages? (default: yes) | ||
538 | AC_MSG_CHECKING(whether to include man pages) | ||
539 | AC_ARG_ENABLE([include-manpages], | 470 | AC_ARG_ENABLE([include-manpages], |
540 | [AS_HELP_STRING([--disable-include-manpages], | 471 | [AS_HELP_STRING([--disable-include-manpages], |
541 | [Do not include the man pages in build and installation])], | 472 | [do not include man pages during installation])], |
542 | [include_manpages=${enableval}], | 473 | [AS_IF([test "x${enableval}" = "xno"], |
543 | [include_manpages=yes]) | 474 | [include_man="0"], |
544 | AC_MSG_RESULT($include_manpages) | 475 | [include_man="1"])], |
545 | AS_IF([test "x$include_manpages" = "xyes"], | 476 | [include_man="1"]) |
546 | [ | 477 | AC_DEFINE_UNQUOTED([INCLUDE_MANPAGES], [$include_man], |
547 | AM_CONDITIONAL([INCLUDE_MANPAGES],true) | 478 | [Define to 1 if man pages are included]) |
548 | AC_DEFINE([INCLUDE_MANPAGES],[1],[Including the man pages in the build and installation]) | 479 | AM_CONDITIONAL([INCLUDE_MANPAGES], [test "x$include_man" = "x1"]) |
549 | ],[ | ||
550 | AM_CONDITIONAL([INCLUDE_MANPAGES],false) | ||
551 | AC_DEFINE([INCLUDE_MANPAGES],[0],[Not including the man pages in the build and installation]) | ||
552 | ]) | ||
553 | 480 | ||
554 | # Do we have texinfo4? If yes, it is used to set texinfo4 specific switches | 481 | # Do we have texinfo4? If yes, it is used to set texinfo4 specific switches |
555 | # (not syntax!) to the commandline tools which generate the html. If not, | 482 | # (not syntax!) to the commandline tools which generate the html. If not, |
@@ -568,797 +495,617 @@ AS_IF([test "x$include_manpages" = "xyes"], | |||
568 | # addition to `--split=nodes`. | 495 | # addition to `--split=nodes`. |
569 | # Hold on to your hats: In version 6.5 this is already removed, ffs. | 496 | # Hold on to your hats: In version 6.5 this is already removed, ffs. |
570 | # GNU Texinfo, please be more consistent than 1 version in switches. | 497 | # GNU Texinfo, please be more consistent than 1 version in switches. |
571 | AC_MSG_CHECKING(whether to enable texinfo4 switches) | ||
572 | AC_ARG_ENABLE([texinfo4], | 498 | AC_ARG_ENABLE([texinfo4], |
573 | [AS_HELP_STRING([--enable-texinfo4], [Use texinfo version 4 specific switches])], | 499 | [AS_HELP_STRING([--enable-texinfo4], |
574 | [activate_texinfo4=${enableval}], | 500 | [Use Texinfo version 4 specific switches])], |
575 | [activate_texinfo4=no]) | 501 | [activate_texinfo4=${enableval}], |
576 | AC_MSG_RESULT($activate_texinfo4) | 502 | [activate_texinfo4=no]) |
503 | AM_CONDITIONAL([ACTIVATE_TEXINFO4], [test "x$activate_texinfo4" = "xyes"]) | ||
577 | AS_IF([test "x$activate_texinfo4" = "xyes"], | 504 | AS_IF([test "x$activate_texinfo4" = "xyes"], |
578 | [ | 505 | [AC_DEFINE([ACTIVATE_TEXINFO4], [1], |
579 | AM_CONDITIONAL([ACTIVATE_TEXINFO4],true) | 506 | [Define to 1 if using Texinfo v4 switches]) |
580 | AC_DEFINE([ACTIVATE_TEXINFO4],[1],[Using texinfo version 4 specific switches]) | 507 | TEXINFO_HTMLFLAGS="--no-split --css-include=style.css --css-include=manual.css"], |
581 | TEXINFO_HTMLFLAGS="--no-split --css-include=style.css --css-include=manual.css" | 508 | [AC_DEFINE([ACTIVATE_TEXINFO4], [0], |
582 | ],[ | 509 | [Define to 1 if using Texinfo v4 switches]) |
583 | AM_CONDITIONAL([ACTIVATE_TEXINFO4],false) | 510 | TEXINFO_HTMLFLAGS="--no-split --css-ref='../style.css' --css-ref='../manual.css'"]) |
584 | AC_DEFINE([ACTIVATE_TEXINFO04],[0],[Using texinfo version 5 or later switches]) | ||
585 | TEXINFO_HTMLFLAGS="--no-split --css-ref='../style.css' --css-ref='../manual.css'" | ||
586 | |||
587 | ]) | ||
588 | |||
589 | AC_SUBST([TEXINFO_HTMLFLAGS]) | 511 | AC_SUBST([TEXINFO_HTMLFLAGS]) |
590 | 512 | ||
591 | # Adam shostack suggests the following for Windows: | 513 | # Hardening options |
592 | # -D_FORTIFY_SOURCE=2 -fstack-protector-all | ||
593 | AC_ARG_ENABLE([gcc-hardening], | 514 | AC_ARG_ENABLE([gcc-hardening], |
594 | AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks), | 515 | [AS_HELP_STRING([--enable-gcc-hardening], [enable compiler security checks])], |
595 | [AS_IF([test x$enableval = xyes],[ | 516 | [AS_IF([test "x$enableval" = "xyes"], |
596 | CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all" | 517 | [CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all" |
597 | CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector" | 518 | CFLAGS="$CFLAGS -fwrapv -fPIE -Wstacl-protector" |
598 | CFLAGS="$CFLAGS --param ssp-buffer-size=1" | 519 | CFLAGS="$CFLAGS --param ssp-buffer-size=1" |
599 | LDFLAGS="$LDFLAGS -pie" | 520 | LDFLAGS="$LDFLAGS -pie"])]) |
600 | ])]) | ||
601 | |||
602 | # Linker hardening options | ||
603 | # Currently these options are ELF specific - you can't use this with MacOSX | ||
604 | AC_ARG_ENABLE([linker-hardening], | ||
605 | AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups), | ||
606 | [AS_IF([test x$enableval = xyes], | ||
607 | [LDFLAGS="$LDFLAGS -z relro -z now"])]) | ||
608 | 521 | ||
522 | AC_ARG_ENABLE([linker-hardening], | ||
523 | [AS_HELP_STRING([--enable-linker-hardening], [enable linker security options])], | ||
524 | [AS_IF([test "x$enableval" = "xyes"], | ||
525 | [LDFLAGS="$LDFLAGS -z relro -z now"])]) | ||
609 | 526 | ||
610 | AC_ARG_ENABLE([sanitizer], | 527 | AC_ARG_ENABLE([sanitizer], |
611 | AS_HELP_STRING(--enable-sanitizer, enable Address Sanitizer and Undefined Behavior Sanitizer), | 528 | [AS_HELP_STRING([--enable-sanitizer], |
612 | [AS_IF([test x$enableval = xyes],[ | 529 | [enable address and undefined behaviour sanitizers])], |
613 | LDFLAGS="$CFLAGS -fsanitize=address,undefined -fno-omit-frame-pointer" | 530 | [AS_IF([test "x$enableval" = "xyes"], |
614 | ])]) | 531 | [CFLAGS="$CFLAGS -fsanitize=address,undefined -fno-omit-frame-pointer"])]) |
615 | |||
616 | 532 | ||
533 | # Logging | ||
617 | extra_logging=GNUNET_NO | 534 | extra_logging=GNUNET_NO |
618 | AC_ARG_ENABLE([logging], | 535 | AC_ARG_ENABLE([logging], |
619 | AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose,veryverbose ('yes' is the default)]), | 536 | [AS_HELP_STRING([--enable-logging@<:@=value@:>@], |
620 | [AS_IF([test "x$enableval" = "xyes"], [], | 537 | [enable logging calls; possible values: yes,no,verbose,veryverbose (default yes)])], |
621 | [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])], | 538 | [AS_CASE([$enableval], |
622 | [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES] | 539 | [yes], |
623 | [test "x$enableval" = "xveryverbose"], [extra_logging=\(GNUNET_YES+1\)]) | 540 | [extra_logging=GNUNET_NO], |
624 | ], []) | 541 | [no], |
625 | AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise]) | 542 | [extra_logging=GNUNET_NO |
626 | 543 | AC_DEFINE([GNUNET_CULL_LOGGING], [1], | |
627 | # should memory poisoning be enabled? | 544 | [Define to 1 to cull all logging calls])], |
628 | AC_MSG_CHECKING(whether to poison freed memory) | 545 | [verbose], |
546 | [extra_loging=GNUNET_YES], | ||
547 | [veryverbose], [extra_logging=\(GNUNET_YES+1\)], | ||
548 | [extra_logging=GNUNET_NO])]) | ||
549 | AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING], [$extra_logging], | ||
550 | [Define to 1 if extra logging is enabled, 2 for very verbose logging]) | ||
551 | |||
629 | AC_ARG_ENABLE([poisoning], | 552 | AC_ARG_ENABLE([poisoning], |
630 | [AS_HELP_STRING([--enable-poisoning], [enable poisoning of freed memory (good for debugging)])], | 553 | [AS_HELP_STRING([--enable-poisoning], |
631 | [enable_poisoning=${enableval}], | 554 | [enable poisoning of freed memory (good for debugging)])], |
632 | [ | 555 | [enable_poisoning=${enableval}], |
633 | AS_IF([test "x$extra_logging" != "xGNUNET_NO"], | 556 | [enable_poisoning=missing]) |
634 | [enable_poisoning="defaults to yes (extra logging is enabled)"], | 557 | |
635 | [enable_poisoning=no]) | 558 | AS_IF([test "x$enable_poisoning" = "xmissing"], |
636 | ]) | 559 | [AS_IF([test "x$extra_logging" != "xGNUNET_NO"], |
637 | AC_MSG_RESULT($enable_poisoning) | 560 | [enable_poisoning=yes], |
638 | AS_IF([test ! "x$enable_poisoning" = "xno"], | 561 | [enable_poisoning=no])]) |
639 | [enable_poisoning=1], | 562 | |
640 | [enable_poisoning=0]) | 563 | AS_IF([test "x$enable_poisoning" = "xyes"], |
641 | AC_DEFINE_UNQUOTED([ENABLE_POISONING],[$enable_poisoning],[1 if freed memory should be poisoned, 0 otherwise]) | 564 | [AC_DEFINE([ENABLED_POISONING], [1], |
642 | 565 | [Define to 1 if freed memory is poisoned])], | |
643 | AS_IF([test $build = $target], | 566 | [AC_DEFINE([ENABLED_POISONING], [0], |
644 | [ | 567 | [Define to 1 if freed memory is poisoned])]) |
645 | AC_MSG_CHECKING([for working HMAC]) | 568 | |
646 | AC_LANG_PUSH(C) | 569 | AS_IF([test "$build" = "$target"], |
647 | LIBS="$LIBS $LIBGCRYPT_LIBS" | 570 | [AC_MSG_CHECKING([for a working HMAC]) |
648 | CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS" | 571 | AC_LANG_PUSH([C]) |
649 | AC_RUN_IFELSE( | 572 | LIBS="$LIBS $LIBGCRYPT_LIBS" |
650 | [AC_LANG_PROGRAM([#include <gcrypt.h> | 573 | CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS" |
651 | #include <stdio.h>], [[ | 574 | AC_RUN_IFELSE( |
652 | gcry_md_hd_t mac; | 575 | [AC_LANG_PROGRAM([#include <gcrypt.h>], |
653 | 576 | [[gcry_md_hd_t mac; | |
654 | unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72, | 577 | unsigned char data[] = { |
655 | 0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe, | 578 | 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 0x93, 0xa7, 0x72, |
656 | 0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde }; | 579 | 0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 0xbe, |
657 | unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 }; | 580 | 0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde |
658 | unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80, | 581 | }; |
659 | 0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0, | 582 | |
660 | 0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b, | 583 | unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 }; |
661 | 0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb, | 584 | |
662 | 0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b, | 585 | unsigned char result[] = { |
663 | 0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3}; | 586 | 0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 0x12, 0x80, |
664 | 587 | 0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 0xd0, | |
665 | if (!gcry_check_version (GCRYPT_VERSION)) | 588 | 0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 0x5b, |
666 | { | 589 | 0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 0xeb, |
667 | fprintf (stderr, "Version mismatch %s <-> %s \n", gcry_check_version (NULL), GCRYPT_VERSION); | 590 | 0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 0x3b, |
668 | return 1; | 591 | 0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3 |
669 | } | 592 | }; |
670 | 593 | ||
671 | gcry_control (GCRYCTL_DISABLE_SECMEM, 0); | 594 | if (!gcry_check_version (GCRYPT_VERSION)) |
672 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); | 595 | { |
673 | 596 | return 1; | |
674 | if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR) | 597 | } |
675 | { | 598 | |
676 | fprintf (stderr, "gcry_md_open error\n"); | 599 | gcry_control (GCRYCTL_DISABLE_SECMEM, 0); |
677 | return 2; | 600 | gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0); |
678 | } | 601 | |
679 | 602 | if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != GPG_ERR_NO_ERROR) | |
680 | gcry_md_setkey (mac, key, sizeof (key)); | 603 | { |
681 | gcry_md_write (mac, data, sizeof (data)); | 604 | return 2; |
682 | 605 | } | |
683 | if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0) | 606 | |
684 | { | 607 | gcry_md_setkey (mac, key, sizeof (key)); |
685 | fprintf (stderr, "memcmp error\n"); | 608 | gcry_md_write (mac, data, sizeof (data)); |
686 | return 3; | 609 | |
687 | } | 610 | if (memcmp(gcry_md_read (mac, 0), |
688 | 611 | result, | |
689 | gcry_md_close (mac); | 612 | gcry_md_get_algo_dlen (gcry_md_get_algo (mac))) != 0) |
690 | 613 | { | |
691 | return 0; | 614 | return 3; |
692 | ]])], | 615 | } |
693 | [AC_MSG_RESULT([yes])], | 616 | |
694 | [ | 617 | gcry_md_close (mac);]])], |
695 | RESULT=$? | 618 | [AC_MSG_RESULT([yes])], |
696 | if test $RESULT = 3 | 619 | [AC_MSG_RESULT([no]) |
697 | then | 620 | RESULT=$? |
698 | 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.]) | 621 | AS_CASE([$RESULT], |
699 | fi | 622 | [1], |
700 | if test $RESULT = 2 | 623 | [AC_MSG_FAILURE([libgcrypt header version does not match library])], |
701 | then | 624 | [2], |
702 | AC_MSG_FAILURE([HMAC test failed]) | 625 | [AC_MSG_FAILURE([HMAC test failed])], |
703 | fi | 626 | [3], |
704 | if test $RESULT = 1 | 627 | [AC_MSG_FAILURE([HMAC test vector does not match. This is a known problem with libgcrypt 1.2.2 on Windows and it's fixed in 1.4.6])], |
705 | then | 628 | [])], |
706 | AC_MSG_FAILURE([libgcrypt header version does not match library version]) | 629 | [AC_MSG_RESULT([cross compiling, test skipped])]) |
707 | fi | 630 | AC_LANG_POP([C])]) |
708 | ], | 631 | |
709 | [AC_MSG_RESULT([cross compiling, test skipped])]) | 632 | AC_MSG_CHECKING([for static assertion support]) |
710 | AC_LANG_POP(C) | 633 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], |
711 | ]) # $build = $target | 634 | [[_Static_assert(sizeof(int) >= 4, "not big enough");]])], |
712 | 635 | [AC_MSG_RESULT([yes]) | |
713 | AC_COMPILE_IFELSE([AC_LANG_SOURCE( | 636 | AC_DEFINE([HAVE_STATIC_ASSERT], [1], |
714 | [[int main() { | 637 | [Define to 1 if static assert is supported])], |
715 | _Static_assert(sizeof(int) >= 4, "not big enough"); | 638 | [AC_MSG_RESULT([no]) |
716 | return 0; | 639 | AC_DEFINE([HAVE_STATIC_ASSERT], [0], |
717 | };]])], | 640 | [Define to 1 if static assert is supported])]) |
718 | [AC_DEFINE([HAVE_STATIC_ASSERT],[1],[Static assertions supported])], | 641 | |
719 | [AC_DEFINE([HAVE_STATIC_ASSERT],[0],[Static assertions not supported])]) | 642 | dnl Helper function to shorten the amount of repeated code |
720 | 643 | dnl It will create a --with-<lib> option for configure. | |
721 | # check for bluetooth library | 644 | dnl |
722 | bluetooth=0 | 645 | dnl CHECK_WITH_LIB(LIBNAME, FUNC, HEADER, DEFINE-SYM) |
723 | AC_MSG_CHECKING(for libbluetooth) | 646 | dnl LIBNAME is the name of a library without the 'lib' prefix, e.g. 'bluetooth' |
724 | AC_ARG_WITH(libbluetooth, | 647 | dnl for 'libbluetooth'. |
725 | [ --with-libbluetooth=PREFIX (base of libbluetooth installation)], | 648 | dnl DEFINE-SYM is a symbol to define using AC_DEFINE; it will be set to 1 if the |
726 | [AC_MSG_RESULT([$with_libbluetooth]) | 649 | dnl library is available, 0 otherwise. |
727 | AS_CASE([$with_libbluetooth], | 650 | dnl |
728 | [no],[], | 651 | dnl The variable LIBNAME (that is, the identifier passed as the first argument) |
729 | [yes],[ | 652 | dnl is kept with the result: 0 if not available, 1 if available. |
730 | CHECK_LIBHEADER(BLUETOOTH, | 653 | dnl For example: CHECK_WITH_LIB(foo, ...) will generate $foo. |
731 | bluetooth, | 654 | AC_DEFUN([CHECK_WITH_LIB], |
732 | ba2str, | 655 | [AC_ARG_WITH([$1], |
733 | bluetooth/bluetooth.h, | 656 | [AS_HELP_STRING([--with-][$1][=PFX], [base of lib][$1][ installation])], |
734 | bluetooth=1,) | 657 | [AS_CASE([$withval], |
735 | ],[ | 658 | [no], |
736 | LDFLAGS="-L$with_libbluetooth/lib $LDFLAGS" | 659 | [eval "AS_TR_SH([$1])=0"], |
737 | CPPFLAGS="-I$with_libbluetooth/include $CPPFLAGS" | 660 | [yes], |
738 | AC_CHECK_HEADERS(bluetooth/bluetooth.h, | 661 | [CHECK_LIBHEADER([m4_translit([$1], [a-z], [A-Z])], |
739 | AC_CHECK_LIB([bluetooth], | 662 | [$1], [$2], [$3], |
740 | [ba2str], | 663 | [eval "AS_TR_SH([$1])=1"], |
741 | EXT_LIB_PATH="-L$with_libbluetooth/lib $EXT_LIB_PATH" | 664 | [eval "AS_TR_SH([$1])=0"])], |
742 | bluetooth=1)) | 665 | [CHECK_LIBHEADER([m4_translit([$1], [a-z], [A-Z])], |
743 | ]) | 666 | [$1], [$2], [$3], |
744 | ], | 667 | [eval "AS_TR_SH([$1])=1"], |
745 | [AC_MSG_RESULT([--with-libbluetooth not specified]) | 668 | [eval "AS_TR_SH([$1])=0"], |
746 | CHECK_LIBHEADER(BLUETOOTH, | 669 | [-L${withval}/lib], |
747 | bluetooth, | 670 | [-I${withval}/include]) |
748 | ba2str, | 671 | AS_IF([test "x$][AS_TR_SH([$1])][" = "x1"], |
749 | bluetooth/bluetooth.h, | 672 | [EXT_LIB_PATH="-L${withval}/lib $EXT_LIB_PATH"])])], |
750 | bluetooth=1,)]) | 673 | [CHECK_LIBHEADER([m4_translit([$1], [a-z], [A-Z])], |
751 | AM_CONDITIONAL(HAVE_LIBBLUETOOTH, [test "$bluetooth" = 1]) | 674 | [$1], [$2], [$3], |
752 | AS_IF([test "$bluetooth" = 1], | 675 | [eval "AS_TR_SH([$1])=1"], |
753 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[1],[Have bluetooth library])], | 676 | [eval "AS_TR_SH([$1])=0"])]) |
754 | [AC_DEFINE([HAVE_LIBBLUETOOTH],[0],[Lacking bluetooth library])]) | 677 | |
755 | 678 | AM_CONDITIONAL([$4], [test "x$][AS_TR_SH([$1])][" = "x1"]) | |
756 | # check for zbar library | 679 | AC_DEFINE_UNQUOTED([$4], [$][AS_TR_SH([$1])], [Define to 1 if available]) |
757 | # NOTE: Do not add checks for: -lSM, -lICE, -lX11, -lXv and -ljpeg | 680 | ])dnl |
758 | # NOTE: they must be provided by the build environment, not the | 681 | |
759 | # NOTE: build-system of gnunet, as they are 2nd or 3rd level dependencies. | 682 | # check for libbluetooth |
760 | zbar=0 | 683 | CHECK_WITH_LIB([bluetooth], |
761 | AC_MSG_CHECKING(for libzbar) | 684 | [ba2str], |
762 | AC_ARG_WITH(zbar, | 685 | [bluetooth/bluetooth.h], |
763 | [ --with-zbar=PREFIX (base of libzbar installation)], | 686 | [HAVE_LIBBLUETOOTH]) |
764 | [AC_MSG_RESULT([$with_zbar]) | 687 | |
765 | AS_CASE([$with_zbar], | 688 | # check for libzbar |
766 | [no],[], | 689 | CHECK_WITH_LIB([zbar], [zbar_processor_create], [zbar.h], [HAVE_ZBAR]) |
767 | [yes],[CHECK_LIBHEADER(ZBAR, zbar, zbar_processor_create, zbar.h,zbar=1,,)], | ||
768 | [ | ||
769 | LDFLAGS="-L$with_zbar/lib $LDFLAGS" | ||
770 | CPPFLAGS="-I$with_zbar/include $CPPFLAGS" | ||
771 | AC_CHECK_HEADERS(zbar.h, | ||
772 | AC_CHECK_LIB([zbar], [zbar_processor_create], | ||
773 | EXT_LIB_PATH="-L$with_zbar/lib $EXT_LIB_PATH" | ||
774 | zbar=1)) | ||
775 | ]) | ||
776 | ], | ||
777 | [AC_MSG_RESULT([--with-zbar not specified]) | ||
778 | CHECK_LIBHEADER(ZBAR, zbar, zbar_processor_create, zbar.h,zbar=1,,)]) | ||
779 | AM_CONDITIONAL(HAVE_ZBAR, [test "$zbar" = 1]) | ||
780 | AS_IF([test "x$zbar" = x1], | ||
781 | [AC_DEFINE([HAVE_ZBAR],[1],[Have zbar library])], | ||
782 | [AC_DEFINE([HAVE_ZBAR],[0],[Lacking zbar library])]) | ||
783 | 690 | ||
784 | # check for libpng library | 691 | # check for libpng library |
785 | # this check is for an optional feature of gnunet-qr. | 692 | # this check is for an optional feature of gnunet-qr. |
786 | # the PNG format was chosen mostly arbitrary: while it's true that more modern | 693 | # the PNG format was chosen mostly arbitrarilyy: while it's true that more |
787 | # formats exists that can be used in stead of PNG, it's also true that it's | 694 | # modern formats exists that can be used in stead of PNG, it's also true that |
788 | # easier for systems to ship with libpng than others; also, a black-or-white | 695 | # it's more common for systems to ship with libpng than other codecs; also, a |
789 | # picture of squares is one of the cases where PNG shines the most. | 696 | # black-or-white picture of squares is one of the cases where PNG shines the |
790 | png=0 | 697 | # most, so the advantages of other formats becomes less important. |
791 | AS_IF([test "x$zbar" = "x1"], | 698 | AS_IF([test "x$zbar" = "x1"], |
792 | [AC_MSG_CHECKING(for libpng) | 699 | [CHECK_WITH_LIB([png], [png_create_read_struct], [png.h], [HAVE_PNG])], |
793 | AC_ARG_WITH(png, | 700 | [AM_CONDITIONAL([HAVE_PNG], [false]) |
794 | [ --with-png=PREFIX (base of libpng installation)], | 701 | AC_DEFINE([HAVE_PNG], [0], [Define to 1 if libpng is available])]) |
795 | [AC_MSG_RESULT([$with_png]) | 702 | |
796 | AS_CASE([$with_png], | 703 | # check for libpabc |
797 | [no],[], | 704 | CHECK_WITH_LIB([pabc], [pabc_new_ctx], [pabc/pabc.h], [HAVE_PABC]) |
798 | [yes],[CHECK_LIBHEADER(PNG, png, png_create_read_struct, png.h, png=1,,)], | 705 | |
799 | [ | 706 | # check for jansson |
800 | LDFLAGS="-L$with_png/lib $LDFLAGS" | 707 | CHECK_WITH_LIB([jansson], [json_loads], [jansson.h], [HAVE_JANSSON]) |
801 | CPPFLAGS="-I$with_png/include $CPPFLAGS" | 708 | AS_IF([test "x$jansson" = "x0"], |
802 | AC_CHECK_HEADERS(png.h, | 709 | [AC_MSG_ERROR([GNUnet requires jansson])]) |
803 | AC_CHECK_LIB([png], [png_create_read_struct], | 710 | |
804 | EXT_LIB_PATH="-L$with_png/lib $EXT_LIB_PATH" | 711 | # check for libpulse (pulseaudio) |
805 | png=1)) | 712 | CHECK_WITH_LIB([pulse], [pa_stream_peek], [pulse/simple.h], [HAVE_PULSE]) |
806 | ]) | 713 | |
807 | ], | 714 | # check for libopus |
808 | [AC_MSG_RESULT([--with-png not specified]) | 715 | # Note: this might need to be expanded if a more detailed check is needed. |
809 | CHECK_LIBHEADER(PNG, png, png_create_read_struct, png.h, png=1,,)]) | 716 | # For example, before CHECK_WITH_LIB was created, it used to look for |
810 | AM_CONDITIONAL(HAVE_PNG, [test "$png" = 1]) | 717 | # "OPUS_SET_GAIN" in libopus |
811 | AS_IF([test "x$png" = "x1"], | 718 | CHECK_WITH_LIB([opus], [opus_decode_float], [opus/opus.h], [HAVE_OPUS]) |
812 | [AC_DEFINE([HAVE_PNG],[1],[Have png library])], | 719 | |
813 | [AC_DEFINE([HAVE_PNG],[0],[Lacking png library])])]) | 720 | # check for libogg |
814 | 721 | CHECK_WITH_LIB([ogg], [ogg_stream_flush_fill], [ogg/ogg.h], [HAVE_OGG]) | |
815 | # check for libpabc library | 722 | |
816 | pabc=0 | 723 | PKG_CHECK_MODULES([GLIB], [glib-2.0], |
817 | AC_MSG_CHECKING(for libpabc) | 724 | [AC_CHECK_HEADER([pbc/pbc.h], [pbc=1], [pbc=0]) |
818 | AC_ARG_WITH(pabc, | 725 | AC_CHECK_HEADER([gabe.h], [abe=1], [abe=0]) |
819 | [ --with-pabc=PREFIX (base of libpabc installation)], | 726 | AM_CONDITIONAL([HAVE_PBC], [test "x$pbc" = "x1"]) |
820 | [AC_MSG_RESULT([$with_pabc]) | 727 | AM_CONDITIONAL([HAVE_ABE], [test "x$abe" = "x1"]) |
821 | AS_CASE([$with_pabc], | 728 | AC_DEFINE_UNQUOTED([HAVE_PBC], [$pbc], [Define to 1 if pbc is available]) |
822 | [no],[], | 729 | AC_DEFINE_UNQUOTED([HAVE_ABE], [$abe], [Define to 1 if abe is available])], |
823 | [yes],[ | 730 | [AM_CONDITIONAL([HAVE_PBC], [false]) |
824 | CHECK_LIBHEADER(PABC, pabc, pabc_new_ctx, pabc/pabc.h,pabc=1,) | 731 | AM_CONDITIONAL([HAVE_ABE], [false]) |
825 | ],[ | 732 | AC_DEFINE([HAVE_PBC], [0], [Define to 1 if pbc is available]) |
826 | LDFLAGS="-L$with_pabc/lib $LDFLAGS" | 733 | AC_DEFINE([HAVE_ABE], [0], [Define to 1 if abe is available])]) |
827 | CPPFLAGS="-I$with_pabc/include $CPPFLAGS" | 734 | |
828 | AC_CHECK_HEADERS(pabc/pabc.h, | 735 | PKG_CHECK_MODULES([GST], |
829 | AC_CHECK_LIB([pabc], [pabc_new_ctx], | ||
830 | EXT_LIB_PATH="-L$with_pabc/lib $EXT_LIB_PATH" | ||
831 | pabc=1)) | ||
832 | ]) | ||
833 | ], | ||
834 | [AC_MSG_RESULT([--with-pabc not specified]) | ||
835 | CHECK_LIBHEADER(PABC, pabc, pabc_new_ctx, pabc/pabc.h,pabc=1,)]) | ||
836 | AM_CONDITIONAL(HAVE_PABC, [test x$pabc = x1]) | ||
837 | |||
838 | |||
839 | # check for jansson library | ||
840 | jansson=0 | ||
841 | AC_MSG_CHECKING(for libjansson) | ||
842 | AC_ARG_WITH(jansson, | ||
843 | [ --with-jansson=PREFIX (base of libjansson installation)], | ||
844 | [AC_MSG_RESULT([$with_jansson]) | ||
845 | AS_CASE([$with_jansson], | ||
846 | [no],[], | ||
847 | [yes],[ | ||
848 | CHECK_LIBHEADER(JANSSON, jansson, json_loads, jansson.h,jansson=1,) | ||
849 | ],[ | ||
850 | LDFLAGS="-L$with_jansson/lib $LDFLAGS" | ||
851 | CPPFLAGS="-I$with_jansson/include $CPPFLAGS" | ||
852 | AC_CHECK_HEADERS(jansson.h, | ||
853 | AC_CHECK_LIB([jansson], [json_loads], | ||
854 | EXT_LIB_PATH="-L$with_jansson/lib $EXT_LIB_PATH" | ||
855 | jansson=1)) | ||
856 | ]) | ||
857 | ], | ||
858 | [AC_MSG_RESULT([--with-jansson not specified]) | ||
859 | CHECK_LIBHEADER(JANSSON, jansson, json_loads, jansson.h,jansson=1,)]) | ||
860 | |||
861 | AS_IF([test "x$jansson" != x1], | ||
862 | [AC_MSG_ERROR([GNUnet requires libjansson])]) | ||
863 | |||
864 | # check for libpulse(audio) library | ||
865 | pulse=0 | ||
866 | libpulse_msg="no" | ||
867 | AC_MSG_CHECKING(for libpulse) | ||
868 | # TODO: --with-libpulse or --with-pulseaudio? What is more established | ||
869 | # TODO: in this context? | ||
870 | AC_ARG_WITH(libpulse, | ||
871 | [ --with-libpulse=PREFIX (base of libpulse installation)], | ||
872 | [AC_MSG_RESULT([$with_libpulse]) | ||
873 | AS_CASE([$with_libpulse], | ||
874 | [no],[], | ||
875 | [yes],[ | ||
876 | CHECK_LIBHEADER(LIBPULSE, | ||
877 | pulse, | ||
878 | pa_stream_peek, | ||
879 | pulse/simple.h, | ||
880 | pulse=1,) | ||
881 | ],[ | ||
882 | LDFLAGS="-L$with_libpulse/lib $LDFLAGS" | ||
883 | CPPFLAGS="-I$with_libpulse/include $CPPFLAGS" | ||
884 | AC_CHECK_HEADERS(pulse/simple.h, | ||
885 | AC_CHECK_LIB([pulse], | ||
886 | [pa_stream_peek], | ||
887 | EXT_LIB_PATH="-L$with_libpulse/lib $EXT_LIB_PATH" | ||
888 | pulse=1)) | ||
889 | ]) | ||
890 | ], | ||
891 | [AC_MSG_RESULT([--with-libpulse not specified]) | ||
892 | CHECK_LIBHEADER(LIBPULSE, | ||
893 | pulse, | ||
894 | pa_stream_peek, | ||
895 | pulse/simple.h, | ||
896 | pulse=1,)]) | ||
897 | AM_CONDITIONAL(HAVE_PULSE, [test "$pulse" = 1]) | ||
898 | AS_IF([test x"$pulse" = x1], | ||
899 | [AC_DEFINE([HAVE_PULSE],[1],[Have libpulse(audio) library]) | ||
900 | libpulse_msg="yes"], | ||
901 | [AC_DEFINE([HAVE_PULSE],[0],[Lacking libpulse(audio) library]) | ||
902 | libpulse_msg="no"]) | ||
903 | |||
904 | # check for libopus(audio) library | ||
905 | opus=0 | ||
906 | libopus_msg="no" | ||
907 | AC_MSG_CHECKING(for libopus) | ||
908 | AC_ARG_WITH(libopus, | ||
909 | [ --with-libopus=PREFIX (base of libopus installation)], | ||
910 | [AC_MSG_RESULT([$with_libopus]) | ||
911 | AS_CASE([$with_libopus], | ||
912 | [no],[], | ||
913 | [yes],[ | ||
914 | CHECK_LIBHEADER(LIBOPUS, | ||
915 | opus, | ||
916 | opus_decode_float, | ||
917 | opus/opus.h, | ||
918 | AC_CHECK_DECL([OPUS_SET_GAIN], | ||
919 | [opus=1], | ||
920 | [], | ||
921 | [[ | ||
922 | #include <opus/opus.h> | ||
923 | ]])) | ||
924 | ],[ | ||
925 | LDFLAGS="-L$with_libopus/lib $LDFLAGS" | ||
926 | CPPFLAGS="-I$with_libopus/include $CPPFLAGS" | ||
927 | AC_CHECK_HEADERS(opus/opus.h, | ||
928 | AC_CHECK_LIB([opus], | ||
929 | [OPUS_SET_GAIN], | ||
930 | EXT_LIB_PATH="-L$with_libopus/lib $EXT_LIB_PATH" | ||
931 | opus=1)) | ||
932 | ]) | ||
933 | ], | ||
934 | [AC_MSG_RESULT([--with-libopus not specified]) | ||
935 | CHECK_LIBHEADER(LIBOPUS, | ||
936 | opus, | ||
937 | opus_decode_float, | ||
938 | opus/opus.h, | ||
939 | AC_CHECK_DECL([OPUS_SET_GAIN], | ||
940 | [opus=1], | ||
941 | [], | ||
942 | [[ | ||
943 | #include <opus/opus.h> | ||
944 | ]]))]) | ||
945 | AM_CONDITIONAL(HAVE_OPUS, [test "$opus" = 1]) | ||
946 | AS_IF([test "x$opus" = x1], | ||
947 | [AC_DEFINE([HAVE_OPUS],[1],[Have libopus library]) | ||
948 | libopus_msg="yes"], | ||
949 | [AC_DEFINE([HAVE_OPUS],[0],[Lacking libopus library]) | ||
950 | libopus_msg="no (required for conversation)"]) | ||
951 | |||
952 | # libogg | ||
953 | AC_MSG_CHECKING(for libogg) | ||
954 | AC_ARG_WITH(libogg, | ||
955 | [ --with-libogg=PREFIX (base of libogg installation)], | ||
956 | [AC_MSG_RESULT([$with_libogg]) | ||
957 | AS_CASE([$with_libogg], | ||
958 | [no],[], | ||
959 | [yes],[ | ||
960 | CHECK_LIBHEADER(LIBOGG, | ||
961 | ogg, | ||
962 | ogg_stream_flush_fill, | ||
963 | ogg/ogg.h, | ||
964 | ogg=1,) | ||
965 | ],[ | ||
966 | LDFLAGS="-L$with_libogg/lib $LDFLAGS" | ||
967 | CPPFLAGS="-I$with_libogg/include $CPPFLAGS" | ||
968 | AC_CHECK_HEADERS(ogg/ogg.h, | ||
969 | AC_CHECK_LIB([ogg], | ||
970 | [ogg_stream_flush_fill], | ||
971 | EXT_LIB_PATH="-L$with_libogg/lib $EXT_LIB_PATH" | ||
972 | ogg=1)) | ||
973 | ]) | ||
974 | ], | ||
975 | [AC_MSG_RESULT([--with-libogg not specified]) | ||
976 | CHECK_LIBHEADER(LIBOGG, | ||
977 | ogg, | ||
978 | ogg_stream_flush_fill, | ||
979 | ogg/ogg.h, | ||
980 | ogg=1,)]) | ||
981 | AM_CONDITIONAL(HAVE_OGG, [test "$ogg" = 1]) | ||
982 | AS_IF([test x"$ogg" = x1], | ||
983 | [AC_DEFINE([HAVE_OGG],[1],[Have ogg])], | ||
984 | [AC_DEFINE([HAVE_OGG],[0],[Lacking ogg])]) | ||
985 | |||
986 | |||
987 | PKG_CHECK_MODULES([GLIB], | ||
988 | [glib-2.0], | ||
989 | [# check for pbc library | ||
990 | pbc=0 | ||
991 | AC_CHECK_HEADER([pbc/pbc.h],pbc=1) | ||
992 | AC_CHECK_HEADER([gabe.h],abe=1) | ||
993 | AM_CONDITIONAL(HAVE_PBC, [test "x$pbc" = x1]) | ||
994 | AM_CONDITIONAL(HAVE_ABE, [test "x$abe" = x1]) | ||
995 | AS_IF([test "x$pbc" = x1], | ||
996 | [AC_DEFINE([HAVE_PBC],[1],[Have pbc library])], | ||
997 | [AC_DEFINE([HAVE_PBC],[0],[Lacking pbc library])]) | ||
998 | AS_IF([test "x$abe" = x1], | ||
999 | [AC_DEFINE([HAVE_ABE],[1],[Have ABE library])], | ||
1000 | [AC_DEFINE([HAVE_ABE],[0],[Lacking ABE library])])], | ||
1001 | [# glib-2 not found | ||
1002 | AM_CONDITIONAL(HAVE_PBC, [false]) | ||
1003 | AM_CONDITIONAL(HAVE_ABE, [false]) | ||
1004 | AC_DEFINE([HAVE_PBC],[0],[Lacking glib library])]) | ||
1005 | |||
1006 | |||
1007 | gst=0 | ||
1008 | gstreamer_msg="no" | ||
1009 | AC_MSG_CHECKING(for gstreamer) | ||
1010 | PKG_CHECK_MODULES( | ||
1011 | [GST], | ||
1012 | [glib-2.0 gobject-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0], | 736 | [glib-2.0 gobject-2.0 gstreamer-1.0 gstreamer-app-1.0 gstreamer-audio-1.0], |
1013 | [gst=1 | 737 | [gst=1], |
1014 | gstreamer_msg="yes"], | ||
1015 | [gst=0]) | 738 | [gst=0]) |
1016 | 739 | ||
1017 | # conversation | 740 | # check if conversation can be built and how |
1018 | AC_MSG_CHECKING(conversation feature set to build) | 741 | AC_MSG_CHECKING([for conversation feature set to build]) |
1019 | AS_IF([test "x$pulse" != "x1" -o "x$opus" != "x1" -o "x$ogg" != "x1"],[ | 742 | AS_IF([test "x$pulse" != "x1" || test "x$opus" != "x1" || test "x$ogg" != "x1"], |
1020 | AS_IF([test "x$gst" != "x1"],[ | 743 | [AS_IF([test "x$gst" != "x1"], |
1021 | conversation_backend=none | 744 | [conversation_backend="none" |
1022 | AM_CONDITIONAL(BUILD_PULSE_HELPERS, false) | 745 | AM_CONDITIONAL([BUILD_PULSE_HELPERS], [false]) |
1023 | AM_CONDITIONAL(BUILD_GST_HELPERS, false) | 746 | AM_CONDITIONAL([BUILD_GST_HELPERS], [false]) |
1024 | AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false) | 747 | AM_CONDITIONAL([BUILD_EXPERIMENTAL_HELPERS], [false])], |
1025 | ],[ | 748 | [conversation_backend="gst" |
1026 | conversation_backend=gst | 749 | AM_CONDITIONAL([BUILD_PULSE_HELPERS], [false]) |
1027 | AM_CONDITIONAL(BUILD_PULSE_HELPERS, false) | 750 | AM_CONDITIONAL([BUILD_GST_HELPERS], [true]) |
1028 | AM_CONDITIONAL(BUILD_GST_HELPERS, true) | 751 | AM_CONDITIONAL([BUILD_EXPERIMENTAL_HELPERS], [false])])], |
1029 | AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false) | 752 | [conversation_backend="pulse" |
1030 | ]) | 753 | AM_CONDITIONAL([BUILD_PULSE_HELPERS], [true]) |
1031 | ],[ | 754 | AM_CONDITIONAL([BUILD_GST_HELPERS], [false]) |
1032 | conversation_backend=pulse | 755 | AM_CONDITIONAL([BUILD_EXPERIMENTAL_HELPERS], [false])]) |
1033 | AM_CONDITIONAL(BUILD_PULSE_HELPERS, true) | 756 | |
1034 | AM_CONDITIONAL(BUILD_GST_HELPERS, false) | 757 | AM_CONDITIONAL([BUILD_CONVERSATION], [test "x$conversation_backend" != "xnone"]) |
1035 | AM_CONDITIONAL(BUILD_EXPERIMENTAL_HELPERS, false) | 758 | AC_MSG_RESULT([$conversation_backend]) |
1036 | ]) | 759 | |
1037 | 760 | # check for libgnurl | |
1038 | AS_IF([test "x$conversation_backend" = "xnone"], | 761 | LIBGNURL_CHECK_CONFIG([], [7.34.0], |
1039 | AM_CONDITIONAL(BUILD_CONVERSATION, false), | 762 | [gnurl=1 |
1040 | AM_CONDITIONAL(BUILD_CONVERSATION, true)) | 763 | curl=0], |
1041 | 764 | [gnurl=0 | |
1042 | # libgnurl | 765 | curl=0]) |
1043 | LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0) | 766 | AS_IF([test "x$gnurl" = "x0"], |
1044 | 767 | [LIBCURL_CHECK_CONFIG([], [7.34.0], [curl=1], [curl=0]) | |
1045 | SAVE_CPPFLAGS=$CPPFLAGS | 768 | AS_IF([test "x$curl" = "x0"], |
1046 | CPPFLAGS="$LIBGNURL_CPPFLAGS $LIBCURL_CPPFLAGS $CPPFLAGS" | 769 | [AC_CHECK_HEADER([curl/curl.h], |
1047 | LIBS="$LIBGNURL $LIBCURL $LIBS" | 770 | [AC_CHECK_DECLS([CURLINFO_TLS_SESSION], |
1048 | 771 | [curl=1], | |
1049 | # libcurl-gnutls | 772 | [curl=0], |
1050 | LIBCURL_CHECK_CONFIG(,7.34.0,[curl=true],[curl=false]) | 773 | [[#include <curl/curl.h>]])]) |
1051 | AS_IF([test "x$curl" = xtrue],[ | 774 | AC_CHECK_LIB([curl-gnutls], |
1052 | AC_CHECK_HEADER([curl/curl.h], | 775 | [curl_easy_getinfo], |
1053 | AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=true],[curl=false],[[#include <curl/curl.h>]]), | 776 | [curl_gnutls=1], |
1054 | [curl=false]) | 777 | [curl_gnutls=0])]) |
1055 | # need libcurl-gnutls.so for proxy, warn later if not found. | 778 | AS_IF([test "x$curl" = "x0" || test "x$curl_gnutls" = "x0"], |
1056 | AC_CHECK_LIB([curl-gnutls],[curl_easy_getinfo],[curl_gnutls=true],[curl_gnutls=false]) | 779 | [AC_MSG_ERROR([cURL must have a version >= 7.34.0 and must support CURLINFO_TLS_SESSION])])]) |
1057 | # cURL must support CURLINFO_TLS_SESSION, version >= 7.34 | 780 | |
1058 | ]) | 781 | AS_IF([test "x$gnurl" = "x0" && test "x$curl" = "x0"], |
1059 | 782 | [AC_MSG_ERROR([either gnurl or cURL must be available])]) | |
1060 | # libcurl and libgnurl should be mutually exclusive | 783 | |
1061 | AS_IF([test "$gnurl" = 1], | 784 | AM_CONDITIONAL([HAVE_LIBGNURL], [test "x$gnurl" = "x1"]) |
1062 | [AM_CONDITIONAL(HAVE_LIBGNURL, true) | 785 | AC_DEFINE_UNQUOTED([HAVE_LIBGNURL], [$gnurl], [Define to 1 if libgnurl is used]) |
1063 | AC_DEFINE([HAVE_LIBGNURL],[1],[Have libgnurl]) | 786 | AM_CONDITIONAL([HAVE_LIBCURL], [test "x$curl" = "x1"]) |
1064 | AM_CONDITIONAL(HAVE_LIBCURL, false) | 787 | AC_DEFINE_UNQUOTED([HAVE_LIBCURL], [$curl], [Define to 0 if libcurl is used]) |
1065 | AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])], | 788 | |
1066 | [AS_IF([test "$curl" = true], | 789 | # libatomic |
1067 | [AM_CONDITIONAL(HAVE_LIBGNURL, false) | 790 | AC_SEARCH_LIBS([__atomic_load_8], [atomic], |
1068 | AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl]) | 791 | [have_libatomic=1 |
1069 | AM_CONDITIONAL(HAVE_LIBCURL, true) | 792 | AC_DEFINE([HAVE_LIBATOMIC], [1], |
1070 | AC_DEFINE([HAVE_LIBCURL],[1],[Have libcurl])], | 793 | [Define to 1 if libatomic is external])]) |
1071 | [AC_MSG_ERROR([GNUnet requires libcurl or gnurl >= 7.34]) | 794 | AM_CONDITIONAL([HAVE_LIBATOMIC], [test "x$have_libatomic" = "x1"]) |
1072 | AM_CONDITIONAL(HAVE_LIBGNURL, false) | 795 | |
1073 | AC_DEFINE([HAVE_LIBGNURL],[0],[Lacking libgnurl]) | 796 | # check for nss |
1074 | AM_CONDITIONAL(HAVE_LIBCURL, false) | 797 | AC_CHECK_HEADERS([nss.h], [nss=true], [nss=false]) |
1075 | AC_DEFINE([HAVE_LIBCURL],[0],[Lacking libcurl])])]) | 798 | AS_IF([test "x$nss" = "xfalse"], |
1076 | 799 | [AM_CONDITIONAL([HAVE_GLIBCNSS], [false]) | |
1077 | AC_SEARCH_LIBS(__atomic_load_8, atomic, [have_libatomic=1 AC_DEFINE(HAVE_LIBATOMIC,1,[external libatomic])]) | 800 | AC_MSG_WARN([NSS plugin will not be build])], |
1078 | AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1]) | 801 | [AC_CHECK_DECL([NSS_STATUS_UNAVAIL], |
1079 | 802 | [AM_CONDITIONAL([HAVE_GLIBCNSS], [true])], | |
1080 | # restore LIBS & CPPFLAGS | 803 | [AM_CONDITIONAL([HAVE_GLIBCNSS], [false]) |
1081 | LIBS=$SAVE_LIBS | 804 | AC_MSG_WARN([NSS plugin will not be built])], |
1082 | CPPFLAGS=$SAVE_CPPFLAGS | 805 | [[#include <nss.h>]])]) |
1083 | |||
1084 | |||
1085 | AC_CHECK_HEADERS([nss.h],[nss=true],[nss=false]) | ||
1086 | AS_IF([test x$nss = xfalse], | ||
1087 | [ | ||
1088 | AM_CONDITIONAL(HAVE_GLIBCNSS, false) | ||
1089 | AC_MSG_WARN([No GNU libc nss header, will not build NSS plugin]) | ||
1090 | ],[ | ||
1091 | NSS_INCLUDES=" | ||
1092 | #include <nss.h> | ||
1093 | " | ||
1094 | AC_CHECK_DECL([NSS_STATUS_UNAVAIL], | ||
1095 | [AM_CONDITIONAL(HAVE_GLIBCNSS, true)], | ||
1096 | [AM_CONDITIONAL(HAVE_GLIBCNSS, false) | ||
1097 | AC_MSG_WARN([No nss header fails to define NSS_STATUS_UNAVAIl, will not build NSS plugin])], | ||
1098 | [$NSS_INCLUDES]) | ||
1099 | ]) | ||
1100 | |||
1101 | |||
1102 | 806 | ||
1103 | # test for kvm and kstat (for CPU stats under BSD/Solaris) | 807 | # test for kvm and kstat (for CPU stats under BSD/Solaris) |
1104 | AC_CHECK_LIB([kvm],[kvm_open]) | 808 | AC_CHECK_LIB([kvm], [kvm_open]) |
1105 | AC_CHECK_LIB([kstat],[kstat_open]) | 809 | AC_CHECK_LIB([kstat], [kstat_open]) |
1106 | 810 | ||
1107 | libsodium=0 | 811 | # check for libsodium version >= 1.0.18 |
1108 | # test for libsodium >=1.018 (introduction of | ||
1109 | # crypto_scalarmult_ed25519_base_noclamp API) | ||
1110 | AC_CHECK_HEADER([sodium.h], | 812 | AC_CHECK_HEADER([sodium.h], |
1111 | [AC_CHECK_LIB([sodium], [crypto_core_ed25519_scalar_mul], | 813 | [AC_CHECK_LIB([sodium], [crypto_core_ed25519_scalar_mul], |
1112 | [libsodium=1])]) | 814 | [libsodium=1], |
1113 | 815 | [libsodium=0])]) | |
1114 | AS_IF([test x$libsodium = x0], | 816 | |
1115 | [AC_MSG_ERROR([GNUnet requires libsodium >= 1.0.18.])]) | 817 | AS_IF([test "x$libsodium" = "x0"], |
1116 | 818 | [AC_MSG_ERROR([GNUnet requires libsodium >= 1.0.18])]) | |
1117 | # test for libextractor | 819 | |
1118 | extractor=0 | 820 | # check for libextractor |
1119 | AC_MSG_CHECKING(for libextractor) | 821 | CHECK_WITH_LIB([extractor], |
1120 | AC_ARG_WITH(extractor, | 822 | [EXTRACTOR_plugin_add_defaults], |
1121 | [ --with-extractor=PREFIX (base of libextractor installation)], | 823 | [extractor.h], |
1122 | [AC_MSG_RESULT([$with_extractor]) | 824 | [HAVE_LIBEXTRACTOR]) |
1123 | AS_CASE([$with_extractor], | 825 | AS_IF([test "x$extractor" = "x0"], |
1124 | [no],[], | 826 | [AC_MSG_ERROR([GNUnet requires libextractor])]) |
1125 | [yes],[ | 827 | |
1126 | AC_CHECK_HEADERS([extractor.h], | 828 | # check for libltdl |
1127 | AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], | 829 | CHECK_WITH_LIB([ltdl], [lt_dlopenext], [ltdl.h], [HAVE_LTDL]) |
1128 | extractor=1)) | 830 | AS_IF([test "x$ldtl" = "x0"], |
1129 | ],[ | 831 | [AC_MSG_RESULT([libltdl (from GNU libtool) is required])]) |
1130 | LDFLAGS="-L$with_extractor/lib $LDFLAGS" | 832 | |
1131 | CPPFLAGS="-I$with_extractor/include $CPPFLAGS" | 833 | # check for libidn, first version 2 and if not found, version 1 |
1132 | AC_CHECK_HEADERS([extractor.h], | 834 | # if both are missing throw an error as libidn is required |
1133 | AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], | 835 | AC_ARG_WITH([libidn], |
1134 | EXT_LIB_PATH="-L$with_extractor/lib $EXT_LIB_PATH" | 836 | [AS_HELP_STRING([--with-libidn=PFX], [base of libidn/libidn2 installation])], |
1135 | extractor=1)) | 837 | [libidn=${withval}], |
1136 | ]) | 838 | [libidn=yes]) |
1137 | ], | 839 | |
1138 | [AC_MSG_RESULT([--with-extractor not specified]) | 840 | AS_IF([test "x$libidn" = "xno"], |
1139 | AC_CHECK_HEADERS([extractor.h], | 841 | [AC_MSG_ERROR([GNUnet requires libidn or libidn2])]) |
1140 | AC_CHECK_LIB([extractor], [EXTRACTOR_plugin_add_defaults], | 842 | |
1141 | extractor=1))]) | 843 | AS_IF([test "x$libidn" = "xyes"], |
1142 | # restore LIBS | 844 | [AC_CHECK_HEADERS([idn2.h], |
1143 | LIBS=$SAVE_LIBS | 845 | [libidn_version="2"], |
1144 | 846 | [AC_CHECK_HEADERS([idn2/idn2.h], | |
1145 | AS_IF([test "$extractor" != 1], | 847 | [libidn_version="2"], |
1146 | [ | 848 | [libidn_version="0"])])], |
1147 | AM_CONDITIONAL(HAVE_LIBEXTRACTOR, false) | 849 | [LDFLAGS="-L$libidn/lib $LDFLAGS" |
1148 | AC_DEFINE([HAVE_LIBEXTRACTOR],[0],[Lacking libextractor]) | 850 | CPPFLAGS="-I$libidn/include $CPPFLAGS" |
1149 | ],[ | 851 | AC_CHECK_HEADERS([idn2.h], |
1150 | AM_CONDITIONAL(HAVE_LIBEXTRACTOR, true) | 852 | [libidn_version="2"], |
1151 | AC_DEFINE([HAVE_LIBEXTRACTOR],[1],[Have libextractor]) | 853 | [AC_CHECK_HEADERS([idn2/idn2.h], |
1152 | ]) | 854 | [libidn_version="2"], |
1153 | 855 | [libidn_version="0"])])]) | |
1154 | 856 | ||
1155 | # Check for libltdl header (#2999) | 857 | AS_IF([test "x$libidn_version" = "x0"], |
1156 | ltdl=0 | 858 | [AS_IF([test "x$libidn" = "xyes"], |
1157 | AC_MSG_CHECKING(for libltdl) | 859 | [AC_CHECK_HEADERS([idna.h], |
1158 | AC_ARG_WITH(ltdl, | 860 | [libidn_version="1"], |
1159 | [AS_HELP_STRING([--with-ltdl=PREFIX],[base of libltdl installation])], | 861 | [AC_CHECK_HEADERS([idn/idna.h], |
1160 | [AC_MSG_RESULT([$with_ltdl]) | 862 | [libidn_version="1"] |
1161 | AS_CASE([$with_ltdl], | 863 | [libidn_version="2"])])], |
1162 | [no],[], | 864 | [LDFLAGS="-L$libidn/lib $LDFLAGS" |
1163 | [yes],[ | 865 | CPPFLAGS="-I$libidn/include $CPPFLAGS" |
1164 | AC_CHECK_HEADERS(ltdl.h, | 866 | AC_CHECK_HEADERS([idna.h], |
1165 | AC_CHECK_LIB([ltdl], [lt_dlopenext], | 867 | [libidn_version="2"], |
1166 | ltdl=1)) | 868 | [AC_CHECK_HEADERS([idn/idna.h], |
1167 | ],[ | 869 | [libidn_version="2"], |
1168 | LDFLAGS="-L$with_ltdl/lib $LDFLAGS" | 870 | [libidn_version="0"])])])]) |
1169 | CPPFLAGS="-I$with_ltdl/include $CPPFLAGS" | 871 | |
1170 | AC_CHECK_HEADERS(ltdl.h, | 872 | AS_IF([test "x$libidn_version" = "x0"], |
1171 | AC_CHECK_LIB([ltdl], [lt_dlopenext], | 873 | [AC_MSG_ERROR([GNUnet requires libidn or libidn2])]) |
1172 | EXT_LIB_PATH="-L$with_ltdl/lib $EXT_LIB_PATH" | 874 | |
1173 | ltdl=1)) | 875 | AS_IF([test "x$libidn_version" = "x2"], |
1174 | ]) | 876 | [AC_CHECK_LIB([idn2], [idn2_to_unicode_8z8z], [libidn_ok=yes], [libidn_ok=no])], |
1175 | ], | 877 | [AC_CHECK_LIB([idn], [idna_to_ascii_8z], [libidn_ok=yes], [libidn_ok=no])]) |
1176 | [AC_MSG_RESULT([--with-ltdl not specified]) | 878 | |
1177 | AC_CHECK_HEADERS(ltdl.h, | 879 | AS_IF([test "x$libidn_ok" = "xno"], |
1178 | AC_CHECK_LIB([ltdl], [lt_dlopenext], | 880 | [AC_MSG_ERROR([GNUnet requires libidn or libidn2])]) |
1179 | ltdl=1))]) | 881 | |
1180 | AS_IF([test x$ltdl = x1], | 882 | AM_CONDITIONAL([HAVE_LIBIDN], [test "x$libidn_version" = "x1"]) |
1181 | [ | 883 | AM_CONDITIONAL([HAVE_LIBIDN2], [test "x$libidn_version" = "x2"]) |
1182 | AC_MSG_RESULT([libltdl found]) | 884 | AS_IF([test "x$libidn_version" = "x2"], |
1183 | ],[ | 885 | [AC_DEFINE([HAVE_LIBIDN2], [1], [Define to 1 if libidn2 is available])], |
1184 | AC_MSG_ERROR([GNUnet requires libltdl (from GNU libtool).]) | 886 | [AC_DEFINE([HAVE_LIBIDN], [1], [Define to 1 if libidn is available])]) |
1185 | ]) | 887 | |
1186 | # restore LIBS | 888 | # check for zlib |
1187 | LIBS=$SAVE_LIBS | 889 | AC_ARG_WITH([zlib], |
1188 | 890 | [AS_HELP_STRING([--with-zlib=PFX], [base of zlib installation])], | |
1189 | # libidn and libidn2. The ideal goal is this: | 891 | [zlib=${withval}], |
1190 | # check for libidn2, if it doesn't exist check for libidn | 892 | [zlib=yes]) |
1191 | # if both exist, prefer libidn2 | 893 | |
1192 | # if none exist, fail and message that libidn or libidn2 | 894 | AS_IF([test "x$zlib" = "xno"], [AC_MSG_ERROR([GNUnet requires zlib])]) |
1193 | # is required with a preference for libidn2. | 895 | |
1194 | # TODO: What we have right here can probably be improved. | 896 | AS_IF([test "x$zlib" = "xyes"], |
1195 | AC_MSG_CHECKING(for idn or idn2) | 897 | [AC_CHECK_HEADER([zlib.h], |
1196 | 898 | [AC_CHECK_LIB([z], [compress2], [zlib_ok=1], [zlib_ok=0])], | |
1197 | AC_MSG_CHECKING(for idn) | 899 | [zlib_ok=0])], |
1198 | my_with_libidn=1 | 900 | [LDFLAGS="-L$zlib/lib $LDFLAGS" |
1199 | AC_ARG_WITH(libidn, | 901 | CPPFLAGS="-I$zlib/include $CPPFLAGS" |
1200 | AS_HELP_STRING([--with-libidn=pathname], | 902 | AC_CHECK_HEADER([zlib.h], |
1201 | [Support IDN (needs libidn)]), | 903 | [AC_CHECK_LIB([z], [compress2], [zlib_ok=1], [zlib_ok=0])], |
1202 | [], | 904 | [zlib_ok=0])]) |
1203 | [withval="yes"]) | 905 | |
1204 | AS_IF([test x_$withval = x_yes], | 906 | AS_IF([test "x$zlib_ok" = "x0"], [AC_MSG_ERROR([GNUnet requires zlib])]) |
1205 | [AC_CHECK_HEADERS([idna.h], | 907 | AS_IF([test "x$zlib" = "xyes"], |
1206 | AC_MSG_NOTICE([Found idna.h]), | 908 | [Z_CFLAGS="" |
1207 | AC_CHECK_HEADERS([idn/idna.h], | 909 | Z_LIBS="-lz"], |
1208 | AC_MSG_NOTICE([Found idn/idna.h]), | 910 | [Z_CFLAGS="-I${zlib}/include" |
1209 | my_with_libidn=0))], | 911 | Z_LIBS="-L${zlib}/lib -lz"]) |
1210 | [AS_IF([test x_$withval != x_no], | 912 | AC_SUBST([Z_CFLAGS]) |
1211 | [CFLAGS="$CFLAGS -I$withval/include" | 913 | AC_SUBST([Z_LIBS]) |
1212 | LDFLAGS="$LDFLAGS -L$withval/lib" | 914 | |
1213 | AC_CHECK_HEADERS([idna.h], | 915 | AM_CONDITIONAL([HAVE_ZLIB], [test "x$zlib_ok" = "x1"]) |
1214 | AC_MSG_NOTICE([Found idna.h]), | 916 | AC_DEFINE_UNQUOTED([HAVE_ZLIB], [$zlib_ok], [Define to 1 if zlib is available]) |
1215 | [AC_MSG_NOTICE([Failed to find idna.h]) | ||
1216 | my_with_libidn=0])], | ||
1217 | [my_with_libidn=0])]) | ||
1218 | |||
1219 | AC_MSG_CHECKING(for idn2) | ||
1220 | my_with_libidn2=1 | ||
1221 | AC_ARG_WITH(libidn2, | ||
1222 | AS_HELP_STRING([--with-libidn2=pathname], | ||
1223 | [Support IDN (needs libidn2)]), | ||
1224 | [], | ||
1225 | [withval="yes"]) | ||
1226 | AS_IF([test x_$withval = x_yes], | ||
1227 | [AC_CHECK_HEADERS([idn2.h], | ||
1228 | AC_MSG_NOTICE([Found idn2.h]), | ||
1229 | AC_CHECK_HEADERS([idn2/idn2.h], | ||
1230 | AC_MSG_NOTICE([Found idn2/idn2.h]), | ||
1231 | [AC_MSG_NOTICE([Failed to find idn2.h]) | ||
1232 | my_with_libidn2=0]))], | ||
1233 | [AS_IF([test x_$withval != x_no], | ||
1234 | [CFLAGS="$CFLAGS -I$withval/include" | ||
1235 | LDFLAGS="$LDFLAGS -L$withval/lib" | ||
1236 | AC_CHECK_HEADERS([idn2/idn2.h], | ||
1237 | AC_MSG_NOTICE([Found idn2/idn2.h]), | ||
1238 | [AC_MSG_NOTICE([Failed to find idn2.h]) | ||
1239 | my_with_libidn2=0])], | ||
1240 | [my_with_libidn2=0])]) | ||
1241 | |||
1242 | AC_MSG_CHECKING([if libidn can be used]) | ||
1243 | # Check for LIBIDNs | ||
1244 | there_can_only_be_one=1 | ||
1245 | |||
1246 | working_libidn1=0 | ||
1247 | working_libidn2=0 | ||
1248 | AS_IF([test x$my_with_libidn2 = x1], | ||
1249 | [AC_MSG_NOTICE([Checking for libidn2]) | ||
1250 | AC_CHECK_LIB([idn2], | ||
1251 | [idn2_to_unicode_8z8z], | ||
1252 | [working_libidn2=1 | ||
1253 | LIBS="-lidn2 $LIBS" | ||
1254 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN2], | ||
1255 | [1], | ||
1256 | [Define to 1 if you have 'libidn2' (-lidn2).])], | ||
1257 | [MISSING_DEPS="${MISSING_DEPS}${MISSING_SEP}libidn2" | ||
1258 | MISSING_SEP=", "])]) | ||
1259 | AM_CONDITIONAL(HAVE_LIBIDN2, test x$working_libidn2 = x1) | ||
1260 | AS_IF([test x$working_libidn2 = x0], | ||
1261 | [AS_IF([test x$my_with_libidn = x1], | ||
1262 | [AC_MSG_NOTICE([Checking for libidn]) | ||
1263 | AC_CHECK_LIB([idn], | ||
1264 | [idna_to_ascii_8z], | ||
1265 | [working_libidn1=1 | ||
1266 | LIBS="-lidn $LIBS" | ||
1267 | AC_DEFINE_UNQUOTED([HAVE_LIBIDN], | ||
1268 | [1], | ||
1269 | [Define to 1 if you have 'libidn' (-lidn).])], | ||
1270 | [there_can_only_be_one=0])], | ||
1271 | [AS_IF([test x$my_with_libidn2 = x1], | ||
1272 | [there_can_only_be_one=0 | ||
1273 | AC_MSG_FAILURE([* There can only be one libidn. | ||
1274 | * Provide either libidn >= 1.13 | ||
1275 | * or | ||
1276 | * libidn2 to the configure | ||
1277 | * script via | ||
1278 | * --with-libidn2 | ||
1279 | * --with-libidn])])])]) | ||
1280 | AM_CONDITIONAL(HAVE_LIBIDN, test x$working_libidn1 = x1) | ||
1281 | |||
1282 | AS_IF([test "$working_libidn1" = 0 -a "$working_libidn2" = 0], | ||
1283 | [AC_MSG_ERROR([GNUnet requires libidn (or libidn2)])]) | ||
1284 | |||
1285 | AS_IF([test x$there_can_only_be_one = x0], | ||
1286 | [AC_MSG_FAILURE([Missing dependencies: $MISSING_DEPS])]) | ||
1287 | |||
1288 | # test for zlib | ||
1289 | SAVE_LDFLAGS=$LDFLAGS | ||
1290 | SAVE_CPPFLAGS=$CPPFLAGS | ||
1291 | AC_ARG_WITH(zlib, | ||
1292 | [ --with-zlib[[=DIR]] use libz in DIR], | ||
1293 | [AS_IF([test "$withval" = "no"], | ||
1294 | [AC_MSG_ERROR([GNUnet requires zlib])], | ||
1295 | [test "$withval" != "yes"], | ||
1296 | [Z_DIR=$withval | ||
1297 | CPPFLAGS="${CPPFLAGS} -I$withval/include" | ||
1298 | LDFLAGS="${LDFLAGS} -L$withval/lib"])]) | ||
1299 | AC_CHECK_HEADER(zlib.h, | ||
1300 | [], | ||
1301 | [AC_MSG_ERROR([GNUnet requires zlib])]) | ||
1302 | AC_CHECK_LIB(z, | ||
1303 | compress2, | ||
1304 | [AC_DEFINE([HAVE_ZLIB], | ||
1305 | [], | ||
1306 | [Have compression library]) | ||
1307 | if test "x${Z_DIR}" != "x"; then | ||
1308 | Z_CFLAGS="-I${Z_DIR}/include" | ||
1309 | Z_LIBS="-L${Z_DIR}/lib -lz" | ||
1310 | else | ||
1311 | Z_LIBS="-lz" | ||
1312 | fi], | ||
1313 | [AC_MSG_ERROR([GNUnet requires zlib])]) | ||
1314 | AC_SUBST(Z_CFLAGS) | ||
1315 | AC_SUBST(Z_LIBS) | ||
1316 | |||
1317 | AS_IF([test "$enable_shared" = "no"], | ||
1318 | [AC_MSG_ERROR([GNUnet only works with shared libraries. Sorry.])]) | ||
1319 | |||
1320 | |||
1321 | # restore LIBS | ||
1322 | LIBS=$SAVE_LIBS | ||
1323 | |||
1324 | 917 | ||
1325 | # check for iconv | 918 | # check for iconv |
1326 | AM_ICONV | 919 | AM_ICONV |
1327 | 920 | ||
1328 | # test for libunistring | 921 | # check for libunistring |
1329 | gl_LIBUNISTRING | 922 | gl_LIBUNISTRING |
1330 | AS_IF([test $HAVE_LIBUNISTRING != yes], | 923 | AS_IF([test "x$HAVE_LIBUNISTRING" != "xyes"], |
1331 | [AC_MSG_ERROR([GNUnet requires libunistring])]) | 924 | [AC_MSG_ERROR([GNUnet requires libunistring])]) |
1332 | 925 | ||
1333 | # Currently broken on Debian :-( | 926 | # Currently broken on Debian :-( |
1334 | #AS_VERSION_COMPARE([$LIBUNISTRING_VERSION],[0.9.1.1], | 927 | # AS_VERSION_COMPARE([$LIBUNISTRING_VERSION], [0.9.1.1], |
1335 | # [AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1, found $LIBUNISTRING_VERSION])]) | 928 | # [AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1, found $LIBUNISTRING_VERSION])], |
929 | # [AC_MSG_ERROR([GNUnet requires libunistring >= 0.9.1.1, found $LIBUNISTRING_VERSION])]) | ||
930 | |||
931 | # check for sqlite | ||
932 | CHECK_WITH_LIB([sqlite3], [sqlite3_open], [sqlite3.h], [HAVE_SQLITE]) | ||
933 | |||
934 | # check for postgres | ||
935 | AX_LIB_POSTGRESQL([12.0], [postgres=1], [postgres=0]) | ||
936 | AS_IF([test "x$postgres" = "x1"], | ||
937 | [SAVE_CPPFLAGS="$CPPFLAGS" | ||
938 | CPPFLAGS="$POSTGRES_CPPFLAGS $CPPFLAGS" | ||
939 | AC_CHECK_HEADERS([libpq-fe.h], [postgres=1], [postgres=0])]) | ||
940 | AM_CONDITIONAL([HAVE_POSTGRESQL], [test "x$postgres" = "x1"]) | ||
941 | AC_DEFINE_UNQUOTED([HAVE_POSTGRESQL], [$postgres], | ||
942 | [Define to 1 if Postgres is available]) | ||
943 | |||
944 | # check for mysql | ||
945 | SAVE_LDFLAGS="$LDFLAGS" | ||
946 | SAVE_CPPFLAGS="$CPPFLAGS" | ||
947 | AC_ARG_WITH([mysql], | ||
948 | [AS_HELP_STRING([--with-mysql=PFX], [base of mysql installation])], | ||
949 | [AS_CASE([$withval], | ||
950 | [no], | ||
951 | [], | ||
952 | [yes|""], | ||
953 | [AC_CHECK_HEADERS([mysql/mysql.h], | ||
954 | [AC_CHECK_LIB([mysqlclient], [mysql_init], | ||
955 | [mysql=true], [mysql=false])])], | ||
956 | [LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS" | ||
957 | CPPFLAGS="-I$with_mysql/include $CPPFLAGS" | ||
958 | AC_CHECK_HEADERS([mysql/mysql.h], | ||
959 | [AC_CHECK_LIB([mysqlclient], [mysql_init], | ||
960 | [MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql" | ||
961 | MYSQL_CPPFLAGS="-I$with_mysql/include" | ||
962 | mysql=true], | ||
963 | [mysql=false])])])], | ||
964 | [AS_IF([test -d "/usr/lib64/mysql"], | ||
965 | [MYSQL_LIBDIR="/usr/lib64/mysql"], | ||
966 | [AS_IF([test -d "/usr/lib/mysql"], | ||
967 | [MYSQL_LIBDIR="/usr/lib/mysql"], | ||
968 | [MYSQL_LIBDIR="/usr/lib"])]) | ||
969 | LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS" | ||
970 | AC_CHECK_LIB([mysqlclient], [mysql_init], | ||
971 | [AC_CHECK_HEADERS([mysql/mysql.h], | ||
972 | [MYSQL_LDFLAGS="-L$MYSQL_LIBDIR" | ||
973 | mysql=true], | ||
974 | [mysql=false])], | ||
975 | [mysql=false])]) | ||
976 | AC_SUBST(MYSQL_LDFLAGS) | ||
977 | AC_SUBST(MYSQL_CPPFLAGS) | ||
1336 | 978 | ||
1337 | AC_CHECK_HEADERS([unistr.h], | 979 | # additional version checks for mysql |
1338 | , | 980 | AS_IF([test "x$mysql" = "xtrue"], |
1339 | AC_MSG_ERROR([Compiling GNUnet requires unistr.h (from libunistring) to be installed])) | 981 | [AC_MSG_CHECKING([for mysql version]) |
982 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | ||
983 | [[include <mysql/mysql_version.h>]], | ||
984 | [[#if (MYSQL_VERSION_ID < 40100) | ||
985 | #error required at least version 4.1 | ||
986 | #endif]])], | ||
987 | [mysql=true], | ||
988 | [mysql=false]) | ||
989 | AS_IF([test "x$mysql" = "xfalse"], | ||
990 | [AC_MSG_RESULT([< 4.1]) | ||
991 | AC_MSG_ERROR([mysql version >= 4.1 required])]) | ||
992 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | ||
993 | [[#include <mysql/mysql_version.h>]], | ||
994 | [[#if (MYSQL_VERSION_ID < 80000) | ||
995 | #error needs at least version 8.0 | ||
996 | #endif]])], | ||
997 | [mysql8=true], | ||
998 | [mysql8=false])]) | ||
999 | |||
1000 | AS_IF([test "x$mysql" = "xtrue"], | ||
1001 | [AS_IF([test "x$mysql8" = "xfalse"], | ||
1002 | [AC_MSG_RESULT([between 4.1 and 8.0])], | ||
1003 | [AC_MSG_RESULT([> 8.0]) | ||
1004 | AC_DEFINE([HAVE_MYSQL8], [1], | ||
1005 | [Define to 1 if MySQL is at least version 8])])]) | ||
1006 | |||
1007 | AM_CONDITIONAL([HAVE_MYSQL], [test "x$mysql" = "xtrue"]) | ||
1008 | AM_CONDITIONAL([HAVE_MYSQLE], [false]) | ||
1009 | |||
1010 | AS_IF([test "x$sqlite3" = "x0" && test "x$mysql" = "xfalse" && test "x$postgres" = "x0"], | ||
1011 | [AC_MSG_ERROR([GNUnet requires either SQLite, MySQL/MariaDB or PostgreSQL])]) | ||
1012 | |||
1013 | LDFLAGS="$SAVE_LDFLAGS" | ||
1014 | CPPFLAGS="$SAVE_CPPFLAGS" | ||
1015 | |||
1016 | # check for libmicrohttpd | ||
1017 | AC_ARG_WITH([microhttpd], | ||
1018 | [AS_HELP_STRING([--with-microhttpd=PFX], | ||
1019 | [base of libmicrohttpd installation])], | ||
1020 | [httpd=${withval}], | ||
1021 | [httpd=check]) | ||
1022 | |||
1023 | AS_CASE([$withval], | ||
1024 | [no], | ||
1025 | [AC_MSG_ERROR([GNUnet requires libmicrohttpd >= 0.9.63])], | ||
1026 | [yes], | ||
1027 | [PKG_CHECK_MODULES([MHD], [libmicrohttpd >= 0.9.63], [libmhd=1], [libmhd=0])], | ||
1028 | [SAVE_PKG_PATH="$PKG_CONFIG_PATH" | ||
1029 | PKG_CONFIG_PATH="$httpd/lib/pkgconfig" | ||
1030 | export PKG_CONFIG_PATH | ||
1031 | PKG_CHECK_MODULES([MHD], [libmicrohttpd >= 0.9.63], [libmhd=1], [libmhd=0]) | ||
1032 | PKG_CONFIG_PATH="$SAVE_PKG_PATH"]) | ||
1033 | |||
1034 | AS_IF([test "x$libmhd" = "x0"], | ||
1035 | [AC_MSG_ERROR([GNUnet requires libmicrohttpd >= 0.9.63])]) | ||
1036 | |||
1037 | AM_CONDITIONAL([HAVE_MHD], [test "x$libmhd" = "x1"]) | ||
1038 | AC_DEFINE_UNQUOTED([HAVE_MHD], [$libmhd], | ||
1039 | [Define to 1 if libmicrohttpd is avaliable]) | ||
1040 | AM_CONDITIONAL([HAVE_REST], [true]) | ||
1041 | |||
1042 | # check for gnutls | ||
1043 | AC_ARG_WITH([gnutls], | ||
1044 | [AS_HELP_STRING([--with-gnutls=PFX], [base of gnutls installation])], | ||
1045 | [AS_CASE([$with_gnutls], | ||
1046 | [no], | ||
1047 | [gnutls=0], | ||
1048 | [yes], | ||
1049 | [AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1050 | [AC_CHECK_LIB([gnutls], [gnutls_priority_set], | ||
1051 | [gnutls=1], [gnutls=0])], | ||
1052 | [gnutls=0]) | ||
1053 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1054 | [AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw], | ||
1055 | [gnutls_dane=1], [gnutls_dane=0])], | ||
1056 | [gnutls_dane=0])], | ||
1057 | [LDFLAGS="-L$with_gnutls/lib $LDFLAGS" | ||
1058 | CPPFLAGS="-I$with_gnutls/include $CPPFLAGS" | ||
1059 | AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1060 | [AC_CHECK_LIB([gnutls], [gnutls_priority_set], | ||
1061 | [gnutls=1], [gnutls=0])], | ||
1062 | [gnutls=0]) | ||
1063 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1064 | [AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw], | ||
1065 | [gnutls_dane=1], [gnutls_dane=0])], | ||
1066 | [gnutls_dane=0])])], | ||
1067 | [AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1068 | [AC_CHECK_LIB([gnutls], [gnutls_priority_set], | ||
1069 | [gnutls=1], [gnutls=0])], | ||
1070 | [gnutls=0]) | ||
1071 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1072 | [AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw], | ||
1073 | [gnutls_dane=1], [gnutls_dane=0])], | ||
1074 | [gnutls_dane=0])]) | ||
1075 | AM_CONDITIONAL([HAVE_GNUTLS], [test "x$gnutls" = "x1"]) | ||
1076 | AM_CONDITIONAL([HAVE_GNUTLS_DANE], [test "x$gnutls_dane" = "x1"]) | ||
1077 | AC_DEFINE_UNQUOTED([HAVE_GNUTLS], [$gnutls], [Define to 1 if GnuTLS is available]) | ||
1078 | AC_DEFINE_UNQUOTED([HAVE_GNUTLS_DANE], [$gnutls_dane], | ||
1079 | [Define to 1 if GnuTLS has DANE support]) | ||
1340 | 1080 | ||
1341 | # restore LIBS | 1081 | # restore LIBS |
1342 | LIBS=$SAVE_LIBS | 1082 | LIBS=$SAVE_LIBS |
1343 | 1083 | ||
1344 | 1084 | # Check for standard header files. | |
1345 | |||
1346 | # Checks for standard header files. | ||
1347 | AC_HEADER_DIRENT | 1085 | AC_HEADER_DIRENT |
1348 | 1086 | ||
1349 | # Check for headers that are ALWAYS required | 1087 | # Check for headers that are ALWAYS required |
1350 | 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])) | 1088 | # It's assumed that AC_INCLUDES_DEFAULT has been executed already, as that |
1351 | 1089 | # makes sure the most common headers (e.g. stdlib.h) are available | |
1352 | 1090 | AC_CHECK_HEADERS([fcntl.h math.h errno.h ctype.h limits.h stdarg.h signal.h locale.h], | |
1353 | 1091 | [], | |
1354 | # Checks for headers that are only required on some systems or | 1092 | [AC_MSG_ERROR([Compiling GNUnet requires standard UNIX header files])]) |
1355 | # opional (and where we do NOT abort if they are not there) | 1093 | |
1356 | 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 argz.h ucred.h sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h]) | 1094 | # Check for headers required only on some systems or which are optional |
1357 | 1095 | AC_CHECK_HEADERS([stdatomic.h malloc.h malloc/malloc.h malloc/malloc_np.h | |
1358 | # FreeBSD requires this for netinet/in_systm.h and netinet/ip.h | 1096 | langinfo.h sys/param.h sys/mount.h sys/statvfs.h sys/select.h |
1359 | AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,, | 1097 | sockLib.h sys/mman.h sys/msg.h sys/vfs.h arpa/inet.h |
1360 | [#ifdef HAVE_SYS_TYPES_H | 1098 | libintl.h netdb.h netinet/in.h sys/ioctl.h sys/socket.h |
1361 | #include <sys/types.h> | 1099 | sys/time.h sys/sysinfo.h sys/file.h sys/resource.h |
1100 | ifaddrs.h mach/mach.h sys/timeb.h argz.h ucred.h | ||
1101 | sys/ucred.h endian.h sys/endian.h execinfo.h byteswap.h]) | ||
1102 | |||
1103 | # Required for FreeBSD's netinet/in_systm.h and netinet/ip.h | ||
1104 | AS_IF([test "x$build_target" = "xfreebsd"], | ||
1105 | [AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h, netinet/ip.h], | ||
1106 | [], [], | ||
1107 | [#ifdef HAVE_SYS_TYPES_H | ||
1108 | #include <sys/type.h> | ||
1362 | #endif | 1109 | #endif |
1363 | #ifdef HAVE_NETINET_IN_SYSTM_H | 1110 | #ifdef HAVE_NETINET_IN_SYSTM_H |
1364 | #include <netinet/in_systm.h> | 1111 | #include <netinet/in_systm.h> |
@@ -1366,535 +1113,220 @@ AC_CHECK_HEADERS([sys/types.h netinet/in_systm.h netinet/in.h netinet/ip.h],,, | |||
1366 | #ifdef HAVE_NETINET_IN_H | 1113 | #ifdef HAVE_NETINET_IN_H |
1367 | #include <netinet/in.h> | 1114 | #include <netinet/in.h> |
1368 | #endif | 1115 | #endif |
1369 | ]) | 1116 | ])]) |
1370 | |||
1371 | SAVE_LDFLAGS=$LDFLAGS | ||
1372 | SAVE_CPPFLAGS=$CPPFLAGS | ||
1373 | |||
1374 | # test for sqlite | ||
1375 | sqlite=false | ||
1376 | AC_MSG_CHECKING(for SQLite) | ||
1377 | AC_ARG_WITH(sqlite, | ||
1378 | [ --with-sqlite=PFX base of SQLite installation], | ||
1379 | [AC_MSG_RESULT("$with_sqlite") | ||
1380 | AS_CASE([$with_sqlite], | ||
1381 | [no],[], | ||
1382 | [yes],[ | ||
1383 | AC_CHECK_HEADERS(sqlite3.h, | ||
1384 | sqlite=true)], | ||
1385 | [ | ||
1386 | LDFLAGS="-L$with_sqlite/lib $LDFLAGS" | ||
1387 | CPPFLAGS="-I$with_sqlite/include $CPPFLAGS" | ||
1388 | AC_CHECK_HEADERS(sqlite3.h, | ||
1389 | EXT_LIB_PATH="-L$with_sqlite/lib $EXT_LIB_PATH" | ||
1390 | SQLITE_LDFLAGS="-L$with_sqlite/lib" | ||
1391 | SQLITE_CPPFLAGS="-I$with_sqlite/include" | ||
1392 | sqlite=true) | ||
1393 | LDFLAGS=$SAVE_LDFLAGS | ||
1394 | CPPFLAGS=$SAVE_CPPFLAGS | ||
1395 | ]) | ||
1396 | ], | ||
1397 | [AC_MSG_RESULT([--with-sqlite not specified]) | ||
1398 | AC_CHECK_HEADERS(sqlite3.h, sqlite=true)]) | ||
1399 | AM_CONDITIONAL(HAVE_SQLITE, test x$sqlite = xtrue) | ||
1400 | AC_SUBST(SQLITE_CPPFLAGS) | ||
1401 | AC_SUBST(SQLITE_LDFLAGS) | ||
1402 | |||
1403 | LDFLAGS=$SAVE_LDFLAGS | ||
1404 | CPPFLAGS=$SAVE_CPPFLAGS | ||
1405 | |||
1406 | # test for postgres: | ||
1407 | postgres=false | ||
1408 | AX_LIB_POSTGRESQL([12.0], | ||
1409 | [CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS" | ||
1410 | AC_CHECK_HEADERS([libpq-fe.h], | ||
1411 | postgres=true) | ||
1412 | ], | ||
1413 | [AC_MSG_RESULT([no postgres])]) | ||
1414 | |||
1415 | AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue) | ||
1416 | AS_IF([test "x$postgres" = xtrue], | ||
1417 | [AC_DEFINE([HAVE_POSTGRESQL],[1],[Have PostgreSQL])], | ||
1418 | [AC_DEFINE([HAVE_POSTGRESQL],[0],[Lacking PostgreSQL])]) | ||
1419 | |||
1420 | LDFLAGS=$SAVE_LDFLAGS | ||
1421 | CPPFLAGS=$SAVE_CPPFLAGS | ||
1422 | |||
1423 | # mysql & windows | ||
1424 | AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>]) | ||
1425 | AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>]) | ||
1426 | |||
1427 | # test for mysql | ||
1428 | mysql=false | ||
1429 | mysqlfail=false | ||
1430 | SAVE_LDFLAGS=$LDFLAGS | ||
1431 | SAVE_CPPFLAGS=$CPPFLAGS | ||
1432 | AC_MSG_CHECKING(for mysql) | ||
1433 | AC_ARG_WITH(mysql, | ||
1434 | [ --with-mysql=PFX base of MySQL installation], | ||
1435 | [AC_MSG_RESULT([$with_mysql]) | ||
1436 | AS_CASE([$with_mysql], | ||
1437 | [no],[], | ||
1438 | [yes|""],[ | ||
1439 | AC_CHECK_HEADERS(mysql/mysql.h, | ||
1440 | AC_CHECK_LIB(mysqlclient, mysql_init, | ||
1441 | mysql=true), [], []) | ||
1442 | ],[ | ||
1443 | LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql $LDFLAGS $ZLIBS" | ||
1444 | CPPFLAGS="-I$with_mysql/include $CPPFLAGS" | ||
1445 | AC_CHECK_HEADERS(mysql/mysql.h, | ||
1446 | AC_CHECK_LIB(mysqlclient, mysql_init, | ||
1447 | MYSQL_LDFLAGS="-L$with_mysql/lib -L$with_mysql/lib/mysql" | ||
1448 | MYSQL_CPPFLAGS="-I$with_mysql/include" | ||
1449 | |||
1450 | mysql=true), [], []) | ||
1451 | ]) | ||
1452 | ], | ||
1453 | [AC_MSG_RESULT([--with-mysql not specified]) | ||
1454 | if test -d "/usr/lib64/mysql"; then | ||
1455 | MYSQL_LIBDIR="/usr/lib64/mysql" | ||
1456 | elif test -d "/usr/lib/mysql"; then | ||
1457 | MYSQL_LIBDIR="/usr/lib/mysql" | ||
1458 | else | ||
1459 | MYSQL_LIBDIR="/usr/lib" | ||
1460 | fi | ||
1461 | LDFLAGS="-L$MYSQL_LIBDIR $LDFLAGS $ZLIBS" | ||
1462 | AC_CHECK_LIB(mysqlclient, mysql_init, | ||
1463 | [AC_CHECK_HEADERS(mysql/mysql.h, | ||
1464 | MYSQL_LDFLAGS="-L$MYSQL_LIBDIR" | ||
1465 | mysql=true | ||
1466 | |||
1467 | , [], [])]) | ||
1468 | ]) | ||
1469 | |||
1470 | AC_SUBST(MYSQL_LDFLAGS) | ||
1471 | AC_SUBST(MYSQL_CPPFLAGS) | ||
1472 | |||
1473 | # additional version check for mysql | ||
1474 | AS_IF([test "$mysql" = "true"], | ||
1475 | [ | ||
1476 | AC_MSG_CHECKING(mysql version) | ||
1477 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | ||
1478 | [[ | ||
1479 | #include <mysql/mysql_version.h>]], | ||
1480 | [[ | ||
1481 | #if (MYSQL_VERSION_ID < 40100) | ||
1482 | #error needs at least version >= 4.1 | ||
1483 | #endif | ||
1484 | ]]) | ||
1485 | ], | ||
1486 | [mysql=true], | ||
1487 | [mysql=false]) | ||
1488 | AS_IF([test x$mysql = xfalse], | ||
1489 | [ | ||
1490 | mysqlfail=true | ||
1491 | AC_MSG_WARN([fail, MySQL >= 4.1 required]) | ||
1492 | ],[ | ||
1493 | AC_MSG_NOTICE([success, will keep $mysqlfail]) | ||
1494 | mysqlfail=false | ||
1495 | AC_MSG_RESULT(ok) | ||
1496 | ]) | ||
1497 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | ||
1498 | [[ | ||
1499 | #include <mysql/mysql_version.h>]], | ||
1500 | [[ | ||
1501 | #if (MYSQL_VERSION_ID < 80000) | ||
1502 | #error needs at least version >= 4.1 | ||
1503 | #endif | ||
1504 | ]]) | ||
1505 | ], | ||
1506 | [mysql8=true], | ||
1507 | [mysql8=false]) | ||
1508 | AS_IF([test x$mysql8 = xtrue], | ||
1509 | [ | ||
1510 | AC_DEFINE([HAVE_MYSQL8],[1],[Have mysql8]) | ||
1511 | ],[]) | ||
1512 | ]) | ||
1513 | |||
1514 | AM_CONDITIONAL(HAVE_MYSQL, test x$mysql = xtrue) | ||
1515 | AM_CONDITIONAL(HAVE_MYSQLE, false) | ||
1516 | # restore LIBS | ||
1517 | LIBS=$SAVE_LIBS | ||
1518 | LDFLAGS=$SAVE_LDFLAGS | ||
1519 | CPPFLAGS=$SAVE_CPPFLAGS | ||
1520 | |||
1521 | # TODO: should this test for "or" not "and"? | ||
1522 | # TODO: Add postgres? | ||
1523 | AS_IF([test "$sqlite" = 0 -a "$mysql" = 0], | ||
1524 | [ | ||
1525 | AC_MSG_ERROR([GNUnet requires SQLite or MySQL / MariaDB.]) | ||
1526 | ]) | ||
1527 | |||
1528 | # libmicrohttpd | ||
1529 | lmhd=0 | ||
1530 | m4_define([MHD_MODULE], [libmicrohttpd >= 0.9.63]) | ||
1531 | AC_ARG_WITH(microhttpd, | ||
1532 | [AS_HELP_STRING([--with-microhttpd[[=PFX]]], | ||
1533 | [base of libmicrohttpd installation])], | ||
1534 | [], | ||
1535 | [with_microhttpd=check]) | ||
1536 | AS_CASE([$with_microhttpd], | ||
1537 | [no], [], | ||
1538 | [yes], [PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1])], | ||
1539 | [check], [PKG_CHECK_MODULES([MHD], [MHD_MODULE], | ||
1540 | [lmhd=1], | ||
1541 | [AC_MSG_WARN([Building without libmicrohttpd])])], | ||
1542 | [SAVE_PKG_CONFIG_PATH=$PKG_CONFIG_PATH | ||
1543 | PKG_CONFIG_PATH=$with_microhttpd/lib/pkgconfig | ||
1544 | export PKG_CONFIG_PATH | ||
1545 | PKG_CHECK_MODULES([MHD], [MHD_MODULE], [lmhd=1]) | ||
1546 | PKG_CONFIG_PATH=$SAVE_PKG_CONFIG_PATH]) | ||
1547 | AM_CONDITIONAL(HAVE_MHD, test x$lmhd = x1) | ||
1548 | AC_DEFINE_UNQUOTED([HAVE_MHD], $lmhd, [We have libmicrohttpd]) | ||
1549 | |||
1550 | AM_CONDITIONAL(HAVE_JSON, [test x$jansson = x1]) | ||
1551 | AM_CONDITIONAL(HAVE_REST, [test x$jansson = x1 -a x$lmhd = x1]) | ||
1552 | AS_IF([test "x$lmhd" != "x1"], | ||
1553 | [AC_MSG_ERROR([GNUnet requires libmicrohttpd >= 0.9.63.])]) | ||
1554 | |||
1555 | |||
1556 | # restore LIBS | ||
1557 | LIBS=$SAVE_LIBS | ||
1558 | 1117 | ||
1559 | # check for gettext | 1118 | # check for gettext |
1560 | AM_GNU_GETTEXT([external]) | 1119 | AM_GNU_GETTEXT([external]) |
1561 | AM_GNU_GETTEXT_VERSION([0.18.1]) | 1120 | AM_GNU_GETTEXT_VERSION([0.18.1]) |
1562 | 1121 | ||
1563 | # Checks for standard typedefs, structures, and compiler characteristics. | 1122 | # check for stantard typedefs, structures and compiler characteristics |
1564 | AC_TYPE_PID_T | 1123 | AC_TYPE_PID_T |
1565 | AC_TYPE_SIZE_T | 1124 | AC_TYPE_SIZE_T |
1566 | AC_TYPE_MODE_T | 1125 | AC_TYPE_MODE_T |
1567 | AC_CHECK_HEADERS_ONCE([sys/time.h]) | ||
1568 | 1126 | ||
1569 | AC_HEADER_STAT | 1127 | AC_HEADER_STAT |
1570 | AC_HEADER_STDBOOL | 1128 | AC_HEADER_STDBOOL |
1571 | AC_STRUCT_TM | 1129 | AC_STRUCT_TM |
1572 | 1130 | ||
1573 | AC_CHECK_MEMBER([struct sockaddr_in.sin_len], | 1131 | AC_CHECK_MEMBER([struct sockaddr_in.sin_len], |
1574 | [ AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [Do we have sockaddr_in.sin_len?]) | 1132 | [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN], [1], |
1575 | ], | 1133 | [Define to 1 if struct sockaddr_in has sin_len field])], |
1576 | [], | 1134 | [], [], |
1577 | [ | 1135 | [#include <sys/types.h> |
1578 | #include <sys/types.h> | 1136 | #include <sys/socket.h> |
1579 | #include <sys/socket.h> | 1137 | #include <netinet/in.h>]) |
1580 | #include <netinet/in.h> | ||
1581 | ]) | ||
1582 | 1138 | ||
1583 | AC_CHECK_MEMBER([struct sockaddr_un.sun_len], | 1139 | AC_CHECK_MEMBER([struct sockaddr_un.sun_len], |
1584 | [ AC_DEFINE(HAVE_SOCKADDR_UN_SUN_LEN, | 1140 | [AC_DEFINE([HAVE_SOCKADDR_UN_SUN_LEN], [1], |
1585 | 1, | 1141 | [Define to 1 if struct sockaddr_un has sun_len field])], |
1586 | [Do we have sockaddr_un.sun_len?])], | 1142 | [], [], |
1587 | [], | 1143 | [#include <sys/types.h> |
1588 | [ | 1144 | #include <sys/socket.h> |
1589 | #include <sys/types.h> | 1145 | #include <sys/un.h>]) |
1590 | #include <sys/socket.h> | ||
1591 | #include <sys/un.h> | ||
1592 | ]) | ||
1593 | |||
1594 | 1146 | ||
1595 | |||
1596 | # Checks for library functions. | ||
1597 | AC_FUNC_CLOSEDIR_VOID | ||
1598 | AC_FUNC_FORK | ||
1599 | AC_PROG_GCC_TRADITIONAL | ||
1600 | AC_FUNC_MEMCMP | ||
1601 | AC_FUNC_SELECT_ARGTYPES | ||
1602 | AC_FUNC_CHOWN | ||
1603 | |||
1604 | AC_FUNC_STAT | ||
1605 | AC_FUNC_STRFTIME | ||
1606 | AC_FUNC_VPRINTF | ||
1607 | AC_HEADER_SYS_WAIT | ||
1608 | AC_TYPE_OFF_T | 1147 | AC_TYPE_OFF_T |
1609 | AC_TYPE_UID_T | 1148 | AC_TYPE_UID_T |
1610 | AC_CHECK_FUNCS(atoll stat64 strnlen mremap getrlimit setrlimit sysconf initgroups strndup gethostbyname2 getpeerucred getpeereid setresuid getifaddrs freeifaddrs getresgid mallinfo malloc_size malloc_usable_size getrusage random srandom stat statfs statvfs wait4 timegm) | ||
1611 | 1149 | ||
1612 | # restore LIBS | 1150 | # check for library functions |
1613 | LIBS=$SAVE_LIBS | 1151 | AC_FUNC_FORK |
1152 | AC_FUNC_CHOWN | ||
1153 | AC_CHECK_FUNCS([atoll stat64 strnlen mremap getrlimit setrlimit sysconf | ||
1154 | initgroups strndup gethostbyname2 getpeerucred getpeereid | ||
1155 | setresuid getifaddrs freeifaddrs getresgid mallinfo malloc_size | ||
1156 | malloc_usable_size getrusage random srandom stat statfs statvfs | ||
1157 | wait4 timegm]) | ||
1614 | 1158 | ||
1615 | GN_INTLINCL="" | 1159 | GN_INTLINCL="" |
1616 | GN_LIBINTL="$LTLIBINTL" | 1160 | GN_LIBINTL="$LTLIBINTL" |
1617 | GN_LIB_LDFLAGS="-export-dynamic -no-undefined" | 1161 | GN_LIB_LDFLAGS="-export-dynamic -no-undefined" |
1618 | GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined" | 1162 | GN_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined" |
1619 | 1163 | ||
1620 | AC_SUBST(GN_LIB_LDFLAGS) | 1164 | AC_SUBST([GN_LIB_LDFLAGS]) |
1621 | AC_SUBST(GN_PLUGIN_LDFLAGS) | 1165 | AC_SUBST([GN_PLUGIN_LDFLAGS]) |
1622 | AC_SUBST(GN_INTLINCL) | 1166 | AC_SUBST([GN_INTLINCL]) |
1623 | AC_SUBST(GN_LIBINTL) | 1167 | AC_SUBST([GN_LIBINTL]) |
1624 | 1168 | ||
1625 | AC_SUBST(CPPFLAGS) | 1169 | AC_SUBST([CPPFLAGS]) |
1626 | AC_SUBST(LIBS) | 1170 | AC_SUBST([LIBS]) |
1627 | AC_SUBST(LDFLAGS) | 1171 | AC_SUBST([LDFLAGS]) |
1628 | AC_SUBST(EXT_LIB_PATH) | 1172 | AC_SUBST([EXT_LIB_PATH]) |
1629 | AC_SUBST(EXT_LIBS) | 1173 | AC_SUBST([EXT_LIBS]) |
1630 | 1174 | ||
1631 | AC_SUBST(LIBPREFIX) | 1175 | AC_SUBST([LIBPREFIX]) |
1632 | AC_SUBST(DLLDIR) | 1176 | AC_SUBST([DLLDIR]) |
1633 | AC_SUBST(EXT_LIB_PATH) | 1177 | AC_SUBST([EXT_LIB_PATH]) |
1634 | 1178 | ||
1635 | DATAROOTDIR=$datarootdir | 1179 | DATAROOTDIR=$datarootdir |
1636 | AC_SUBST(DATAROOTDIR) | 1180 | AC_SUBST([DATAROOTDIR]) |
1637 | |||
1638 | # test for sudo | ||
1639 | AC_MSG_CHECKING(for sudo) | ||
1640 | #AC_CHECK_PROGS(SUDO_BINARY, [sudo], false) | ||
1641 | #AM_CONDITIONAL(HAVE_SUDO, test x$SUDO_BINARY != xfalse) | ||
1642 | AC_ARG_WITH(sudo, | ||
1643 | [ --with-sudo=PATH path to sudo binary (or just yes)], | ||
1644 | [AC_MSG_RESULT("$with_sudo") | ||
1645 | AS_CASE([$with_sudo], | ||
1646 | [no],[SUDO_BINARY=], | ||
1647 | [yes],[SUDO_BINARY=sudo], | ||
1648 | [SUDO_BINARY=$with_sudo])], | ||
1649 | [AC_MSG_RESULT([no])]) | ||
1650 | AC_SUBST(SUDO_BINARY) | ||
1651 | AM_CONDITIONAL([HAVE_SUDO], | ||
1652 | [test "x$SUDO_BINARY" != "x" -o -w /]) | ||
1653 | |||
1654 | # test for doas | ||
1655 | AC_MSG_CHECKING(for doas) | ||
1656 | AC_CHECK_PROGS(DOAS_BINARY, [doas], false) | ||
1657 | AM_CONDITIONAL(HAVE_DOAS_BINARY, test x$DOAS_BINARY != xfalse) | ||
1658 | |||
1659 | # test for gnunetdns group name | ||
1660 | GNUNETDNS_GROUP=gnunetdns | ||
1661 | AC_MSG_CHECKING(for gnunetdns group name) | ||
1662 | AC_ARG_WITH(gnunetdns, | ||
1663 | [ --with-gnunetdns=GRPNAME name for gnunetdns group], | ||
1664 | [AC_MSG_RESULT("$with_gnunetdns") | ||
1665 | AS_CASE([$with_gnunetdns], | ||
1666 | [no],[GNUNETDNS_GROUP=gnunet], | ||
1667 | [yes],[GNUNETDNS_GROUP=gnunetdns], | ||
1668 | [GNUNETDNS_GROUP=$with_gnunetdns])], | ||
1669 | [AC_MSG_RESULT([gnunetdns])]) | ||
1670 | AC_SUBST(GNUNETDNS_GROUP) | ||
1671 | 1181 | ||
1182 | # check for sudo | ||
1183 | AC_CHECK_PROGS([SUDO_BINARY], [sudo], [false]) | ||
1184 | AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "xfalse"]) | ||
1672 | 1185 | ||
1186 | # check for doas | ||
1187 | AC_CHECK_PROGS([DOAS_BINARY], [doas], [false]) | ||
1188 | AM_CONDITIONAL([HAVE_DOAS_BINARY], [test "x$DOAS_BINARY" != "xfalse"]) | ||
1673 | 1189 | ||
1674 | # gnutls | 1190 | # check if NSE has to send timestamp information to testbed logger for |
1675 | gnutls=0 | ||
1676 | gnutls_dane=0 | ||
1677 | AC_MSG_CHECKING(for gnutls) | ||
1678 | AC_ARG_WITH(gnutls, | ||
1679 | [ --with-gnutls=PFX base of gnutls installation], | ||
1680 | [AC_MSG_RESULT([$with_gnutls]) | ||
1681 | AS_CASE([$with_gnutls], | ||
1682 | [no],[], | ||
1683 | [yes], | ||
1684 | [AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1685 | AC_CHECK_LIB([gnutls], | ||
1686 | [gnutls_priority_set], | ||
1687 | gnutls=true)) | ||
1688 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1689 | AC_CHECK_LIB([gnutls-dane], | ||
1690 | [dane_verify_crt_raw], | ||
1691 | gnutls_dane=1))], | ||
1692 | |||
1693 | [LDFLAGS="-L$with_gnutls/lib $LDFLAGS" | ||
1694 | CPPFLAGS="-I$with_gnutls/include $CPPFLAGS" | ||
1695 | AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1696 | AC_CHECK_LIB([gnutls], [gnutls_priority_set], | ||
1697 | EXT_LIB_PATH="-L$with_gnutls/lib $EXT_LIB_PATH" | ||
1698 | gnutls=true)) | ||
1699 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1700 | AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw], | ||
1701 | gnutls_dane=1)) | ||
1702 | ]) | ||
1703 | ], | ||
1704 | [AC_MSG_RESULT([--with-gnutls not specified]) | ||
1705 | AC_CHECK_HEADERS([gnutls/abstract.h], | ||
1706 | AC_CHECK_LIB([gnutls], [gnutls_priority_set], | ||
1707 | gnutls=true)) | ||
1708 | AC_CHECK_HEADERS([gnutls/dane.h], | ||
1709 | AC_CHECK_LIB([gnutls-dane], [dane_verify_crt_raw], | ||
1710 | gnutls_dane=1)) | ||
1711 | ]) | ||
1712 | AM_CONDITIONAL(HAVE_GNUTLS, test x$gnutls = xtrue) | ||
1713 | AC_DEFINE_UNQUOTED([HAVE_GNUTLS], $gnutls, [We have GnuTLS]) | ||
1714 | AM_CONDITIONAL(HAVE_GNUTLS_DANE, test x$gnutls_dane = x1) | ||
1715 | AC_DEFINE_UNQUOTED([HAVE_GNUTLS_DANE], $gnutls_dane, [We have GnuTLS with DANE support]) | ||
1716 | |||
1717 | |||
1718 | |||
1719 | # Check if NSE has to send timestamp information to testbed logger for | ||
1720 | # generating histogram of messages received | 1191 | # generating histogram of messages received |
1721 | AC_MSG_CHECKING(if NSE has to send timestamp information to testbed logger) | ||
1722 | AC_ARG_ENABLE([nse-histogram], | 1192 | AC_ARG_ENABLE([nse-histogram], |
1723 | [AS_HELP_STRING([--enable-nse-histogram], | 1193 | [AS_HELP_STRING([--enable-nse-histogram], |
1724 | [have NSE send timestamp information to testbed logger for generating | 1194 | [have NSE send timestamp information to testbed logger for generating a histogram of received messages. NOT useful for production (default is no)])], |
1725 | histogram of received messages. NOT useful for production (default is | 1195 | [AS_IF([test "x$enableval" = "xno"] |
1726 | NO)])], | 1196 | [nse_histogram=0], |
1727 | [AS_IF([test "x$enableval" = "xno"], | 1197 | [nse_histogram=1])], |
1728 | [nse_histogram=0], | 1198 | [nse_histogram=0]) |
1729 | [nse_histogram=1])], | ||
1730 | [nse_histogram=0 | ||
1731 | enable_nse_histogram=no]) | ||
1732 | AC_MSG_RESULT($enable_nse_histogram) | ||
1733 | AM_CONDITIONAL([ENABLE_NSE_HISTOGRAM], [test "x$nse_histogram" = "x1"]) | 1199 | AM_CONDITIONAL([ENABLE_NSE_HISTOGRAM], [test "x$nse_histogram" = "x1"]) |
1734 | AC_DEFINE_UNQUOTED([ENABLE_NSE_HISTOGRAM], [$nse_histogram], | 1200 | AC_DEFINE_UNQUOTED([ENABLE_NSE_HISTOGRAM], [$nse_histogram], |
1735 | [have NSE send timestamp information to testbed logger]) | 1201 | [Define to 1 if NSE should send timestamp informations]) |
1736 | 1202 | ||
1737 | # should 'make check' run tests? | 1203 | # check if 'make check' should run tests |
1738 | AC_MSG_CHECKING(whether to run tests) | ||
1739 | AC_ARG_ENABLE([testruns], | 1204 | AC_ARG_ENABLE([testruns], |
1740 | [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])], | 1205 | [AS_HELP_STRING([--disable-testruns], |
1741 | [enable_tests_run=${enableval}], | 1206 | [disable running tests on make check])], |
1742 | [enable_tests_run=yes]) | 1207 | [enable_testruns=${enableval}], |
1743 | AC_MSG_RESULT($enable_test_run) | 1208 | [enable_testruns=yes]) |
1744 | AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"]) | 1209 | AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_testruns" = "xyes"]) |
1745 | |||
1746 | |||
1747 | AC_MSG_CHECKING([whether to compile in benchmarks (currently for http and crypto)]) | ||
1748 | AC_ARG_ENABLE([benchmark], | ||
1749 | [AS_HELP_STRING([--enable-benchmark], [enable benchmarking])], | ||
1750 | [enable_benchmark=${enableval}], | ||
1751 | [enable_benchmark=no]) | ||
1752 | AC_MSG_RESULT($enable_benchmark) | ||
1753 | AS_IF([test "x$enable_benchmark" = "xyes"], | ||
1754 | [AC_DEFINE_UNQUOTED(ENABLE_BENCHMARK,1,[Benchmarks are enabled])]) | ||
1755 | AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmark" = "xyes"]) | ||
1756 | |||
1757 | |||
1758 | # should ports be open for Java services? | ||
1759 | AC_MSG_CHECKING(whether to enable ports for gnunet-java) | ||
1760 | AC_ARG_ENABLE([javaports], | ||
1761 | [AS_HELP_STRING([--enable-javaports], [use non-zero ports for services with Java bindings (default is NO)])], | ||
1762 | [enable_java_ports=${enableval}], | ||
1763 | [enable_java_ports=no]) | ||
1764 | AC_MSG_RESULT($enable_java_ports) | ||
1765 | AS_IF([test "x$enable_java_ports" = "xyes"], | ||
1766 | [JAVAPORT=""], | ||
1767 | [JAVAPORT="$UNIXONLY"]) | ||
1768 | AC_SUBST(JAVAPORT) | ||
1769 | 1210 | ||
1770 | # should benchmarks be run? | 1211 | # check if benchmarks should be executed |
1771 | AC_MSG_CHECKING(whether to run benchmarks during make check) | ||
1772 | AC_ARG_ENABLE([benchmarks], | 1212 | AC_ARG_ENABLE([benchmarks], |
1773 | [AS_HELP_STRING([--enable-benchmarks], [enable running benchmarks during make check])], | 1213 | [AS_HELP_STRING([--enable-benchmarks], |
1774 | [enable_benchmarks=${enableval}], | 1214 | [enable benchmarking (default is no)])], |
1775 | [enable_benchmarks=no]) | 1215 | [enable_benchmarks=${enableval}], |
1776 | AC_MSG_RESULT($enable_benchmarks) | 1216 | [enable_benchmarks=no]) |
1217 | |||
1218 | AS_IF([test "x$enable_benchmarks" = "xyes"], | ||
1219 | [AC_DEFINE([ENABLE_BENCHMARK], [1], [Define to 1 if benchmarks are enabled])]) | ||
1220 | AM_CONDITIONAL([ENABLE_BENCHMARK], [test "x$enable_benchmarks" = "xyes"]) | ||
1777 | AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"]) | 1221 | AM_CONDITIONAL([HAVE_BENCHMARKS], [test "x$enable_benchmarks" = "xyes"]) |
1778 | 1222 | ||
1779 | # should experimental code be compiled (code that may not yet compile)? | 1223 | # check if ports should be opened for Java services |
1780 | AC_MSG_CHECKING(whether to compile experimental code) | 1224 | AC_ARG_ENABLE([javaports], |
1225 | [AS_HELP_STRING([--enable-javaports], | ||
1226 | [use non-zero ports for services with Java bindings (default is no)])], | ||
1227 | [enable_java_ports=${enableval}], | ||
1228 | [enable_java_ports="no"]) | ||
1229 | |||
1230 | AS_IF([test "x$enable_java_ports" = "xyes"], | ||
1231 | [JAVAPORT=""], | ||
1232 | [JAVAPORT="$UNIXONLY"]) | ||
1233 | AC_SUBST([JAVAPORT]) | ||
1234 | |||
1235 | # check if experimental code should be compiled (or at least attempted to) | ||
1781 | AC_ARG_ENABLE([experimental], | 1236 | AC_ARG_ENABLE([experimental], |
1782 | [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])], | 1237 | [AS_HELP_STRING([--enable-experimental], |
1783 | [enable_experimental=${enableval}], | 1238 | [enable experimental code paths (default is no)])], |
1784 | [enable_experimental=no]) | 1239 | [enable_experimental="${enableval}"] |
1785 | AC_MSG_RESULT($enable_experimental) | 1240 | [enable_experimental="no"]) |
1786 | AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) | 1241 | AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) |
1787 | 1242 | ||
1788 | # should malicious code be compiled (should only be used for testing)? | 1243 | # check if malicious code should be compiled (for testing) |
1789 | AC_MSG_CHECKING(whether to compile malicious code) | ||
1790 | AC_ARG_ENABLE([malicious], | 1244 | AC_ARG_ENABLE([malicious], |
1791 | [AS_HELP_STRING([--enable-malicious], [enable compiling malicious code])], | 1245 | [AS_HELP_STRING([--enable-malicious], |
1792 | [AS_IF([test "x$enableval" = "xno"], | 1246 | [enable malicious code path (only for testing; default is no)])], |
1793 | [malicious=0], | 1247 | [AS_IF([test "x$enableval" = "xno"], |
1794 | [malicious=1])], | 1248 | [malicious=0], |
1795 | [malicious=0 | 1249 | [malicious=1])], |
1796 | enable_malicious=no]) | 1250 | [malicious=0 |
1797 | AC_MSG_RESULT($enable_malicious) | 1251 | enable_malicious=no]) |
1798 | AM_CONDITIONAL([ENABLE_MALICIOUS], [test 1=$malicious]) | 1252 | AM_CONDITIONAL([ENABLE_MALICIOUS], [test "x$malicious" = "x1"]) |
1799 | AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious], | 1253 | AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious], |
1800 | [enable compilation of malicious code]) | 1254 | [Define to 1 if malicious code paths should be compiled]) |
1801 | 1255 | ||
1802 | # should services be started on demand when needed? | 1256 | # check if services should be started on demand when needed |
1803 | # Some services may choose to never start by default | 1257 | # Some services may choose to never start by default |
1804 | # and it is up to the service/module developer to decide | 1258 | # and it is up to the service/module developer to decide |
1805 | # by having "START_ON_DEMAND = NO" instead of | 1259 | # by having "START_ON_DEMAND = NO" instead of |
1806 | # "START_ON_DEMAND = @START_ON_DEMAND@" | 1260 | # "START_ON_DEMAND = @START_ON_DEMAND@" |
1807 | # in the service/module's conf.in file. | 1261 | # in the service/module's conf.in file. |
1808 | # See also IMMEDIATE_START for an unconditional immediate start. | 1262 | # See also IMMEDIATE_START for an unconditional immediate start. |
1809 | START_ON_DEMAND="YES" | ||
1810 | AC_MSG_CHECKING(whether to start peer's services on demand by default) | ||
1811 | AC_ARG_ENABLE([autostart], | 1263 | AC_ARG_ENABLE([autostart], |
1812 | [AS_HELP_STRING([--disable-autostart], [do not start peer's services by default])], | 1264 | [AS_HELP_STRING([--disable-autostart], |
1813 | [enable_autostart=${enableval} | 1265 | [do not start peer services by default])], |
1814 | AS_IF([test "x$enable_autostart" = "xno"], | 1266 | [AS_IF([test "x$enableval" = "xno"], |
1815 | [START_ON_DEMAND="NO"]) | 1267 | [START_ON_DEMAND=NO], |
1816 | ], | 1268 | [START_ON_DEMAND=YES])], |
1817 | [enable_autostart=yes]) | 1269 | [START_ON_DEMAND=YES]) |
1818 | AC_MSG_RESULT($enable_autostart) | 1270 | AC_SUBST([START_ON_DEMAND]) |
1819 | #AM_CONDITIONAL([HAVE_START_ON_DEMAND], [test "x$enable_autostart" = "xyes"]) | 1271 | |
1820 | AC_SUBST(START_ON_DEMAND) | 1272 | # check if memory statistics should be kept (very expensive CPU-wise!) |
1821 | |||
1822 | # should memory statistics be kept (very expensive CPU-wise!) | ||
1823 | AC_MSG_CHECKING(whether to create expensive statistics on memory use) | ||
1824 | AC_ARG_ENABLE([heapstats], | 1273 | AC_ARG_ENABLE([heapstats], |
1825 | [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])], | 1274 | [AS_HELP_STRING([--enable-heapstats], [enable expensive heap statistics])], |
1826 | [enable_heapstats=1], | 1275 | [AS_IF([test "x$enableval" = "xno"], |
1827 | [enable_heapstats=0]) | 1276 | [enable_heapstats=0], |
1828 | AC_MSG_RESULT($enable_heapstats) | 1277 | [enable_heapstats=1])], |
1829 | AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS],$enable_heapstats,[enable expensive heap statistics]) | 1278 | [enable_heapstats=0]) |
1830 | 1279 | AC_DEFINE_UNQUOTED([ENABLE_HEAP_STATISTICS], [$enable_heapstats], | |
1831 | 1280 | [Define to 1 if expensive heap statistics should be enabled]) | |
1832 | # Check if the __thread storage class for | 1281 | |
1833 | # thread-local storage is available. | 1282 | # check if the __thread storage class is available |
1834 | AC_MSG_CHECKING(whether __thread is supported) | 1283 | AC_MSG_CHECKING([if __thread is supported]) |
1835 | AC_LINK_IFELSE( | 1284 | AC_LINK_IFELSE( |
1836 | [AC_LANG_PROGRAM([#include <stdlib.h> | 1285 | [AC_LANG_PROGRAM([#include <stdlib.h> |
1837 | #undef __thread | 1286 | #undef __thread |
1838 | static __thread int a = 1;], | 1287 | static __thread int a = 1;], |
1839 | [exit(a-1);])], | 1288 | [exit(a-1);])], |
1840 | [have_thread_local_gcc=1],[have_thread_local_gcc=0]) | 1289 | [have_thread_local=1], |
1841 | AC_DEFINE_UNQUOTED([HAVE_THREAD_LOCAL_GCC],$have_thread_local_gcc,[Define this if __thread is supported]) | 1290 | [have_thread_local=0]) |
1842 | AS_IF([test "x$have_thread_local_gcc" = "x1"], | 1291 | AC_DEFINE_UNQUOTED([HAVE_THREAD_LOCAL_GCC], [$have_thread_local], |
1843 | [AC_MSG_RESULT(yes)], | 1292 | [Define to 1 if __thread is supported]) |
1844 | [AC_MSG_RESULT(no)]) | 1293 | AS_IF([test "x$have_thread_local" = "x1"], |
1845 | 1294 | [AC_MSG_RESULT([yes])], | |
1846 | # gcov compilation | 1295 | [AC_MSG_RESULT([no])]) |
1847 | AC_MSG_CHECKING(whether to compile with support for code coverage analysis) | 1296 | |
1297 | # check if gcov should be used | ||
1848 | AC_ARG_ENABLE([coverage], | 1298 | AC_ARG_ENABLE([coverage], |
1849 | AS_HELP_STRING([--enable-coverage], | 1299 | [AS_HELP_STRING([--enable-coverage], |
1850 | [compile the library with code coverage support]), | 1300 | [compile the library with code coverage support])], |
1851 | [use_gcov=${enableval}], | 1301 | [use_gcov=${enableval}], |
1852 | [use_gcov=no]) | 1302 | [use_gcov=no]) |
1853 | AC_MSG_RESULT($use_gcov) | ||
1854 | AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"]) | 1303 | AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"]) |
1855 | 1304 | ||
1856 | |||
1857 | # Temporarily disable a specific piece of code until TNG is out. | 1305 | # Temporarily disable a specific piece of code until TNG is out. |
1858 | AC_ARG_ENABLE([transport-timing-diagnostic], | 1306 | AC_ARG_ENABLE([transport-timing-diagnostic], |
1859 | [AS_HELP_STRING([--enable-transport-timing-diagnostic], | 1307 | [AS_HELP_STRING([--enable-transport-timing-diagnostic], |
1860 | [enable logging of transport (not TNG) sending times])], | 1308 | [enable logging of transport (not TNG) sending times])], |
1861 | [enable_ttd=yes], | 1309 | [enable_ttd=yes], |
1862 | [enable_ttd=no]) | 1310 | [enable_ttd=no]) |
1863 | AS_IF([test "x$enable_ttd" = "xyes"], | 1311 | AS_IF([test "x$enable_ttd" = "xyes"], |
1864 | [AC_DEFINE([ENABLE_TTD], [1], [Define if transport (not TNG) should warn about sending times.])]) | 1312 | [AC_DEFINE([ENABLE_TTD], [1], |
1865 | 1313 | [Define if transport (not TNG) should warn about sending times.])]) | |
1866 | 1314 | ||
1867 | # version info | 1315 | # get version informations |
1868 | # TODO: git blame says this predates our switch to git. | 1316 | AC_PATH_PROG([gitcommand], [git]) |
1869 | # git-svn should be adjusted to simply git, or | 1317 | AC_MSG_CHECKING([if source is under a VCS]) |
1870 | # an external script that does the job. | 1318 | AS_IF([test "x$gitcommand" = "x"], |
1871 | AC_PATH_PROG(svnversioncommand, svnversion) | 1319 | [vcs_name="no" |
1872 | AC_PATH_PROG(gitcommand, git) | 1320 | vcs_version="\"release\""], |
1873 | AC_MSG_CHECKING(for source being under a VCS) | 1321 | [AS_IF([test -d .git], dnl admittedly, not the best |
1874 | 1322 | [git_version=$(cd $srcdir; git log -n1 --abbrev-commit | head -n1 | cut -d ' ' -f2 2>/dev/null) | |
1875 | 1323 | vcs_name='yes, git-svn' | |
1876 | # version info | 1324 | vcs_version="\"git-$git_version\""], |
1877 | AC_PATH_PROG(gitcommand, git) | 1325 | [vcs_name="no" |
1878 | AC_MSG_CHECKING(for source being under a VCS) | 1326 | vcs_version="\"release\""])]) |
1879 | git_version= | 1327 | AC_MSG_RESULT([$vcs_name]) |
1880 | AS_IF([test ! "X$gitcommand" = "X"], | 1328 | AC_DEFINE_UNQUOTED([VCS_VERSION], [$vcs_version], |
1881 | [ | 1329 | [VCS revision/hash or tarball version]) |
1882 | git_version=$(cd $srcdir ; git log -n1 --abbrev-commit | head -n1 | cut -d " " -f2 2>/dev/null) | ||
1883 | ]) | ||
1884 | AS_IF([test "X$git_version" = "X"], | ||
1885 | [ | ||
1886 | vcs_name="no" | ||
1887 | vcs_version="\"release\"" | ||
1888 | ], | ||
1889 | [ | ||
1890 | vcs_name="yes, git-svn" | ||
1891 | vcs_version="\"git-$git_version\"" | ||
1892 | ]) | ||
1893 | AC_MSG_RESULT($vcs_name) | ||
1894 | |||
1895 | AC_MSG_CHECKING(VCS version) | ||
1896 | AC_MSG_RESULT($vcs_version) | ||
1897 | AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version]) | ||
1898 | 1330 | ||
1899 | AC_CONFIG_FILES([ | 1331 | AC_CONFIG_FILES([ |
1900 | Makefile | 1332 | Makefile |
@@ -2050,149 +1482,147 @@ pkgconfig/gnunettransport.pc | |||
2050 | pkgconfig/gnunetutil.pc | 1482 | pkgconfig/gnunetutil.pc |
2051 | pkgconfig/gnunetvpn.pc | 1483 | pkgconfig/gnunetvpn.pc |
2052 | ]) | 1484 | ]) |
2053 | AC_OUTPUT | ||
2054 | 1485 | ||
1486 | AC_OUTPUT | ||
2055 | 1487 | ||
2056 | # FIXME: `some modules' -> be more specific which exact modules. | 1488 | # notice about Java ports |
2057 | |||
2058 | # java ports | ||
2059 | AS_IF([test "x$enable_java_ports" = "xyes"], | 1489 | AS_IF([test "x$enable_java_ports" = "xyes"], |
2060 | [AC_MSG_NOTICE([Opening TCP ports by default to enable gnunet-java bindings.])]) | 1490 | [AC_MSG_NOTICE([Opening TCP ports to enable gnunet-java bindings]) |
1491 | java_msg="yes"], | ||
1492 | [java_msg="no"]) | ||
2061 | 1493 | ||
2062 | #### | 1494 | # experimental code is enabled |
2063 | #### This could be moved to the checks above, | ||
2064 | #### but for now let's keep it here. | ||
2065 | #### | ||
2066 | transport_msg="tcp udp unix http" | ||
2067 | AS_IF([test "x$build_target" = "xlinux" -a "x$enable_experimental" = "xyes"], | ||
2068 | [transport_msg="$transport_msg wlan"]) | ||
2069 | # -- print message regarding enabled experimental features | ||
2070 | experimental_msg="no" | ||
2071 | AS_IF([test "x$enable_experimental" = "xyes"], | 1495 | AS_IF([test "x$enable_experimental" = "xyes"], |
2072 | [experimental_msg="yes"]) | 1496 | [experimental_msg="yes"], |
2073 | # -- libidn 2 | 1497 | [experimental_msg="no"]) |
2074 | AS_IF([test "x$working_libidn2" = x1], | 1498 | |
2075 | [libidn2_msg="libidn2"]) | 1499 | # experimental code for transport is enabled |
2076 | # -- libidn 1 | 1500 | transport_msg="tcp udp unix http" |
2077 | AS_IF([test "x$working_libidn1" = x1], | 1501 | AS_IF([test "x$build_target" = "xlinux" && test "x$enable_experimental" = "xyes"], |
2078 | [libidn1_msg="libidn1"]) | 1502 | [transport_msg="tcp udp unix http wlan"]) |
2079 | # -- texi2mdoc-generation | 1503 | |
2080 | AS_IF([test "x$texi2mdoc_generation" = "xyes"], | 1504 | # libidn version |
2081 | [mdocml_msg="yes"], | 1505 | AS_IF([test "x$libidn_version" = "x2"], |
2082 | [mdocml_msg="no"]) | 1506 | [libidn_msg="libidn2"], |
2083 | # -- texi2mdoc | 1507 | [libidn_msg="libidn"]) |
2084 | AS_IF([test "x$TEXI2MDOC_BINARY" = "false"], | 1508 | |
2085 | [AC_MSG_NOTICE([texi2mdoc binary not found (will not generate mdoc documentation)]) | 1509 | # texi2mdoc |
2086 | texi2mdoc_msg="no (optional)"], | 1510 | AS_IF([test "x$texi2mdoc_enabled" = "xyes"], |
2087 | [texi2mdoc_msg="yes"]) | 1511 | [mdocml_msg="yes"], |
2088 | # -- mandoc | 1512 | [mdocml_msg="no"]) |
2089 | AS_IF([test "x$MANDOC_BINARY" = "false"], | 1513 | AS_IF([test "x$TEXI2MDOC_BINARY" = "xfalse"], |
2090 | [AC_MSG_NOTICE([mandoc binary not found (will not generate handbook as man page)]) | 1514 | [mdocbin_msg="no"], |
2091 | mandoc_msg="no"], | 1515 | [mdocbin_msg="yes"]) |
2092 | [mandoc_msg="yes"]) | 1516 | |
2093 | # -- texinfo | 1517 | # mandoc |
2094 | AS_IF([test "x$makeinfo" != "x1"], | 1518 | AS_IF([test "x$MANDOC_BINARY" = "xfalse"], |
2095 | [texinfo_msg="no"], | 1519 | [mandoc_msg="no"], |
2096 | [texinfo_msg="yes"]) | 1520 | [mandoc_msg="yes"]) |
2097 | # -- conversation | 1521 | |
1522 | # texinfo | ||
1523 | AS_IF([test "x$documentation" = "xyes"], | ||
1524 | [texinfo_msg="yes"], | ||
1525 | [texinfo_msg="no"]) | ||
1526 | |||
1527 | # conversation | ||
2098 | conversation_msg="no" | 1528 | conversation_msg="no" |
1529 | AS_IF([test "x$pulse" = "x1"], | ||
1530 | [libpulse_msg="yes"], | ||
1531 | [libpulse_msg="no"]) | ||
1532 | AS_IF([test "x$opus" = "x1"], | ||
1533 | [libopus_msg="yes"], | ||
1534 | [libopus_msg="no"]) | ||
1535 | gstreamer_msg="no" | ||
2099 | AS_IF([test "x$conversation_backend" = "xnone"], | 1536 | AS_IF([test "x$conversation_backend" = "xnone"], |
2100 | [AS_IF([test "x$pulse" != "x1"], | 1537 | [AS_IF([test "x$pulse" != "x1"], |
2101 | [libpulse_msg="no (required for conversation)"], | 1538 | [libpulse_msg="no (required to build conversation)"], |
2102 | [libpulse_msg="yes"]) | 1539 | [libpulse_msg="yes"]) |
2103 | AS_IF([test "x$opus" != "x1"], | 1540 | AS_IF([test "x$opus" != "x1"], |
2104 | [libopus_msg="no (required for conversation)"], | 1541 | [libopus_msg="no (required to build conversation)"], |
2105 | [libopus_msg="yes"]) | 1542 | [libopus_msg="yes"]) |
2106 | AS_IF([test "x$gst" != "x1"], | 1543 | AS_IF([test "x$gst" != "x1"], |
2107 | [gstreamer_msg="no (required for conversation)"], | 1544 | [gstreamer_msg="no (required to build conversation)"], |
2108 | [gstreamer_msg="yes"])], | 1545 | [gstreamer_msg="yes"])], |
2109 | [AS_IF([test "x$opus" = x1], | 1546 | [AS_IF([test "x$opus" = "x1"], |
2110 | [conversation_msg="yes (x$conversation_backend)"], | 1547 | [conversation_msg="yes ($conversation_backend)"], |
2111 | [AC_MSG_WARN([libopus not found (required to build conversation)])])]) | 1548 | [conversation_msg="no"])]) |
2112 | 1549 | ||
2113 | # -- interface | 1550 | # default network interface |
2114 | interface_msg=`echo $DEFAULT_INTERFACE | tr -d \"` | 1551 | interface_msg=$(echo "$DEFAULT_INTERFACE" | tr -d \") |
2115 | # -- jansson | 1552 | |
2116 | # -- libextractor | 1553 | # libextractor |
2117 | AS_IF([test "$extractor" != 1], | 1554 | AS_IF([test "x$extractor" = "x0"], |
2118 | [AC_MSG_WARN([libextractor not found, but various file-sharing functions require it])], | 1555 | [libextractor_msg="no" |
2119 | [libextractor_msg="yes"]) | 1556 | AC_MSG_WARN([libextractor not found, but various file-sharing operations require it])], |
2120 | # -- libzbar | 1557 | [libextractor_msg="yes"]) |
1558 | |||
1559 | # libzbar | ||
2121 | AS_IF([test "x$zbar" = "x1"], | 1560 | AS_IF([test "x$zbar" = "x1"], |
2122 | [libzbar_msg="yes"], | 1561 | [libzbar_msg="yes"], |
2123 | [libzbar_msg="no (gnunet-qr will not be built)"]) | 1562 | [libzbar_msg="no"]) |
2124 | # -- libpng | 1563 | |
1564 | # libpng | ||
2125 | AS_IF([test "x$png" = "x1"], | 1565 | AS_IF([test "x$png" = "x1"], |
2126 | [libpng_msg="yes"], | 1566 | [libpng_msg="yes"], |
2127 | [libpng_msg="no (gnunet-qr will not scan images)"]) | 1567 | [libpng_msg="no"]) |
2128 | # -- libgnurl | 1568 | |
2129 | AS_IF([test "$gnurl" = "0"], | 1569 | # curl or gnurl |
2130 | [AS_IF([test "x$curl" = "xfalse"], | 1570 | AS_IF([test "x$gnurl" = "x1"], |
2131 | [AC_MSG_WARN([libgnurl not found. http client support will not be compiled.]) | 1571 | [http_client="gnurl"], |
2132 | AC_MSG_WARN([IMPORTANT: No HTTP client library found. HTTP transports and hostlist daemon will not be compiled, and you probably WANT the hostlist daemon]) | 1572 | [AS_IF([test "x$curl_gnutls" = "x1"], |
2133 | http_client="none"], | 1573 | [http_client="curl-gnutls"], |
2134 | [AC_MSG_NOTICE([Using libcurl as HTTP client library.]) | 1574 | [http_client="curl-openssl"])]) |
2135 | http_client="curl"])], | 1575 | |
2136 | [AC_MSG_NOTICE([Using libgnurl as HTTP client library.]) | 1576 | # ifconfig |
2137 | http_client="gnurl"]) | 1577 | AS_IF([test "x$IFCONFIG_BINARY" = "xfalse"], |
2138 | AS_IF([test "x$curl" = "xtrue" -a "x$curl_gnutls" != "xtrue"], | 1578 | [ifconfig_msg="no (some features might not work)"], |
2139 | [AC_MSG_WARN([libcurl TLS backend is not gnutls. The GNS Proxy will likely not function properly.]) | 1579 | [ifconfig_msg="yes"]) |
2140 | http_client="curl-openssl"], | 1580 | |
2141 | [http_client="curl-gnutls"]) | 1581 | # upnpc |
2142 | # -- ifconfig | 1582 | AS_IF([test "x$UPNPC_BINARY" = "xfalse"], |
2143 | AS_IF([test "$VAR_IFCONFIG_BINARY" = "false"], | 1583 | [upnpc_msg="no (NAT traversal might not work)"], |
2144 | [ifconfig_msg="no (optional, some features will not work)"], | 1584 | [upnpc_msg="yes"]) |
2145 | [ifconfig_msg="yes"]) | 1585 | |
2146 | # -- upnpc | 1586 | # iptables |
2147 | AS_IF([test "$VAR_UPNPC_BINARY" = "false"], | 1587 | AS_IF([test "x$IPTABLES_BINARY" = "xfalse"], |
2148 | [upnpc_msg="no (optional, NAT traversal using UPnPc will not work)"], | 1588 | [iptables_msg="no (DNS query interception might not work)"], |
2149 | [upnpc_msg="yes"]) | 1589 | [iptables_msg="yes"]) |
2150 | # -- iptables | 1590 | |
2151 | AS_IF([test "$VAR_IPTABLES_BINARY" = "false"], | 1591 | # bluetooth |
2152 | [iptables_msg="no (optional, DNS query interception will not work)"], | ||
2153 | [iptables_msg="yes"]) | ||
2154 | # -- bluetooth | ||
2155 | AS_IF([test "x$bluetooth" = "x0"], | 1592 | AS_IF([test "x$bluetooth" = "x0"], |
2156 | [bluetooth_msg="no (optional)"], | 1593 | [bluetooth_msg="no"], |
2157 | [bluetooth_msg="yes" | 1594 | [bluetooth_msg="yes"]) |
2158 | transport_msg="$transport_msg bluetooth"]) | 1595 | |
2159 | # -- gnutls | 1596 | # gnutls |
2160 | AS_IF([test x$gnutls != xtrue], | 1597 | AS_IF([test "x$gnutls" = "x0"], |
2161 | [AC_MSG_WARN([GnuTLS not found, gnunet-gns-proxy will not be built]) | 1598 | [gnutls_msg="no"], |
2162 | gnutls_msg="no (gnunet-gns-proxy will not be built)"], | 1599 | [AS_IF([test "x$gnutls_dane" = "x0"], |
2163 | [AS_IF([test "x$gnutls_dane" != "x1"], | 1600 | [gnutls_msg="yes (without DANE support)" |
2164 | [AC_MSG_WARN([GnuTLS lacks DANE support, DANE validation will not be possible]) | 1601 | AC_MSG_WARN([GnuTLS lacks DANE support; validation using it will not be possible])], |
2165 | gnutls_msg="yes (without DANE support)"], | 1602 | [gnutls_msg="yes (with DANE support)"])]) |
2166 | [gnutls_msg="yes (with DANE support)"])]) | 1603 | |
2167 | # -- databases | 1604 | # database backends |
2168 | # TODO: this always returns true, the check might | 1605 | features_msg="" |
2169 | # TODO: not be working as intended (for msqlfail). | 1606 | |
2170 | AS_IF([test "$mysql" = true], | 1607 | AS_IF([test "x$sqlite3" = "x1"], |
2171 | [features_msg="$features_msg mysql" | 1608 | [sqlite_msg="yes" |
2172 | mysql_msg="yes"], | 1609 | features_msg="sqlite $features_msg"], |
2173 | [mysql_msg="no"]) | 1610 | [sqlite_msg="no"]) |
2174 | AS_IF([test x$mysqlfail = xtrue], | 1611 | |
2175 | [AC_MSG_WARN([MySQL not found (or too old), will not create MySQL database support]) | 1612 | AS_IF([test "x$mysql" = "xtrue"], |
2176 | mysql_msg="unsupported version"]) | 1613 | [mysql_msg="yes" |
2177 | AS_IF([test "$sqlite" = true], | 1614 | features_msg="mysql $features_msg"], |
2178 | [features_msg="$features_msg sqlite" | 1615 | [mysql_msg="no"]) |
2179 | sqlite_msg="yes"], | 1616 | |
2180 | [AC_MSG_ERROR([sqlite3 not found, but sqlite3 is required.]) | 1617 | AS_IF([test "x$postgres" = "x1"], |
2181 | sqlite_msg="no"]) | 1618 | [postgres_msg="yes" |
2182 | AS_IF([test "$postgres" = true], | 1619 | features_msg="postgres $features_msg"], |
2183 | [features_msg="$features_msg postgres" | 1620 | [postgres_msg="no"]) |
2184 | postgres_msg="yes"], | 1621 | |
2185 | [postgres_msg="no"]) | 1622 | # Too new versions of Python might cause compatibility issues, so output a |
2186 | # -- features | 1623 | # warning when the version found goes above the recommended maximum version. |
2187 | # ---- 1. replace spaces with newlines, | 1624 | AS_VERSION_COMPARE([$PYTHON_VERSION],[3.8],[],[], |
2188 | # ---- 2. sort the lines, | 1625 | [AC_MSG_WARN([Your version of Python is not supported, you might see issues])]) |
2189 | # ---- 3. replace the newlines with spaces. | ||
2190 | features_msg=`echo $features_msg | tr ' ' '\012' | sort | tr '\012' ' '` | ||
2191 | AC_SUBST(features_msg) | ||
2192 | |||
2193 | |||
2194 | # The summary | ||
2195 | # TODO: reduce the length of the last message block, following "IMPORTANT". | ||
2196 | 1626 | ||
2197 | AC_MSG_NOTICE([ | 1627 | AC_MSG_NOTICE([ |
2198 | Detected system | 1628 | Detected system |
@@ -2200,60 +1630,65 @@ Detected system | |||
2200 | 1630 | ||
2201 | GNUnet version: ${VERSION} | 1631 | GNUnet version: ${VERSION} |
2202 | 1632 | ||
2203 | Host setup: ${host} | 1633 | Host Setup: ${host} |
2204 | Install prefix: ${prefix} | 1634 | Install Prefix: ${prefix} |
2205 | Compiler: ${CC} | 1635 | Compiler: ${CC} |
2206 | CFLAGS: ${CFLAGS} | 1636 | CFLAGS: ${CFLAGS} |
2207 | CPPFLAGS: ${CPPFLAGS} | 1637 | CPPFLAGS: ${CPPFLAGS} |
2208 | LDFLAGS: ${LDFLAGS} | 1638 | LDFLAGS: ${LDFLAGS} |
2209 | LIBS: ${LIBS} | 1639 | LIBS: ${LIBS} |
2210 | Build Target: $build_target | 1640 | Build Target: ${build_target} |
2211 | 1641 | ||
2212 | Default Interface: ${interface_msg} | 1642 | Default Interface: ${interface_msg} |
2213 | 1643 | ||
1644 | sqlite3: ${sqlite_msg} | ||
2214 | MySQL: ${mysql_msg} | 1645 | MySQL: ${mysql_msg} |
2215 | PostgreSQL: ${postgres_msg} | 1646 | PostgreSQL: ${postgres_msg} |
2216 | sqlite3: ${sqlite_msg} | 1647 | |
2217 | http client: ${http_client} | 1648 | HTTP Client: ${http_client} |
2218 | bluetooth: ${bluetooth_msg} | 1649 | Bluetooth: ${bluetooth_msg} |
2219 | iptables: ${iptables_msg} | 1650 | iptables: ${iptables_msg} |
2220 | ifconfig: ${ifconfig_msg} | 1651 | ifconfig: ${ifconfig_msg} |
2221 | upnpc: ${upnpc_msg} | 1652 | UPnPc: ${upnpc_msg} |
2222 | gnutls: ${gnutls_msg} | 1653 | GnuTLS: ${gnutls_msg} |
1654 | |||
1655 | libextractor: ${libextractor_msg} | ||
2223 | libzbar: ${libzbar_msg} | 1656 | libzbar: ${libzbar_msg} |
2224 | libpng: ${libpng_msg} | 1657 | libpng: ${libpng_msg} |
2225 | java: ${java_msg} | 1658 | libidn: ${libidn_msg} |
2226 | libidn: ${libidn1_msg}${libidn2_msg} | ||
2227 | libopus: ${libopus_msg} | 1659 | libopus: ${libopus_msg} |
2228 | gstreamer: ${gstreamer_msg} | ||
2229 | libpulse: ${libpulse_msg} | 1660 | libpulse: ${libpulse_msg} |
2230 | libextractor: ${libextractor_msg} | 1661 | gstreamer: ${gstreamer_msg} |
2231 | texi2mdoc: ${texi2mdoc_msg} | 1662 | |
1663 | Java: ${java_msg} | ||
1664 | |||
1665 | texi2mdoc: ${mdocbin_msg} | ||
2232 | mandoc: ${mandoc_msg} | 1666 | mandoc: ${mandoc_msg} |
2233 | 1667 | ||
2234 | GNUnet configuration: | 1668 | GNUnet configuration |
2235 | ===================== | 1669 | ==================== |
2236 | transports: ${transport_msg} | 1670 | |
2237 | conversation: ${conversation_msg} | 1671 | Transports: ${transport_msg} |
2238 | database backends: ${features_msg} | 1672 | Conversation: ${conversation_msg} |
2239 | experimental: ${experimental_msg} | 1673 | Database Backends ${features_msg} |
1674 | Experimental Code: ${experimental_msg} | ||
2240 | 1675 | ||
2241 | texinfo manual: ${texinfo_msg} | 1676 | Texinfo Manual: ${texinfo_msg} |
2242 | transpiled mdocml manual: ${mdocml_msg} | 1677 | Transpiled mdocml Manual: ${mdocml_msg} |
2243 | ]) | 1678 | ]) |
2244 | 1679 | ||
2245 | AS_IF([test x$MSG_USER_SETUP != xfalse], | 1680 | AS_IF([test "x$MSG_USER_SETUP" != "xfalse"], |
2246 | [AC_MSG_WARN([Please make sure NOW to create a user and group 'gnunet' and additionally a group 'gnunetdns'. Make sure that '/var/lib/gnunet' is owned (and writable) by user 'gnunet'.]) | 1681 | [AC_MSG_WARN([Please make sure NOW to create a user and group 'gnunet' and additionall a group 'gnunetdns'. Make sure that '/var/lib/gnunet' is owned (and writable) by user 'gnunet'.]) |
2247 | AS_IF([test x$HAVE_GNUNET_USER != 0], | 1682 | AS_IF([test "x$HAVE_GNUNET_USER" != "x0"], |
2248 | [AC_MSG_NOTICE([To do this on this system, run: | 1683 | [AC_MSG_NOTICE([To do this on this system, run: |
2249 | # addgroup gnunetdns | 1684 | # addgroup gnunetdns |
2250 | # adduser --system --disabled-login --home /var/lib/gnunet gnunet | 1685 | # adduser --system --disabled-login --home /var/lib/gnunet gnunet |
2251 | ])]) | 1686 | ])]) |
2252 | AC_MSG_WARN([Each user of GNUnet should be added to the 'gnunet' group.]) | 1687 | AC_MSG_WARN([Each user of GNUnet should be added to the 'gnunet' group]) |
2253 | AS_IF([test x$HAVE_GNUNET_USER != 0], | 1688 | AS_IF([test "x$HAVE_GNUNET_USER" != "x0"], |
2254 | [AC_MSG_NOTICE([To do this on this system, run: | 1689 | [AC_MSG_NOTICE([To do this on this system, run: |
2255 | # adduser USERNAME gnunet | 1690 | # adduser USERNAME gnunet |
2256 | for each of your users, replacing "USERNAME" with the respective login name. Users may have to login again for the changes to take effect. | 1691 | for each of your users, replacing 'USERNAME' with the respective login name. |
2257 | ])])]) | 1692 | Users may have to login again for the changes to take effect.])])]) |
2258 | 1693 | ||
2259 | AC_MSG_NOTICE([For detailed setup instructions, type 'info gnunet' after the installation or visit https://docs.gnunet.org/]) | 1694 | AC_MSG_NOTICE([For detailed setup instructions, type 'info gnunet' after the installation or visit https://docs.gnunet.org/]) |