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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
import Logs, Options, sys
import samba3
def set_options(opt):
help = "Build with gpgme support (default=auto). "
help += "This requires gpgme devel and python packages "
help += "(e.g. libgpgme11-dev, python-gpgme on debian/ubuntu)."
opt.SAMBA3_ADD_OPTION('gpgme', default=None, help=(help))
return
def configure(conf):
conf.SET_TARGET_TYPE('nettle', 'EMPTY')
if conf.CHECK_CFG(
package="nettle",
args="--cflags --libs",
msg='Checking for nettle support'):
if conf.CHECK_FUNCS_IN(
'nettle_gcm_aes_encrypt',
'nettle',
headers='nettle/gcm.h'):
conf.DEFINE('HAVE_NETTLE_AES_GCM', '1')
else:
Logs.warn('No nettle support for AES GCM')
else:
Logs.warn('No nettle encryption libraries')
if conf.env.HAVE_GNUTLS:
if conf.CHECK_FUNCS_IN(
'gnutls_aead_cipher_init',
'gnutls',
headers='gnutls/gnutls.h'):
conf.DEFINE('HAVE_GNUTLS_AEAD', '1')
else:
Logs.warn('No gnutls support for AEAD encryption')
if not conf.env.HAVE_GNUTLS_AEAD and not conf.env.HAVE_NETTLE_AES_GCM:
conf.fatal("No AES GCM AEAD support"
"Try installing gnutls if that does not support AEAD "
"try installing nettle-dev or nettle-devel")
conf.SET_TARGET_TYPE('gpgme', 'EMPTY')
if Options.options.with_gpgme != False:
conf.find_program('gpgme-config', var='GPGME_CONFIG')
if conf.env.GPGME_CONFIG:
conf.CHECK_CFG(path=conf.env.GPGME_CONFIG, args="--cflags --libs",
package="", uselib_store="gpgme",
msg='Checking for gpgme support')
if conf.CHECK_FUNCS_IN('gpgme_new', 'gpgme', headers='gpgme.h'):
conf.DEFINE('ENABLE_GPGME', '1')
if not conf.CONFIG_SET('ENABLE_GPGME'):
if Options.options.with_gpgme == True:
conf.fatal('GPGME support requested, but no suitable GPGME library found, eg libgpgme11-dev and python-gpgme')
else:
Logs.warn('no suitable GPGME library found')
|