From: Jordan Williams Date: Wed, 20 Mar 2024 16:41:49 +0000 (-0500) Subject: meson: Only build blkzone and blkpr if the required linux header exists X-Git-Tag: v2.40~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8beae411393d565778a80d3513be8b68bf5967fa;p=thirdparty%2Futil-linux.git meson: Only build blkzone and blkpr if the required linux header exists Checks for the required headers for blkzone and blkptr are done for Autotools. This logic wasn't carried over to Meson. This PR just adds the same checks. Fixes #2850. Signed-off-by: Jordan Williams (cherry picked from commit 1a374511693e4b2e8e53966615ce9112553d3b08) --- diff --git a/meson.build b/meson.build index b6efc4220..a7b8e1d25 100644 --- a/meson.build +++ b/meson.build @@ -1556,26 +1556,30 @@ exes += exe manadocs += ['sys-utils/blkdiscard.8.adoc'] bashcompletions += ['blkdiscard'] -exe = executable( - 'blkzone', - blkzone_sources, - include_directories : includes, - link_with : [lib_common], - install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/blkzone.8.adoc'] -bashcompletions += ['blkzone'] +if cc.has_header('linux/blkzoned.h') + exe = executable( + 'blkzone', + blkzone_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : sbindir, + install : true) + exes += exe + manadocs += ['sys-utils/blkzone.8.adoc'] + bashcompletions += ['blkzone'] +endif -exe = executable( - 'blkpr', - blkpr_sources, - include_directories : includes, - link_with : [lib_common], - install_dir : sbindir, - install : true) -exes += exe -manadocs += ['sys-utils/blkpr.8.adoc'] +if cc.has_header('linux/pr.h') + exe = executable( + 'blkpr', + blkpr_sources, + include_directories : includes, + link_with : [lib_common], + install_dir : sbindir, + install : true) + exes += exe + manadocs += ['sys-utils/blkpr.8.adoc'] +endif exe = executable( 'ldattach',