s4:dsdb/samdb: add configure checks for libgpgme
[sfrench/samba-autobuild/.git] / source4 / dsdb / samdb / ldb_modules / wscript
1
2 import Logs, Options, sys
3 import samba3
4
5 def set_options(opt):
6     help =  "Build with gpgme support (default=auto). "
7     help += "This requires gpgme devel and python packages "
8     help += "(e.g. libgpgme11-dev, python-gpgme on debian/ubuntu)."
9
10     opt.SAMBA3_ADD_OPTION('gpgme', default=None, help=(help))
11
12     return
13
14 def configure(conf):
15     conf.SET_TARGET_TYPE('gpgme', 'EMPTY')
16
17     if Options.options.with_gpgme != False:
18         conf.find_program('gpgme-config', var='GPGME_CONFIG')
19
20         if conf.env.GPGME_CONFIG:
21             conf.CHECK_CFG(path=conf.env.GPGME_CONFIG, args="--cflags --libs",
22                            package="", uselib_store="gpgme",
23                            msg='Checking for gpgme support')
24
25         if conf.CHECK_FUNCS_IN('gpgme_new', 'gpgme', headers='gpgme.h'):
26             conf.DEFINE('ENABLE_GPGME', '1')
27
28         if not conf.CONFIG_SET('ENABLE_GPGME'):
29             if Options.options.with_gpgme == True:
30                 conf.fatal('GPGME support requested, but no suitable GPGME library found')
31             else:
32                 Logs.warn('no suitable GPGME library found')