diff options
author | Brent Cook <bcook@openbsd.org> | 2016-05-02 02:00:55 -0500 |
---|---|---|
committer | Brent Cook <bcook@openbsd.org> | 2016-05-02 02:00:55 -0500 |
commit | 5582be55b4c8ee55243a13c4e46a1691ca919997 (patch) | |
tree | 85a341c3ac1c8a4bd1df3376d58e16ade0068aaf /CMakeLists.txt | |
parent | a653a67a1ee84e41e0a989ecdc54a17e32fdd6fe (diff) | |
parent | 49eabdcb1619ea691e2b6d78ffb82ce60e47d20f (diff) | |
download | portable-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.txt | 31 |
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") |
60 | endif() | 60 | endif() |
61 | 61 | ||
62 | if(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") | ||
68 | endif() | ||
69 | |||
62 | add_definitions(-DLIBRESSL_INTERNAL) | 70 | add_definitions(-DLIBRESSL_INTERNAL) |
63 | add_definitions(-DOPENSSL_NO_HW_PADLOCK) | 71 | add_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) |
197 | endif() | 205 | endif() |
198 | 206 | ||
199 | if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF" AND "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND ENABLE_ASM) | 207 | if(ENABLE_ASM) |
200 | set(HOST_ASM_ELF_X86_64 true) | 208 | if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF") |
201 | endif() | 209 | if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)") |
202 | 210 | set(HOST_ASM_ELF_X86_64 true) | |
203 | if(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() | ||
205 | endif() | 217 | endif() |
206 | 218 | ||
207 | set(OPENSSL_LIBS ssl crypto) | 219 | set(OPENSSL_LIBS ssl crypto) |
@@ -217,6 +229,9 @@ endif() | |||
217 | if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") | 229 | if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") |
218 | set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) | 230 | set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) |
219 | endif() | 231 | endif() |
232 | if(CMAKE_SYSTEM_NAME MATCHES "SunOS") | ||
233 | set(OPENSSL_LIBS ${OPENSSL_LIBS} nsl socket) | ||
234 | endif() | ||
220 | 235 | ||
221 | if(NOT (CMAKE_SYSTEM_NAME MATCHES "(Darwin|MINGW|CYGWIN)" OR MSVC)) | 236 | if(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() | |||
225 | check_type_size(time_t SIZEOF_TIME_T) | 240 | check_type_size(time_t SIZEOF_TIME_T) |
226 | if(SIZEOF_TIME_T STREQUAL "4") | 241 | if(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") |
230 | endif() | 245 | endif() |
231 | add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) | 246 | add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) |
232 | 247 | ||