build: use a common autogen-waf.sh for all builds
[Samba/gebeck_regimport.git] / lib / tdb / wscript
blobd80b7209b0f814da93337927ed418cc527a21f2a
1 #!/usr/bin/env python
3 APPNAME = 'tdb'
4 VERSION = '1.2.1'
6 blddir = 'bin'
8 import sys, os
10 # find the buildtools directory
11 srcdir = '.'
12 while not os.path.exists(srcdir+'/buildtools') and len(srcdir.split('/')) < 5:
13 srcdir = '../' + srcdir
14 sys.path.insert(0, srcdir + '/buildtools/wafsamba')
16 import wafsamba, samba_dist
18 samba_dist.DIST_DIRS('lib/tdb:. lib/replace:lib/replace buildtools:buildtools')
20 def set_options(opt):
21 opt.BUILTIN_DEFAULT('replace')
22 opt.BUNDLED_EXTENSION_DEFAULT('tdb', noextenion='tdb')
23 opt.RECURSE('lib/replace')
25 def configure(conf):
26 conf.RECURSE('lib/replace')
28 if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION,
29 implied_deps='replace'):
30 conf.define('USING_SYSTEM_TDB', 1)
32 conf.SAMBA_CONFIG_H()
34 def build(bld):
35 bld.RECURSE('lib/replace')
37 COMMON_SRC = bld.SUBDIR('common',
38 '''check.c error.c tdb.c traverse.c
39 freelistcheck.c lock.c dump.c freelist.c
40 io.c open.c transaction.c''')
42 if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
43 bld.SAMBA_LIBRARY('tdb',
44 COMMON_SRC,
45 deps='replace rt',
46 includes='include',
47 vnum=VERSION)
49 bld.SAMBA_BINARY('tdbtorture',
50 'tools/tdbtorture.c',
51 'tdb')
53 bld.SAMBA_BINARY('tdbdump',
54 'tools/tdbdump.c',
55 'tdb')
57 bld.SAMBA_BINARY('tdbbackup',
58 'tools/tdbbackup.c',
59 'tdb')
61 bld.SAMBA_BINARY('tdbtool',
62 'tools/tdbtool.c',
63 'tdb')
65 s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
67 bld.SAMBA_PYTHON('pytdb',
68 'pytdb.c',
69 deps='tdb',
70 enabled=s4_build,
71 realname='tdb.so')
74 def test(ctx):
75 '''run tdb testsuite'''
76 import Utils
77 cmd = os.path.join(Utils.g_module.blddir, 'tdbtorture')
78 os.system(cmd)
80 def dist():
81 '''makes a tarball for distribution'''
82 samba_dist.dist()