summaryrefslogtreecommitdiffstats
path: root/lib/ldb/wscript
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ldb/wscript')
-rwxr-xr-xlib/ldb/wscript38
1 files changed, 31 insertions, 7 deletions
diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 47b8c46b79..aebd342ce4 100755
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -42,10 +42,8 @@ def configure(conf):
conf.define('USING_SYSTEM_POPT', 1)
conf.RECURSE('lib/replace')
- conf.find_program('python', var='PYTHON')
conf.find_program('xsltproc', var='XSLTPROC')
- conf.check_tool('python')
- conf.check_python_version((2,4,2))
+ conf.SAMBA_CHECK_PYTHON(version=(2, 4, 2), mandatory=False)
conf.SAMBA_CHECK_PYTHON_HEADERS(mandatory=True)
# where does the default LIBDIR end up? in conf.env somewhere?
@@ -120,8 +118,9 @@ def build(bld):
bld.env.PACKAGE_VERSION = VERSION
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
+ pyldb_util_name = bld.pyembed_libname('pyldb-util')
if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
- bld.SAMBA_LIBRARY('pyldb-util',
+ bld.SAMBA_LIBRARY(pyldb_util_name,
deps='ldb',
source='pyldb_util.c',
public_headers='pyldb.h',
@@ -168,7 +167,7 @@ def build(bld):
bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
- deps='ldb pyldb-util',
+ deps='ldb ' + pyldb_util_name,
realname='ldb.so',
cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
@@ -274,10 +273,32 @@ def build(bld):
deps='ldb dl popt',
private_library=True)
+ if bld.env['EXTRA_PYTHON']:
+ pyldb_util_name = bld.pyembed_libname('pyldb-util', extrapython=True)
+ if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
+ bld.SAMBA_LIBRARY(pyldb_util_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=None,
+ pyfeature='extrapyembed',
+ abi_directory='ABI',
+ abi_match='pyldb_*')
+
+ bld.SAMBA_PYTHON('extra-pyldb', 'pyldb.c',
+ deps='ldb ' + pyldb_util_name,
+ realname='ldb.so',
+ cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION,
+ extra_python=True)
+
def test(ctx):
'''run ldb testsuite'''
import Utils, samba_utils, shutil
+ env = samba_utils.LOAD_ENVIRONMENT()
test_prefix = "%s/st" % (Utils.g_module.blddir)
shutil.rmtree(test_prefix, ignore_errors=True)
os.makedirs(test_prefix)
@@ -285,8 +306,11 @@ def test(ctx):
cmd = 'tests/test-tdb.sh %s' % Utils.g_module.blddir
ret = samba_utils.RUN_COMMAND(cmd)
print("testsuite returned %d" % ret)
- # FIXME: Run python testsuite
- sys.exit(ret)
+ if not env.disable_python and not env['USING_SYSTEM_LDB']:
+ pyret = samba_utils.RUN_PYTHON_TESTS(
+ ['tests/python/api.py'],
+ setup_cmd='export TEST_DATA_PREFIX=%s' % test_prefix)
+ sys.exit(ret or pyret)
def dist():
'''makes a tarball for distribution'''