]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix build of MSVC with OpenSSL 3.0.0
authorMichael Paquier <michael@paquier.xyz>
Wed, 20 Oct 2021 07:49:10 +0000 (16:49 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 20 Oct 2021 07:49:10 +0000 (16:49 +0900)
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

index 711db815d8f8d089afea810ea179385f9cbb84b1..374931047c4b2748d57107dbcac9197acb447680 100644 (file)
@@ -256,7 +256,8 @@ s{PG_VERSION_STR "[^"]+"}{PG_VERSION_STR "PostgreSQL $self->{strver}$extraver, c
                        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";
@@ -578,7 +579,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;