From 4864ced5614f5954f5bcab95e897da9b6824d931 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Aug 2022 14:26:24 +0200 Subject: Adding upstream version 1.1. Signed-off-by: Daniel Baumann --- meson.build | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index f64bd7a..bd13fe9 100644 --- a/meson.build +++ b/meson.build @@ -68,14 +68,30 @@ openssl_dep = dependency('openssl', required: get_option('openssl'), fallback : ['openssl', 'libssl_dep']) if openssl_dep.found() - conf.set('CONFIG_OPENSSL', true, description: 'Is OpenSSL available?') - conf.set('CONFIG_OPENSSL_1', - openssl_dep.version().version_compare('<2.0.0') and - openssl_dep.version().version_compare('>=1.1.0'), - description: 'OpenSSL version 1.x') - conf.set('CONFIG_OPENSSL_3', - openssl_dep.version().version_compare('>=3.0.0'), - description: 'OpenSSL version 3.x') + conf.set('CONFIG_OPENSSL', true, + description: 'Is OpenSSL/LibreSSL available?') + + if openssl_dep.version().version_compare('<2.0.0') + api_version = 1 + endif + + if openssl_dep.version().version_compare('>=3.0.0') + api_version = 3 + + # Test for LibreSSL v3.x with incomplete OpenSSL v3 APIs + is_libressl = cc.has_header_symbol('openssl/opensslv.h', + 'LIBRESSL_VERSION_NUMBER', + dependencies: openssl_dep) + has_header = cc.has_header('openssl/core_names.h', + dependencies: openssl_dep) + if is_libressl and not has_header + api_version = 1 + endif + + endif + + conf.set('CONFIG_OPENSSL_@0@'.format(api_version), true, + description: 'OpenSSL/LibreSSL API version @0@'.format(api_version)) endif # Check for libsystemd availability. Optional, only required for MCTP dbus scan -- cgit v1.2.3