-
Notifications
You must be signed in to change notification settings - Fork 8
/
acinclude.m4
29 lines (29 loc) · 870 Bytes
/
acinclude.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# check for clock_gettime(CLOCK_MONOTONIC, ...)
AC_DEFUN([EL_CLOCK_MONOTONIC],
[
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CACHE_CHECK([for CLOCK_MONOTONIC],
ac_cv_have_clock_monotonic,
[
AC_TRY_RUN(
[
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
int main() {
struct timespec ts;
return !!clock_gettime(CLOCK_MONOTONIC, &ts);
}
],
[ ac_cv_have_clock_monotonic="yes"],
[ ac_cv_have_clock_monotonic="no" ]
)
])
AM_CONDITIONAL(HAVE_CLOCK_MONOTONIC, test x$ac_cv_have_clock_monotonic = xyes)
if test x$ac_cv_have_clock_monotonic = xyes; then
AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, [Have symbol CLOCK_MONOTONIC])
fi
])