summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/wscript
blob: ef984ccbe3488fdd9e07bb190e14560fd82c886e (plain)
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

import sys
from waflib import Logs, Options
import samba3

def 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.samba_add_onoff_option('gpgme', default=True, help=(help))

    return

def configure(conf):
    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')

    conf.SET_TARGET_TYPE('gpgme', 'EMPTY')

    if not Options.options.without_ad_dc \
       and 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'):
            conf.fatal("GPGME support not found. "
                       "Try installing libgpgme11-dev or gpgme-devel "
		       "and python-gpgme. "
                       "Otherwise, use --without-gpgme to build without "
                       "GPGME support or --without-ad-dc to build without "
		       "the Samba AD DC. "
                       "GPGME support is required for the GPG encrypted "
                       "password sync feature")