changeset 6004:4d8b047aec43

recovering mingw build for windows xp with dcmtk 3.6.8
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Feb 2025 16:15:29 +0100
parents d69db70fa8ba
children 318f3234e9ed
files INSTALL OrthancFramework/Resources/Patches/curl-8.9.0.patch
diffstat 2 files changed, 28 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/INSTALL	Sun Feb 16 14:30:31 2025 +0100
+++ b/INSTALL	Tue Feb 18 16:15:29 2025 +0100
@@ -145,17 +145,20 @@
 Cross-Compilation for Windows under GNU/Linux
 ---------------------------------------------
 
-Some versions of MinGW-W64 might have problems with C++11 (notably
-those shipped in Ubuntu 16.04 LTS, in the "mingw-w64" package). Use
-the following command to disable C++11:
+Some versions of MinGW-W64 may have insufficient support C++11 to
+compile recent versions of Boost or ICU (notably those shipped in
+Ubuntu 22.04 LTS, in the "g++-mingw-w64-i686-win32" package). Use the
+following command to disable C++11 in Boost and ICU:
 
 # cd ~/Orthanc/Build
 # cmake ../OrthancServer \
-        -DCMAKE_BUILD_TYPE=Debug \
-        -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain32.cmake \
         -DSTANDALONE_BUILD=ON \
         -DSTATIC_BUILD=ON \
-        -DUSE_LEGACY_JSONCPP=ON
+        -DBOOST_LOCALE_BACKEND=icu \
+        -DUSE_LEGACY_BOOST=ON \
+        -DUSE_LEGACY_LIBICU=ON
 # make
 
 NB: Use the toolchain "MinGW-W64-Toolchain64.cmake" to produce 64bit
@@ -170,10 +173,12 @@
 
 # cd ~/Orthanc/Build
 # cmake ../OrthancServer \
-        -DCMAKE_BUILD_TYPE=Debug \
-        -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGWToolchain.cmake \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/MinGWToolchain.cmake \
         -DSTANDALONE_BUILD=ON \
         -DSTATIC_BUILD=ON \
         -DDCMTK_STATIC_VERSION=3.6.0 \
-        -DUSE_LEGACY_JSONCPP=ON
+        -DUSE_LEGACY_JSONCPP=ON \
+        -DUSE_LEGACY_BOOST=ON \
+        -DUSE_LEGACY_LIBICU=ON
 # make
--- a/OrthancFramework/Resources/Patches/curl-8.9.0.patch	Sun Feb 16 14:30:31 2025 +0100
+++ b/OrthancFramework/Resources/Patches/curl-8.9.0.patch	Tue Feb 18 16:15:29 2025 +0100
@@ -1,6 +1,6 @@
 diff -urEb curl-8.9.0.orig/CMake/Macros.cmake curl-8.9.0/CMake/Macros.cmake
---- curl-8.9.0.orig/CMake/Macros.cmake	2024-07-26 18:47:52.920588300 +0200
-+++ curl-8.9.0/CMake/Macros.cmake	2024-07-26 18:48:08.345522100 +0200
+--- curl-8.9.0.orig/CMake/Macros.cmake	2025-02-18 16:04:59.818585107 +0100
++++ curl-8.9.0/CMake/Macros.cmake	2025-02-18 16:05:16.867458366 +0100
 @@ -48,7 +48,7 @@
      message(STATUS "Performing Test ${CURL_TEST}")
      try_compile(${CURL_TEST}
@@ -10,3 +10,15 @@
        CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
        "${CURL_TEST_ADD_LIBRARIES}"
        OUTPUT_VARIABLE OUTPUT)
+diff -urEb curl-8.9.0.orig/lib/system_win32.c curl-8.9.0/lib/system_win32.c
+--- curl-8.9.0.orig/lib/system_win32.c	2025-02-18 16:04:59.834584988 +0100
++++ curl-8.9.0/lib/system_win32.c	2025-02-18 16:06:26.448941452 +0100
+@@ -273,7 +273,7 @@
+ 
+ bool Curl_win32_impersonating(void)
+ {
+-#ifndef CURL_WINDOWS_APP
++#if !defined(CURL_WINDOWS_APP) && !defined(__MINGW32__)
+   HANDLE token = NULL;
+   if(OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token)) {
+     CloseHandle(token);