aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2024-04-22 09:42:25 -0500
committerJordan Williams <jordan@jwillikers.com>2024-04-24 15:30:30 -0500
commit3e6d539e6e283927639c02792c968848f6c7dc71 (patch)
treef556c2e6f3505daa18adee0524833e384c1e1315
parenta2c940f44b2a54deedfc21cc7fd91625dcbacf1a (diff)
downloadutil-linux-3e6d539e6e283927639c02792c968848f6c7dc71.tar.gz
meson: Add build-blockdev option
Only build blockdev on Linux. The BLKROSET macro is used in blockdev.c from blkdev.h. The blkdev.h header only defines this macro when it is missing on Linux. Add blockdev to the list of executables, which appears to have been omitted previously. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
-rw-r--r--meson.build11
-rw-r--r--meson_options.txt2
2 files changed, 10 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 0c29d7c635..8a73248320 100644
--- a/meson.build
+++ b/meson.build
@@ -2314,15 +2314,20 @@ if opt and not is_disabler(exe)
bashcompletions += ['fdformat']
endif
+opt = get_option('build-blockdev').require(LINUX).allowed()
exe = executable(
'blockdev',
blockdev_sources,
include_directories : includes,
link_with : [lib_common],
install_dir : sbindir,
- install : true)
-manadocs += ['disk-utils/blockdev.8.adoc']
-bashcompletions += ['blockdev']
+ install : opt,
+ build_by_default : opt)
+if opt and not is_disabler(exe)
+ exes += exe
+ manadocs += ['disk-utils/blockdev.8.adoc']
+ bashcompletions += ['blockdev']
+endif
opt = not get_option('build-fdisks').disabled()
if opt and not have_dirfd and not have_ddfd
diff --git a/meson_options.txt b/meson_options.txt
index ed4001d44e..39ff026cee 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -99,6 +99,8 @@ option('build-minix', type : 'feature',
description : 'build fsck.minix, mkfs.minix')
option('build-fdformat', type : 'feature', value : 'disabled',
description : 'build fdformat')
+option('build-blockdev', type : 'feature',
+ description : 'build blockdev')
option('build-hwclock', type : 'feature',
description : 'build hwclock')
option('build-lslogins', type : 'feature',