From d581960dfbeaea27f1c20f31c7133c9a25a326f6 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 20 Oct 2021 16:49:14 +0900 Subject: [PATCH] Fix build of MSVC with OpenSSL 3.0.0 The build scripts of Visual Studio would fail to detect properly a 3.0.0 build as the check on the second digit was failing. This is adjusted where needed, allowing the builds to complete. Note that the MSIs of OpenSSL mentioned in the documentation have not changed any library names for Win32 and Win64, making this change straight-forward. Reported-by: htalaco, via github Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/YW5XKYkq6k7OtrFq@paquier.xyz Backpatch-through: 9.6 --- src/tools/msvc/Solution.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 002546fec9c..1e2afa2fb2b 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -263,7 +263,8 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY my ($digit1, $digit2, $digit3) = $self->GetOpenSSLVersion(); # More symbols are needed with OpenSSL 1.1.0 and above. - if ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0') + if ( ($digit1 >= '3' && $digit2 >= '0' && $digit3 >= '0') + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) { print O "#define HAVE_ASN1_STRING_GET0_DATA 1\n"; print O "#define HAVE_BIO_GET_DATA 1\n"; @@ -575,7 +576,8 @@ sub AddProject # changed their library names from: # - libeay to libcrypto # - ssleay to libssl - if ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0') + if ( ($digit1 >= '3' && $digit2 >= '0' && $digit3 >= '0') + || ($digit1 >= '1' && $digit2 >= '1' && $digit3 >= '0')) { my $dbgsuffix; my $libsslpath; -- 2.30.2