From: Jordan Williams Date: Mon, 22 Apr 2024 14:42:25 +0000 (-0500) Subject: meson: Add build-blockdev option X-Git-Tag: v2.42-start~379^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e6d539e6e283927639c02792c968848f6c7dc71;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 --- diff --git a/meson.build b/meson.build index 0c29d7c63..8a7324832 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 ed4001d44..39ff026ce 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',