Skip to content

Commit 2b4a09e

Browse files
authored
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. PR-URL: #59353 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 31aacfa commit 2b4a09e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

configure.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ def get_gas_version(cc):
12051205
warn(f'Could not recognize `gas`: {gas_ret}')
12061206
return '0.0'
12071207

1208-
def get_openssl_version():
1208+
def get_openssl_version(o):
12091209
"""Parse OpenSSL version from opensslv.h header file.
12101210
12111211
Returns the version as a number matching OPENSSL_VERSION_NUMBER format:
@@ -1219,6 +1219,9 @@ def get_openssl_version():
12191219
args = ['-I', 'deps/openssl/openssl/include'] + args
12201220
elif options.shared_openssl_includes:
12211221
args = ['-I', options.shared_openssl_includes] + args
1222+
else:
1223+
for dir in o['include_dirs']:
1224+
args = ['-I', dir] + args
12221225

12231226
proc = subprocess.Popen(
12241227
shlex.split(CC) + args,
@@ -1887,10 +1890,10 @@ def without_ssl_error(option):
18871890
if options.quic:
18881891
o['defines'] += ['NODE_OPENSSL_HAS_QUIC']
18891892

1890-
o['variables']['openssl_version'] = get_openssl_version()
1891-
18921893
configure_library('openssl', o)
18931894

1895+
o['variables']['openssl_version'] = get_openssl_version(o)
1896+
18941897
def configure_sqlite(o):
18951898
o['variables']['node_use_sqlite'] = b(not options.without_sqlite)
18961899
if options.without_sqlite:

0 commit comments

Comments
 (0)