build(waf): Fail "configure --with-cluster-support" if ctdb support is not available.
[Samba/gebeck_regimport.git] / source4 / lib / tls / wscript
blobf34d7e8a08457ce9b4267f11df16b1609c623e83
1 #!/usr/bin/env python
3 import Options
4 from optparse import SUPPRESS_HELP
6 def set_options(opt):
7 # allow users to disable gnutls
8 opt.add_option('--enable-gnutls',
9 help=("Enable use of gnutls"),
10 action="store_true", dest='enable_gnutls', default=True)
11 opt.add_option('--disable-gnutls', help=SUPPRESS_HELP, action="store_false", dest='enable_gnutls')
14 def configure(conf):
15 conf.env.enable_gnutls = Options.options.enable_gnutls
16 if not conf.env.enable_gnutls:
17 conf.SET_TARGET_TYPE('gnutls', 'DISABLED')
18 conf.SET_TARGET_TYPE('gcrypt', 'DISABLED')
19 conf.SET_TARGET_TYPE('gpg-error', 'DISABLED')
20 return
22 conf.check_cfg(package='gnutls',
23 args='"gnutls >= 1.4.0 gnutls != 2.2.4 gnutls != 2.8.0 gnutls != 2.8.1" --cflags --libs',
24 msg='Checking for gnutls >= 1.4.0 and broken versions', mandatory=False)
26 if 'HAVE_GNUTLS' in conf.env:
27 conf.DEFINE('ENABLE_GNUTLS', 1)
29 conf.CHECK_FUNCS_IN('gnutls_global_init', 'gnutls',
30 headers='gnutls/gnutls.h')
32 conf.CHECK_VARIABLE('gnutls_x509_crt_set_version',
33 headers='gnutls/gnutls.h gnutls/x509.h',
34 define='HAVE_GNUTLS_X509_CRT_SET_VERSION',
35 lib='gnutls')
36 conf.CHECK_VARIABLE('gnutls_x509_crt_set_subject_key_id',
37 headers='gnutls/gnutls.h gnutls/x509.h',
38 define='HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID',
39 lib='gnutls')
41 # check for gnutls_datum types
42 conf.CHECK_TYPES('gnutls_datum gnutls_datum_t',
43 headers='gnutls/gnutls.h', lib='gnutls')
45 conf.CHECK_FUNCS_IN('gcry_control', 'gcrypt', headers='gcrypt.h')
46 conf.CHECK_FUNCS_IN('gpg_err_code_from_errno', 'gpg-error')
49 def build(bld):
50 bld.SAMBA_SUBSYSTEM('LIBTLS',
51 source='tls.c tlscert.c tls_tstream.c',
52 public_deps='talloc gnutls gcrypt samba-hostconfig samba_socket LIBTSOCKET tevent tevent-util'