summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-15 12:26:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-15 12:26:29 +0000
commit33b8fe1a294d670d67a2e9802ca0c753826b1562 (patch)
treec7909b9865f0ee1b4f517d16283a0420ce08566b /meson.build
parentReleasing debian version 1.1~rc0-1. (diff)
downloadlibnvme-33b8fe1a294d670d67a2e9802ca0c753826b1562.tar.xz
libnvme-33b8fe1a294d670d67a2e9802ca0c753826b1562.zip
Merging upstream version 1.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build32
1 files changed, 24 insertions, 8 deletions
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