]> 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>
Wed, 24 Apr 2024 20:30:30 +0000 (15: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>
meson.build
meson_options.txt

index 0c29d7c6357233a94ca845cc07f5382f4563cf35..8a732483203339632ed15579ae60a89b46e7b8ad 100644 (file)
@@ -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
index ed4001d44e3d220e156759025ade968b5c84528f..39ff026ceec352860d7e61a321e0efac9187017e 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',