util-linux: use meson to build

Compiles faster, is PIC by default, and does not have pkgconfig files
with wrong paths.

Add various fixes to it as it seems cross compilation was never tested.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2022-04-29 18:41:45 -07:00
committed by Christian Lamparter
parent d93aae1d67
commit 28cec43807
16 changed files with 384 additions and 51 deletions

View File

@@ -0,0 +1,18 @@
--- a/meson.build
+++ b/meson.build
@@ -299,10 +299,14 @@ conf.set('HAVE_LIBUDEV', lib_udev.found(
lib_crypt = cc.find_library('crypt')
-lib_pam = cc.find_library('pam')
+req_libpam = not (get_option('build-login').disabled() or get_option('build-chfn-chsh').disabled()
+ or get_option('build-su').disabled() or get_option('build-runuser').disabled())
+lib_pam = cc.find_library('pam', required : req_libpam)
if lib_pam.found()
lib_pam_misc = cc.find_library('pam_misc')
lib_pam = [lib_pam, lib_pam_misc]
+else
+ lib_pam_misc = declare_dependency()
endif
lib_cryptsetup = dependency(