aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrent Cook <bcook@openbsd.org>2016-04-09 11:49:29 -0500
committerBrent Cook <bcook@openbsd.org>2016-04-09 11:49:29 -0500
commitd9b0838432d4a89e23964ac86fc05cec1c208913 (patch)
treeb89e9666e59e47c687192beb892dd6d84cff582b /CMakeLists.txt
parent2997b8577c7a7ff4c53e1b5b16ac87ecd12dbce1 (diff)
parent3207606f117fe4844c5eb18019a4f0939349ece7 (diff)
downloadportable-d9b0838432d4a89e23964ac86fc05cec1c208913.tar.gz
portable-d9b0838432d4a89e23964ac86fc05cec1c208913.tar.bz2
portable-d9b0838432d4a89e23964ac86fc05cec1c208913.zip
Land #183, fix cmake on HP-UX
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c9f6556..e782e38 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.8.8)
2include(CheckFunctionExists) 2include(CheckFunctionExists)
3include(CheckLibraryExists) 3include(CheckLibraryExists)
4include(CheckIncludeFiles) 4include(CheckIncludeFiles)
5include(CheckTypeSize)
5 6
6project (LibreSSL C) 7project (LibreSSL C)
7 8
@@ -33,6 +34,16 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
33 add_definitions(-D_GNU_SOURCE) 34 add_definitions(-D_GNU_SOURCE)
34endif() 35endif()
35 36
37if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
38 if(CMAKE_C_COMPILER MATCHES "gcc")
39 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing")
40 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlp64")
41 else()
42 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off")
43 endif()
44 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT")
45endif()
46
36add_definitions(-DLIBRESSL_INTERNAL) 47add_definitions(-DLIBRESSL_INTERNAL)
37add_definitions(-DOPENSSL_NO_HW_PADLOCK) 48add_definitions(-DOPENSSL_NO_HW_PADLOCK)
38add_definitions(-DOPENSSL_NO_ASM) 49add_definitions(-DOPENSSL_NO_ASM)
@@ -156,6 +167,11 @@ if(HAVE_MEMCMP)
156 add_definitions(-DHAVE_MEMCMP) 167 add_definitions(-DHAVE_MEMCMP)
157endif() 168endif()
158 169
170check_function_exists(memmem HAVE_MEMMEM)
171if(HAVE_MEMMEM)
172 add_definitions(-DHAVE_MEMMEM)
173endif()
174
159check_include_files(err.h HAVE_ERR_H) 175check_include_files(err.h HAVE_ERR_H)
160if(HAVE_ERR_H) 176if(HAVE_ERR_H)
161 add_definitions(-DHAVE_ERR_H) 177 add_definitions(-DHAVE_ERR_H)
@@ -171,11 +187,22 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux")
171 set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) 187 set(OPENSSL_LIBS ${OPENSSL_LIBS} rt)
172 endif() 188 endif()
173endif() 189endif()
190if(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
191 set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread)
192endif()
174 193
175if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC)) 194if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC))
176 set(BUILD_SHARED true) 195 set(BUILD_SHARED true)
177endif() 196endif()
178 197
198check_type_size(time_t SIZEOF_TIME_T)
199if(SIZEOF_TIME_T STREQUAL "4")
200 set(SMALL_TIME_T true)
201 message(WARNING " ** Warning, this system is unable to represent times past 2038")
202 message(WARNING " ** It will behave incorrectly when handling valid RFC5280 dates")
203endif()
204add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T})
205
179add_subdirectory(crypto) 206add_subdirectory(crypto)
180add_subdirectory(ssl) 207add_subdirectory(ssl)
181add_subdirectory(apps) 208add_subdirectory(apps)