From bda2d7559f18b2e02050dc433c5ff70cec8e3362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 16 Jan 2021 00:25:29 +0100 Subject: Add sys/time.h and time.h header detection to resolve FTBFS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- CMakeLists.txt | 1 + ConfigureChecks.cmake | 3 +++ config.h.cmake | 6 ++++++ configure.in.in | 3 +++ src/torkview.cpp | 7 ++++++- 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3547cfe..63cb36b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ include( FindPkgConfig ) include( CheckFunctionExists ) include( CheckSymbolExists ) include( CheckIncludeFile ) +include( CheckIncludeFiles ) include( CheckIncludeFileCXX ) include( CheckLibraryExists ) include( CheckCSourceCompiles ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index acda08b..b36d0e7 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -35,6 +35,9 @@ find_package( X11 ) check_include_file( stdint.h HAVE_STDINT_H ) check_include_file( inttypes.h HAVE_INTTYPES_H ) +check_include_file( "sys/time.h" HAVE_SYS_TIME_H ) +check_include_files( "sys/time.h;time.h" TIME_WITH_SYS_TIME ) + ##### check for GnuTLS or OpenSSL( default ) diff --git a/config.h.cmake b/config.h.cmake index a8b653b..59360ae 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -22,6 +22,12 @@ /* Defined if you have header */ #cmakedefine HAVE_INTTYPES_H 1 +// Defined to 1 if you have 'sys/time.h' header +#cmakedefine HAVE_SYS_TIME_H 1 + +// Defined to 1 if 'time.h' header can be included together with 'sys/time.h' +#cmakedefine TIME_WITH_SYS_TIME 1 + /* Disable features for LIVECD use */ #cmakedefine LIVECD 1 diff --git a/configure.in.in b/configure.in.in index 6317614..71dcdc9 100644 --- a/configure.in.in +++ b/configure.in.in @@ -496,6 +496,9 @@ AC_CHECK_FUNCS(strchr memcpy getopt_long) AC_CHECK_HEADERS(unistd.h string.h libiberty.h) AC_HEADER_STAT +AC_HEADER_TIME +AC_CHECK_HEADERS(sys/time.h) + dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T diff --git a/src/torkview.cpp b/src/torkview.cpp index ff76276..8aa8ba1 100644 --- a/src/torkview.cpp +++ b/src/torkview.cpp @@ -44,7 +44,12 @@ #include #include -#include +#if defined(HAVE_SYS_TIME_H) +# include +#endif +#if defined(TIME_WITH_SYS_TIME) +# include +#endif /* Linux-specific includes */ #include -- cgit v1.2.1