chiark / gitweb /
autoconf: Check for adns_if_monotonic and define USE_MONOTONIC
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 May 2020 17:36:10 +0000 (18:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 24 May 2020 19:47:10 +0000 (20:47 +0100)
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 <ijackson@chiark.greenend.org.uk>
config.h.in
configure
configure.ac

index a99e83f1ce52faef56789141ec8041ea4957eb63..7455fb93e1e34453cac278aea2dbd716a8978d01 100644 (file)
@@ -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
index 152c8ed24a97d24ddf74a60ffa670c0aa7d94133..7cf44213db46f41742d4d17078188055feefa231 100755 (executable)
--- 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 <sys/types.h>
+          # include <sys/stat.h>
+          # include <stdlib.h>
+          # include <stddef.h>
+          # include <string.h>
+          # include <inttypes.h>
+          # include <stdint.h>
+          # include <unistd.h>
+
+          # include <sys/types.h>
+          # include <sys/stat.h>
+          # include <stdlib.h>
+          # include <stddef.h>
+          # include <string.h>
+          # include <inttypes.h>
+          # include <stdint.h>
+          # include <unistd.h>
+
+
+#include <adns.h>
+
+"
+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"
index 471a6e77db56f726b675cdad6114732c200a4109..53810e4a53eb1cbfae521db0edf8de898974b31c 100644 (file)
@@ -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 <adns.h>
+])
+
 SUBDIRMK_MAKEFILES(common.make)
 
 AC_OUTPUT(,