]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Add build-blkpr option
authorJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 13:46:55 +0000 (08:46 -0500)
committerJordan Williams <jordan@jwillikers.com>
Mon, 22 Apr 2024 13:46:55 +0000 (08:46 -0500)
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build
meson_options.txt

index 5b4f59b8c3893eb078996145b03ef3a512bd2d58..fb895a8d923522b8da542dc042e86c7437e35610 100644 (file)
@@ -1610,14 +1610,16 @@ if cc.has_header('linux/blkzoned.h')
   bashcompletions += ['blkzone']
 endif
 
-if cc.has_header('linux/pr.h')
-  exe = executable(
-    'blkpr',
-    blkpr_sources,
-    include_directories : includes,
-    link_with : [lib_common],
-    install_dir : sbindir,
-    install : true)
+opt = get_option('build-blkpr').require(cc.has_header('linux/pr.h')).allowed()
+exe = executable(
+  'blkpr',
+  blkpr_sources,
+  include_directories : includes,
+  link_with : [lib_common],
+  install_dir : sbindir,
+  install : opt,
+  build_by_default : opt)
+if opt and not is_disabler(exe)
   exes += exe
   manadocs += ['sys-utils/blkpr.8.adoc']
 endif
index ca76530a93e1d93b792aa8dff4626bd241e7b08b..2de75784f9f670edbb8ef72483a1025ab5e2ec74 100644 (file)
@@ -141,6 +141,8 @@ option('build-fstrim', type : 'feature',
        description : 'build fstrim')
 option('build-dmesg', type : 'feature',
        description : 'build dmesg')
+option('build-blkpr', type : 'feature',
+       description : 'build blkpr')
 option('build-kill', type : 'feature',
        description : 'build kill')
 option('build-last', type : 'feature',