aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2024-04-24 15:30:26 -0500
committerJordan Williams <jordan@jwillikers.com>2024-04-24 15:30:26 -0500
commit9c4ef6f71169c48cee60523d851ff0b453a1d52f (patch)
tree16054b3f7ec3b4d047b95a18145242ba1e0c05a0
parent6549a90cb9d3f6c0a4a3fc7e87536b5e4690517a (diff)
downloadutil-linux-9c4ef6f71169c48cee60523d851ff0b453a1d52f.tar.gz
meson: Add build-blkdiscard option
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
-rw-r--r--meson.build18
-rw-r--r--meson_options.txt2
2 files changed, 14 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index 466689fd87..5fb7e8a0ff 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 b057d8426d..f14c935222 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',