Skip to content

Commit

Permalink
configure: check properly for the monotonic clock POSIX option
Browse files Browse the repository at this point in the history
  • Loading branch information
wferi committed Oct 12, 2017
1 parent c85640e commit 74f7cdc
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -182,18 +182,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
]
)

AC_MSG_CHECKING(for a working clock_getres(CLOCK_MONOTONIC, &ts))
AC_MSG_CHECKING([for the monotonic clock POSIX option])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include <time.h>]],
[[struct timespec ts; if(clock_getres(CLOCK_MONOTONIC, &ts)) return -1;]])],
[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([HAVE_CLOCK_GETRES_MONOTONIC], 1, [Define to 1 if clock_getres(CLOCK_MONOTONIC, &ts) works])
],
[
AC_MSG_RESULT([no])
]
)
[[#include <unistd.h>]],
[[/* positive value signifies unconditional availability */
int a[_POSIX_MONOTONIC_CLOCK-1];]])],
[AC_MSG_RESULT([yes])],[AC_MSG_FAILURE([no])])


# Checks for library functions
Expand Down

0 comments on commit 74f7cdc

Please sign in to comment.