From 17c3fb55eaa8feff7c39a326c54d065572af2303 Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Mon, 4 Aug 2025 19:00:57 +0000 Subject: [PATCH] build: fix OpenSSL version detection Fix OpenSSL version detection in `configure.py` when `pkg-config` is used to configure building with a shared OpenSSL library. --- configure.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index c60dc30188af96..b782269e218441 100755 --- a/configure.py +++ b/configure.py @@ -1205,7 +1205,7 @@ def get_gas_version(cc): warn(f'Could not recognize `gas`: {gas_ret}') return '0.0' -def get_openssl_version(): +def get_openssl_version(o): """Parse OpenSSL version from opensslv.h header file. Returns the version as a number matching OPENSSL_VERSION_NUMBER format: @@ -1219,6 +1219,9 @@ def get_openssl_version(): args = ['-I', 'deps/openssl/openssl/include'] + args elif options.shared_openssl_includes: args = ['-I', options.shared_openssl_includes] + args + else: + for dir in o['include_dirs']: + args = ['-I', dir] + args proc = subprocess.Popen( shlex.split(CC) + args, @@ -1887,10 +1890,10 @@ def without_ssl_error(option): if options.quic: o['defines'] += ['NODE_OPENSSL_HAS_QUIC'] - o['variables']['openssl_version'] = get_openssl_version() - configure_library('openssl', o) + o['variables']['openssl_version'] = get_openssl_version(o) + def configure_sqlite(o): o['variables']['node_use_sqlite'] = b(not options.without_sqlite) if options.without_sqlite: