summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-16 12:17:49 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-08-16 12:17:49 +0000
commit47ee94c511129ba7f5e0f8c6cf79486f37009efa (patch)
tree12f72cc6a863fdf896f0a804e7c13eb764db7305
parent3b4636871e82d88e545cfce8e93109a5ed00e548 (diff)
Improved monotonic clock detection in configure.ac
-rw-r--r--configure.ac15
1 files changed, 12 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 263e1f17..1742d16f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -678,8 +678,8 @@ AC_MSG_CHECKING([[for clock_get_time]])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[
- #include <mach/clock.h>
- #include <mach/mach.h>
+#include <mach/clock.h>
+#include <mach/mach.h>
]],
[[
clock_serv_t cs;
@@ -699,7 +699,16 @@ AC_LINK_IFELSE(
AC_MSG_CHECKING([[for gethrtime]])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
- [[#include <sys/time.h>]], [[hrtime_t hrt = gethrtime(); ]])
+ [[
+#ifdef HAVE_SYS_TIME_H
+/* Solaris define gethrtime() in sys/time.h */
+#include <sys/time.h>
+#endif /* HAVE_SYS_TIME_H */
+#ifdef HAVE_TIME_H
+/* HP-UX define gethrtime() in time.h */
+#include <time.h>
+#endif /* HAVE_TIME_H */
+ ]], [[hrtime_t hrt = gethrtime(); ]])
],
[
AC_DEFINE([HAVE_GETHRTIME], [1], [Define to 1 if you have `gethrtime' function.])