From 75637b8813f593225fa69b4f963c9bfd16daefc9 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Mon, 22 Apr 2024 08:57:40 -0500 Subject: [PATCH] meson: Add build-ldattach option Signed-off-by: Jordan Williams --- meson.build | 12 ++++++++---- meson_options.txt | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 5fb7e8a0f..aa4ed8b81 100644 --- a/meson.build +++ b/meson.build @@ -1636,16 +1636,20 @@ if opt and not is_disabler(exe) manadocs += ['sys-utils/blkpr.8.adoc'] endif +opt = get_option('build-ldattach').require(cc.has_header('linux/if.h')).allowed() exe = executable( 'ldattach', ldattach_sources, include_directories : includes, link_with : [lib_common], install_dir : usrsbin_exec_dir, - install : true) -exes += exe -manadocs += ['sys-utils/ldattach.8.adoc'] -bashcompletions += ['ldattach'] + install : opt, + build_by_default : opt) +if opt and not is_disabler(exe) + exes += exe + manadocs += ['sys-utils/ldattach.8.adoc'] + bashcompletions += ['ldattach'] +endif exe = executable( 'rtcwake', diff --git a/meson_options.txt b/meson_options.txt index f14c93522..8a11cd8e1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -149,6 +149,8 @@ option('build-blkzone', type : 'feature', description : 'build blkzone') option('build-blkpr', type : 'feature', description : 'build blkpr') +option('build-ldattach', type : 'feature', + description : 'build ldattach') option('build-kill', type : 'feature', description : 'build kill') option('build-last', type : 'feature', -- 2.47.3