From 8d39823eeb8c3fb25c7907259a7cd7fe88bc9df4 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Wed, 4 Dec 2024 02:03:07 -0600 Subject: [PATCH] meson: Let openssl option follow same logic as compression Keep the logic similar for all libraries. While at it, add a comment divider for the config output. Signed-off-by: Lucas De Marchi Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/262 --- meson.build | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 7a70996f..25029d6c 100644 --- a/meson.build +++ b/meson.build @@ -316,14 +316,22 @@ endforeach # Signed modules #------------------------------------------------------------------------------- -crypto = dependency('libcrypto', version : '>= 1.1.0', required : get_option('openssl')) -if crypto.found() +opt = 'openssl' +dep = dependency('libcrypto', version : '>= 1.1.0', required : get_option(opt)) +have = dep.found() + +if have module_signatures = 'PKCS7 legacy' else module_signatures = 'legacy' endif -cdata.set10('ENABLE_OPENSSL', crypto.found()) -features += ['@0@LIBCRYPTO'.format(crypto.found() ? '+' : '-')] +cdata.set10('ENABLE_' + opt.to_upper(), have) +features += ['@0@@1@'.format(have ? '+' : '-', opt.to_upper())] +dep_map += {opt : dep} + +#------------------------------------------------------------------------------- +# Config output +#------------------------------------------------------------------------------- cdata.set_quoted('KMOD_FEATURES', ' '.join(features)) @@ -389,8 +397,8 @@ if dep_map.get('zlib').found() libkmod_deps += dep_map['zlib'] endif -if crypto.found() - libkmod_deps += crypto +if dep_map.get('openssl').found() + libkmod_deps += dep_map['openssl'] endif install_headers('libkmod/libkmod.h') -- 2.47.2