]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
wafsamba: simplify mit kerberos detection
authorNoel Power <noel.power@suse.com>
Thu, 8 May 2025 08:43:17 +0000 (09:43 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 16 May 2025 09:33:41 +0000 (09:33 +0000)
This patch removes the --with-system-mitkrb5 callback and associated
ability to store both boolean and path (string list) content.
The boolean part is self explanatory, specifying a path list
was a way to alternatively specify where krb5-config was found.
Instead now after this change to influence where krb5-config is found
the PATH variable itself should be modified before running configure.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
wscript
wscript_configure_system_mitkrb5

diff --git a/wscript b/wscript
index dcdde5b97122a0f00cce2e40cfbb36cb27df34b7..1f0a41fb05294446edf079eab053a8b767b4ff09 100644 (file)
--- a/wscript
+++ b/wscript
@@ -40,20 +40,6 @@ DEFAULT_PRIVATE_LIBS = get_default_private_libs()
 # install in /usr/local/samba by default
 default_prefix = Options.default_prefix = '/usr/local/samba'
 
-# This callback optionally takes a list of paths as arguments:
-# --with-system_mitkrb5 /path/to/krb5 /another/path
-def system_mitkrb5_callback(option, opt, value, parser):
-    setattr(parser.values, option.dest, True)
-    value = []
-    for arg in parser.rargs:
-        # stop on --foo like options
-        if arg[:2] == "--" and len(arg) > 2:
-            break
-        value.append(arg)
-    if len(value)>0:
-        del parser.rargs[:len(value)]
-        setattr(parser.values, option.dest, value)
-
 def options(opt):
     opt.BUILTIN_DEFAULT('NONE')
     opt.PRIVATE_EXTENSION_DEFAULT('private-samba')
@@ -91,9 +77,10 @@ def options(opt):
     opt.samba_add_onoff_option('pthreadpool', with_name="enable", without_name="disable", default=True)
 
     opt.add_option('--with-system-mitkrb5',
-                   help='build Samba with system MIT Kerberos. ' +
-                        'You may specify list of paths where Kerberos is installed (e.g. /usr/local /usr/kerberos) to search krb5-config',
-                   action='callback', callback=system_mitkrb5_callback, dest='with_system_mitkrb5', default=False)
+                   help='build Samba with system MIT Kerberos.',
+                   action='store_true',
+                   dest='with_system_mitkrb5',
+                   default=False)
 
     opt.add_option('--with-experimental-mit-ad-dc',
                    help='Enable the experimental MIT Kerberos-backed AD DC.  ' +
index 58b9fb802d0330046ac0a2a59e7cacb06383a1a2..0bf755bc0cb89fbbaecc697801637a7f313b84f0 100644 (file)
@@ -25,16 +25,11 @@ def krb5_define_syslib(conf, lib, deps):
 Logs.info("Looking for kerberos features")
 conf.find_program('krb5-config.heimdal', var='HEIMDAL_KRB5_CONFIG')
 
-if isinstance(Options.options.with_system_mitkrb5, list):
-    path_krb5_config = [x+'/bin' for x in Options.options.with_system_mitkrb5]
-else:
-    path_krb5_config = None
-
 conf.CHECK_CFG(args="--cflags --libs", package="com_err", uselib_store="com_err")
 conf.CHECK_FUNCS_IN('_et_list', 'com_err')
 conf.CHECK_HEADERS('com_err.h', lib='com_err')
 
-conf.find_program('krb5-config', path_list=path_krb5_config, var='KRB5_CONFIG')
+conf.find_program('krb5-config', var='KRB5_CONFIG')
 if conf.env.KRB5_CONFIG:
     vendor = conf.cmd_and_log(conf.env.KRB5_CONFIG+['--vendor'])
     conf.env.KRB5_VENDOR = vendor.strip().lower()