]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/meson: move caputils.c from lib_common to per-binary sources
authorKarel Zak <kzak@redhat.com>
Mon, 9 Mar 2026 10:03:54 +0000 (11:03 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 9 Mar 2026 10:03:54 +0000 (11:03 +0100)
caputils.c is GPL-licensed, and libcommon should only contain LGPL
or public domain code (as stated in lib/Makemodule.am). Move it out
of lib_common_sources and add it directly to the sources of binaries
that use it (unshare, nsenter, setpriv), matching autotools.

Addresses: https://github.com/util-linux/util-linux/issues/4085
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/meson.build
sys-utils/meson.build

index f7ba093e3c39b47ad972027545f816954be5ae29..35c6b2ca157faa334c61e1d0531e20d7a606e17d 100644 (file)
@@ -58,9 +58,10 @@ logindefs_c = static_library('logindefs',
 )
 selinux_utils_c = files('selinux-utils.c')
 
+caputils_c = files('caputils.c')
+
 if LINUX
   lib_common_sources += '''
-    caputils.c
     linux_version.c
     loopdev.c
 '''.split()
index d9817f922cab62bf7912a80bb2f4bd1a93b1d4e7..1614220cafcbcb43f990a516aeef70c15af734ef 100644 (file)
@@ -221,18 +221,21 @@ switch_root_manadocs = files('switch_root.8.adoc')
 unshare_sources = files(
   'unshare.c',
 ) + \
+    caputils_c + \
     exec_shell_c
 unshare_manadocs = files('unshare.1.adoc')
 
 nsenter_sources = files(
   'nsenter.c',
 ) + \
+    caputils_c + \
     exec_shell_c
 nsenter_manadocs = files('nsenter.1.adoc')
 
 setpriv_sources = files(
   'setpriv.c',
-)
+) + \
+    caputils_c
 if LINUX and conf.get('HAVE_LINUX_LANDLOCK_H').to_string() == '1'
   setpriv_sources += files('setpriv-landlock.c')
 endif