# HG changeset patch # User Sebastien Jodogne # Date 1402926073 -7200 # Node ID 517e28b420afa1743288049da2e2367a3c7573f6 # Parent d0a08d8881b73804e00561e87ff9ae55701295cf# Parent 816dccaeb7cf92b590803994271ec462391834ee integration mainline -> plugins diff -r d0a08d8881b7 -r 517e28b420af CMakeLists.txt --- a/CMakeLists.txt Mon Jun 16 15:40:58 2014 +0200 +++ b/CMakeLists.txt Mon Jun 16 15:41:13 2014 +0200 @@ -398,7 +398,8 @@ ${GOOGLE_LOG_SOURCES} ) - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") set_target_properties(OrthancClient PROPERTIES LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined -Wl,--as-needed -Wl,--version-script=${ORTHANC_ROOT}/OrthancCppClient/SharedLibrary/Laaw/VersionScript.map" ) diff -r d0a08d8881b7 -r 517e28b420af Core/MultiThreading/Mutex.cpp --- a/Core/MultiThreading/Mutex.cpp Mon Jun 16 15:40:58 2014 +0200 +++ b/Core/MultiThreading/Mutex.cpp Mon Jun 16 15:41:13 2014 +0200 @@ -37,7 +37,7 @@ #if defined(_WIN32) #include -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) #include #else #error Support your platform here @@ -75,7 +75,7 @@ } -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) struct Mutex::PImpl { diff -r d0a08d8881b7 -r 517e28b420af Core/Toolbox.cpp --- a/Core/Toolbox.cpp Mon Jun 16 15:40:58 2014 +0200 +++ b/Core/Toolbox.cpp Mon Jun 16 15:41:13 2014 +0200 @@ -54,7 +54,7 @@ #include /* PATH_MAX */ #endif -#if defined(__linux) +#if defined(__linux) || defined(__FreeBSD_kernel__) #include /* PATH_MAX */ #include #include @@ -162,7 +162,7 @@ { #if defined(_WIN32) ::Sleep(static_cast(microSeconds / static_cast(1000))); -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) usleep(microSeconds); #else #error Support your platform here @@ -515,7 +515,7 @@ return std::string(&buffer[0]); } -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) std::string Toolbox::GetPathToExecutable() { std::vector buffer(PATH_MAX + 1); diff -r d0a08d8881b7 -r 517e28b420af NEWS --- a/NEWS Mon Jun 16 15:40:58 2014 +0200 +++ b/NEWS Mon Jun 16 15:41:13 2014 +0200 @@ -1,6 +1,7 @@ Pending changes in the mainline =============================== +* Support of kFreeBSD Version 0.7.6 (2014/06/11) diff -r d0a08d8881b7 -r 517e28b420af OrthancServer/DicomProtocol/DicomServer.cpp --- a/OrthancServer/DicomProtocol/DicomServer.cpp Mon Jun 16 15:40:58 2014 +0200 +++ b/OrthancServer/DicomProtocol/DicomServer.cpp Mon Jun 16 15:41:13 2014 +0200 @@ -116,7 +116,7 @@ LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_DICOM); LoadEmbeddedDictionary(d, EmbeddedResources::DICTIONARY_PRIVATE); -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) std::string path = DCMTK_DICTIONARY_DIR; const char* env = std::getenv(DCM_DICT_ENVIRONMENT_VARIABLE); diff -r d0a08d8881b7 -r 517e28b420af OrthancServer/DicomProtocol/DicomUserConnection.cpp --- a/OrthancServer/DicomProtocol/DicomUserConnection.cpp Mon Jun 16 15:40:58 2014 +0200 +++ b/OrthancServer/DicomProtocol/DicomUserConnection.cpp Mon Jun 16 15:41:13 2014 +0200 @@ -107,6 +107,18 @@ #endif +#if defined(__FreeBSD_kernel__) +/** + * TO IMPROVE: "_POSIX_HOST_NAME_MAX is only the minimum value that + * HOST_NAME_MAX can ever have [...] Therefore you cannot allocate an + * array of size _POSIX_HOST_NAME_MAX, invoke gethostname() and expect + * that the result will fit." + * http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00128.html + **/ +#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX +#endif + + static const char* DEFAULT_PREFERRED_TRANSFER_SYNTAX = UID_LittleEndianImplicitTransferSyntax; /** diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/BoostConfiguration.cmake --- a/Resources/CMake/BoostConfiguration.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/BoostConfiguration.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -53,7 +53,8 @@ ) set(BOOST_SOURCES) - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") list(APPEND BOOST_SOURCES ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/once.cpp ${BOOST_SOURCES_DIR}/libs/thread/src/pthread/thread.cpp diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/Compiler.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -37,7 +37,8 @@ endif() -if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -nostdinc++ -I${LSB_PATH}/include -I${LSB_PATH}/include/c++ -I${LSB_PATH}/include/c++/backward -fpermissive") diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/DcmtkConfiguration.cmake --- a/Resources/CMake/DcmtkConfiguration.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/DcmtkConfiguration.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -87,7 +87,8 @@ # Source for the logging facility of DCMTK AUX_SOURCE_DIRECTORY(${DCMTK_SOURCES_DIR}/oflog/libsrc DCMTK_SOURCES) - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") list(REMOVE_ITEM DCMTK_SOURCES ${DCMTK_SOURCES_DIR}/oflog/libsrc/windebap.cc ${DCMTK_SOURCES_DIR}/oflog/libsrc/winsock.cc diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/GoogleLogConfiguration.cmake --- a/Resources/CMake/GoogleLogConfiguration.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/GoogleLogConfiguration.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -28,7 +28,8 @@ set(ac_google_start_namespace "namespace google {") set(ac_google_end_namespace "}") - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") set(ac_cv_have_unistd_h 1) set(ac_cv_have_stdint_h 1) set(ac_cv_have_systypes_h 0) @@ -83,7 +84,8 @@ ) endif() - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") # Install the specific configuration for LSB SDK configure_file( diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/LibCurlConfiguration.cmake --- a/Resources/CMake/LibCurlConfiguration.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/LibCurlConfiguration.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -40,7 +40,8 @@ ) endif() - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") SET(TMP_OS "x86_64") else() diff -r d0a08d8881b7 -r 517e28b420af Resources/CMake/MongooseConfiguration.cmake --- a/Resources/CMake/MongooseConfiguration.cmake Mon Jun 16 15:40:58 2014 +0200 +++ b/Resources/CMake/MongooseConfiguration.cmake Mon Jun 16 15:41:13 2014 +0200 @@ -24,7 +24,8 @@ add_definitions( -DNO_SSL_DL=1 ) - if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR + ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") link_libraries(dl) endif() diff -r d0a08d8881b7 -r 517e28b420af UnitTestsSources/UnitTestsMain.cpp --- a/UnitTestsSources/UnitTestsMain.cpp Mon Jun 16 15:40:58 2014 +0200 +++ b/UnitTestsSources/UnitTestsMain.cpp Mon Jun 16 15:41:13 2014 +0200 @@ -595,7 +595,7 @@ #if defined(_WIN32) ASSERT_EQ(Endianness_Little, Toolbox::DetectEndianness()); -#elif defined(__linux) +#elif defined(__linux) || defined(__FreeBSD_kernel__) #if !defined(__BYTE_ORDER) # error Support your platform here