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
This commit is contained in:
Sam James 2021-11-24 19:42:01 +00:00 committed by William Hubbs
parent b94517376e
commit 2ba16135cb

View File

@ -108,7 +108,10 @@ if selinux_dep.found()
error('Pam was requested but could not be located') error('Pam was requested but could not be located')
endif endif
else 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 endif
else else
cc_selinux_flags = [] cc_selinux_flags = []