Skip to content

Commit

Permalink
ldb: Build for two Python versions at once
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Viktorin <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Stefan Metzmacher <[email protected]>
  • Loading branch information
encukou authored and metze-samba committed Nov 5, 2015
1 parent e958385 commit 2a29e36
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions lib/ldb/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 2a29e36

Please sign in to comment.