fix cmake on Solaris

- add Solaris specific compiler flags and library
- merge message when SMALL_TIME_T is true
- confirmed on SunOS Release 5.11 Version 11.3 64-bit Solaris i386
This commit is contained in:
kinichiro 2016-04-15 01:11:19 +09:00 committed by kinichiro
parent c94670a8cd
commit 08089a1b20

View File

@ -44,6 +44,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -m64")
endif()
add_definitions(-DLIBRESSL_INTERNAL) add_definitions(-DLIBRESSL_INTERNAL)
add_definitions(-DOPENSSL_NO_HW_PADLOCK) add_definitions(-DOPENSSL_NO_HW_PADLOCK)
@ -202,6 +210,9 @@ endif()
if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread)
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket)
endif()
if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC)) if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC))
set(BUILD_SHARED true) set(BUILD_SHARED true)
@ -210,8 +221,8 @@ endif()
check_type_size(time_t SIZEOF_TIME_T) check_type_size(time_t SIZEOF_TIME_T)
if(SIZEOF_TIME_T STREQUAL "4") if(SIZEOF_TIME_T STREQUAL "4")
set(SMALL_TIME_T true) set(SMALL_TIME_T true)
message(WARNING " ** Warning, this system is unable to represent times past 2038") message(WARNING " ** Warning, this system is unable to represent times past 2038\n"
message(WARNING " ** It will behave incorrectly when handling valid RFC5280 dates") " ** It will behave incorrectly when handling valid RFC5280 dates")
endif() endif()
add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})