summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-13 10:36:24 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-13 11:00:03 +0000
commitd95160ca2f22edbc000ea2c78eab04e8e06be151 (patch)
treebb3908f5f6d3e48c10205e5f79db1cd0a9c80782
parentf81c8403807033023512fd83985124904b7f1505 (diff)
downloadsamba-d95160ca2f22edbc000ea2c78eab04e8e06be151.tar.gz
samba-d95160ca2f22edbc000ea2c78eab04e8e06be151.tar.bz2
samba-d95160ca2f22edbc000ea2c78eab04e8e06be151.zip
ldb: when running from build directory, use the build modules
we need to use the build modules, not the installed modules, so tests run from the source directory are valid Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
-rw-r--r--source4/lib/ldb/wscript62
1 files changed, 35 insertions, 27 deletions
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 9246fbe163..ac2894b130 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -13,7 +13,7 @@ while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
srcdir = '../' + srcdir
sys.path.insert(0, srcdir + '/buildtools/wafsamba')
-import wafsamba, samba_dist
+import wafsamba, samba_dist, Options
samba_dist.DIST_DIRS('''source4/lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
lib/tdb:lib/tdb lib/tevent:lib/tevent lib/popt:lib/popt
@@ -72,8 +72,8 @@ def build(bld):
'ldb_map.c ldb_map_inbound.c ldb_map_outbound.c')
COMMON_SRC = bld.SUBDIR('common',
- '''ldb.c ldb_ldif.c ldb_parse.c ldb_msg.c ldb_utf8.c
- ldb_debug.c ldb_dn.c ldb_match.c ldb_modules.c ldb_options.c
+ '''ldb_modules.c ldb_ldif.c ldb_parse.c ldb_msg.c ldb_utf8.c
+ ldb_debug.c ldb_dn.c ldb_match.c ldb_options.c
ldb_attributes.c attrib_handlers.c ldb_controls.c qsort.c''')
if s4_build:
@@ -101,36 +101,36 @@ def build(bld):
bld.env.PACKAGE_VERSION = VERSION
bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
- abi_file = 'ABI/ldb-%s.sigs' % VERSION
bld.SAMBA_SUBSYSTEM('pyldb_util', deps='ldb', source='pyldb_util.c', pyext=True)
if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
- modules_dir = bld.EXPAND_VARIABLES('${LDB_MODULESDIR}')
+ if Options.is_install:
+ modules_dir = bld.EXPAND_VARIABLES('${LDB_MODULESDIR}')
+ else:
+ # when we run from the source directory, we want to use
+ # the current modules, not the installed ones
+ modules_dir = os.path.join(os.getcwd(), 'bin/modules/ldb')
+
if bld.env.standalone_ldb:
- bld.SAMBA_LIBRARY('ldb',
- COMMON_SRC + ' ' + LDB_MAP_SRC,
- deps='tevent',
- includes='include',
- public_headers='include/ldb.h include/ldb_errors.h '\
- 'include/ldb_module.h include/ldb_handlers.h',
- pc_files='ldb.pc',
- cflags='-DLDB_MODULESDIR=\"%s\"' % modules_dir,
- abi_file=abi_file,
- abi_match='!ldb_*module_ops !ldb_*backend_ops ldb_*',
- vnum=VERSION, manpages='man/ldb.3',
- is_bundled=not bld.env.standalone_ldb)
+ # do ABI checking on the standalone ldb
+ abi_file = 'ABI/ldb-%s.sigs' % VERSION
+ abi_match = '!ldb_*module_ops !ldb_*backend_ops ldb_*'
else:
- bld.SAMBA_LIBRARY('ldb',
- COMMON_SRC + ' ' + LDB_MAP_SRC,
- deps='tevent',
- includes='include',
- public_headers='include/ldb.h include/ldb_errors.h '\
- 'include/ldb_module.h include/ldb_handlers.h',
- pc_files='ldb.pc',
- cflags='-DLDB_MODULESDIR=\"%s\"' % modules_dir,
- vnum=VERSION, manpages='man/ldb.3',
- is_bundled=not bld.env.standalone_ldb)
+ abi_file = None
+ abi_match = None
+
+ bld.SAMBA_LIBRARY('ldb',
+ COMMON_SRC + ' ' + LDB_MAP_SRC,
+ deps='tevent LIBLDB_MAIN',
+ includes='include',
+ public_headers='include/ldb.h include/ldb_errors.h '\
+ 'include/ldb_module.h include/ldb_handlers.h',
+ pc_files='ldb.pc',
+ vnum=VERSION, manpages='man/ldb.3',
+ abi_file = abi_file,
+ abi_match = abi_match,
+ is_bundled=not bld.env.standalone_ldb)
bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
deps='ldb pyldb_util',
@@ -193,6 +193,14 @@ def build(bld):
else:
extra_cmdline_deps = ''
+ # have a separate subsystem for common/ldb.c, so it can rebuild
+ # for install with a different -DLDB_MODULESDIR=
+ bld.SAMBA_SUBSYSTEM('LIBLDB_MAIN',
+ 'common/ldb.c',
+ deps='tevent',
+ includes='include',
+ cflags='-DLDB_MODULESDIR=\"%s\"' % modules_dir)
+
bld.SAMBA_SUBSYSTEM('LIBLDB_CMDLINE',
'tools/ldbutil.c tools/cmdline.c',
'ldb dl popt' + extra_cmdline_deps)