ldb: Release ldb 1.6.3
[samba.git] / lib / ldb / wscript
1 #!/usr/bin/env python
2
3 APPNAME = 'ldb'
4 VERSION = '1.6.3'
5
6 import sys, os
7
8 # find the buildtools directory
9 top = '.'
10 while not os.path.exists(top+'/buildtools') and len(top.split('/')) < 5:
11     top = top + '/..'
12 sys.path.insert(0, top + '/buildtools/wafsamba')
13
14 out = 'bin'
15
16 import wafsamba
17 from wafsamba import samba_dist, samba_utils
18 from waflib import Errors, Options, Logs, Context
19 import shutil
20
21 samba_dist.DIST_DIRS('''lib/ldb:. lib/replace:lib/replace lib/talloc:lib/talloc
22                         lib/tdb:lib/tdb lib/tdb:lib/tdb lib/tevent:lib/tevent
23                         third_party/popt:third_party/popt
24                         third_party/cmocka:third_party/cmocka
25                         buildtools:buildtools third_party/waf:third_party/waf''')
26
27 samba_dist.DIST_FILES('''lib/util/binsearch.h:lib/util/binsearch.h''')
28
29 def options(opt):
30     opt.BUILTIN_DEFAULT('replace')
31     opt.PRIVATE_EXTENSION_DEFAULT('ldb', noextension='ldb')
32     opt.RECURSE('lib/tdb')
33     opt.RECURSE('lib/tevent')
34     opt.RECURSE('lib/replace')
35     opt.load('python') # options for disabling pyc or pyo compilation
36
37     opt.add_option('--without-ldb-lmdb',
38                    help='disable new LMDB backend for LDB',
39                    action='store_true', dest='without_ldb_lmdb', default=False)
40
41
42 def configure(conf):
43     conf.RECURSE('lib/tdb')
44     conf.RECURSE('lib/tevent')
45
46     if conf.CHECK_FOR_THIRD_PARTY():
47         conf.RECURSE('third_party/popt')
48         conf.RECURSE('third_party/cmocka')
49     else:
50         if not conf.CHECK_POPT():
51             raise Errors.WafError('popt development packages have not been found.\nIf third_party is installed, check that it is in the proper place.')
52         else:
53             conf.define('USING_SYSTEM_POPT', 1)
54
55         if not conf.CHECK_CMOCKA():
56             raise Errors.WafError('cmocka development package have not been found.\nIf third_party is installed, check that it is in the proper place.')
57         else:
58             conf.define('USING_SYSTEM_CMOCKA', 1)
59
60     conf.RECURSE('lib/replace')
61     conf.find_program('xsltproc', var='XSLTPROC')
62     conf.SAMBA_CHECK_PYTHON()
63     conf.SAMBA_CHECK_PYTHON_HEADERS()
64
65     # where does the default LIBDIR end up? in conf.env somewhere?
66     #
67     conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
68
69     conf.env.standalone_ldb = conf.IN_LAUNCH_DIR()
70
71     if not conf.env.standalone_ldb:
72         max_ldb_version = [int(x) for x in VERSION.split(".")]
73         max_ldb_version[2] = 999
74         max_ldb_version_dots = "%d.%d.%d" % tuple(max_ldb_version)
75
76         if conf.env.disable_python:
77             if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
78                                              minversion=VERSION,
79                                              maxversion=max_ldb_version_dots,
80                                              onlyif='talloc tdb tevent',
81                                              implied_deps='replace talloc tdb tevent'):
82                 conf.define('USING_SYSTEM_LDB', 1)
83         else:
84             using_system_pyldb_util = True
85             dflt_name = 'pyldb-util' + conf.all_envs['default']['PYTHON_SO_ABI_FLAG']
86             if not conf.CHECK_BUNDLED_SYSTEM_PKG(dflt_name,
87                                                  minversion=VERSION,
88                                                  maxversion=max_ldb_version_dots,
89                                                  onlyif='talloc tdb tevent',
90                                                  implied_deps='replace talloc tdb tevent ldb'):
91                 using_system_pyldb_util = False
92
93             if using_system_pyldb_util:
94                 conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
95
96             if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
97                                              minversion=VERSION,
98                                              maxversion=max_ldb_version_dots,
99                                              onlyif='talloc tdb tevent %s' % dflt_name,
100                                              implied_deps='replace talloc tdb tevent'):
101                 conf.define('USING_SYSTEM_LDB', 1)
102
103     if not conf.CHECK_CODE('return !(sizeof(size_t) >= 8)',
104                            "HAVE_64_BIT_SIZE_T_FOR_LMDB",
105                            execute=True,
106                            msg='Checking for a 64-bit host to '
107                            'support lmdb'):
108         Logs.warn("--without-ldb-lmdb implied as this "
109                   "host is not 64-bit")
110
111         if not conf.env.standalone_ldb and \
112            not Options.options.without_ad_dc and \
113            conf.CONFIG_GET('ENABLE_SELFTEST'):
114             Logs.warn("NOTE: Some AD DC parts of selftest will fail")
115
116         conf.env.REQUIRE_LMDB = False
117     else:
118         if conf.env.standalone_ldb:
119             if Options.options.without_ldb_lmdb:
120                 conf.env.REQUIRE_LMDB = False
121             else:
122                 conf.env.REQUIRE_LMDB = True
123         elif Options.options.without_ad_dc:
124             conf.env.REQUIRE_LMDB = False
125         else:
126             if Options.options.without_ldb_lmdb:
127                 if not Options.options.without_ad_dc and \
128                    conf.CONFIG_GET('ENABLE_SELFTEST'):
129                     raise Errors.WafError('--without-ldb-lmdb conflicts '
130                                          'with --enable-selftest while '
131                                          'building the AD DC')
132
133                 conf.env.REQUIRE_LMDB = False
134             else:
135                 conf.env.REQUIRE_LMDB = True
136
137
138     if conf.CONFIG_SET('USING_SYSTEM_LDB'):
139         v = VERSION.split('.')
140         conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_MAJOR', int(v[0]))
141         conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_MINOR', int(v[1]))
142         conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))
143
144     if conf.env.standalone_ldb:
145         conf.CHECK_XSLTPROC_MANPAGES()
146
147         # we need this for the ldap backend
148         if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
149             conf.env.ENABLE_LDAP_BACKEND = True
150
151         # we don't want any libraries or modules to rely on runtime
152         # resolution of symbols
153         if not sys.platform.startswith("openbsd"):
154             conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
155
156     # if lmdb support is enabled then we require lmdb
157     # is present, build the mdb back end and enable lmdb support in
158     # the tools.
159     if conf.env.REQUIRE_LMDB and \
160        not conf.CONFIG_SET('USING_SYSTEM_LDB'):
161         if not conf.CHECK_CFG(package='lmdb',
162                               args='"lmdb >= 0.9.16" --cflags --libs',
163                               msg='Checking for lmdb >= 0.9.16',
164                               mandatory=False):
165             if not conf.CHECK_CODE('''
166                     #if MDB_VERSION_MAJOR == 0 \
167                       && MDB_VERSION_MINOR <= 9 \
168                       && MDB_VERSION_PATCH < 16
169                     #error LMDB too old
170                     #endif
171                     ''',
172                     'HAVE_GOOD_LMDB_VERSION',
173                     headers='lmdb.h',
174                     msg='Checking for lmdb >= 0.9.16 via header check'):
175
176                 if conf.env.standalone_ldb:
177                     raise Errors.WafError('ldb build (unless --without-ldb-lmdb) '
178                                          'requires '
179                                          'lmdb 0.9.16 or later')
180                 elif not Options.options.without_ad_dc:
181                     raise Errors.WafError('Samba AD DC and --enable-selftest '
182                                          'requires '
183                                          'lmdb 0.9.16 or later')
184
185         if conf.CHECK_FUNCS_IN('mdb_env_create', 'lmdb', headers='lmdb.h'):
186             conf.DEFINE('HAVE_LMDB', '1')
187             conf.env.HAVE_LMDB = True
188
189
190     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
191
192     conf.SAMBA_CONFIG_H()
193
194     conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()
195
196 def build(bld):
197     bld.RECURSE('lib/tevent')
198
199     if bld.CHECK_FOR_THIRD_PARTY():
200         bld.RECURSE('third_party/popt')
201         bld.RECURSE('third_party/cmocka')
202
203     bld.RECURSE('lib/replace')
204     bld.RECURSE('lib/tdb')
205
206     if bld.env.standalone_ldb:
207         if not 'PACKAGE_VERSION' in bld.env:
208             bld.env.PACKAGE_VERSION = VERSION
209         bld.env.PKGCONFIGDIR = '${LIBDIR}/pkgconfig'
210         private_library = False
211     else:
212         private_library = True
213     # we're not currently linking against the ldap libs, but ldb.pc.in
214     # has @LDAP_LIBS@
215     bld.env.LDAP_LIBS = ''
216
217     LDB_MAP_SRC = bld.SUBDIR('ldb_map',
218                              'ldb_map.c ldb_map_inbound.c ldb_map_outbound.c')
219
220     COMMON_SRC = bld.SUBDIR('common',
221                             '''ldb_modules.c ldb_ldif.c ldb_parse.c ldb_msg.c ldb_utf8.c
222                             ldb_debug.c ldb_dn.c ldb_match.c ldb_options.c ldb_pack.c
223                             ldb_attributes.c attrib_handlers.c ldb_controls.c qsort.c''')
224
225     bld.SAMBA_MODULE('ldb_ldap', 'ldb_ldap/ldb_ldap.c',
226                      init_function='ldb_ldap_init',
227                      module_init_name='ldb_init_module',
228                      deps='talloc lber ldap ldb',
229                      enabled=bld.env.ENABLE_LDAP_BACKEND,
230                      internal_module=False,
231                      subsystem='ldb')
232
233     if bld.PYTHON_BUILD_IS_ENABLED():
234         if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
235             name = bld.pyembed_libname('pyldb-util')
236             bld.SAMBA_LIBRARY(name,
237                               deps='replace ldb',
238                               source='pyldb_util.c',
239                               public_headers=('' if private_library else 'pyldb.h'),
240                               public_headers_install=not private_library,
241                               vnum=VERSION,
242                               private_library=private_library,
243                               pc_files='pyldb-util.pc',
244                               pyembed=True,
245                               enabled=bld.PYTHON_BUILD_IS_ENABLED(),
246                               abi_directory='ABI',
247                               abi_match='pyldb_*')
248
249             if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
250                 bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
251                                  deps='replace ldb ' + name,
252                                  realname='ldb.so',
253                                  cflags='-DPACKAGE_VERSION=\"%s\"' % VERSION)
254
255         # Do only install this file as part of the Samba build if we do not
256         # use the system libldb!
257         if not bld.CONFIG_SET('USING_SYSTEM_PYLDB_UTIL'):
258             bld.SAMBA_SCRIPT('_ldb_text.py',
259                              pattern='_ldb_text.py',
260                              installdir='python')
261
262             bld.INSTALL_FILES('${PYTHONARCHDIR}', '_ldb_text.py')
263
264     if not bld.CONFIG_SET('USING_SYSTEM_LDB'):
265         if bld.is_install:
266             modules_dir = bld.EXPAND_VARIABLES('${LDB_MODULESDIR}')
267         else:
268             # when we run from the source directory, we want to use
269             # the current modules, not the installed ones
270             modules_dir = os.path.join(os.getcwd(), 'bin/modules/ldb')
271
272         abi_match = '!ldb_*module_ops !ldb_*backend_ops ldb_*'
273
274         ldb_headers = ('include/ldb.h include/ldb_errors.h '
275                        'include/ldb_module.h include/ldb_handlers.h')
276
277         bld.SAMBA_LIBRARY('ldb',
278                           COMMON_SRC + ' ' + LDB_MAP_SRC,
279                           deps='tevent LIBLDB_MAIN replace',
280                           includes='include',
281                           public_headers=('' if private_library else ldb_headers),
282                           public_headers_install=not private_library,
283                           pc_files='ldb.pc',
284                           vnum=VERSION,
285                           private_library=private_library,
286                           manpages='man/ldb.3',
287                           abi_directory='ABI',
288                           abi_match = abi_match)
289
290         # generate a include/ldb_version.h
291         def generate_ldb_version_h(t):
292             '''generate a vscript file for our public libraries'''
293
294             tgt = t.outputs[0].bldpath(t.env)
295
296             v = t.env.LDB_VERSION.split('.')
297
298             f = open(tgt, mode='w')
299             try:
300                 f.write('#define LDB_VERSION "%s"\n' % t.env.LDB_VERSION)
301                 f.write('#define LDB_VERSION_MAJOR %d\n' % int(v[0]))
302                 f.write('#define LDB_VERSION_MINOR %d\n' % int(v[1]))
303                 f.write('#define LDB_VERSION_RELEASE %d\n' % int(v[2]))
304             finally:
305                 f.close()
306             return
307         t = bld.SAMBA_GENERATOR('ldb_version.h',
308                                 rule=generate_ldb_version_h,
309                                 dep_vars=['LDB_VERSION'],
310                                 target='include/ldb_version.h',
311                                 public_headers='include/ldb_version.h',
312                                 public_headers_install=not private_library)
313         t.env.LDB_VERSION = VERSION
314
315         bld.SAMBA_MODULE('ldb_asq',
316                          'modules/asq.c',
317                          init_function='ldb_asq_init',
318                          module_init_name='ldb_init_module',
319                          internal_module=False,
320                          deps='ldb',
321                          subsystem='ldb')
322
323         bld.SAMBA_MODULE('ldb_server_sort',
324                          'modules/sort.c',
325                          init_function='ldb_server_sort_init',
326                          internal_module=False,
327                          module_init_name='ldb_init_module',
328                          deps='ldb',
329                          subsystem='ldb')
330
331         bld.SAMBA_MODULE('ldb_paged_searches',
332                          'modules/paged_searches.c',
333                          init_function='ldb_paged_searches_init',
334                          internal_module=False,
335                          module_init_name='ldb_init_module',
336                          deps='ldb',
337                          subsystem='ldb')
338
339         bld.SAMBA_MODULE('ldb_rdn_name',
340                          'modules/rdn_name.c',
341                          init_function='ldb_rdn_name_init',
342                          internal_module=False,
343                          module_init_name='ldb_init_module',
344                          deps='ldb',
345                          subsystem='ldb')
346
347         bld.SAMBA_MODULE('ldb_sample',
348                          'tests/sample_module.c',
349                          init_function='ldb_sample_init',
350                          internal_module=False,
351                          module_init_name='ldb_init_module',
352                          deps='ldb',
353                          subsystem='ldb')
354
355         bld.SAMBA_MODULE('ldb_skel',
356                          'modules/skel.c',
357                          init_function='ldb_skel_init',
358                          internal_module=False,
359                          module_init_name='ldb_init_module',
360                          deps='ldb',
361                          subsystem='ldb')
362
363         bld.SAMBA_MODULE('ldb_sqlite3',
364                          'sqlite3/ldb_sqlite3.c',
365                          init_function='ldb_sqlite3_init',
366                          internal_module=False,
367                          module_init_name='ldb_init_module',
368                          enabled=False,
369                          deps='ldb',
370                          subsystem='ldb')
371
372         bld.SAMBA_MODULE('ldb_tdb',
373                          bld.SUBDIR('ldb_tdb',
374                                     '''ldb_tdb_init.c'''),
375                          init_function='ldb_tdb_init',
376                          module_init_name='ldb_init_module',
377                          internal_module=False,
378                          deps='ldb ldb_tdb_int ldb_key_value',
379                          subsystem='ldb')
380
381         bld.SAMBA_LIBRARY('ldb_tdb_int',
382                           bld.SUBDIR('ldb_tdb',
383                                      '''ldb_tdb_wrap.c ldb_tdb.c'''),
384                           private_library=True,
385                           deps='ldb tdb ldb_key_value ldb_tdb_err_map')
386
387         bld.SAMBA_LIBRARY('ldb_tdb_err_map',
388                           bld.SUBDIR('ldb_tdb',
389                                      '''ldb_tdb_err_map.c '''),
390                           private_library=True,
391                           deps='ldb tdb')
392
393         bld.SAMBA_LIBRARY('ldb_key_value',
394                           bld.SUBDIR('ldb_key_value',
395                                     '''ldb_kv.c ldb_kv_search.c ldb_kv_index.c
396                                     ldb_kv_cache.c'''),
397                           private_library=True,
398                           deps='tdb ldb ldb_tdb_err_map')
399
400         if bld.CONFIG_SET('HAVE_LMDB'):
401             bld.SAMBA_MODULE('ldb_mdb',
402                              bld.SUBDIR('ldb_mdb',
403                                         '''ldb_mdb_init.c'''),
404                              init_function='ldb_mdb_init',
405                              module_init_name='ldb_init_module',
406                              internal_module=False,
407                              deps='ldb ldb_key_value ldb_mdb_int',
408                              subsystem='ldb')
409
410             bld.SAMBA_LIBRARY('ldb_mdb_int',
411                               bld.SUBDIR('ldb_mdb',
412                                          '''ldb_mdb.c '''),
413                               private_library=True,
414                               deps='ldb lmdb ldb_key_value')
415             lmdb_deps = ' ldb_mdb_int'
416         else:
417             lmdb_deps = ''
418
419
420         bld.SAMBA_MODULE('ldb_ldb',
421                          bld.SUBDIR('ldb_ldb',
422                                     '''ldb_ldb.c'''),
423                          init_function='ldb_ldb_init',
424                          module_init_name='ldb_init_module',
425                          internal_module=False,
426                          deps='ldb ldb_tdb_int ldb_key_value' + lmdb_deps,
427                          subsystem='ldb')
428
429         # have a separate subsystem for common/ldb.c, so it can rebuild
430         # for install with a different -DLDB_MODULESDIR=
431         bld.SAMBA_SUBSYSTEM('LIBLDB_MAIN',
432                             'common/ldb.c',
433                             deps='tevent tdb',
434                             includes='include',
435                             cflags=['-DLDB_MODULESDIR=\"%s\"' % modules_dir])
436
437         LDB_TOOLS='ldbadd ldbsearch ldbdel ldbmodify ldbedit ldbrename'
438         for t in LDB_TOOLS.split():
439             bld.SAMBA_BINARY(t, 'tools/%s.c' % t, deps='ldb-cmdline ldb',
440                              manpages='man/%s.1' % t)
441
442         # ldbtest doesn't get installed
443         bld.SAMBA_BINARY('ldbtest', 'tools/ldbtest.c', deps='ldb-cmdline ldb',
444                          install=False)
445
446         if bld.CONFIG_SET('HAVE_LMDB'):
447             lmdb_deps = ' lmdb'
448         else:
449             lmdb_deps = ''
450         # ldbdump doesn't get installed
451         bld.SAMBA_BINARY('ldbdump',
452                          'tools/ldbdump.c',
453                          deps='ldb-cmdline ldb' + lmdb_deps,
454                          install=False)
455
456         bld.SAMBA_LIBRARY('ldb-cmdline',
457                           source='tools/ldbutil.c tools/cmdline.c',
458                           deps='ldb dl popt',
459                           private_library=True)
460
461         bld.SAMBA_BINARY('ldb_tdb_mod_op_test',
462                          source='tests/ldb_mod_op_test.c',
463                          cflags='-DTEST_BE=\"tdb\"',
464                          deps='cmocka ldb',
465                          install=False)
466
467         bld.SAMBA_BINARY('ldb_tdb_guid_mod_op_test',
468                          source='tests/ldb_mod_op_test.c',
469                          cflags='-DTEST_BE=\"tdb\" -DGUID_IDX=1',
470                          deps='cmocka ldb',
471                          install=False)
472
473         bld.SAMBA_BINARY('ldb_tdb_kv_ops_test',
474                          source='tests/ldb_kv_ops_test.c',
475                          cflags='-DTEST_BE=\"tdb\"',
476                          deps='cmocka ldb',
477                          install=False)
478
479         bld.SAMBA_BINARY('ldb_tdb_test',
480                          source='tests/ldb_tdb_test.c',
481                          deps='cmocka ldb',
482                          install=False)
483
484         bld.SAMBA_BINARY('ldb_msg_test',
485                          source='tests/ldb_msg.c',
486                          deps='cmocka ldb',
487                          install=False)
488
489         bld.SAMBA_BINARY('test_ldb_qsort',
490                          source='tests/test_ldb_qsort.c',
491                          deps='cmocka ldb',
492                          install=False)
493
494         bld.SAMBA_BINARY('test_ldb_dn',
495                          source='tests/test_ldb_dn.c',
496                          deps='cmocka ldb',
497                          install=False)
498
499         bld.SAMBA_BINARY('ldb_match_test',
500                          source='tests/ldb_match_test.c',
501                          deps='cmocka ldb',
502                          install=False)
503
504         if bld.CONFIG_SET('HAVE_LMDB'):
505             bld.SAMBA_BINARY('ldb_mdb_mod_op_test',
506                              source='tests/ldb_mod_op_test.c',
507                              cflags='-DTEST_BE=\"mdb\" -DGUID_IDX=1 '
508                                   + '-DTEST_LMDB=1',
509                              deps='cmocka ldb lmdb',
510                              install=False)
511
512             bld.SAMBA_BINARY('ldb_lmdb_test',
513                              source='tests/ldb_lmdb_test.c',
514                              deps='cmocka ldb',
515                              install=False)
516
517             bld.SAMBA_BINARY('ldb_lmdb_size_test',
518                              source='tests/ldb_lmdb_size_test.c',
519                              deps='cmocka ldb',
520                              install=False)
521
522             bld.SAMBA_BINARY('ldb_mdb_kv_ops_test',
523                              source='tests/ldb_kv_ops_test.c',
524                              cflags='-DTEST_BE=\"mdb\"',
525                              deps='cmocka ldb',
526                              install=False)
527         else:
528             bld.SAMBA_BINARY('ldb_no_lmdb_test',
529                              source='tests/ldb_no_lmdb_test.c',
530                              deps='cmocka ldb',
531                              install=False)
532
533 def test(ctx):
534     '''run ldb testsuite'''
535     env = samba_utils.LOAD_ENVIRONMENT()
536     ctx.env = env
537
538     test_prefix = "%s/st" % (Context.g_module.out)
539     shutil.rmtree(test_prefix, ignore_errors=True)
540     os.makedirs(test_prefix)
541     os.environ['TEST_DATA_PREFIX'] = test_prefix
542     os.environ['LDB_MODULES_PATH'] = Context.g_module.out + "/modules/ldb"
543     if env.HAVE_LMDB:
544         os.environ['HAVE_LMDB'] = '1'
545     else:
546         os.environ['HAVE_LMDB'] = '0'
547     samba_utils.ADD_LD_LIBRARY_PATH('bin/shared')
548     samba_utils.ADD_LD_LIBRARY_PATH('bin/shared/private')
549
550     cmd = 'tests/test-tdb.sh %s' % Context.g_module.out
551     ret = samba_utils.RUN_COMMAND(cmd)
552     print("testsuite returned %d" % ret)
553
554     tmp_dir = os.path.join(test_prefix, 'tmp')
555     if not os.path.exists(tmp_dir):
556         os.mkdir(tmp_dir)
557     pyret = samba_utils.RUN_PYTHON_TESTS(
558         ['tests/python/api.py', 'tests/python/index.py'],
559         extra_env={'SELFTEST_PREFIX': test_prefix})
560     print("Python testsuite returned %d" % pyret)
561
562     cmocka_ret = 0
563     test_exes = ['test_ldb_qsort',
564                  'test_ldb_dn',
565                  'ldb_msg_test',
566                  'ldb_tdb_mod_op_test',
567                  'ldb_tdb_guid_mod_op_test',
568                  'ldb_msg_test',
569                  'ldb_tdb_kv_ops_test',
570                  'ldb_tdb_test',
571                  'ldb_match_test']
572
573     if env.HAVE_LMDB:
574         test_exes += ['ldb_mdb_mod_op_test',
575                      'ldb_lmdb_test',
576                      # we don't want to run ldb_lmdb_size_test (which proves we can
577                      # fit > 4G of data into the DB), it would fill up the disk on
578                      # many of our test instances
579                      'ldb_mdb_kv_ops_test']
580     else:
581         test_exes += ['ldb_no_lmdb_test']
582
583     for test_exe in test_exes:
584             cmd = os.path.join(Context.g_module.out, test_exe)
585             cmocka_ret = cmocka_ret or samba_utils.RUN_COMMAND(cmd)
586
587     sys.exit(ret or pyret or cmocka_ret)
588
589 def dist():
590     '''makes a tarball for distribution'''
591     samba_dist.dist()
592
593 def reconfigure(ctx):
594     '''reconfigure if config scripts have changed'''
595     import samba_utils
596     samba_utils.reconfigure(ctx)