pytalloc: Build for two Python versions at once
authorPetr Viktorin <pviktori@redhat.com>
Wed, 6 May 2015 16:17:06 +0000 (18:17 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 19 May 2015 17:28:19 +0000 (19:28 +0200)
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
lib/talloc/wscript

index 3bc932e93cf95422119dea954afd0be29e540531..0b62d405c695c64d18794a5d55358538d9dcc442 100644 (file)
@@ -143,6 +143,43 @@ def build(bld):
                          realname='_test_pytalloc.so',
                          install=False)
 
+    if bld.env['EXTRA_PYTHON']:
+        for var_name in ('GLOBAL_DEPENDENCIES', 'TARGET_TYPE', 'PKGCONFIGDIR'):
+            bld.all_envs['extrapython'][var_name] = bld.all_envs['default'][var_name]
+        bak = bld.all_envs['default']
+        bld.all_envs['default'] = bld.all_envs['extrapython']
+
+        name = bld.pyembed_libname('pytalloc-util')
+
+        bld.SAMBA_LIBRARY(name,
+            source='pytalloc_util.c',
+            public_deps='talloc',
+            pyembed=True,
+            vnum=VERSION,
+            hide_symbols=True,
+            abi_directory='ABI',
+            abi_match='pytalloc_*',
+            private_library=private_library,
+            #public_headers='pytalloc.h',
+            #pc_files='pytalloc-util.pc'
+            )
+
+        bld.SAMBA_PYTHON('extra-pytalloc',
+                         'pytalloc.c',
+                         deps='talloc ' + name,
+                         enabled=True,
+                         realname='talloc.so')
+
+        bld.SAMBA_PYTHON('extra-test_pytalloc',
+                         'test_pytalloc.c',
+                         deps='pytalloc',
+                         enabled=True,
+                         realname='_test_pytalloc.so',
+                         install=False)
+
+        bld.all_envs['default'] = bak
+
+
 def test(ctx):
     '''run talloc testsuite'''
     import Utils, samba_utils