From: Jordan Williams Date: Wed, 24 Apr 2024 20:30:26 +0000 (-0500) Subject: meson: Add build-blkdiscard option X-Git-Tag: v2.40.1-rc1~9^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d9e1bf9aad506ac545c3d90b81e468bdd8173ec;p=thirdparty%2Futil-linux.git meson: Add build-blkdiscard option Signed-off-by: Jordan Williams (cherry picked from commit 9c4ef6f71169c48cee60523d851ff0b453a1d52f) --- diff --git a/meson.build b/meson.build index 60cdc40cd..0fb110893 100644 --- a/meson.build +++ b/meson.build @@ -1564,7 +1564,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, @@ -1578,6 +1580,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, @@ -1585,12 +1588,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 930e96bd3..c91a1cbfd 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',