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)