waf: disable-python - align talloc's wscript
authorIan Stakenvicius <axs@gentoo.org>
Fri, 27 Jan 2017 19:27:50 +0000 (14:27 -0500)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 10 Mar 2017 06:31:12 +0000 (07:31 +0100)
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>
lib/talloc/wscript

index af939104a173208a0e9206b721a514d5b752a655..df7e6be55939a1aa9004e2decb65768387fb4b60 100644 (file)
@@ -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)