1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

build: Allow --with-ldbmodulesdir to override location of LDB modules

This will allow some packagers to set this to a directory that does
not mention Samba, or to put a version string in to avoid loading
old modules.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
Andrew Bartlett 2024-02-14 11:54:54 +13:00
parent 5af23f1b58
commit 81994b85ad
3 changed files with 16 additions and 5 deletions

View File

@ -573,8 +573,7 @@ def SAMBA_MODULE(bld, modname, source,
manpages=None,
allow_undefined_symbols=False,
allow_warnings=False,
install=True
):
install=True):
'''define a Samba module.'''
bld.ASSERT(subsystem, "You must specify a subsystem for SAMBA_MODULE(%s)" % modname)
@ -625,6 +624,11 @@ def SAMBA_MODULE(bld, modname, source,
build_link_name = "modules/%s/%s" % (subsystem, realname)
if f'{subsystem}_modules_install_dir' in bld.env:
install_path = bld.env[f'{subsystem}_modules_install_dir']
else:
install_path = "${MODULESDIR}/%s" % subsystem
if init_function:
cflags += " -D%s=%s" % (init_function, module_init_name)
@ -641,7 +645,7 @@ def SAMBA_MODULE(bld, modname, source,
vars=vars,
bundled_name=build_name,
link_name=build_link_name,
install_path="${MODULESDIR}/%s" % subsystem,
install_path=install_path,
pyembed=pyembed,
manpages=manpages,
allow_undefined_symbols=allow_undefined_symbols,

View File

@ -170,6 +170,13 @@ dynconfig = {
'HELPTEXT': 'Which directory to use for Samba modules',
'OVERWRITE': True,
},
'LDBMODULESDIR' : {
'STD-PATH': '${MODULESDIR}/ldb',
'FHS-PATH': '${MODULESDIR}/ldb',
'OPTION': '--with-ldbmodulesdir',
'HELPTEXT': 'Which directory to use for LDB modules',
'DELAY': True,
},
'PAMMODULESDIR' : {
'STD-PATH': '${LIBDIR}/security',
'FHS-PATH': '${LIBDIR}/security',

View File

@ -15,11 +15,11 @@ def options(opt):
help='disable new LMDB backend for LDB',
action='store_true', dest='without_ldb_lmdb', default=False)
def configure(conf):
# where does the default LIBDIR end up? in conf.env somewhere?
#
conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
conf.env.ldb_modules_install_dir = conf.SUBST_ENV_VAR('LDBMODULESDIR')
conf.CONFIG_PATH('LDB_MODULESDIR', conf.env.ldb_modules_install_dir)
if not conf.CHECK_CODE('return !(sizeof(size_t) >= 8)',
"HAVE_64_BIT_SIZE_T_FOR_LMDB",