1 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2 # 2009, 2010, 2011 Free Software Foundation, Inc.
4 # Author: Nikos Mavrogiannopoulos, Simon Josefsson
6 # This file is part of GnuTLS.
8 # The GnuTLS is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Lesser General Public License
10 # as published by the Free Software Foundation; either version 2.1 of
11 # the License, or (at your option) any later version.
13 # The GnuTLS is distributed in the hope that it will be
14 # useful, but WITHOUT ANY WARRANTY; without even the implied warranty
15 # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Lesser General Public License for more details.
18 # You should have received a copy of the GNU Lesser General Public
19 # License along with GnuTLS; if not, write to the Free
20 # Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 AC_DEFUN([LIBGNUTLS_EXTRA_HOOKS],
25 AC_MSG_CHECKING([whether to build OpenSSL compatibility layer])
26 AC_ARG_ENABLE(openssl-compatibility,
27 AS_HELP_STRING([--disable-openssl-compatibility],
28 [disable the OpenSSL compatibility support]),
29 enable_openssl=$enableval, enable_openssl=yes)
30 AC_MSG_RESULT($enable_openssl)
31 AM_CONDITIONAL(ENABLE_OPENSSL, test "$enable_openssl" = "yes")
33 # We link to ../lib's gnulib, which needs -lws2_32 via LIBSOCKET in Makefile.am.
37 AC_DEFUN([LIBGNUTLS_HOOKS],
39 # Library code modified: REVISION++
40 # Interfaces changed/added/removed: CURRENT++ REVISION=0
41 # Interfaces added: AGE++
42 # Interfaces removed: AGE=0
43 AC_SUBST(LT_CURRENT, 30)
44 AC_SUBST(LT_REVISION, 1)
47 AC_SUBST(LT_SSL_CURRENT, 27)
48 AC_SUBST(LT_SSL_REVISION, 1)
49 AC_SUBST(LT_SSL_AGE, 0)
51 AC_SUBST(CXX_LT_CURRENT, 28)
52 AC_SUBST(CXX_LT_REVISION, 0)
53 AC_SUBST(CXX_LT_AGE, 0)
55 AC_SUBST(CRYWRAP_PATCHLEVEL, 3)
57 # Used when creating the Windows libgnutls-XX.def files.
58 DLL_VERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
63 dnl AC_ARG_WITH(libgcrypt,
64 dnl AS_HELP_STRING([--with-libgcrypt], [use libgcrypt as crypto library]),
65 dnl libgcrypt=$withval,
67 dnl if test "$libgcrypt" = "yes"; then
68 dnl cryptolib=libgcrypt
69 dnl AC_DEFINE([HAVE_GCRYPT], 1, [whether the gcrypt library is in use])
70 dnl AC_LIB_HAVE_LINKFLAGS([gcrypt], [gpg-error], [#include <gcrypt.h>],
71 dnl [enum gcry_cipher_algos i = GCRY_CIPHER_CAMELLIA128])
72 dnl if test "$ac_cv_libgcrypt" != yes; then
75 dnl*** Libgcrypt v1.4.0 or later was not found. You may want to get it from
76 dnl*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
82 AC_MSG_CHECKING([whether to use nettle])
83 if test "$cryptolib" = "nettle";then
85 AC_LIB_HAVE_LINKFLAGS([nettle], [hogweed gmp], [#include <nettle/ripemd160.h>],
87 if test "$ac_cv_libnettle" != yes; then
90 *** Libnettle 2.4 was not found.
96 AM_CONDITIONAL(ENABLE_NETTLE, test "$cryptolib" = "nettle")
98 AC_ARG_WITH(included-libtasn1,
99 AS_HELP_STRING([--with-included-libtasn1], [use the included libtasn1]),
100 included_libtasn1=$withval,
101 included_libtasn1=no)
102 if test "$included_libtasn1" = "no"; then
103 AC_LIB_HAVE_LINKFLAGS(tasn1,, [#include <libtasn1.h>],
104 [asn1_check_version (NULL)])
105 if test "$ac_cv_libtasn1" != yes; then
106 included_libtasn1=yes
109 *** Libtasn1 was not found. Will use the included one.
113 AC_MSG_CHECKING([whether to use the included minitasn1])
114 AC_MSG_RESULT($included_libtasn1)
115 AM_CONDITIONAL(ENABLE_MINITASN1, test "$included_libtasn1" = "yes")
117 if test "$included_libtasn1" = "no"; then
118 GNUTLS_REQUIRES_PRIVATE="Requires.private: libtasn1"
121 AC_MSG_CHECKING([whether C99 macros are supported])
124 #define test_mac(...)
129 AC_DEFINE([C99_MACROS], 1, [C99 macros are supported])
133 AC_MSG_WARN([C99 macros not supported. This may affect compiling.])
136 AC_MSG_CHECKING([whether to disable SRP authentication support])
137 AC_ARG_ENABLE(srp-authentication,
138 AS_HELP_STRING([--disable-srp-authentication],
139 [disable the SRP authentication support]),
141 if test x$ac_enable_srp != xno; then
143 AC_DEFINE([ENABLE_SRP], 1, [enable SRP authentication])
148 AM_CONDITIONAL(ENABLE_SRP, test "$ac_enable_srp" != "no")
150 AC_MSG_CHECKING([whether to disable PSK authentication support])
151 AC_ARG_ENABLE(psk-authentication,
152 AS_HELP_STRING([--disable-psk-authentication],
153 [disable the PSK authentication support]),
155 if test x$ac_enable_psk != xno; then
157 AC_DEFINE([ENABLE_PSK], 1, [enable PSK authentication])
162 AM_CONDITIONAL(ENABLE_PSK, test "$ac_enable_psk" != "no")
164 AC_MSG_CHECKING([whether to disable anonymous authentication support])
165 AC_ARG_ENABLE(anon-authentication,
166 AS_HELP_STRING([--disable-anon-authentication],
167 [disable the anonymous authentication support]),
169 if test x$ac_enable_anon != xno; then
171 AC_DEFINE([ENABLE_ANON], 1, [enable anonymous authentication])
176 AM_CONDITIONAL(ENABLE_ANON, test "$ac_enable_anon" != "no")
178 AC_MSG_CHECKING([whether to disable extra PKI stuff])
179 AC_ARG_ENABLE(extra-pki,
180 AS_HELP_STRING([--disable-extra-pki],
181 [only enable the basic PKI stuff]),
182 enable_pki=$enableval, enable_pki=yes)
183 if test "$enable_pki" != "yes"; then
188 AC_DEFINE([ENABLE_PKI], 1, [whether to include all the PKCS/PKI stuff])
190 AM_CONDITIONAL(ENABLE_PKI, test "$enable_pki" = "yes")
192 ac_enable_openpgp=yes
193 AC_MSG_CHECKING([whether to disable OpenPGP Certificate authentication support])
194 AC_ARG_ENABLE(openpgp-authentication,
195 AS_HELP_STRING([--disable-openpgp-authentication],
196 [disable the OpenPGP authentication support]),
197 ac_enable_openpgp=no)
198 if test x$ac_enable_openpgp = xno; then
202 AC_DEFINE([ENABLE_OPENPGP], 1, [use openpgp authentication])
205 AM_CONDITIONAL(ENABLE_OPENPGP, test "$ac_enable_openpgp" = "yes")
208 AC_MSG_CHECKING([whether to add cryptodev support])
209 AC_ARG_ENABLE(cryptodev,
210 AS_HELP_STRING([--enable-cryptodev], [enable cryptodev support]),
211 enable_cryptodev=yes,enable_cryptodev=no)
212 AC_MSG_RESULT($enable_cryptodev)
214 if test "$enable_cryptodev" = "yes"; then
215 AC_DEFINE([ENABLE_CRYPTODEV], 1, [Enable cryptodev support])
218 # For storing integers in pointers without warnings
219 # http://developer.gnome.org/doc/API/2.0/glib/glib-Type-Conversion-Macros.html#desc
220 AC_CHECK_SIZEOF(void *)
221 AC_CHECK_SIZEOF(long)
223 case $ac_cv_sizeof_void_p in
225 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [(long)],
226 [Additional cast to bring void* to a type castable to int.])
229 AC_DEFINE([GNUTLS_POINTER_TO_INT_CAST], [])