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([--disable-openssl-compatibility],
27 [disable the OpenSSL compatibility support]),
28 enable_openssl=$enableval, enable_openssl=yes)
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, 71)
43 AC_SUBST(LT_REVISION, 1)
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, 5)
51 AC_SUBST(LT_DANE_REVISION, 0)
52 AC_SUBST(LT_DANE_AGE, 5)
54 AC_SUBST(CXX_LT_CURRENT, 29)
55 AC_SUBST(CXX_LT_REVISION, 0)
56 AC_SUBST(CXX_LT_AGE, 1)
58 AC_SUBST(CRYWRAP_PATCHLEVEL, 3)
60 # Used when creating the Windows libgnutls-XX.def files.
61 DLL_VERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
64 PKG_CHECK_MODULES(NETTLE, [nettle >= 2.7], [cryptolib="nettle"], [
67 *** Libnettle 2.7.1 was not found.
70 PKG_CHECK_MODULES(HOGWEED, [hogweed >= 2.7], [], [
73 *** Libhogweed (nettle's companion library) was not found. Note that you must compile nettle with gmp support.
76 AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
77 AC_DEFINE([HAVE_LIBNETTLE], 1, [nettle is enabled])
78 nettle_version=`$PKG_CONFIG --modversion nettle`
80 if $PKG_CONFIG --atleast-version=3.0 nettle; then
81 AC_DEFINE([USE_NETTLE3], 1, [nettle 3.0 or later])
86 AM_CONDITIONAL(USE_NETTLE3, test "$use_nettle3" = "yes")
88 GNUTLS_REQUIRES_PRIVATE="Requires.private: nettle, hogweed"
90 AC_ARG_WITH(nettle-mini,
91 AS_HELP_STRING([--with-nettle-mini], [Link against a mini-nettle (that includes mini-gmp)]),
95 AC_ARG_VAR(GMP_CFLAGS, [C compiler flags for gmp])
96 AC_ARG_VAR(GMP_LIBS, [linker flags for gmp])
97 if test "$mini_nettle" != no;then
101 if test x$GMP_LIBS = x; then
102 AC_CHECK_LIB(gmp, __gmpz_cmp, [GMP_LIBS="-lgmp"], [AC_MSG_ERROR([[
104 *** gmp was not found.
111 AC_ARG_WITH(included-libtasn1,
112 AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
113 included_libtasn1=$withval,
114 included_libtasn1=no)
115 if test "$included_libtasn1" = "no"; then
116 PKG_CHECK_MODULES(LIBTASN1, [libtasn1 >= 3.9], [], [included_libtasn1=yes])
117 if test "$included_libtasn1" = yes; then
120 *** Libtasn1 was not found. Will use the included one.
124 AC_MSG_CHECKING([whether to use the included minitasn1])
125 AC_MSG_RESULT($included_libtasn1)
126 AM_CONDITIONAL(ENABLE_MINITASN1, test "$included_libtasn1" = "yes")
128 if test "$included_libtasn1" = "no"; then
129 GNUTLS_REQUIRES_PRIVATE="${GNUTLS_REQUIRES_PRIVATE}, libtasn1"
131 LIBS="$LIBS $LIBTASN1_LIBS"
133 CFLAGS="$CFLAGS $LIBTASN1_CFLAGS"
134 AC_CHECK_FUNC(asn1_decode_simple_ber,
135 [AC_DEFINE(HAVE_ASN1_DECODE_SIMPLE_BER, 1, [Have this function])], [])
138 AC_DEFINE(HAVE_ASN1_DECODE_SIMPLE_BER, 1, [Have this function])
141 AC_MSG_CHECKING([whether C99 macros are supported])
144 #define test_mac(...)
149 AC_DEFINE([C99_MACROS], 1, [C99 macros are supported])
153 AC_MSG_WARN([C99 macros not supported. This may affect compiling.])
157 AC_MSG_CHECKING([whether to disable DTLS-SRTP extension])
158 AC_ARG_ENABLE(dtls-srtp-support,
159 AS_HELP_STRING([--disable-dtls-srtp-support],
160 [disable support for the DTLS-SRTP extension]),
161 ac_enable_srtp=$enableval)
162 if test x$ac_enable_srtp != xno; then
164 AC_DEFINE([ENABLE_DTLS_SRTP], 1, [enable DTLS-SRTP support])
169 AM_CONDITIONAL(ENABLE_DTLS_SRTP, test "$ac_enable_srtp" != "no")
171 AC_MSG_CHECKING([whether to disable ALPN extension])
172 AC_ARG_ENABLE(alpn-support,
173 AS_HELP_STRING([--disable-alpn-support],
174 [disable support for the Application Layer Protocol Negotiation (ALPN) extension]),
175 ac_enable_alpn=$enableval,ac_enable_alpn=yes)
176 if test x$ac_enable_alpn != xno; then
178 AC_DEFINE([ENABLE_ALPN], 1, [enable ALPN support])
183 AM_CONDITIONAL(ENABLE_ALPN, test "$ac_enable_alpn" != "no")
185 AC_MSG_CHECKING([whether to disable RSA-EXPORT support])
186 AC_ARG_ENABLE(rsa-export,
187 AS_HELP_STRING([--disable-rsa-export],
188 [disable the RSA-EXPORT support]),
189 ac_enable_rsa_export=$enableval, ac_enable_rsa_export=yes)
190 if test x$ac_enable_rsa_export != xno; then
192 AC_DEFINE([ENABLE_RSA_EXPORT], 1, [enable RSA-EXPORT])
197 AM_CONDITIONAL(ENABLE_RSA_EXPORT, test "$ac_enable_rsa_export" != "no")
199 ac_enable_heartbeat=yes
200 AC_MSG_CHECKING([whether to disable TLS heartbeat support])
201 AC_ARG_ENABLE(heartbeat-support,
202 AS_HELP_STRING([--disable-heartbeat-support],
203 [disable support for the heartbeat extension]),
204 ac_enable_heartbeat=$enableval)
205 if test x$ac_enable_heartbeat != xno; then
207 AC_DEFINE([ENABLE_HEARTBEAT], 1, [enable heartbeat support])
211 AM_CONDITIONAL(ENABLE_HEARTBEAT, test "$ac_enable_heartbeat" != "no")
214 AC_MSG_CHECKING([whether to disable SRP authentication support])
215 AC_ARG_ENABLE(srp-authentication,
216 AS_HELP_STRING([--disable-srp-authentication],
217 [disable the SRP authentication support]),
218 ac_enable_srp=$enableval)
219 if test x$ac_enable_srp != xno; then
221 AC_DEFINE([ENABLE_SRP], 1, [enable SRP authentication])
226 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
229 AC_MSG_CHECKING([whether to disable PSK authentication support])
230 AC_ARG_ENABLE(psk-authentication,
231 AS_HELP_STRING([--disable-psk-authentication],
232 [disable the PSK authentication support]),
233 ac_enable_psk=$enableval)
234 if test x$ac_enable_psk != xno; then
236 AC_DEFINE([ENABLE_PSK], 1, [enable PSK authentication])
241 AM_CONDITIONAL(ENABLE_PSK, test "$ac_enable_psk" != "no")
244 AC_MSG_CHECKING([whether to disable anonymous authentication support])
245 AC_ARG_ENABLE(anon-authentication,
246 AS_HELP_STRING([--disable-anon-authentication],
247 [disable the anonymous authentication support]),
248 ac_enable_anon=$enableval)
249 if test x$ac_enable_anon != xno; then
251 AC_DEFINE([ENABLE_ANON], 1, [enable anonymous authentication])
256 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
258 AC_MSG_CHECKING([whether to disable DHE support])
260 AS_HELP_STRING([--disable-dhe],
261 [disable the DHE support]),
262 ac_enable_dhe=$enableval, ac_enable_dhe=yes)
263 if test x$ac_enable_dhe != xno; then
265 AC_DEFINE([ENABLE_DHE], 1, [enable DHE])
270 AM_CONDITIONAL(ENABLE_DHE, test "$ac_enable_dhe" != "no")
272 AC_MSG_CHECKING([whether to disable ECDHE support])
274 AS_HELP_STRING([--disable-ecdhe],
275 [disable the ECDHE support]),
276 ac_enable_ecdhe=$enableval, ac_enable_ecdhe=yes)
277 if test x$ac_enable_ecdhe != xno; then
279 AC_DEFINE([ENABLE_ECDHE], 1, [enable DHE])
284 AM_CONDITIONAL(ENABLE_ECDHE, test "$ac_enable_ecdhe" != "no")
286 ac_enable_openpgp=yes
287 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
288 AC_ARG_ENABLE(openpgp-authentication,
289 AS_HELP_STRING([--disable-openpgp-authentication],
290 [disable the OpenPGP authentication support]),
291 ac_enable_openpgp=$enableval)
292 if test x$ac_enable_openpgp = xno; then
296 AC_DEFINE([ENABLE_OPENPGP], 1, [use openpgp authentication])
299 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
302 AC_MSG_CHECKING([whether to add cryptodev support])
303 AC_ARG_ENABLE(cryptodev,
304 AS_HELP_STRING([--enable-cryptodev], [enable cryptodev support]),
305 enable_cryptodev=$enableval,enable_cryptodev=no)
306 AC_MSG_RESULT($enable_cryptodev)
308 if test "$enable_cryptodev" = "yes"; then
309 AC_DEFINE([ENABLE_CRYPTODEV], 1, [Enable cryptodev support])
312 AC_MSG_CHECKING([whether to disable OCSP support])
314 AS_HELP_STRING([--disable-ocsp],
315 [disable OCSP support]),
316 ac_enable_ocsp=$enableval,ac_enable_ocsp=yes)
317 if test x$ac_enable_ocsp != xno; then
320 AC_DEFINE([ENABLE_OCSP], 1, [enable OCSP support])
325 AM_CONDITIONAL(ENABLE_OCSP, test "$ac_enable_ocsp" != "no")
328 AC_MSG_CHECKING([whether to disable session tickets support])
329 AC_ARG_ENABLE(session-tickets,
330 AS_HELP_STRING([--disable-session-tickets],
331 [disable session tickets support]),
332 ac_enable_session_tickets=$enableval,ac_enable_session_tickets=yes)
333 if test x$ac_enable_session_tickets != xno; then
334 ac_enable_session_tickets=yes
336 AC_DEFINE([ENABLE_SESSION_TICKETS], 1, [enable session tickets support])
341 AM_CONDITIONAL(ENABLE_SESSION_TICKETS, test "$ac_enable_session_tickets" != "no")
343 # For storing integers in pointers without warnings
344 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
345 AC_CHECK_SIZEOF(void *)
346 AC_CHECK_SIZEOF(long long)
347 AC_CHECK_SIZEOF(long)
349 if test x$ac_cv_sizeof_void_p = x$ac_cv_sizeof_long;then
350 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long)],
351 [Additional cast to bring void* to a type castable to int.])
352 elif test x$ac_cv_sizeof_void_p = x$ac_cv_sizeof_long_long;then
353 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long long)],
354 [Additional cast to bring void* to a type castable to int.])
356 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [])
359 dnl this is called from somewhere else
361 dnl m4_ifdef([gl_ICONV_MODULE_INDICATOR],
362 dnl [gl_ICONV_MODULE_INDICATOR([iconv])])