changeset 2546:6d5e36e1256f

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 17 Apr 2018 19:19:27 +0200
parents 9f325c631973
children 8b6b0b6ece6b
files Core/Endianness.h INSTALL Resources/CMake/DcmtkConfiguration.cmake Resources/Patches/dcmtk-3.6.0-mingw64.patch
diffstat 4 files changed, 11 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Endianness.h	Tue Apr 17 21:01:08 2018 +0200
+++ b/Core/Endianness.h	Tue Apr 17 19:19:27 2018 +0200
@@ -69,7 +69,7 @@
 #    define be32toh(x) __builtin_bswap32(x)
 #    define be64toh(x) __builtin_bswap64(x)
 #  else
-//   MinGW <= 4.2, we must manually implement the byte swapping
+//   MinGW <= 4.2, we must manually implement the byte swapping (*)
 #    define ORTHANC_HAS_BUILTIN_BYTE_SWAP 0
 #    define be16toh(x) __orthanc_bswap16(x)
 #    define be32toh(x) __orthanc_bswap32(x)
@@ -170,7 +170,9 @@
           static_cast<uint64_t>(p[7]));
 }
 
-#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
+#if defined(_WIN32)
+// Implemented above (*)
+#elif defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
 #  if __BYTE_ORDER == __LITTLE_ENDIAN
 #    define be16toh(x) __orthanc_bswap16(x)
 #    define be32toh(x) __orthanc_bswap32(x)
--- a/INSTALL	Tue Apr 17 21:01:08 2018 +0200
+++ b/INSTALL	Tue Apr 17 19:19:27 2018 +0200
@@ -95,18 +95,13 @@
 Cross-Compilation for Windows under GNU/Linux
 ---------------------------------------------
 
-To cross-compile Windows binaries under Linux using MinGW, please use
-the following command:
+To cross-compile Windows binaries under Linux using MinGW-W64, please
+use the following command:
 
 # cd ~/OrthancBuild
-# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_DCMTK_360=ON -DUSE_LEGACY_JSONCPP=ON ~/Orthanc
+# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGW-W64-Toolchain32.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DUSE_DCMTK_360=ON -DCMAKE_BUILD_TYPE=Debug ~/Orthanc
 # make
 
-
+For older MinGW32, use the following CMake invokation:
 
-Native Windows build with MinGW (VERY SLOW)
--------------------------------------------
-
-# cd [...]\OrthancBuild
-# cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug [...]\Orthanc
-# mingw32-make
+# cmake -DCMAKE_TOOLCHAIN_FILE=~/Orthanc/Resources/MinGWToolchain.cmake -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DUSE_DCMTK_360=ON -DUSE_LEGACY_JSONCPP=ON ~/Orthanc
--- a/Resources/CMake/DcmtkConfiguration.cmake	Tue Apr 17 21:01:08 2018 +0200
+++ b/Resources/CMake/DcmtkConfiguration.cmake	Tue Apr 17 19:19:27 2018 +0200
@@ -278,7 +278,6 @@
       )
 
     if (CMAKE_COMPILER_IS_GNUCXX AND
-        DCMTK_PATCH_MINGW64 AND
         USE_DCMTK_360)
       # This is a patch for MinGW64
       execute_process(
--- a/Resources/Patches/dcmtk-3.6.0-mingw64.patch	Tue Apr 17 21:01:08 2018 +0200
+++ b/Resources/Patches/dcmtk-3.6.0-mingw64.patch	Tue Apr 17 19:19:27 2018 +0200
@@ -6,7 +6,7 @@
    {
      if (file_) fclose();
 -#ifdef _WIN32
-+#if 0
++#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR)
      file_ = _popen(command, modes);
  #else
      file_ = :: popen(command, modes);
@@ -15,8 +15,7 @@
        if (popened_)
        {
 -#ifdef _WIN32
-+#if 0
++#if defined(_WIN32) && !defined(__MINGW64_VERSION_MAJOR)
          result = _pclose(file_);
  #else
          result = :: pclose(file_);
-Only in dcmtk-3.6.0/ofstd/include/dcmtk/ofstd: offile.h~