From: Jordan Williams Date: Fri, 29 Mar 2024 15:31:27 +0000 (-0500) Subject: meson: Only require the crypt library when necessary X-Git-Tag: v2.40.1-rc1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=777cd421f2bc56c5d850d3231862225565a0f12e;p=thirdparty%2Futil-linux.git meson: Only require the crypt library when necessary The `crypt` library is only necessary for two executables. These are build-newgrp and build-sulogin. Don't otherwise require this dependency. Signed-off-by: Jordan Williams (cherry picked from commit d0a07e7fb8109e9fdeb5e2c90c019c0cf5f92009) --- diff --git a/meson.build b/meson.build index 77f6dd845..66a90b66f 100644 --- a/meson.build +++ b/meson.build @@ -346,7 +346,10 @@ lib_udev = dependency( required : get_option('systemd')) conf.set('HAVE_LIBUDEV', lib_udev.found() ? 1 : false) -lib_crypt = cc.find_library('crypt') +lib_crypt = cc.find_library('crypt', required : get_option('build-newgrp')) +if not lib_crypt.found() + lib_crypt = cc.find_library('crypt', required : get_option('build-sulogin')) +endif lib_pam = cc.find_library('pam', required : get_option('build-login')) if not lib_pam.found()