From: Jordan Williams Date: Fri, 5 Apr 2024 15:33:22 +0000 (-0700) Subject: meson: Use libmount as a dependency X-Git-Tag: v2.40.1-rc1~32^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4895394ba6dec446dd222933c9b7933581ae23eb;p=thirdparty%2Futil-linux.git meson: Use libmount as a dependency Several utilities depend on libmount internally. Currently, link_with and global include directories are used to associate targets with libmount. This PR uses Meson's dependencies argument for targets to define this relationship instead. This carries include directories along with the library to link. An additional dependency is declared for the static libmount library. A couple of executables use this dependency explicitly. Signed-off-by: Jordan Williams (cherry picked from commit c43b185a3feb8cd7261c94f42a566486ce2c0438) --- diff --git a/libmount/meson.build b/libmount/meson.build index d1262e7f0..ea363a0d5 100644 --- a/libmount/meson.build +++ b/libmount/meson.build @@ -80,6 +80,7 @@ lib_mount_static = static_library( lib_blkid.get_static_lib()], dependencies : [realtime_libs], install : false) +mount_static_dep = declare_dependency(link_with: lib_mount_static, include_directories: '.') lib__mount_deps = [ lib_selinux, diff --git a/libmount/python/meson.build b/libmount/python/meson.build index e1a79d187..702ca8f37 100644 --- a/libmount/python/meson.build +++ b/libmount/python/meson.build @@ -21,10 +21,9 @@ if build_python python.extension_module( 'pylibmount', pylibmount_sources, - include_directories : [dir_include, dir_libmount], + include_directories : [dir_include], subdir : 'libmount', - link_with : lib_mount, - dependencies : python.dependency(), + dependencies : [mount_dep, python.dependency()], c_args : [ '-Wno-cast-function-type', diff --git a/meson.build b/meson.build index bd8d0e394..d2c0d3d6b 100644 --- a/meson.build +++ b/meson.build @@ -971,7 +971,6 @@ subdir('po') includes = [dir_include, dir_libblkid, dir_libsmartcols, - dir_libmount, dir_libfdisk, dir_libuuid, dir_liblastlog2, @@ -1498,8 +1497,8 @@ exe = executable( 'fstrim', fstrim_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1649,8 +1648,8 @@ exe = executable( 'eject', eject_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -1726,8 +1725,8 @@ exe = executable( lsns_sources, include_directories : includes, link_with : [lib_common, - lib_smartcols, - lib_mount], + lib_smartcols], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -1742,9 +1741,8 @@ exe = executable( mount_sources, include_directories : includes, link_with : [lib_common, - lib_smartcols, - lib_mount], - dependencies : lib_selinux, + lib_smartcols], + dependencies : [lib_selinux, mount_dep], install_mode : 'rwsr-xr-x', install : opt, build_by_default : opt) @@ -1752,8 +1750,8 @@ exe2 = executable( 'umount', umount_sources, include_directories : includes, - link_with : [lib_common, - lib_mount], + link_with : [lib_common], + dependencies : [mount_dep], install_mode : 'rwsr-xr-x', install : opt, build_by_default : opt) @@ -1772,8 +1770,8 @@ exe = executable( include_directories : includes, link_args : ['--static'], link_with : [lib_common, - lib_smartcols_static, - lib_mount_static], + lib_smartcols_static], + dependencies : [mount_static_dep], install : opt2, build_by_default : opt2) if opt2 and not is_disabler(exe) @@ -1786,8 +1784,8 @@ exe = executable( umount_sources, include_directories : includes, link_args : ['--static'], - link_with : [lib_common, - lib_mount_static], + link_with : [lib_common], + dependencies : [mount_static_dep], install : opt2, build_by_default : opt2) if opt2 and not is_disabler(exe) @@ -1802,8 +1800,8 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_smartcols], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1817,8 +1815,8 @@ exe = executable( swapoff_sources, include_directories : includes, link_with : [lib_common, - lib_blkid, - lib_mount], + lib_blkid], + dependencies : [mount_dep], install_dir : sbindir, install : true) if not is_disabler(exe) @@ -1871,7 +1869,7 @@ exe = executable( 'mountpoint', mountpoint_sources, include_directories : includes, - link_with : [lib_mount], + dependencies : [mount_dep], install : opt, build_by_default : opt) if opt and not is_disabler(exe) @@ -1931,6 +1929,7 @@ exe = executable( unshare_sources, include_directories : includes, link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -1946,6 +1945,7 @@ exe = executable( unshare_sources, include_directories : includes, link_with : [lib_common], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : opt, build_by_default : opt) @@ -2151,9 +2151,8 @@ exe = executable( fsck_sources, include_directories : includes, link_with : [lib_common, - lib_blkid, - lib_mount], - dependencies : realtime_libs, + lib_blkid], + dependencies : [realtime_libs, mount_dep], install_dir : sbindir, install : opt, build_by_default : opt) @@ -2340,9 +2339,8 @@ exe = executable( link_with : [lib_common, lib_fdisk, lib_smartcols, - lib_tcolors, - lib_mount], - dependencies : [curses_libs], + lib_tcolors], + dependencies : [curses_libs, mount_dep], install_dir : sbindir, install : opt, build_by_default : opt) @@ -2683,8 +2681,8 @@ exe = executable( lslocks_sources, include_directories : includes, link_with : [lib_common, - lib_mount, lib_smartcols], + dependencies : [mount_dep], install_dir : usrbin_exec_dir, install : true) if not is_disabler(exe) @@ -2699,10 +2697,9 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_tcolors, lib_smartcols], - dependencies : lib_udev, + dependencies : [lib_udev, mount_dep], install : true) if not is_disabler(exe) exes += exe @@ -2896,9 +2893,8 @@ exe = executable( include_directories : includes, link_with : [lib_common, lib_blkid, - lib_mount, lib_smartcols], - dependencies : [lib_udev], + dependencies : [lib_udev, mount_dep], install : true) if not is_disabler(exe) exes += exe