From 08089a1b20a1818538670d641242266ed3185814 Mon Sep 17 00:00:00 2001 From: kinichiro Date: Fri, 15 Apr 2016 01:11:19 +0900 Subject: 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 --- CMakeLists.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e12909..447c3f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") 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(-DOPENSSL_NO_HW_PADLOCK) @@ -202,6 +210,9 @@ endif() if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) 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)) set(BUILD_SHARED true) @@ -210,8 +221,8 @@ endif() check_type_size(time_t SIZEOF_TIME_T) if(SIZEOF_TIME_T STREQUAL "4") set(SMALL_TIME_T true) - message(WARNING " ** Warning, this system is unable to represent times past 2038") - message(WARNING " ** It will behave incorrectly when handling valid RFC5280 dates") + message(WARNING " ** Warning, this system is unable to represent times past 2038\n" + " ** It will behave incorrectly when handling valid RFC5280 dates") endif() add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) -- cgit v1.2.3-55-g6feb From 49eabdcb1619ea691e2b6d78ffb82ce60e47d20f Mon Sep 17 00:00:00 2001 From: kinichiro Date: Fri, 15 Apr 2016 14:24:00 +0900 Subject: organize enabling asm condition in cmake - add amd64 as same as x86_64 - add solaris(i386) --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 447c3f3..9639f89 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,12 +189,16 @@ if(HAVE_ERR_H) add_definitions(-DHAVE_ERR_H) endif() -if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND ENABLE_ASM) - set(HOST_ASM_ELF_X86_64 true) -endif() - -if(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND ENABLE_ASM) - set(HOST_ASM_MACOSX_X86_64 true) +if(ENABLE_ASM) + if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF") + if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)") + set(HOST_ASM_ELF_X86_64 true) + elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386") + set(HOST_ASM_ELF_X86_64 true) + endif() + elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") + set(HOST_ASM_MACOSX_X86_64 true) + endif() endif() set(OPENSSL_LIBS ssl crypto) -- cgit v1.2.3-55-g6feb