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-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)
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''',
66 private_library
=private_library
)
68 bld
.SAMBA_BINARY('tdb2torture',
69 'tools/tdb2torture.c',
73 bld
.SAMBA_BINARY('tdb2tool',
77 bld
.SAMBA_BINARY('tdb2dump',
81 bld
.SAMBA_BINARY('tdb2restore',
82 'tools/tdb2restore.c',
85 bld
.SAMBA_PYTHON('pytdb',
88 enabled
=not bld
.env
.disable_python
,
90 cflags
='-DPACKAGE_VERSION=\"%s\"' % VERSION
)
93 '''makes a tarball for distribution'''
97 '''reconfigure if config scripts have changed'''
99 samba_utils
.reconfigure(ctx
)