diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-24 15:46:52 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-02-24 15:46:52 +0000 |
commit | 9bedcb071720dd506384ece87df06417e8ed3c49 (patch) | |
tree | 47d03e584f83274742569ee89e68f96e6a3ec9f8 /configure.ac | |
parent | dac0a716ad969ef3a4d179f50697d8cb0e7b15ac (diff) |
Modernize checks for monotonic clock
Part of a patch by Javier Jardón.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32245
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 8440c2ce..4ab8b4a1 100644 --- a/configure.ac +++ b/configure.ac @@ -817,15 +817,17 @@ AC_CHECK_FUNC(pthread_condattr_setclock,have_pthread_condattr_setclock=true,have if test x$have_pthread_condattr_setclock = xtrue; then AC_SEARCH_LIBS([clock_getres],[rt],[THREAD_LIBS="$THREAD_LIBS -lrt"]) AC_MSG_CHECKING([for CLOCK_MONOTONIC]) - AC_TRY_COMPILE([#include <time.h> + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h> #include <pthread.h> -], [ +]], [[ struct timespec monotonic_timer; pthread_condattr_t attr; pthread_condattr_init (&attr); pthread_condattr_setclock (&attr, CLOCK_MONOTONIC); clock_getres (CLOCK_MONOTONIC,&monotonic_timer); -], have_clock_monotonic=true, have_clock_monotonic=false) +]])], +[have_clock_monotonic=true], +[have_clock_monotonic=false]) if test x$have_clock_monotonic = xtrue; then AC_MSG_RESULT([found]) AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC]) |