10 # find the buildtools directory
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')
21 opt.BUILTIN_DEFAULT('replace')
22 opt.PRIVATE_EXTENSION_DEFAULT('tdb2', noextension='tdb2')
23 opt.RECURSE('lib/replace')
24 opt.add_option('--enable-tdb2',
25 help=("Use tdb2 API instead of 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)
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)
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
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 tdb1_check.c tdb1_freelist.c tdb1_hash.c
66 tdb1_io.c tdb1_lock.c tdb1_open.c
67 tdb1_summary.c tdb1_tdb.c tdb1_transaction.c
70 private_library=private_library)
72 bld.SAMBA_BINARY('tdb2torture',
73 'tools/tdb2torture.c',
77 bld.SAMBA_BINARY('tdb2tool',
81 bld.SAMBA_BINARY('tdb2dump',
85 bld.SAMBA_BINARY('tdb2restore',
86 'tools/tdb2restore.c',
89 bld.SAMBA_PYTHON('pytdb',
92 enabled=not bld.env.disable_python,
94 cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
97 '''makes a tarball for distribution'''
100 def reconfigure(ctx):
101 '''reconfigure if config scripts have changed'''
103 samba_utils.reconfigure(ctx)