]> granicus.if.org Git - mutt/commitdiff
Add autoconf search for clock_gettime.
authorKevin McCarthy <kevin@8t8.us>
Mon, 24 Jul 2017 18:19:05 +0000 (11:19 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 24 Jul 2017 18:19:05 +0000 (11:19 -0700)
It appears to be specified in POSIX.1-2001, so just abort if it's not found.

Add a missing time.h include in mutt_socket.c

configure.ac
mutt_socket.c

index 4f41632a9b32c40c6ecde29dbf76f818160730db..ef408ca90555a57e707c81d84ec0990dea32920e 100644 (file)
@@ -642,6 +642,14 @@ dnl -- end socket dependencies --
 if test "$need_socket" = "yes"
 then
         AC_CHECK_HEADERS([sys/select.h])
+
+        mutt_save_LIBS="$LIBS"
+        LIBS=
+        AC_SEARCH_LIBS([clock_gettime], [rt],
+                MUTTLIBS="$MUTTLIBS $LIBS",
+                AC_MSG_ERROR([Unable to find clock_gettime function]))
+        LIBS="$mutt_save_LIBS"
+
         AC_MSG_CHECKING([for socklen_t])
         AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
                 AC_MSG_RESULT([no])
index d4b22973e4f14a96971fd5ccfd1592a78c7da6e9..bd585c759d7f95551678cb6d41c702cc6d004696 100644 (file)
@@ -41,6 +41,7 @@
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
+#include <time.h>
 #include <sys/socket.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>