2010-03-28 01:48:49 +03:00
#!/usr/bin/env python
2010-04-04 04:06:34 +04:00
APPNAME = 'tdb'
VERSION = '1.2.1'
2010-03-17 12:31:46 +03:00
2010-03-17 12:32:15 +03:00
blddir = 'bin'
2010-02-20 16:24:40 +03:00
2010-04-04 04:18:39 +04:00
import sys, os
# find the buildtools directory
2010-04-04 05:40:05 +04:00
buildtools = 'buildtools'
while not os.path.exists(buildtools) and len(buildtools.split('/')) < 5:
buildtools = '../' + buildtools
srcdir = os.path.dirname(buildtools) or '.'
2010-04-04 04:18:39 +04:00
2010-04-04 05:40:05 +04:00
sys.path.insert(0, buildtools + "/wafsamba")
2010-04-04 05:00:42 +04:00
import wafsamba, samba_dist
samba_dist.DIST_DIRS('lib/tdb:. lib/replace:lib/replace buildtools:buildtools')
2010-02-26 14:21:50 +03:00
2010-04-04 05:40:05 +04:00
LIBREPLACE_DIR= '../replace'
2010-03-17 12:31:46 +03:00
2010-02-20 16:24:40 +03:00
def set_options(opt):
2010-03-28 08:42:28 +04:00
opt.BUILTIN_DEFAULT('replace')
opt.BUNDLED_EXTENSION_DEFAULT('tdb', noextenion='tdb')
2010-04-04 07:08:05 +04:00
opt.RECURSE(LIBREPLACE_DIR)
2010-02-20 16:24:40 +03:00
def configure(conf):
2010-04-04 07:08:05 +04:00
conf.RECURSE(LIBREPLACE_DIR)
2010-03-28 09:38:27 +04:00
2010-03-29 15:27:17 +04:00
if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION,
implied_deps='replace'):
2010-03-28 09:38:27 +04:00
conf.define('USING_SYSTEM_TDB', 1)
2010-03-17 12:31:46 +03:00
conf.SAMBA_CONFIG_H()
2010-02-20 16:24:40 +03:00
def build(bld):
2010-04-04 07:08:05 +04:00
bld.RECURSE(LIBREPLACE_DIR)
2010-02-20 16:24:40 +03:00
2010-03-17 12:31:46 +03:00
COMMON_SRC = bld.SUBDIR('common',
'''check.c error.c tdb.c traverse.c
freelistcheck.c lock.c dump.c freelist.c
io.c open.c transaction.c''')
2010-02-20 16:24:40 +03:00
2010-03-28 09:38:27 +04:00
if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
bld.SAMBA_LIBRARY('tdb',
COMMON_SRC,
deps='replace rt',
includes='include',
vnum=VERSION)
2010-02-20 16:24:40 +03:00
bld.SAMBA_BINARY('tdbtorture',
'tools/tdbtorture.c',
'tdb')
2010-02-20 16:27:37 +03:00
bld.SAMBA_BINARY('tdbdump',
'tools/tdbdump.c',
'tdb')
bld.SAMBA_BINARY('tdbbackup',
'tools/tdbbackup.c',
'tdb')
bld.SAMBA_BINARY('tdbtool',
'tools/tdbtool.c',
'tdb')
2010-03-17 09:20:02 +03:00
2010-03-17 09:52:41 +03:00
s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
2010-03-17 09:20:02 +03:00
bld.SAMBA_PYTHON('pytdb',
'pytdb.c',
deps='tdb',
2010-03-17 09:52:41 +03:00
enabled=s4_build,
2010-03-17 09:20:02 +03:00
realname='tdb.so')