From 21e16fbf18b62a36be886d7c15d1671d3971db66 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 24 May 2020 18:36:10 +0100 Subject: [PATCH] autoconf: Check for adns_if_monotonic and define USE_MONOTONIC Nothing uses this yet. Split out into its own commit for clarity. This flag is not yet in any released version of adns but as adns upstream I promise this is how it will be. for my convenience I am making secnet check for it ahead of its existence in public adns.... Signed-off-by: Ian Jackson --- config.h.in | 3 +++ configure | 37 +++++++++++++++++++++++++++++++++++++ configure.ac | 8 ++++++++ 3 files changed, 48 insertions(+) diff --git a/config.h.in b/config.h.in index a99e83f..7455fb9 100644 --- a/config.h.in +++ b/config.h.in @@ -68,6 +68,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Use CLOCK_MONOTONIC and adns_if_monotonic */ +#undef USE_MONOTONIC + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD diff --git a/configure b/configure index 152c8ed..7cf4421 100755 --- a/configure +++ b/configure @@ -4219,6 +4219,43 @@ else $as_echo "$as_me: WARNING: Disabling IPv6 support" >&2;} fi +ac_fn_c_check_decl "$LINENO" "adns_if_monotonic" "ac_cv_have_decl_adns_if_monotonic" " + # include + # include + # include + # include + # include + # include + # include + # include + + # include + # include + # include + # include + # include + # include + # include + # include + + +#include + +" +if test "x$ac_cv_have_decl_adns_if_monotonic" = xyes; then : + + +$as_echo "#define USE_MONOTONIC 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Using non-monotonic clock, due to lack of adns_if_monotonic" >&5 +$as_echo "$as_me: WARNING: Using non-monotonic clock, due to lack of adns_if_monotonic" >&2;} + +fi + + _SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES common.make" diff --git a/configure.ac b/configure.ac index 471a6e7..53810e4 100644 --- a/configure.ac +++ b/configure.ac @@ -137,6 +137,14 @@ else AC_MSG_WARN([Disabling IPv6 support]) fi +AC_CHECK_DECL([adns_if_monotonic],[ + AC_DEFINE([USE_MONOTONIC],[1],[Use CLOCK_MONOTONIC and adns_if_monotonic]) +],[ + AC_MSG_WARN([Using non-monotonic clock, due to lack of adns_if_monotonic]) +],[AC_INCLUDES_DEFAULT +#include +]) + SUBDIRMK_MAKEFILES(common.make) AC_OUTPUT(, -- 2.30.2