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