You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2022/06/08 21:41:39 UTC

[trafficserver] branch 9.2.x updated: Add compatibility define when building with OpenSSL3 (#8837)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
     new a2b412740 Add compatibility define when building with OpenSSL3 (#8837)
a2b412740 is described below

commit a2b4127409ab0efb6147286bc64efeea2531733c
Author: Bryan Call <bc...@apache.org>
AuthorDate: Thu May 12 08:10:06 2022 -0700

    Add compatibility define when building with OpenSSL3 (#8837)
    
    (cherry picked from commit cea26fe72406963fa7648a9bef3099a1a545f838)
---
 build/crypto.m4 | 19 +++++++++++++++++++
 configure.ac    |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/build/crypto.m4 b/build/crypto.m4
index e9e675fff..71d35a68d 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -59,6 +59,25 @@ int main() {
   )
 ])
 
+dnl
+dnl Check OpenSSL Version 3
+dnl
+AC_DEFUN([TS_CHECK_OPENSSL3], [
+  AC_MSG_CHECKING([for OpenSSL version 3])
+  AC_RUN_IFELSE([AC_LANG_SOURCE(
+  [
+#include <openssl/opensslv.h>
+int main() {
+  if (OPENSSL_VERSION_NUMBER > 0x3000000fL) {
+    return 0;
+  }
+  return 1;
+}
+  ])],
+  [AC_MSG_RESULT(yes) TS_ADDTO(CPPFLAGS, -DOPENSSL_API_COMPAT=10002)], [AC_MSG_RESULT(no)]
+  )
+])
+
 dnl
 dnl Since OpenSSL 1.1.0
 dnl
diff --git a/configure.ac b/configure.ac
index 434930c13..64192700d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1251,6 +1251,9 @@ TS_CHECK_CRYPTO
 # Check for OpenSSL Version
 TS_CHECK_CRYPTO_VERSION
 
+# Check for OpenSSL Version 3 and add compatiblity define if needed
+TS_CHECK_OPENSSL3
+
 # Check for openssl ASYNC jobs
 TS_CHECK_CRYPTO_ASYNC