1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
import Options
def set_options(opt):
# allow users to disable gnutls
opt.add_option('--disable-gnutls',
help=("Disable use of gnutls"),
action="store_true", dest='disable_gnutls', default=False)
def configure(conf):
# check for gnutls
conf.check_cfg(package='gnutls',
args='"gnutls >= 1.4.0" --cflags --libs',
msg='Checking for gnutls >= 1.4.0', mandatory=False)
if 'HAVE_GNUTLS' in conf.env and not Options.options.disable_gnutls:
conf.DEFINE('ENABLE_GNUTLS', 1)
conf.CHECK_FUNCS_IN('gnutls_global_init', 'gnutls', headers='gnutls/gnutls.h')
conf.CHECK_VARIABLE('gnutls_x509_crt_set_version',
headers='gnutls/gnutls.h gnutls/x509.h',
define='HAVE_GNUTLS_X509_CRT_SET_VERSION')
conf.CHECK_VARIABLE('gnutls_x509_crt_set_subject_key_id',
headers='gnutls/gnutls.h gnutls/x509.h',
define='HAVE_GNUTLS_X509_CRT_SET_SUBJECT_KEY_ID')
# check for gnutls_datum types
conf.CHECK_TYPES('gnutls_datum gnutls_datum_t', headers='gnutls/gnutls.h')
conf.CHECK_FUNCS_IN('gcry_control', 'gcrypt', headers='gcrypt.h')
conf.CHECK_FUNCS_IN('gpg_err_code_from_errno', 'gpg-error')
def build(bld):
bld.SAMBA_SUBSYSTEM('LIBTLS',
source='tls.c tlscert.c',
public_deps='talloc gnutls gcrypt LIBSAMBA-HOSTCONFIG samba_socket'
)
|