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