mirror of
https://github.com/postgres/postgres.git
synced 2025-05-06 19:59:18 +03:00
meson: Fix linking using old OpenSSL lib names
Before OpenSSL 1.1.0 the legacy names ssleay32 and libeay32 were still used on Windows, and while we have support for this auto- conf the meson buildsystem only used the new names on all plat- forms. This adds support for the old name scheme when building on Windows. This patch only applies to 17 and 16 as master no longer support OpenSSL 1.0.2. Author: Darek Ślusarczyk <dslusarczyk@splunk.com> Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/CAN55FZ1Nk8wqY=mTrN78H026TuGV50h2H6uq1PwxhTauPYi3ug@mail.gmail.com Backpatch-through: 16
This commit is contained in:
parent
9af2b34358
commit
0951d4ee42
31
meson.build
31
meson.build
@ -1333,14 +1333,37 @@ if sslopt in ['auto', 'openssl']
|
|||||||
|
|
||||||
# via library + headers
|
# via library + headers
|
||||||
if not ssl.found()
|
if not ssl.found()
|
||||||
|
is_windows = host_system == 'windows'
|
||||||
|
|
||||||
|
ssl_lib_common_params = {
|
||||||
|
'dirs': test_lib_d,
|
||||||
|
'header_include_directories': postgres_inc,
|
||||||
|
'has_headers': ['openssl/ssl.h', 'openssl/err.h'],
|
||||||
|
}
|
||||||
ssl_lib = cc.find_library('ssl',
|
ssl_lib = cc.find_library('ssl',
|
||||||
dirs: test_lib_d,
|
kwargs: ssl_lib_common_params,
|
||||||
header_include_directories: postgres_inc,
|
required: openssl_required and not is_windows
|
||||||
has_headers: ['openssl/ssl.h', 'openssl/err.h'],
|
)
|
||||||
required: openssl_required)
|
# Before OpenSSL 1.1.0, there was a different naming convention for
|
||||||
|
# libraries on Windows, so try the alternative name if ssl wasn't found
|
||||||
|
if not ssl_lib.found() and is_windows
|
||||||
|
ssl_lib = cc.find_library('ssleay32',
|
||||||
|
kwargs: ssl_lib_common_params,
|
||||||
|
required: openssl_required
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
crypto_lib = cc.find_library('crypto',
|
crypto_lib = cc.find_library('crypto',
|
||||||
|
dirs: test_lib_d,
|
||||||
|
required: openssl_required and not is_windows)
|
||||||
|
# Before OpenSSL 1.1.0, there was a different naming convention for
|
||||||
|
# libraries on Windows, so try the alternatve name if crypto wasn't found
|
||||||
|
if not crypto_lib.found() and is_windows
|
||||||
|
crypto_lib = cc.find_library('libeay32',
|
||||||
dirs: test_lib_d,
|
dirs: test_lib_d,
|
||||||
required: openssl_required)
|
required: openssl_required)
|
||||||
|
endif
|
||||||
|
|
||||||
if ssl_lib.found() and crypto_lib.found()
|
if ssl_lib.found() and crypto_lib.found()
|
||||||
ssl_int = [ssl_lib, crypto_lib]
|
ssl_int = [ssl_lib, crypto_lib]
|
||||||
ssl = declare_dependency(dependencies: ssl_int, include_directories: postgres_inc)
|
ssl = declare_dependency(dependencies: ssl_int, include_directories: postgres_inc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user