changeset 4701:68635d365a27

patch for compatibility of civetweb 1.14 with openssl 3.0.0
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 21 Jun 2021 17:55:53 +0200
parents 863383e7e582
children 312e0e29de90 dbee8bd8ee1f
files OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake OrthancFramework/Resources/Patches/civetweb-1.14.patch
diffstat 2 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake	Mon Jun 21 17:54:55 2021 +0200
+++ b/OrthancFramework/Resources/CMake/CivetwebConfiguration.cmake	Mon Jun 21 17:55:53 2021 +0200
@@ -44,6 +44,17 @@
 
   DownloadPackage(${CIVETWEB_MD5} ${CIVETWEB_URL} "${CIVETWEB_SOURCES_DIR}")
 
+  execute_process(
+    COMMAND ${PATCH_EXECUTABLE} -p0 -N -i
+    ${CMAKE_CURRENT_LIST_DIR}/../Patches/civetweb-1.14.patch
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    RESULT_VARIABLE Failure
+    )
+
+  if (FirstRun AND Failure)
+    message(FATAL_ERROR "Error while patching a file")
+  endif()
+
   include_directories(
     ${CIVETWEB_SOURCES_DIR}/include
     )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancFramework/Resources/Patches/civetweb-1.14.patch	Mon Jun 21 17:55:53 2021 +0200
@@ -0,0 +1,11 @@
+diff -urEb civetweb-1.14.orig/src/civetweb.c civetweb-1.14/src/civetweb.c
+--- civetweb-1.14.orig/src/civetweb.c	2021-06-21 17:42:52.343136123 +0200
++++ civetweb-1.14/src/civetweb.c	2021-06-21 17:43:11.623158128 +0200
+@@ -1774,6 +1774,7 @@
+ #if !defined(OPENSSL_API_3_0)
+ #define OPENSSL_API_3_0
+ #endif
++#define OPENSSL_REMOVE_THREAD_STATE()
+ #else
+ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
+ #if !defined(OPENSSL_API_1_1)