libwbclient: Remove some pointless BAIL_ON_WBC_ERROR macro calls
[Samba/ekacnet.git] / lib / tdb / wscript
blob70eb8cf5d05455de73d7e80a584be3f292e3e716
1 #!/usr/bin/env python
3 APPNAME = 'tdb'
4 VERSION = '1.2.2'
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, Options, Logs
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')
24 if opt.IN_LAUNCH_DIR():
25 opt.add_option('--disable-python',
26 help=("disable the pytdb module"),
27 action="store_true", dest='disable_python', default=False)
30 def configure(conf):
31 conf.RECURSE('lib/replace')
33 conf.env.standalone_tdb = conf.IN_LAUNCH_DIR()
35 if not conf.env.standalone_tdb:
36 if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION,
37 implied_deps='replace'):
38 conf.define('USING_SYSTEM_TDB', 1)
40 conf.env.disable_python = getattr(Options.options, 'disable_python', False)
42 if conf.env.standalone_tdb:
43 conf.find_program('xsltproc', var='XSLTPROC')
45 if not conf.env.disable_python:
46 # also disable if we don't have the python libs installed
47 conf.check_tool('python')
48 conf.check_python_version((2,4,2))
49 conf.check_python_headers(mandatory=False)
50 if not conf.env.HAVE_PYTHON_H:
51 Logs.warn('Disabling pytdb as python devel libs not found')
52 conf.env.disable_python = True
54 conf.SAMBA_CONFIG_H()
56 def build(bld):
57 bld.RECURSE('lib/replace')
59 COMMON_SRC = bld.SUBDIR('common',
60 '''check.c error.c tdb.c traverse.c
61 freelistcheck.c lock.c dump.c freelist.c
62 io.c open.c transaction.c''')
64 if not bld.CONFIG_SET('USING_SYSTEM_TDB'):
65 bld.SAMBA_LIBRARY('tdb',
66 COMMON_SRC,
67 deps='replace rt',
68 includes='include',
69 abi_file='ABI/tdb-%s.sigs' % VERSION,
70 abi_match='tdb_*',
71 hide_symbols=True,
72 vnum=VERSION)
74 bld.SAMBA_BINARY('tdbtorture',
75 'tools/tdbtorture.c',
76 'tdb',
77 install=False)
79 bld.SAMBA_BINARY('tdbdump',
80 'tools/tdbdump.c',
81 'tdb')
83 bld.SAMBA_BINARY('tdbbackup',
84 'tools/tdbbackup.c',
85 'tdb')
87 bld.SAMBA_BINARY('tdbtool',
88 'tools/tdbtool.c',
89 'tdb')
91 s4_build = getattr(bld.env, '_SAMBA_BUILD_', 0) == 4
93 bld.SAMBA_PYTHON('pytdb',
94 'pytdb.c',
95 deps='tdb',
96 enabled=not bld.env.disable_python,
97 realname='tdb.so')
99 if bld.env.standalone_tdb:
100 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
101 bld.PKG_CONFIG_FILES('tdb.pc', vnum=VERSION)
102 bld.INSTALL_FILES('${INCLUDEDIR}', 'include/tdb.h', flat=True)
104 if bld.env.XSLTPROC:
105 manpages = 'manpages/tdbbackup.8 manpages/tdbdump.8 manpages/tdbtool.8'
107 bld.env.TDB_MAN_XSL = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
109 for m in manpages.split():
110 source = m + '.xml'
111 bld.SAMBA_GENERATOR(m,
112 source=source,
113 target=m,
114 rule='${XSLTPROC} -o ${TGT} ${TDB_MAN_XSL} ${SRC}'
116 bld.INSTALL_FILES('${MANDIR}/man8', m, flat=True)
119 def test(ctx):
120 '''run tdb testsuite'''
121 import Utils
122 cmd = os.path.join(Utils.g_module.blddir, 'tdbtorture')
123 os.system(cmd)
125 def dist():
126 '''makes a tarball for distribution'''
127 samba_dist.dist()