]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Add build-blockdev option
authorJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 14:42:25 +0000 (09:42 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 25 Apr 2024 12:30:55 +0000 (07:30 -0500)
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>
(cherry picked from commit 3e6d539e6e283927639c02792c968848f6c7dc71)

meson.build
meson_options.txt

index 95c71eb7ad30b5767a50e11476482c1a4f096e16..d8ff27a0740fb410f3c612431388a0bbb7e01152 100644 (file)
@@ -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
index b60e46a00ae9b1d9568c611d1deaff55ef288c06..ef186db4766886224701280ca51311f1718c4f24 100644 (file)
@@ -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',