Skip to content

Commit

Permalink
turn --with-json-audit into global --with-json
Browse files Browse the repository at this point in the history
Fold the build option --with-json-audit into the toplevel wscript
to reflect the fact that JSON support is no longer local to the
audit subsystem.

Signed-off-by: Philipp Gesang <[email protected]>
Reviewed-by: Douglas Bagnall <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
phi-gamma authored and abartlet committed Sep 26, 2018
1 parent cb8e61b commit c98f997
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs-xml/smbdotconf/logging/loglevel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<para>Authentication and authorization audit information is logged
under the auth_audit, and if Samba was not compiled with
--without-json-audit, a JSON representation is logged under
--without-json, a JSON representation is logged under
auth_json_audit.</para>

<para>Support is comprehensive for all authentication and authorisation
Expand Down
36 changes: 0 additions & 36 deletions lib/audit_logging/wscript

This file was deleted.

2 changes: 1 addition & 1 deletion script/autobuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

# We split out this so the isolated ad_dc tests do not wait for ad_dc_ntvfs tests (which are long)
"samba-fileserver": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json-audit --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
("configure", "./configure.developer --without-ad-dc --without-ldap --without-ads --without-json --with-selftest-prefix=./bin/ab" + samba_configure_params, "text/plain"),
("make", "make -j", "text/plain"),
("test", "make test FAIL_IMMEDIATELY=1 "
"TESTS='${PY3_ONLY}"
Expand Down
31 changes: 29 additions & 2 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def system_mitkrb5_callback(option, opt, value, parser):
def options(opt):
opt.BUILTIN_DEFAULT('NONE')
opt.PRIVATE_EXTENSION_DEFAULT('samba4')
opt.RECURSE('lib/audit_logging')
opt.RECURSE('lib/replace')
opt.RECURSE('dynconfig')
opt.RECURSE('packaging')
Expand Down Expand Up @@ -103,6 +102,13 @@ def options(opt):
opt.load('python') # options for disabling pyc or pyo compilation
# enable options related to building python extensions

opt.add_option('--with-json',
action='store_true', dest='with_json',
help=("Build with JSON support (default=True). This "
"requires the jansson development headers."))
opt.add_option('--without-json',
action='store_false', dest='with_json',
help=("Build without JSON support."))

def configure(conf):
version = samba_version.load_version(env=conf.env)
Expand Down Expand Up @@ -234,7 +240,6 @@ def configure(conf):
# system-provided or embedded Heimdal build
if conf.CONFIG_GET('KRB5_VENDOR') in (None, 'heimdal'):
conf.RECURSE('source4/heimdal_build')
conf.RECURSE('lib/audit_logging')
conf.RECURSE('source4/lib/tls')
conf.RECURSE('source4/dsdb/samdb/ldb_modules')
conf.RECURSE('source4/ntvfs/sysdep')
Expand Down Expand Up @@ -274,6 +279,28 @@ def configure(conf):
Logs.warn("pthreadpool support cannot be enabled when __thread support was not found")
conf.undefine('WITH_PTHREADPOOL')

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

if Options.options.with_json != 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 != False:
conf.fatal("Jansson JSON support not found. "
"Try installing libjansson-dev or jansson-devel. "
"Otherwise, use --without-json to build without "
"JSON support. "
"JSON support is required for the JSON "
"formatted audit log feature, the AD DC, and "
"the JSON printers of the net utility")
if not Options.options.without_ad_dc:
raise Errors.WafError('--without-json requires --without-ad-dc. '
'Jansson JSON library is required for '
'building the AD DC')
Logs.info("Building without Jansson JSON log support")

conf.RECURSE('source3')
conf.RECURSE('lib/texpect')
conf.RECURSE('python')
Expand Down

0 comments on commit c98f997

Please sign in to comment.