]> 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>
Mon, 22 Apr 2024 11:34:46 +0000 (06:34 -0500)
Require the sys/klog.h header to exist in order to enable the feature.

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
(cherry picked from commit 73f3e2ad6e00c93e9a0c7ed8bdb4eb63ac5ebdad)

meson.build
meson_options.txt

index 8d92e58b49d17aa96a3b3a904bf98a7cfa210b92..8213d3e21f38a2625fc25f95cab1f8beea697675 100644 (file)
@@ -1524,16 +1524,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 6e2f9456e7c248149cde6dec557face1d563178c..500c3bfba2af0dd873a9dd7f7e67e0adbea277b9 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',