- if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb', minversion=VERSION,
- onlyif='talloc tdb tevent',
- implied_deps='replace talloc tdb tevent'):
- conf.define('USING_SYSTEM_LDB', 1)
- if conf.CHECK_BUNDLED_SYSTEM_PKG('pyldb-util', minversion=VERSION,
- onlyif='talloc tdb tevent ldb',
- implied_deps='replace talloc tdb tevent ldb'):
- conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
+ max_ldb_version = [int(x) for x in VERSION.split(".")]
+ max_ldb_version[2] = 999
+ max_ldb_version_dots = "%d.%d.%d" % tuple(max_ldb_version)
+
+ if conf.env.disable_python:
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
+ minversion=VERSION,
+ maxversion=max_ldb_version_dots,
+ onlyif='talloc tdb tevent',
+ implied_deps='replace talloc tdb tevent'):
+ conf.define('USING_SYSTEM_LDB', 1)
+ else:
+ using_system_pyldb_util = True
+ dflt_name = 'pyldb-util' + conf.all_envs['default']['PYTHON_SO_ABI_FLAG']
+ if not conf.CHECK_BUNDLED_SYSTEM_PKG(dflt_name,
+ minversion=VERSION,
+ maxversion=max_ldb_version_dots,
+ onlyif='talloc tdb tevent',
+ implied_deps='replace talloc tdb tevent ldb'):
+ using_system_pyldb_util = False
+
+ # We need to get a pyldb-util for all the python versions
+ # we are building for
+ if conf.env['EXTRA_PYTHON']:
+ name = 'pyldb-util' + conf.all_envs['extrapython']['PYTHON_SO_ABI_FLAG']
+ if not conf.CHECK_BUNDLED_SYSTEM_PKG(name,
+ minversion=VERSION,
+ maxversion=max_ldb_version_dots,
+ onlyif='talloc tdb tevent',
+ implied_deps='replace talloc tdb tevent ldb'):
+ using_system_pyldb_util = False
+
+ if using_system_pyldb_util:
+ conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
+
+ if conf.CHECK_BUNDLED_SYSTEM_PKG('ldb',
+ minversion=VERSION,
+ maxversion=max_ldb_version_dots,
+ onlyif='talloc tdb tevent %s' % dflt_name,
+ implied_deps='replace talloc tdb tevent'):
+ conf.define('USING_SYSTEM_LDB', 1)
+
+ if not conf.CHECK_CODE('return !(sizeof(size_t) >= 8)',
+ "HAVE_64_BIT_SIZE_T_FOR_LMDB",
+ execute=True,
+ msg='Checking for a 64-bit host to '
+ 'support lmdb'):
+ Logs.warn("--without-ldb-lmdb implied as this "
+ "host is not 64-bit")
+
+ if not conf.env.standalone_ldb and \
+ not Options.options.without_ad_dc and \
+ conf.CONFIG_GET('ENABLE_SELFTEST'):
+ Logs.warn("NOTE: Some AD DC parts of selftest will fail")
+
+ conf.env.REQUIRE_LMDB = False
+ else:
+ if conf.env.standalone_ldb:
+ if Options.options.without_ldb_lmdb:
+ conf.env.REQUIRE_LMDB = False
+ else:
+ conf.env.REQUIRE_LMDB = True
+ elif Options.options.without_ad_dc:
+ conf.env.REQUIRE_LMDB = False
+ else:
+ if Options.options.without_ldb_lmdb:
+ if not Options.options.without_ad_dc and \
+ conf.CONFIG_GET('ENABLE_SELFTEST'):
+ raise Errors.WafError('--without-ldb-lmdb conflicts '
+ 'with --enable-selftest while '
+ 'building the AD DC')
+
+ conf.env.REQUIRE_LMDB = False
+ else:
+ conf.env.REQUIRE_LMDB = True
+
+
+ if conf.CONFIG_SET('USING_SYSTEM_LDB'):
+ v = VERSION.split('.')
+ conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_MAJOR', int(v[0]))
+ conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_MINOR', int(v[1]))
+ conf.DEFINE('EXPECTED_SYSTEM_LDB_VERSION_RELEASE', int(v[2]))