From dadeeb0a2ed5e21bb90bb819a13c1bf9f4d1accf Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 15 Oct 2015 14:32:16 -0500 Subject: [PATCH] check for timegm in cmake builds --- CMakeLists.txt | 5 +++++ crypto/CMakeLists.txt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed9cb1f..e4cf7ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,11 @@ if(HAVE_STRSEP) add_definitions(-DHAVE_STRSEP) endif() +check_function_exists(timegm HAVE_TIMEGM) +if(HAVE_TIMEGM) + add_definitions(-DHAVE_TIMEGM) +endif() + check_function_exists(arc4random_buf HAVE_ARC4RANDOM_BUF) if(HAVE_ARC4RANDOM_BUF) add_definitions(-DHAVE_ARC4RANDOM_BUF) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 3326dd7..792041e 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -596,6 +596,10 @@ if(NOT HAVE_STRNDUP) endif() endif() +if(NOT HAVE_TIMEGM) + set(CRYPTO_SRC ${CRYPTO_SRC} compat/timegm.c) +endif() + if(NOT HAVE_EXPLICIT_BZERO) if(CMAKE_HOST_WIN32) set(CRYPTO_SRC ${CRYPTO_SRC} compat/explicit_bzero_win.c)