s4-waf: set the bundled library extension for some libs
[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.recurse(LIBREPLACE_DIR)
17
18 def configure(conf):
19     conf.BUNDLED_LIBRARY_EXTENSION('tdb')
20     conf.sub_config(LIBREPLACE_DIR)
21     conf.SAMBA_CONFIG_H()
22
23 def build(bld):
24     bld.BUILD_SUBDIR(LIBREPLACE_DIR)
25
26     COMMON_SRC = bld.SUBDIR('common',
27                             '''check.c error.c tdb.c traverse.c
28                             freelistcheck.c lock.c dump.c freelist.c
29                             io.c open.c transaction.c''')
30
31     bld.SAMBA_LIBRARY('tdb',
32                       COMMON_SRC,
33                       deps='replace rt',
34                       includes='include',
35                       vnum=VERSION)
36
37     bld.SAMBA_BINARY('tdbtorture',
38                      'tools/tdbtorture.c',
39                      'tdb')
40
41     bld.SAMBA_BINARY('tdbdump',
42                      'tools/tdbdump.c',
43                      'tdb')
44
45     bld.SAMBA_BINARY('tdbbackup',
46                      'tools/tdbbackup.c',
47                      'tdb')
48
49     bld.SAMBA_BINARY('tdbtool',
50                      'tools/tdbtool.c',
51                      'tdb')
52
53     s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
54
55     bld.SAMBA_PYTHON('pytdb',
56                      'pytdb.c',
57                      deps='tdb',
58                      enabled=s4_build,
59                      realname='tdb.so')
60