From 9502e6897d935673aa8ab7c290841691b7591243 Mon Sep 17 00:00:00 2001 From: Lars Wendler Date: Thu, 24 Oct 2024 16:26:29 +0200 Subject: [PATCH] Support elogind as logind alternative Can be enabled with -Dlogind=enabled -Delogind=enabled logind from systemd is still the default --- meson.build | 9 ++++++++- meson_options.txt | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 2be21282..1f1ecb4b 100644 --- a/meson.build +++ b/meson.build @@ -316,8 +316,15 @@ else stringparam_profileconditions += ';no_openssl_hmac' endif +if get_option('elogind').enabled() + logind_check='libelogind' + logind_ver='>= 255' +else + logind_check='libsystemd' + logind_ver='>= 254' +endif -libsystemd = dependency('libsystemd', version: '>= 254', required: get_option('logind')) +libsystemd = dependency(logind_check, version: logind_ver, required: get_option('logind')) cdata.set('USE_LOGIND', libsystemd.found() ? 1 : false) systemdunitdir = get_option('systemdunitdir') diff --git a/meson_options.txt b/meson_options.txt index 914ab462..9686ba53 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,6 +10,8 @@ option('econf', type: 'feature', value: 'auto', description: 'libeconf support') option('logind', type: 'feature', value: 'auto', description: 'logind support in pam_issue and pam_timestamp') +option('elogind', type: 'feature', value: 'disabled', + description: 'Prefer elogind over systemd as logind provider') option('openssl', type: 'feature', value: 'disabled', description: 'Use OpenSSL crypto libraries in pam_timestamp') option('selinux', type: 'feature', value: 'auto', -- 2.47.0