1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

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 <axs@gentoo.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Ian Stakenvicius 2017-01-27 14:27:50 -05:00 committed by Andrew Bartlett
parent 7d5db90850
commit dcba0b1975

View File

@ -32,9 +32,6 @@ def set_options(opt):
opt.add_option('--enable-talloc-compat1', opt.add_option('--enable-talloc-compat1',
help=("Build talloc 1.x.x compat library [False]"), help=("Build talloc 1.x.x compat library [False]"),
action="store_true", dest='TALLOC_COMPAT1', default=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): 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_MINOR', int(VERSION.split('.')[1]))
conf.define('TALLOC_BUILD_VERSION_RELEASE', int(VERSION.split('.')[2])) 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 conf.env.TALLOC_COMPAT1 = False
if conf.env.standalone_talloc: if conf.env.standalone_talloc:
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1 conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
@ -142,7 +137,7 @@ def build(bld):
private_library=private_library, private_library=private_library,
manpages='man/talloc.3') 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']): for env in bld.gen_python_environments(['PKGCONFIGDIR']):
name = bld.pyembed_libname('pytalloc-util') name = bld.pyembed_libname('pytalloc-util')
@ -156,16 +151,19 @@ def build(bld):
abi_match='pytalloc_* _pytalloc_*', abi_match='pytalloc_* _pytalloc_*',
private_library=private_library, private_library=private_library,
public_headers=('' if private_library else 'pytalloc.h'), 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', bld.SAMBA_PYTHON('pytalloc',
'pytalloc.c', 'pytalloc.c',
deps='talloc ' + name, deps='talloc ' + name,
enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='talloc.so') realname='talloc.so')
bld.SAMBA_PYTHON('test_pytalloc', bld.SAMBA_PYTHON('test_pytalloc',
'test_pytalloc.c', 'test_pytalloc.c',
deps='pytalloc', deps='pytalloc',
enabled=bld.PYTHON_BUILD_IS_ENABLED(),
realname='_test_pytalloc.so', realname='_test_pytalloc.so',
install=False) install=False)