ldb: Build for two Python versions at once
authorPetr Viktorin <pviktori@redhat.com>
Fri, 14 Aug 2015 10:43:41 +0000 (12:43 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 5 Nov 2015 17:04:24 +0000 (18:04 +0100)
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/ldb/wscript

index cb0e5a2a9c1832957a248430dafb0a376b8289ff..326d8a7de639c72fe32e3d4953eb6aba76b72a10 100755 (executable)
@@ -120,20 +120,28 @@ def build(bld):
         bld.env.PACKAGE_VERSION = VERSION
         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
 
-    if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
-        bld.SAMBA_LIBRARY('pyldb-util',
-                          deps='ldb',
-                          source='pyldb_util.c',
-                          public_headers='pyldb.h',
-                          public_headers_install=not private_library,
-                          vnum=VERSION,
-                          private_library=private_library,
-                          pc_files='pyldb-util.pc',
-                          pyembed=True,
-                          abi_directory='ABI',
-                          abi_match='pyldb_*')
-
     if not bld.env.disable_python:
+        if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
+            for env in bld.gen_python_environments(['PKGCONFIGDIR']):
+                name = bld.pyembed_libname('pyldb-util')
+                bld.SAMBA_LIBRARY(name,
+                                  deps='ldb',
+                                  source='pyldb_util.c',
+                                  public_headers='pyldb.h',
+                                  public_headers_install=not private_library,
+                                  vnum=VERSION,
+                                  private_library=private_library,
+                                  pc_files='pyldb-util.pc',
+                                  pyembed=True,
+                                  abi_directory='ABI',
+                                  abi_match='pyldb_*')
+
+                if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
+                    bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
+                                     deps='ldb ' + name,
+                                     realname='ldb.so',
+                                     cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
+
         for env in bld.gen_python_environments(['PKGCONFIGDIR']):
             bld.SAMBA_SCRIPT('_ldb_text.py',
                              pattern='_ldb_text.py',
@@ -175,11 +183,6 @@ def build(bld):
         t.env.LDB_VERSION = VERSION
 
 
-        bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
-                         deps='ldb pyldb-util',
-                         realname='ldb.so',
-                         cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
-
         bld.SAMBA_MODULE('ldb_paged_results',
                          'modules/paged_results.c',
                          init_function='ldb_paged_results_init',