From ac46856010e38bbb5767233541b96f433bdcd7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 13 Sep 2018 04:48:59 +0200 Subject: [PATCH] cmake: Adjusted test for time.h, added test of strtoll function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 2 ++ ConfigureChecks.cmake | 8 +++++++- config.h.cmake | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3648f1..d670466 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,9 @@ set( VERSION R14.1.0 ) include( FindPkgConfig ) include( CheckIncludeFile ) +include( CheckIncludeFiles ) include( CheckLibraryExists ) +include( CheckFunctionExists ) include( CheckCSourceCompiles ) include( CheckCXXSourceCompiles ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 0c8966b..4b2708e 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -33,4 +33,10 @@ endif( WITH_GCC_VISIBILITY ) check_include_file( "sys/select.h" HAVE_SYS_SELECT_H ) check_include_file( "sys/time.h" HAVE_SYS_TIME_H ) -check_include_file( "time.h" TIME_WITH_SYS_TIME ) + +check_include_files( "sys/time.h;time.h" TIME_WITH_SYS_TIME ) + + +#### check for functions + +check_function_exists( strtoll HAVE_STRTOLL ) diff --git a/config.h.cmake b/config.h.cmake index ff9b61c..618f11a 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -13,8 +13,8 @@ // Defined to 1 if you have 'sys/select.h' header #cmakedefine HAVE_SYS_SELECT_H 1 -// Defined to 1 if you have 'time.h' header +// Defined to 1 if 'time.h' header can be included together with 'sys/time.h' #cmakedefine TIME_WITH_SYS_TIME 1 // We should have 'strtol, strtoll' in stdlib.h header or in cstdlib with c++ -#define HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOLL 1