aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Williams <jordan@jwillikers.com>2024-04-17 11:13:59 -0500
committerJordan Williams <jordan@jwillikers.com>2024-04-18 08:25:03 -0500
commit73f3e2ad6e00c93e9a0c7ed8bdb4eb63ac5ebdad (patch)
treef6d3a55ce3e1c643aedac1ae88be226dc3d16912
parenta6d12b403eec9f3fddc0fa82325dac04826c4b48 (diff)
downloadutil-linux-73f3e2ad6e00c93e9a0c7ed8bdb4eb63ac5ebdad.tar.gz
meson: Add build-dmesg option
Require the sys/klog.h header to exist in order to enable the feature. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
-rw-r--r--meson.build8
-rw-r--r--meson_options.txt2
2 files changed, 7 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index 19f11c6d43..be620758fa 100644
--- a/meson.build
+++ b/meson.build
@@ -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']
diff --git a/meson_options.txt b/meson_options.txt
index 332f2b7ca6..ca76530a93 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -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',