From: Jordan Williams Date: Wed, 24 Apr 2024 20:30:26 +0000 (-0500) Subject: meson: Add build-blkdiscard option X-Git-Tag: v2.42-start~379^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c4ef6f71169c48cee60523d851ff0b453a1d52f;p=thirdparty%2Futil-linux.git meson: Add build-blkdiscard option Signed-off-by: Jordan Williams --- diff --git a/meson.build b/meson.build index 466689fd8..5fb7e8a0f 100644 --- a/meson.build +++ b/meson.build @@ -1575,7 +1575,9 @@ exes += exe manadocs += ['sys-utils/ctrlaltdel.8.adoc'] bashcompletions += ['ctrlaltdel'] -opt = get_option('build-fsfreeze').require(conf.get('HAVE_LINUX_FS_H').to_string() == '1').allowed() +have_linux_fs_h = conf.get('HAVE_LINUX_FS_H').to_string() == '1' + +opt = get_option('build-fsfreeze').require(have_linux_fs_h).allowed() exe = executable( 'fsfreeze', fsfreeze_sources, @@ -1589,6 +1591,7 @@ if opt and not is_disabler(exe) bashcompletions += ['fsfreeze'] endif +opt = get_option('build-blkdiscard').require(have_linux_fs_h).allowed() exe = executable( 'blkdiscard', blkdiscard_sources, @@ -1596,12 +1599,15 @@ exe = executable( link_with : [lib_common], dependencies : [blkid_dep], install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/blkdiscard.8.adoc'] -bashcompletions += ['blkdiscard'] + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['sys-utils/blkdiscard.8.adoc'] + bashcompletions += ['blkdiscard'] +endif -opt = get_option('build-blkzone').require(cc.has_header('linux/blkzoned.h')).allowed() +opt = get_option('build-blkzone').require(have_linux_fs_h).allowed() exe = executable( 'blkzone', blkzone_sources, diff --git a/meson_options.txt b/meson_options.txt index b057d8426..f14c93522 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -143,6 +143,8 @@ option('build-dmesg', type : 'feature', description : 'build dmesg') option('build-fsfreeze', type : 'feature', description : 'build fsfreeze') +option('build-blkdiscard', type : 'feature', + description : 'build blkdiscard') option('build-blkzone', type : 'feature', description : 'build blkzone') option('build-blkpr', type : 'feature',