add support for the old naming libs convention on windows (ssleay32.lib and libeay32.lib)

From: Darek Ślusarczyk <dslusarczyk(at)splunk(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: add support for the old naming libs convention on windows (ssleay32.lib and libeay32.lib)
Date: 2024-12-02 21:12:01
Message-ID: CAHrt6656W9OnFomQTHBGYDcM5CKZ7hcgzFt8L+N0ezBZfcN3zA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Summary of Changes:

According to the postgresql-17 requirements
https://www.postgresql.org/docs/17/install-requirements.html
the minimum required version of openssl is 1.0.2.
In that version, the naming convention on windows is still
ssleay32.[lib|dll] and
libeay32.[lib|dll] instead of libssl.[lib|dll] and libcrypto.[lib|dll].
It changed in version 1.1.0
https://github.com/openssl/openssl/issues/10332#issuecomment-549027653
Thus there is a bug in meson.build as it only supports libssl.lib and
libcrypto.lib,
hence a simple patch that fixes the issue and supports both conventions.

I also submitted a pull request on GitHub, which can be found here:
https://github.com/postgres/postgres/pull/188
There are two simple changes in the meson.build file.

Reason for Changes:

Add support for the old naming libs convention on windows (ssleay32.lib and
libeay32.lib).

Testing:

The patch has been tested against postgres-17 and openssl v1.0.2 in our
environment on various platforms (lnx, win, ...)

Patch:

diff --git a/meson.build b/meson.build
index 451c3f6d85..50fa6d865b 100644
--- a/meson.build
+++ b/meson.build
@@ -1337,12 +1337,12 @@ if sslopt in ['auto', 'openssl']

# via library + headers
if not ssl.found()
- ssl_lib = cc.find_library('ssl',
+ ssl_lib = cc.find_library(['ssl', 'ssleay32'],
dirs: test_lib_d,
header_include_directories: postgres_inc,
has_headers: ['openssl/ssl.h', 'openssl/err.h'],
required: openssl_required)
- crypto_lib = cc.find_library('crypto',
+ crypto_lib = cc.find_library(['crypto', 'libeay32'],
dirs: test_lib_d,
required: openssl_required)
if ssl_lib.found() and crypto_lib.found()

kind regards,
ds
--
marines() {
return Darek_Slusarczyk;
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2024-12-02 21:16:19 Re: Incorrect result of bitmap heap scan.
Previous Message Robert Haas 2024-12-02 21:10:22 code contributions for 2024, WIP version