changeset 1473:0631b56c35eb

Update to Boost 1.58.0 for static and Windows builds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 31 Jul 2015 11:10:27 +0200
parents 237d83694d82
children 3b68924ffb24
files NEWS Resources/CMake/BoostConfiguration.cmake Resources/CMake/BoostConfiguration.sh Resources/Patches/boost-1.55.0-clang-atomic.patch UnitTestsSources/VersionsTests.cpp
diffstat 5 files changed, 18 insertions(+), 113 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Thu Jul 30 17:55:12 2015 +0200
+++ b/NEWS	Fri Jul 31 11:10:27 2015 +0200
@@ -1,6 +1,7 @@
 Pending changes in the mainline
 ===============================
 
+* Update to Boost 1.58.0 for static and Windows builds
 * Source code repository moved from Google Code to BitBucket
 * Inject version information into Windows binaries
 * Fix access to binary data in HTTP/REST requests by Lua scripts
--- a/Resources/CMake/BoostConfiguration.cmake	Thu Jul 30 17:55:12 2015 +0200
+++ b/Resources/CMake/BoostConfiguration.cmake	Fri Jul 31 11:10:27 2015 +0200
@@ -39,10 +39,10 @@
 
 
 if (BOOST_STATIC)
-  # Parameters for Boost 1.55.0
-  set(BOOST_NAME boost_1_55_0)
-  set(BOOST_BCP_SUFFIX bcpdigest-0.7.4)
-  set(BOOST_MD5 "409f7a0e4fb1f5659d07114f3133b67b")
+  # Parameters for Boost 1.58.0
+  set(BOOST_NAME boost_1_58_0)
+  set(BOOST_BCP_SUFFIX bcpdigest-0.9.2)
+  set(BOOST_MD5 "704b110917cbda903e07cb53934b47ac")
   set(BOOST_FILESYSTEM_SOURCES_DIR "${BOOST_NAME}/libs/filesystem/src")
   
   set(BOOST_SOURCES_DIR ${CMAKE_BINARY_DIR}/${BOOST_NAME})
@@ -99,16 +99,6 @@
       )
   endif()
 
-  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    # This is a patch to compile Boost 1.55.0 with Clang 3.4 and later
-    # (including XCode 5.1). Fixes issue 14 of Orthanc.
-    # https://trac.macports.org/ticket/42282#comment:10
-    execute_process(
-      COMMAND patch -p0 -N -i ${ORTHANC_ROOT}/Resources/Patches/boost-1.55.0-clang-atomic.patch
-      WORKING_DIRECTORY ${BOOST_SOURCES_DIR}
-      )
-  endif()
-
   aux_source_directory(${BOOST_SOURCES_DIR}/libs/regex/src BOOST_REGEX_SOURCES)
 
   list(APPEND BOOST_SOURCES
--- a/Resources/CMake/BoostConfiguration.sh	Thu Jul 30 17:55:12 2015 +0200
+++ b/Resources/CMake/BoostConfiguration.sh	Fri Jul 31 11:10:27 2015 +0200
@@ -12,22 +12,23 @@
 ##
 ## History:
 ##   - Orthanc between 0.6.2 and 0.7.3: Boost 1.54.0
-##   - Orthanc above 0.7.4: Boost 1.55.0
+##   - Orthanc between 0.7.4 and 0.9.1: Boost 1.55.0
+##   - Orthanc >= 0.9.2: Boost 1.58.0
 
-rm -rf /tmp/boost_1_55_0
-rm -rf /tmp/bcp/boost_1_55_0
+rm -rf /tmp/boost_1_58_0
+rm -rf /tmp/bcp/boost_1_58_0
 
 cd /tmp
-echo "Uncompressing the source of Boost 1.55.0..."
-tar xfz boost_1_55_0.tar.gz 
+echo "Uncompressing the sources of Boost 1.58.0..."
+tar xfz ./boost_1_58_0.tar.gz 
 
 echo "Generating the subset..."
-mkdir -p /tmp/bcp/boost_1_55_0
-bcp --boost=/tmp/boost_1_55_0 thread system locale date_time filesystem math/special_functions algorithm uuid /tmp/bcp/boost_1_55_0
+mkdir -p /tmp/bcp/boost_1_58_0
+bcp --boost=/tmp/boost_1_58_0 thread system locale date_time filesystem math/special_functions algorithm uuid atomic /tmp/bcp/boost_1_58_0
 cd /tmp/bcp
 
 echo "Compressing the subset..."
-tar cfz boost_1_55_0_bcpdigest-0.7.4.tar.gz boost_1_55_0
-ls -l boost_1_55_0_bcpdigest-0.7.4.tar.gz
-md5sum boost_1_55_0_bcpdigest-0.7.4.tar.gz
-readlink -f boost_1_55_0_bcpdigest-0.7.4.tar.gz
+tar cfz boost_1_58_0_bcpdigest-0.9.2.tar.gz boost_1_58_0
+ls -l boost_1_58_0_bcpdigest-0.9.2.tar.gz
+md5sum boost_1_58_0_bcpdigest-0.9.2.tar.gz
+readlink -f boost_1_58_0_bcpdigest-0.9.2.tar.gz
--- a/Resources/Patches/boost-1.55.0-clang-atomic.patch	Thu Jul 30 17:55:12 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
---- boost/atomic/detail/cas128strong.hpp
-+++ boost/atomic/detail/cas128strong.hpp
-@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign>
- 
- public:
-     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
--    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
-+    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
-     {
-+        memset(&v_, 0, sizeof(v_));
-         memcpy(&v_, &v, sizeof(value_type));
-     }
- 
-     void
-     store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type value_s = 0;
-+        storage_type value_s;
-+        memset(&value_s, 0, sizeof(value_s));
-         memcpy(&value_s, &value, sizeof(value_type));
-         platform_fence_before_store(order);
-         platform_store128(value_s, &v_);
-@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
- 
---- boost/atomic/detail/gcc-atomic.hpp
-+++ boost/atomic/detail/gcc-atomic.hpp
-@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign>
- 
- public:
-     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
--    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
-+    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
-     {
-+        memset(&v_, 0, sizeof(v_));
-         memcpy(&v_, &v, sizeof(value_type));
-     }
- 
-     void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type tmp = 0;
-+        storage_type tmp;
-+        memset(&tmp, 0, sizeof(tmp));
-         memcpy(&tmp, &v, sizeof(value_type));
-         __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
-     }
-@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign>
- 
-     value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
-     {
--        storage_type tmp = 0;
-+        storage_type tmp;
-+        memset(&tmp, 0, sizeof(tmp));
-         memcpy(&tmp, &v, sizeof(value_type));
-         tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
-         value_type res;
-@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
-         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false,
-@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign>
-         memory_order success_order,
-         memory_order failure_order) volatile BOOST_NOEXCEPT
-     {
--        storage_type expected_s = 0, desired_s = 0;
-+        storage_type expected_s, desired_s;
-+        memset(&expected_s, 0, sizeof(expected_s));
-+        memset(&desired_s, 0, sizeof(desired_s));
-         memcpy(&expected_s, &expected, sizeof(value_type));
-         memcpy(&desired_s, &desired, sizeof(value_type));
-         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,
--- 
--- a/UnitTestsSources/VersionsTests.cpp	Thu Jul 30 17:55:12 2015 +0200
+++ b/UnitTestsSources/VersionsTests.cpp	Fri Jul 31 11:10:27 2015 +0200
@@ -91,7 +91,7 @@
 
 TEST(Versions, BoostStatic)
 {
-  ASSERT_STREQ("1_55", BOOST_LIB_VERSION);
+  ASSERT_STREQ("1_58", BOOST_LIB_VERSION);
 }
 
 TEST(Versions, CurlStatic)