From b868fc2c8d8068ef4804ef9f5bc19b9c5dc8ae19 Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 22 Nov 2021 10:30:36 +0000 Subject: [PATCH] meson: only find libcrypt if SELinux and no PAM We only need libcrypt if we're building _with_ SELinux and _without_ PAM. We don't use libcrypt for general SELinux with PAM. This is mostly a correctness change as libcrypt should generally be available (as opposed to the previous change which fixed some real-world cases). Fixes: f3f0fde861b438c80f99afdd49fe175e9d0a68ca Fixes: #478 --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1ee10751..fe0e04ef 100644 --- a/meson.build +++ b/meson.build @@ -93,7 +93,7 @@ rc_bindir = rc_libexecdir / 'bin' rc_sbindir = rc_libexecdir / 'sbin' sbindir = rootprefix / get_option('sbindir') -crypt_dep = dependency('libcrypt', required : not get_option('pam')) +crypt_dep = [] selinux_dep = dependency('libselinux', required : get_option('selinux')) pam_misc_dep = [] @@ -107,6 +107,8 @@ if selinux_dep.found() if not pam_misc_dep.found() and get_option('pam') error('Pam was requested but could not be located') endif + else + crypt_dep = dependency('libcrypt', required : not get_option('pam')) endif else cc_selinux_flags = []