]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
meson: Add build-dmesg option
authorJordan Williams <jordan@jwillikers.com>
Wed, 17 Apr 2024 16:13:59 +0000 (11:13 -0500)
committerJordan Williams <jordan@jwillikers.com>
Thu, 18 Apr 2024 13:25:03 +0000 (08:25 -0500)
Require the sys/klog.h header to exist in order to enable the feature.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
meson.build
meson_options.txt

index 19f11c6d430811a30db7576e6f7d2bac885d0167..be620758fa07ab7d3385f41b4d69a352e079e8f3 100644 (file)
@@ -1535,16 +1535,18 @@ if opt and not is_disabler(exe)
   exes += exe
   manadocs += ['sys-utils/fstrim.8.adoc']
   bashcompletions += ['fstrim']
-endif  
+endif
 
+opt = get_option('build-dmesg').require(cc.has_header('sys/klog.h')).allowed()
 exe = executable(
   'dmesg',
   dmesg_sources,
   include_directories : includes,
   link_with : [lib_common,
                lib_tcolors],
-  install : true)
-if not is_disabler(exe)
+  install : opt,
+  build_by_default : opt)
+if opt and not is_disabler(exe)
   exes += exe
   manadocs += ['sys-utils/dmesg.1.adoc']
   bashcompletions += ['dmesg']
index 332f2b7ca63990f4bb4eb267718ec8bcfc187cf7..ca76530a93e1d93b792aa8dff4626bd241e7b08b 100644 (file)
@@ -139,6 +139,8 @@ option('build-tunelp', type : 'feature',
        description : 'build tunelp')
 option('build-fstrim', type : 'feature',
        description : 'build fstrim')
+option('build-dmesg', type : 'feature',
+       description : 'build dmesg')
 option('build-kill', type : 'feature',
        description : 'build kill')
 option('build-last', type : 'feature',