]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: fix build with -Dselinux=enabled
authorChris Hofstaedtler <zeha@debian.org>
Sun, 18 Dec 2022 18:55:01 +0000 (18:55 +0000)
committerChris Hofstaedtler <zeha@debian.org>
Sun, 18 Dec 2022 22:40:44 +0000 (23:40 +0100)
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
disk-utils/meson.build
lib/meson.build
libmount/meson.build
login-utils/meson.build
meson.build

index c1419e66dc393d5931ead39fe6403e4bfdc5b822..2bf3558346ab38509092c9f9b0cfd2bb0f745b8e 100644 (file)
@@ -14,6 +14,9 @@ mkswap_sources = files(
   'mkswap.c',
 ) + \
   ismounted_c
+if lib_selinux.found()
+  mkswap_sources += selinux_utils_c
+endif
 
 swaplabel_sources = files(
   'swaplabel.c',
index 6d08dfe4ab6ef2a48b51d9f3f4f1a54544fb79b5..57833aa7480e5a08689af13178ec63ebb15b771f 100644 (file)
@@ -57,6 +57,7 @@ logindefs_c = static_library('logindefs',
   include_directories : dir_include,
   dependencies : lib_econf,
 )
+selinux_utils_c = files('selinux-utils.c')
 
 if LINUX
   lib_common_sources += '''
index 6f2bba6aceef3df67bf46c7d36bde40c9f9d3c9a..d454e9f9a269ed9ed579385ff9f3e32fd42befc8 100644 (file)
@@ -72,6 +72,11 @@ lib_mount_static = static_library(
   dependencies : [realtime_libs],
   install : false)
 
+lib__mount_deps = [
+  lib_selinux,
+  get_option('cryptsetup-dlopen').enabled() ? lib_dl : lib_cryptsetup,
+  realtime_libs
+]
 lib_mount = library(
   'mount',
   link_whole : lib__mount,
@@ -83,9 +88,7 @@ lib_mount = library(
   link_args : ['-Wl,--version-script=@0@'.format(libmount_sym_path)],
   link_with : [lib_common,
                lib_blkid],
-  dependencies : [lib_selinux,
-                  get_option('cryptsetup-dlopen').enabled() ? lib_dl : lib_cryptsetup,
-                  realtime_libs],
+  dependencies : lib__mount_deps,
   install : build_libmount)
 mount_dep = declare_dependency(link_with: lib_mount, include_directories: '.')
 
@@ -124,7 +127,7 @@ foreach libmount_test: libmount_tests
     'src/' + libmount_test_src_override.get(libmount_test, libmount_test) + '.c',
     include_directories : [dir_include, dir_libblkid],
     link_with : [lib__mount, lib_common, lib_blkid_static],
-    dependencies : [lib_cryptsetup],
+    dependencies : lib__mount_deps,
     c_args : ['-DTEST_PROGRAM'],
   )
   # the test-setup expects the helpers in the toplevel build-directory
index 647f568cd331383d9f92d05c89ec9be76002483f..14d7b39efec00ce20aede7bb1b0d097b9c2ced09 100644 (file)
@@ -31,10 +31,7 @@ else
 endif
 
 if lib_selinux.found()
-  chfn_chsh_sources += files(
-    'selinux_utils.c',
-    'selinux_utils.h',
-  )
+  chfn_chsh_sources += selinux_utils_c
   chfn_chsh_deps += [lib_selinux]
 endif
 
index 38e59bd9ae288ec7bcbf42caa9c315d17063dc78..ac385e8b25a73ad96e68e9889a7524f75cc4e829 100644 (file)
@@ -2449,6 +2449,7 @@ exe = executable(
   'namei',
   namei_sources,
   include_directories : includes,
+  dependencies : [lib_selinux],
   install_dir : usrbin_exec_dir,
   install : true)
 exes += exe