s4-waf: added implied_deps for system libraries
[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                                  implied_deps='replace'):
25         conf.define('USING_SYSTEM_TDB', 1)
26
27     conf.SAMBA_CONFIG_H()
28
29 def build(bld):
30     bld.BUILD_SUBDIR(LIBREPLACE_DIR)
31
32     COMMON_SRC = bld.SUBDIR('common',
33                             '''check.c error.c tdb.c traverse.c
34                             freelistcheck.c lock.c dump.c freelist.c
35                             io.c open.c transaction.c''')
36
37     if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
38         bld.SAMBA_LIBRARY('tdb',
39                           COMMON_SRC,
40                           deps='replace rt',
41                           includes='include',
42                           vnum=VERSION)
43
44     bld.SAMBA_BINARY('tdbtorture',
45                      'tools/tdbtorture.c',
46                      'tdb')
47
48     bld.SAMBA_BINARY('tdbdump',
49                      'tools/tdbdump.c',
50                      'tdb')
51
52     bld.SAMBA_BINARY('tdbbackup',
53                      'tools/tdbbackup.c',
54                      'tdb')
55
56     bld.SAMBA_BINARY('tdbtool',
57                      'tools/tdbtool.c',
58                      'tdb')
59
60     s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
61
62     bld.SAMBA_PYTHON('pytdb',
63                      'pytdb.c',
64                      deps='tdb',
65                      enabled=s4_build,
66                      realname='tdb.so')
67