]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
meson: Let openssl option follow same logic as compression
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 4 Dec 2024 08:03:07 +0000 (02:03 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 6 Dec 2024 21:06:42 +0000 (13:06 -0800)
Keep the logic similar for all libraries. While at it, add a comment
divider for the config output.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/262
meson.build

index 7a70996f7c45539e2acfb07f67f7d3d9245cd3c0..25029d6c93f032527e322064a5c6338782941c09 100644 (file)
@@ -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')