Note that the delaytime for update has changed betweek w2k3 and w2k8.
[Samba/gbeck.git] / source4 / lib / tls / config.m4
blobc46a009e3df5b7104be8c56a75927f708dc8911a
1 ###############################
2 # start SMB_EXT_LIB_GNUTLS
3 # check for gnutls/gnutls.h and -lgnutls
5 use_gnutls=auto
6 AC_ARG_ENABLE(gnutls,
7 AS_HELP_STRING([--enable-gnutls],[Turn on gnutls support (default=yes)]),
8     [if test x$enable_gnutls = xno; then
9         use_gnutls=no
10     fi])
13 if test x$use_gnutls = xauto && pkg-config --exists gnutls; then
14         SMB_EXT_LIB_FROM_PKGCONFIG(GNUTLS, gnutls < 2.6.0, 
15                                                            [use_gnutls=yes], 
16                                                            [use_gnutls=no])
18         
19 if test x$use_gnutls = xauto; then
20         AC_CHECK_HEADERS(gnutls/gnutls.h)
21         AC_CHECK_LIB_EXT(gnutls, GNUTLS_LIBS, gnutls_global_init)
22         AC_CHECK_DECL(gnutls_x509_crt_set_version,  
23                                   [AC_DEFINE(HAVE_GNUTLS_X509_CRT_SET_VERSION,1,gnutls set_version)], [], [
24         #include <gnutls/gnutls.h>
25         #include <gnutls/x509.h>
26         ])
27         if test x"$ac_cv_header_gnutls_gnutls_h" = x"yes" -a x"$ac_cv_lib_ext_gnutls_gnutls_global_init" = x"yes" -a x"$ac_cv_have_decl_gnutls_x509_crt_set_version" = x"yes";then
28                 SMB_ENABLE(GNUTLS,YES)
29                 AC_CHECK_DECL(gnutls_x509_crt_set_subject_key_id,  
30                                           [AC_DEFINE(HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID,1,gnutls subject_key)], [], [
31         #include <gnutls/gnutls.h>
32         #include <gnutls/x509.h>
33         ])
34         fi
35         SMB_EXT_LIB(GNUTLS, $GNUTLS_LIBS)
37 if test x$use_gnutls = xyes; then
38         #Some older versions have a different type name
39         AC_CHECK_TYPES([gnutls_datum],,,[#include "gnutls/gnutls.h"])
40         AC_CHECK_TYPES([gnutls_datum_t],,,[#include "gnutls/gnutls.h"])
41         AC_DEFINE(ENABLE_GNUTLS,1,[Whether we have gnutls support (SSL)])
42         AC_CHECK_HEADERS(gcrypt.h)
43         AC_CHECK_LIB_EXT(gcrypt, GCRYPT_LIBS, gcry_control)
44         SMB_EXT_LIB(GCRYPT, $GCRYPT_LIBS)