From: Noel Power Date: Thu, 8 May 2025 08:43:17 +0000 (+0100) Subject: wafsamba: simplify mit kerberos detection X-Git-Tag: tevent-0.17.0~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caaca330cabcaa4e4c444b958f771d2dd5e0f2cb;p=thirdparty%2Fsamba.git wafsamba: simplify mit kerberos detection 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 Reviewed-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/wscript b/wscript index dcdde5b9712..1f0a41fb052 100644 --- 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. ' + diff --git a/wscript_configure_system_mitkrb5 b/wscript_configure_system_mitkrb5 index 58b9fb802d0..0bf755bc0cb 100644 --- a/wscript_configure_system_mitkrb5 +++ b/wscript_configure_system_mitkrb5 @@ -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()