From 47cf15d19812662704cad1eda7878bb6c7e7d8bc Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Mon, 16 Mar 2009 22:52:54 +0000 Subject: [PATCH] cmake scripts: fix SunPro C++ on linux --- CMakeLists.txt | 8 +++++++- Foundation/CMakeLists.txt | 6 ++++++ Foundation/src/Mutex_POSIX.cpp | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a4ae810..74de1ebd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ include_directories( CppUnit/include Foundation/include XML/include Net/include include(CheckTypeSize) include(FindCygwin) include(FindOpenSSL) +include(CMakeDetermineCompilerId) include(contrib/cmake/FindMySQL.cmake) include(contrib/cmake/FindAPR.cmake) @@ -47,7 +48,7 @@ endif(CMAKE_SYSTEM MATCHES "Windows") if (CMAKE_SYSTEM MATCHES "Linux") add_definitions( -DPOCO_OS_FAMILY_UNIX ) # Standard 'must be' defines - add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 ) + add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) set(SYSLIBS pthread dl rt) endif(CMAKE_SYSTEM MATCHES "Linux") @@ -69,6 +70,11 @@ if (CMAKE_COMPILER_IS_CYGWIN) # add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400) endif (CMAKE_COMPILER_IS_CYGWIN) +# SunPro C++ +if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") + add_definitions( -D_BSD_SOURCE -library=stlport4) +endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") + add_subdirectory(CppUnit) add_subdirectory(Foundation) add_subdirectory(XML) diff --git a/Foundation/CMakeLists.txt b/Foundation/CMakeLists.txt index f6d3b1716..75641929e 100644 --- a/Foundation/CMakeLists.txt +++ b/Foundation/CMakeLists.txt @@ -186,6 +186,9 @@ set_target_properties( ${LIBNAME} PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS} VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) +if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") + set_target_properties( ${LIBNAME} PROPERTIES LINK_FLAGS "-library=stlport4") +endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") target_link_libraries( ${LIBNAME} ${SYSLIBS}) add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} ) @@ -193,6 +196,9 @@ set_target_properties( ${LIBNAMED} PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}" VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH} SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}) +if (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") + set_target_properties( ${LIBNAMED} PROPERTIES LINK_FLAGS "-library=stlport4") +endif (${CMAKE_CXX_COMPILER_ID} MATCHES "SunPro") target_link_libraries( ${LIBNAMED} ${SYSLIBS}) install( diff --git a/Foundation/src/Mutex_POSIX.cpp b/Foundation/src/Mutex_POSIX.cpp index a98199be9..3889022bd 100644 --- a/Foundation/src/Mutex_POSIX.cpp +++ b/Foundation/src/Mutex_POSIX.cpp @@ -45,9 +45,11 @@ #if defined(_POSIX_TIMEOUTS) && (_POSIX_TIMEOUTS - 200112L) >= 0L #if defined(_POSIX_THREADS) && (_POSIX_THREADS - 200112L) >= 0L +#if !(defined(__SUNPRO_CC)) #define POCO_HAVE_MUTEX_TIMEOUT #endif #endif +#endif namespace Poco {