1 # Copyright (C) 2000-2012 Free Software Foundation, Inc.
3 # Author: Nikos Mavrogiannopoulos, Simon Josefsson
5 # This file is part of GnuTLS.
7 # The GnuTLS is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public License
9 # as published by the Free Software Foundation; either version 2.1 of
10 # the License, or (at your option) any later version.
12 # The GnuTLS is distributed in the hope that it will be
13 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with GnuTLS; if not, write to the Free
19 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 AC_DEFUN([LIBGNUTLS_EXTRA_HOOKS],
24 AC_MSG_CHECKING([whether to build OpenSSL compatibility layer])
25 AC_ARG_ENABLE(openssl-compatibility,
26 AS_HELP_STRING([--enable-openssl-compatibility],
27 [enable the OpenSSL compatibility library]),
28 enable_openssl=$enableval, enable_openssl=no)
29 AC_MSG_RESULT($enable_openssl)
30 AM_CONDITIONAL(ENABLE_OPENSSL, test "$enable_openssl" = "yes")
32 # We link to ../lib's gnulib, which needs -lws2_32 via LIBSOCKET in Makefile.am.
36 AC_DEFUN([LIBGNUTLS_HOOKS],
38 # Library code modified: REVISION++
39 # Interfaces changed/added/removed: CURRENT++ REVISION=0
40 # Interfaces added: AGE++
41 # Interfaces removed: AGE=0 (+bump all symbol versions in .map)
42 AC_SUBST(LT_CURRENT, 30)
43 AC_SUBST(LT_REVISION, 0)
46 AC_SUBST(LT_SSL_CURRENT, 27)
47 AC_SUBST(LT_SSL_REVISION, 2)
48 AC_SUBST(LT_SSL_AGE, 0)
50 AC_SUBST(LT_DANE_CURRENT, 4)
51 AC_SUBST(LT_DANE_REVISION, 1)
52 AC_SUBST(LT_DANE_AGE, 4)
54 AC_SUBST(LT_XSSL_CURRENT, 0)
55 AC_SUBST(LT_XSSL_REVISION, 0)
56 AC_SUBST(LT_XSSL_AGE, 0)
58 AC_SUBST(CXX_LT_CURRENT, 29)
59 AC_SUBST(CXX_LT_REVISION, 0)
60 AC_SUBST(CXX_LT_AGE, 1)
62 AC_SUBST(CRYWRAP_PATCHLEVEL, 3)
64 # Used when creating the Windows libgnutls-XX.def files.
65 DLL_VERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
68 PKG_CHECK_MODULES(NETTLE, [nettle >= 3.0], [cryptolib="nettle"], [
71 *** Libnettle 3.0 was not found.
74 PKG_CHECK_MODULES(HOGWEED, [hogweed >= 3.0], [], [
77 *** Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
80 AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
81 AC_DEFINE([HAVE_LIBNETTLE], 1, [nettle is enabled])
83 GNUTLS_REQUIRES_PRIVATE="Requires.private: nettle, hogweed"
85 AC_ARG_WITH(nettle-mini,
86 AS_HELP_STRING([--with-nettle-mini], [Link against a mini-nettle (that includes mini-gmp)]),
90 AC_ARG_VAR(GMP_CFLAGS, [C compiler flags for gmp])
91 AC_ARG_VAR(GMP_LIBS, [linker flags for gmp])
92 if test "$mini_nettle" != no;then
96 if test x$GMP_LIBS = x; then
97 AC_CHECK_LIB(gmp, __gmpz_cmp, [GMP_LIBS="-lgmp"], [AC_MSG_ERROR([[
99 *** gmp was not found.
106 AC_ARG_WITH(included-libtasn1,
107 AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
108 included_libtasn1=$withval,
109 included_libtasn1=no)
110 if test "$included_libtasn1" = "no"; then
111 PKG_CHECK_MODULES(LIBTASN1, [libtasn1 >= 3.9], [], [included_libtasn1=yes])
112 if test "$included_libtasn1" = yes; then
115 *** Libtasn1 was not found. Will use the included one.
119 AC_MSG_CHECKING([whether to use the included minitasn1])
120 AC_MSG_RESULT($included_libtasn1)
121 AM_CONDITIONAL(ENABLE_MINITASN1, test "$included_libtasn1" = "yes")
123 if test "$included_libtasn1" = "no"; then
124 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libtasn1"
127 AC_MSG_CHECKING([whether C99 macros are supported])
130 #define test_mac(...)
135 AC_DEFINE([C99_MACROS], 1, [C99 macros are supported])
139 AC_MSG_WARN([C99 macros not supported. This may affect compiling.])
143 AC_MSG_CHECKING([whether to disable DTLS-SRTP extension])
144 AC_ARG_ENABLE(dtls-srtp-support,
145 AS_HELP_STRING([--disable-dtls-srtp-support],
146 [disable support for the DTLS-SRTP extension]),
147 ac_enable_srtp=$enableval)
148 if test x$ac_enable_srtp != xno; then
150 AC_DEFINE([ENABLE_DTLS_SRTP], 1, [enable DTLS-SRTP support])
155 AM_CONDITIONAL(ENABLE_DTLS_SRTP, test "$ac_enable_srtp" != "no")
157 AC_MSG_CHECKING([whether to disable ALPN extension])
158 AC_ARG_ENABLE(alpn-support,
159 AS_HELP_STRING([--disable-alpn-support],
160 [disable support for the Application Layer Protocol Negotiation (ALPN) extension]),
161 ac_enable_alpn=$enableval,ac_enable_alpn=yes)
162 if test x$ac_enable_alpn != xno; then
164 AC_DEFINE([ENABLE_ALPN], 1, [enable ALPN support])
169 AM_CONDITIONAL(ENABLE_ALPN, test "$ac_enable_alpn" != "no")
171 ac_enable_heartbeat=yes
172 AC_MSG_CHECKING([whether to disable TLS heartbeat support])
173 AC_ARG_ENABLE(heartbeat-support,
174 AS_HELP_STRING([--disable-heartbeat-support],
175 [disable support for the heartbeat extension]),
176 ac_enable_heartbeat=$enableval)
177 if test x$ac_enable_heartbeat != xno; then
179 AC_DEFINE([ENABLE_HEARTBEAT], 1, [enable heartbeat support])
183 AM_CONDITIONAL(ENABLE_HEARTBEAT, test "$ac_enable_heartbeat" != "no")
186 AC_MSG_CHECKING([whether to disable SRP authentication support])
187 AC_ARG_ENABLE(srp-authentication,
188 AS_HELP_STRING([--disable-srp-authentication],
189 [disable the SRP authentication support]),
190 ac_enable_srp=$enableval)
191 if test x$ac_enable_srp != xno; then
193 AC_DEFINE([ENABLE_SRP], 1, [enable SRP authentication])
198 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
201 AC_MSG_CHECKING([whether to disable PSK authentication support])
202 AC_ARG_ENABLE(psk-authentication,
203 AS_HELP_STRING([--disable-psk-authentication],
204 [disable the PSK authentication support]),
205 ac_enable_psk=$enableval)
206 if test x$ac_enable_psk != xno; then
208 AC_DEFINE([ENABLE_PSK], 1, [enable PSK authentication])
213 AM_CONDITIONAL(ENABLE_PSK, test "$ac_enable_psk" != "no")
216 AC_MSG_CHECKING([whether to disable anonymous authentication support])
217 AC_ARG_ENABLE(anon-authentication,
218 AS_HELP_STRING([--disable-anon-authentication],
219 [disable the anonymous authentication support]),
220 ac_enable_anon=$enableval)
221 if test x$ac_enable_anon != xno; then
223 AC_DEFINE([ENABLE_ANON], 1, [enable anonymous authentication])
228 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
230 AC_MSG_CHECKING([whether to disable DHE support])
232 AS_HELP_STRING([--disable-dhe],
233 [disable the DHE support]),
234 ac_enable_dhe=$enableval, ac_enable_dhe=yes)
235 if test x$ac_enable_dhe != xno; then
237 AC_DEFINE([ENABLE_DHE], 1, [enable DHE])
242 AM_CONDITIONAL(ENABLE_DHE, test "$ac_enable_dhe" != "no")
244 AC_MSG_CHECKING([whether to disable ECDHE support])
246 AS_HELP_STRING([--disable-ecdhe],
247 [disable the ECDHE support]),
248 ac_enable_ecdhe=$enableval, ac_enable_ecdhe=yes)
249 if test x$ac_enable_ecdhe != xno; then
251 AC_DEFINE([ENABLE_ECDHE], 1, [enable DHE])
256 AM_CONDITIONAL(ENABLE_ECDHE, test "$ac_enable_ecdhe" != "no")
258 ac_enable_openpgp=yes
259 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
260 AC_ARG_ENABLE(openpgp-authentication,
261 AS_HELP_STRING([--disable-openpgp-authentication],
262 [disable the OpenPGP authentication support]),
263 ac_enable_openpgp=$enableval)
264 if test x$ac_enable_openpgp = xno; then
268 AC_DEFINE([ENABLE_OPENPGP], 1, [use openpgp authentication])
271 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
274 AC_MSG_CHECKING([whether to add cryptodev support])
275 AC_ARG_ENABLE(cryptodev,
276 AS_HELP_STRING([--enable-cryptodev], [enable cryptodev support]),
277 enable_cryptodev=$enableval,enable_cryptodev=no)
278 AC_MSG_RESULT($enable_cryptodev)
280 if test "$enable_cryptodev" = "yes"; then
281 AC_DEFINE([ENABLE_CRYPTODEV], 1, [Enable cryptodev support])
284 AC_MSG_CHECKING([whether to disable OCSP support])
286 AS_HELP_STRING([--disable-ocsp],
287 [disable OCSP support]),
288 ac_enable_ocsp=$enableval,ac_enable_ocsp=yes)
289 if test x$ac_enable_ocsp != xno; then
292 AC_DEFINE([ENABLE_OCSP], 1, [enable OCSP support])
297 AM_CONDITIONAL(ENABLE_OCSP, test "$ac_enable_ocsp" != "no")
300 AC_MSG_CHECKING([whether to disable session tickets support])
301 AC_ARG_ENABLE(session-tickets,
302 AS_HELP_STRING([--disable-session-tickets],
303 [disable session tickets support]),
304 ac_enable_session_tickets=$enableval,ac_enable_session_tickets=yes)
305 if test x$ac_enable_session_tickets != xno; then
306 ac_enable_session_tickets=yes
308 AC_DEFINE([ENABLE_SESSION_TICKETS], 1, [enable session tickets support])
313 AM_CONDITIONAL(ENABLE_SESSION_TICKETS, test "$ac_enable_session_tickets" != "no")
315 # For storing integers in pointers without warnings
316 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
317 AC_CHECK_SIZEOF(void *)
318 AC_CHECK_SIZEOF(long long)
319 AC_CHECK_SIZEOF(long)
321 if test x$ac_cv_sizeof_void_p = x$ac_cv_sizeof_long;then
322 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long)],
323 [Additional cast to bring void* to a type castable to int.])
324 elif test x$ac_cv_sizeof_void_p = x$ac_cv_sizeof_long_long;then
325 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long long)],
326 [Additional cast to bring void* to a type castable to int.])
328 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [])
331 dnl this is called from somewhere else
333 dnl m4_ifdef([gl_ICONV_MODULE_INDICATOR],
334 dnl [gl_ICONV_MODULE_INDICATOR([iconv])])