databases/mysql57-client: be ready for OpenSSL 3.0 in base

Fix build by merging another change in ssl.cmake from MySQL 8.0
PORTREVISION not bumped intentionally.

PR:		271656
This commit is contained in:
Eugene Grosbein 2023-06-13 12:12:49 +07:00
parent aaa80b4f53
commit f89fd0980a
No known key found for this signature in database
GPG key ID: C8960FF146564C9A

View file

@ -1,6 +1,6 @@
--- cmake/ssl.cmake.orig 2019-12-06 10:41:47 UTC
+++ cmake/ssl.cmake
@@ -150,22 +150,12 @@ MACRO (MYSQL_CHECK_SSL)
--- cmake/ssl.cmake.orig 2023-03-16 22:25:04.000000000 +0700
+++ cmake/ssl.cmake 2023-06-13 12:11:25.125506000 +0700
@@ -176,24 +176,32 @@ MACRO (MYSQL_CHECK_SSL)
MESSAGE(STATUS "OPENSSL_APPLINK_C ${OPENSSL_APPLINK_C}")
ENDIF()
@ -20,10 +20,38 @@
- IF (WITH_SSL_PATH)
- LIST(REVERSE CMAKE_FIND_LIBRARY_SUFFIXES)
- ENDIF()
-
IF(OPENSSL_INCLUDE_DIR)
+ FOREACH(version_part
+ OPENSSL_VERSION_MAJOR
+ OPENSSL_VERSION_MINOR
+ OPENSSL_VERSION_PATCH
+ )
+ FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" ${version_part}
+ REGEX "^#[\t ]*define[\t ]+${version_part}[\t ]+([0-9]+).*")
+ STRING(REGEX REPLACE
+ "^.*${version_part}[\t ]+([0-9]+).*" "\\1"
+ ${version_part} "${${version_part}}")
+ ENDFOREACH()
+
+ IF(OPENSSL_VERSION_MAJOR VERSION_EQUAL 3)
+ # OpenSSL 3
+ SET(OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_MAJOR}")
+ SET(OPENSSL_MINOR_VERSION "${OPENSSL_VERSION_MINOR}")
+ SET(OPENSSL_FIX_VERSION "${OPENSSL_VERSION_PATCH}")
+ SET(OPENSSL_FOUND TRUE)
+ ELSE()
# Verify version number. Version information looks like:
@@ -193,9 +183,10 @@ MACRO (MYSQL_CHECK_SSL)
# #define OPENSSL_VERSION_NUMBER 0x1000103fL
# Encoded as MNNFFPPS: major minor fix patch status
@@ -213,15 +221,17 @@ MACRO (MYSQL_CHECK_SSL)
"^.*OPENSSL_VERSION_NUMBER[\t ]+0x[0-9][0-9][0-9]([0-9][0-9]).*$" "\\1"
OPENSSL_FIX_VERSION "${OPENSSL_VERSION_NUMBER}"
)
+ ENDIF()
ENDIF()
SET(OPENSSL_VERSION
"${OPENSSL_MAJOR_VERSION}.${OPENSSL_MINOR_VERSION}.${OPENSSL_FIX_VERSION}"
)
SET(OPENSSL_VERSION ${OPENSSL_VERSION} CACHE INTERNAL "")
@ -37,7 +65,7 @@
IF(SOLARIS)
SET(FORCE_SSL_SOLARIS "-Wl,--undefined,address_of_sk_new_null")
ENDIF()
@@ -203,7 +204,13 @@ MACRO (MYSQL_CHECK_SSL)
@@ -229,7 +239,13 @@ MACRO (MYSQL_CHECK_SSL)
IF(OPENSSL_INCLUDE_DIR AND
OPENSSL_LIBRARY AND
CRYPTO_LIBRARY AND