summaryrefslogtreecommitdiff
path: root/lib/audit_logging/wscript
blob: f99df055731540c72b035512b6207236e2051e23 (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
#!/usr/bin/env python

from waflib import Logs, Options, Errors
import samba3

def options(opt):
    help = ("Build with JSON auth audit support (default=True). "
            "This requires the jansson devel package.")

    opt.SAMBA3_ADD_OPTION('json-audit', default=None, help=(help))

    return

def configure(conf):
    conf.SET_TARGET_TYPE('jansson', 'EMPTY')

    if Options.options.with_json_audit != False:
        if conf.CHECK_CFG(package='jansson', args='--cflags --libs',
                          msg='Checking for jansson'):
            conf.CHECK_FUNCS_IN('json_object', 'jansson')

    if not conf.CONFIG_GET('HAVE_JSON_OBJECT'):
        if Options.options.with_json_audit != False:
            conf.fatal("Jansson JSON support not found. "
                       "Try installing libjansson-dev or jansson-devel. "
                       "Otherwise, use --without-json-audit to build without "
                       "JSON support. "
                       "JSON support is required for the JSON "
                       "formatted audit log feature and the AD DC")
        if not Options.options.without_ad_dc:
            raise Errors.WafError('--without-json-audit requires '
                                 '--without-ad-dc. '
                                 'Jansson JSON library is required for '
                                 'building the AD DC')
        Logs.info("Building without Jansson JSON log support")