]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
build: Allow --with-ldbmodulesdir to override location of LDB modules
authorAndrew Bartlett <abartlet@samba.org>
Tue, 13 Feb 2024 22:54:54 +0000 (11:54 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 1 Mar 2024 02:41:37 +0000 (02:41 +0000)
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>
buildtools/wafsamba/wafsamba.py
dynconfig/wscript
lib/ldb/wscript

index fad5fd24e38cb46bc1359a6412c71f57cc5d0097..250da072c508987d1e23c50fa2eab8a46b49f5bd 100644 (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,
index 347e5ddbabc75dc76abf01bddacf580581f243ac..2041d881546f291a0431aa75711e97c1a1d009ea 100644 (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',
index 28275d8bc117d0aa8725cf0136466adde1b7e720..6ac15f253a952e7afe4cd8a9767f7504f8409e0b 100644 (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",