diff options
Diffstat (limited to 'buildtools')
-rw-r--r-- | buildtools/wafsamba/samba_python.py | 25 | ||||
-rw-r--r-- | buildtools/wafsamba/wafsamba.py | 3 |
2 files changed, 28 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_python.py b/buildtools/wafsamba/samba_python.py index d12fe95a465..a0e0ffa9f6b 100644 --- a/buildtools/wafsamba/samba_python.py +++ b/buildtools/wafsamba/samba_python.py @@ -74,6 +74,9 @@ def SAMBA_PYTHON(bld, name, enabled=True): '''build a python extension for Samba''' + if bld.env['IS_EXTRA_PYTHON']: + name = 'extra-' + name + # when we support static python modules we'll need to gather # the list from all the SAMBA_PYTHON() targets if init_function_sentinel is not None: @@ -111,3 +114,25 @@ def pyembed_libname(bld, name, extrapython=False): return name + bld.env['PYTHON_SO_ABI_FLAG'] Build.BuildContext.pyembed_libname = pyembed_libname + + +def gen_python_environments(bld, extra_env_vars=()): + """Generate all Python environments + + To be used in a for loop. Normally, the loop body will be executed once. + + When --extra-python is used, the body will additionaly be executed + with the extra-python environment active. + """ + yield + + if bld.env['EXTRA_PYTHON']: + copied = ('GLOBAL_DEPENDENCIES', 'TARGET_TYPE') + tuple(extra_env_vars) + for name in copied: + bld.all_envs['extrapython'][name] = bld.all_envs['default'][name] + default_env = bld.all_envs['default'] + bld.all_envs['default'] = bld.all_envs['extrapython'] + yield + bld.all_envs['default'] = default_env + +Build.BuildContext.gen_python_environments = gen_python_environments diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py index 12bf2311cf0..64382da4e43 100644 --- a/buildtools/wafsamba/wafsamba.py +++ b/buildtools/wafsamba/wafsamba.py @@ -143,6 +143,9 @@ def SAMBA_LIBRARY(bld, libname, source, enabled=True): '''define a Samba library''' + if pyembed and bld.env['IS_EXTRA_PYTHON']: + public_headers = pc_files = None + if LIB_MUST_BE_PRIVATE(bld, libname): private_library=True |