aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2016-05-02 02:00:55 -0500
committerBrent Cook <bcook@openbsd.org>2016-05-02 02:00:55 -0500
commit5582be55b4c8ee55243a13c4e46a1691ca919997 (patch)
tree85a341c3ac1c8a4bd1df3376d58e16ade0068aaf /CMakeLists.txt
parenta653a67a1ee84e41e0a989ecdc54a17e32fdd6fe (diff)
parent49eabdcb1619ea691e2b6d78ffb82ce60e47d20f (diff)
downloadportable-5582be55b4c8ee55243a13c4e46a1691ca919997.tar.gz
portable-5582be55b4c8ee55243a13c4e46a1691ca919997.tar.bz2
portable-5582be55b4c8ee55243a13c4e46a1691ca919997.zip
Land #190, Enable cmake on Solaris
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 23 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 595e829..589b6eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,6 +59,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
59 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") 59 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")
60endif() 60endif()
61 61
62if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
63 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing")
64 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
65 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600")
66 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBSD_COMP")
67 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fpic -m64")
68endif()
69
62add_definitions(-DLIBRESSL_INTERNAL) 70add_definitions(-DLIBRESSL_INTERNAL)
63add_definitions(-DOPENSSL_NO_HW_PADLOCK) 71add_definitions(-DOPENSSL_NO_HW_PADLOCK)
64 72
@@ -196,12 +204,16 @@ if(HAVE_ERR_H)
196 add_definitions(-DHAVE_ERR_H) 204 add_definitions(-DHAVE_ERR_H)
197endif() 205endif()
198 206
199if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND ENABLE_ASM) 207if(ENABLE_ASM)
200 set(HOST_ASM_ELF_X86_64 true) 208 if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF")
201endif() 209 if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)")
202 210 set(HOST_ASM_ELF_X86_64 true)
203if(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND ENABLE_ASM) 211 elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i386")
204 set(HOST_ASM_MACOSX_X86_64 true) 212 set(HOST_ASM_ELF_X86_64 true)
213 endif()
214 elseif(APPLE AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
215 set(HOST_ASM_MACOSX_X86_64 true)
216 endif()
205endif() 217endif()
206 218
207set(OPENSSL_LIBS ssl crypto) 219set(OPENSSL_LIBS ssl crypto)
@@ -217,6 +229,9 @@ endif()
217if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") 229if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
218 set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) 230 set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread)
219endif() 231endif()
232if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
233 set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket)
234endif()
220 235
221if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC)) 236if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC))
222 set(BUILD_SHARED true) 237 set(BUILD_SHARED true)
@@ -225,8 +240,8 @@ endif()
225check_type_size(time_t SIZEOF_TIME_T) 240check_type_size(time_t SIZEOF_TIME_T)
226if(SIZEOF_TIME_T STREQUAL "4") 241if(SIZEOF_TIME_T STREQUAL "4")
227 set(SMALL_TIME_T true) 242 set(SMALL_TIME_T true)
228 message(WARNING " ** Warning, this system is unable to represent times past 2038") 243 message(WARNING " ** Warning, this system is unable to represent times past 2038\n"
229 message(WARNING " ** It will behave incorrectly when handling valid RFC5280 dates") 244 " ** It will behave incorrectly when handling valid RFC5280 dates")
230endif() 245endif()
231add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) 246add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})
232 247