365c3842016dc512af764410e4227ecc0a84711e
[samba.git] / lib / tdb / wscript
1 #!/usr/bin/env python
2
3 VERSION='1.2.1'
4
5 srcdir = '../..'
6 blddir = 'bin'
7
8 import sys
9 sys.path.insert(0, srcdir+"/buildtools/wafsamba")
10 import wafsamba
11
12
13 LIBREPLACE_DIR= srcdir + '/lib/replace'
14
15 def set_options(opt):
16     opt.BUILTIN_DEFAULT('replace')
17     opt.BUNDLED_EXTENSION_DEFAULT('tdb', noextenion='tdb')
18     opt.recurse(LIBREPLACE_DIR)
19
20 def configure(conf):
21     conf.sub_config(LIBREPLACE_DIR)
22
23     if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION):
24         conf.define('USING_SYSTEM_TDB', 1)
25
26     conf.SAMBA_CONFIG_H()
27
28 def build(bld):
29     bld.BUILD_SUBDIR(LIBREPLACE_DIR)
30
31     COMMON_SRC = bld.SUBDIR('common',
32                             '''check.c error.c tdb.c traverse.c
33                             freelistcheck.c lock.c dump.c freelist.c
34                             io.c open.c transaction.c''')
35
36     if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
37         bld.SAMBA_LIBRARY('tdb',
38                           COMMON_SRC,
39                           deps='replace rt',
40                           includes='include',
41                           vnum=VERSION)
42
43     bld.SAMBA_BINARY('tdbtorture',
44                      'tools/tdbtorture.c',
45                      'tdb')
46
47     bld.SAMBA_BINARY('tdbdump',
48                      'tools/tdbdump.c',
49                      'tdb')
50
51     bld.SAMBA_BINARY('tdbbackup',
52                      'tools/tdbbackup.c',
53                      'tdb')
54
55     bld.SAMBA_BINARY('tdbtool',
56                      'tools/tdbtool.c',
57                      'tdb')
58
59     s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
60
61     bld.SAMBA_PYTHON('pytdb',
62                      'pytdb.c',
63                      deps='tdb',
64                      enabled=s4_build,
65                      realname='tdb.so')
66