From e9391c93fbdcde41cbde9a0f14a4ac8374dd11cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20B=C3=B6ger?= <mail@lboeger.de>
Date: Mon, 31 May 2021 08:57:04 +0100
Subject: [PATCH] mimic Makefile's ntp and stdint conditional compilation

---
 CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c0bde2c..cba9b1fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,7 @@ project(chibi-scheme LANGUAGES C VERSION ${version}
     DESCRIPTION "Chibi-Scheme: minimal r7rs implementation, release: ${release}")
 
 include(CheckIncludeFile)
+include(CheckSymbolExists)
 
 
 endif()
@@ -25,7 +26,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 #
 
 check_include_file(poll.h HAVE_POLL_H)
-check_include_file(stdint.h HAVE_STDINT_H)
+check_symbol_exists(ntp_gettime sys/timex.h HAVE_NTP_GETTIME)
+check_symbol_exists(int_least8_t inttypes.h HAVE_STDINT_H)
 
 if (WIN32 AND NOT CYGWIN)
     set(DEFAULT_SHARED_LIBS OFF)