From 2ba16135cbef444a566da5e2e02e2f41b48c2109 Mon Sep 17 00:00:00 2001 From: Sam James Date: Wed, 24 Nov 2021 19:42:01 +0000 Subject: [PATCH] meson: fallback to libcrypt detection outside of pkg-config Much like PAM, not all implementations of libcrypt provide a pkg-config file, and hence we can't find it using the old logic. Let's fall back to the standard AC_SEARCH_LIBS-style check if the pkg-config-style detection fails. This fixes finding e.g. musl's libcrypt. X-Gentoo-Bug: 827074 X-Gentoo-Bug-URL: https://bugs.gentoo.org/827074 --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fe0e04ef..4cc9232c 100644 --- a/meson.build +++ b/meson.build @@ -108,7 +108,10 @@ if selinux_dep.found() error('Pam was requested but could not be located') endif else - crypt_dep = dependency('libcrypt', required : not get_option('pam')) + crypt_dep = dependency('libcrypt', required : false) + if not crypt_dep.found() + crypt_dep = cc.find_library('crypt', required : true) + endif endif else cc_selinux_flags = []