]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Only require the crypt library when necessary
authorJordan Williams <jordan@jwillikers.com>
Fri, 29 Mar 2024 15:31:27 +0000 (10:31 -0500)
committerJordan Williams <jordan@jwillikers.com>
Fri, 29 Mar 2024 15:39:58 +0000 (10:39 -0500)
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 <jordan@jwillikers.com>
meson.build

index 9600ce49f73d69045a9ddc304bb3570aec72a85e..a2e138aeece0daaad14db04354c6379b0e255bd2 100644 (file)
@@ -350,7 +350,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()