From 3207606f117fe4844c5eb18019a4f0939349ece7 Mon Sep 17 00:00:00 2001 From: kinichiro Date: Mon, 4 Apr 2016 11:28:46 +0900 Subject: fix cmake on HP-UX - CMakeLists.txt * add OS specific compiler flags and library * add checking size of time_t * add checking memmem() - tests/CMakeLists.txt * add if(HAVE_MEMMEM) for explicit_bzero * add checking SMALL_TIME_T for rfc5280time - crypto/CMakeLists.txt * add getentropy_hpux.c - tls/CMakeLists.txt * fix checking strsep --- CMakeLists.txt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 710d8a9..788a052 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required (VERSION 2.8) include(CheckFunctionExists) include(CheckLibraryExists) include(CheckIncludeFiles) +include(CheckTypeSize) project (LibreSSL) @@ -33,6 +34,16 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") add_definitions(-D_GNU_SOURCE) endif() +if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") + if(CMAKE_C_COMPILER MATCHES "gcc") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99 -fno-strict-aliasing") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlp64") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O2 +DD64 +Otype_safety=off") + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_XOPEN_SOURCE=600 -D__STRICT_ALIGNMENT") +endif() + add_definitions(-DLIBRESSL_INTERNAL) add_definitions(-DOPENSSL_NO_HW_PADLOCK) add_definitions(-DOPENSSL_NO_ASM) @@ -156,6 +167,11 @@ if(HAVE_MEMCMP) add_definitions(-DHAVE_MEMCMP) endif() +check_function_exists(memmem HAVE_MEMMEM) +if(HAVE_MEMMEM) + add_definitions(-DHAVE_MEMMEM) +endif() + check_include_files(err.h HAVE_ERR_H) if(HAVE_ERR_H) add_definitions(-DHAVE_ERR_H) @@ -171,11 +187,22 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(OPENSSL_LIBS ${OPENSSL_LIBS} rt) endif() endif() +if(CMAKE_SYSTEM_NAME MATCHES "HP-UX") + set(OPENSSL_LIBS ${OPENSSL_LIBS} pthread) +endif() if(NOT (CMAKE_SYSTEM_NAME MATCHES "Darwin" OR MSVC)) set(BUILD_SHARED true) 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") +endif() +add_definitions(-DSIZEOF_TIME_T=${SIZEOF_TIME_T}) + add_subdirectory(crypto) add_subdirectory(ssl) add_subdirectory(apps) -- cgit v1.2.3-55-g6feb