From dcba0b19757b64164577722976b3da7622ff3955 Mon Sep 17 00:00:00 2001 From: Ian Stakenvicius Date: Fri, 27 Jan 2017 14:27:50 -0500 Subject: [PATCH] waf: disable-python - align talloc's wscript Drop the configure option for --disable-python as it is now global in wafsamba If samba is set to use a system copy of talloc, and talloc wasn't built with python support, then the system pytalloc-util will not be found. If samba is being built without python support then pytalloc-util is not needed, so do not bother to try and find it. The build configuration for pytalloc-util needs to exist even if it's not being built, so that dependency resolution can occur throughout the rest of the samba build system -- this required dropping the higher level conditional and using the enabled= parameter instead. Signed-off-by: Ian Stakenvicius Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- lib/talloc/wscript | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/talloc/wscript b/lib/talloc/wscript index af939104a17..df7e6be5593 100644 --- a/lib/talloc/wscript +++ b/lib/talloc/wscript @@ -32,9 +32,6 @@ def set_options(opt): opt.add_option('--enable-talloc-compat1', help=("Build talloc 1.x.x compat library [False]"), action="store_true", dest='TALLOC_COMPAT1', default=False) - opt.add_option('--disable-python', - help=("disable the pytalloc module"), - action="store_true", dest='disable_python', default=False) def configure(conf): @@ -46,8 +43,6 @@ def configure(conf): conf.define('TALLOC_BUILD_VERSION_MINOR', int(VERSION.split('.')[1])) conf.define('TALLOC_BUILD_VERSION_RELEASE', int(VERSION.split('.')[2])) - conf.env.disable_python = getattr(Options.options, 'disable_python', False) - conf.env.TALLOC_COMPAT1 = False if conf.env.standalone_talloc: conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1 @@ -142,7 +137,7 @@ def build(bld): private_library=private_library, manpages='man/talloc.3') - if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL') and not bld.env.disable_python: + if not bld.CONFIG_SET('USING_SYSTEM_PYTALLOC_UTIL'): for env in bld.gen_python_environments(['PKGCONFIGDIR']): name = bld.pyembed_libname('pytalloc-util') @@ -156,16 +151,19 @@ def build(bld): abi_match='pytalloc_* _pytalloc_*', private_library=private_library, public_headers=('' if private_library else 'pytalloc.h'), - pc_files='pytalloc-util.pc' + pc_files='pytalloc-util.pc', + enabled=bld.PYTHON_BUILD_IS_ENABLED() ) bld.SAMBA_PYTHON('pytalloc', 'pytalloc.c', deps='talloc ' + name, + enabled=bld.PYTHON_BUILD_IS_ENABLED(), realname='talloc.so') bld.SAMBA_PYTHON('test_pytalloc', 'test_pytalloc.c', deps='pytalloc', + enabled=bld.PYTHON_BUILD_IS_ENABLED(), realname='_test_pytalloc.so', install=False)