From: Jordan Williams Date: Mon, 22 Apr 2024 14:42:25 +0000 (-0500) Subject: meson: Add build-blockdev option X-Git-Tag: v2.40.1-rc1~9^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fe43153b66c0d692dd2d829df7b12c9bb712dea;p=thirdparty%2Futil-linux.git 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 (cherry picked from commit 3e6d539e6e283927639c02792c968848f6c7dc71) --- diff --git a/meson.build b/meson.build index 95c71eb7a..d8ff27a07 100644 --- a/meson.build +++ b/meson.build @@ -2303,15 +2303,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 b60e46a00..ef186db47 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',