s3-spoolss: Use a global variable for the pool
[Samba/vl.git] / lib / tdb2 / wscript
blob386768f0fcb8b768679d3d444d32572b19af255b
1 #!/usr/bin/env python
3 APPNAME = 'tdb'
4 VERSION = '2.0-alpha'
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/tdb2:. lib/replace:lib/replace buildtools:buildtools')
20 def set_options(opt):
21 opt.BUILTIN_DEFAULT('replace')
22 opt.PRIVATE_EXTENSION_DEFAULT('tdb2', noextension='tdb2')
23 opt.RECURSE('lib/replace')
24 opt.add_option('--enable-tdb2-breaks-compat',
25 help=("Build tdb2 instead of tdb1 (BREAKS TDB1!) [False]"),
26 action="store_true", dest='BUILD_TDB2', default=False)
27 if opt.IN_LAUNCH_DIR():
28 opt.add_option('--disable-python',
29 help=("disable the pytdb module"),
30 action="store_true", dest='disable_python', default=False)
32 def configure(conf):
33 if conf.env.BUILD_TDB2:
34 conf.DEFINE('BUILD_TDB2', 1)
35 conf.RECURSE('lib/replace')
36 conf.RECURSE('lib/ccan')
38 conf.env.standalone_tdb2 = conf.IN_LAUNCH_DIR()
39 conf.env.disable_python = getattr(Options.options, 'disable_python', False)
41 # if not conf.env.standalone_tdb2:
42 # if conf.CHECK_BUNDLED_SYSTEM('tdb', minversion=VERSION,
43 # implied_deps='replace'):
44 # conf.define('USING_SYSTEM_TDB2', 1)
46 conf.SAMBA_CONFIG_H()
48 def build(bld):
49 if bld.env.BUILD_TDB2:
50 bld.RECURSE('lib/replace')
52 if bld.env.standalone_tdb2:
53 bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
54 bld.PKG_CONFIG_FILES('tdb2.pc', vnum=VERSION)
55 bld.INSTALL_FILES('${INCLUDEDIR}', 'tdb2.h', flat=True)
56 private_library = False
57 else:
58 private_library = True
60 if not bld.CONFIG_SET('USING_SYSTEM_TDB2'):
61 # FIXME: hide_symbols=True, abi_directory='ABI', abi_match='tdb_*', vnum=VERSION,
62 bld.SAMBA_LIBRARY('tdb',
63 '''check.c free.c hash.c io.c lock.c open.c
64 summary.c tdb.c transaction.c traverse.c''',
65 deps='replace ccan',
66 private_library=private_library)
68 bld.SAMBA_BINARY('tdb2torture',
69 'tools/tdb2torture.c',
70 'tdb',
71 install=False)
73 bld.SAMBA_BINARY('tdb2tool',
74 'tools/tdb2tool.c',
75 'tdb')
77 bld.SAMBA_BINARY('tdb2dump',
78 'tools/tdb2dump.c',
79 'tdb')
81 bld.SAMBA_BINARY('tdb2restore',
82 'tools/tdb2restore.c',
83 'tdb')
85 bld.SAMBA_PYTHON('pytdb',
86 'pytdb.c',
87 deps='tdb',
88 enabled=not bld.env.disable_python,
89 realname='tdb.so',
90 cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
92 def dist():
93 '''makes a tarball for distribution'''
94 samba_dist.dist()
96 def reconfigure(ctx):
97 '''reconfigure if config scripts have changed'''
98 import samba_utils
99 samba_utils.reconfigure(ctx)