diff --git a/acinclude.m4 b/acinclude.m4 index ba8b09031..5bd1cedab 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -529,8 +529,14 @@ AC_DEFUN([gl_CLOCK_TIME], AC_SUBST([LIB_CLOCK_GETTIME]) gl_saved_libs=$LIBS AC_SEARCH_LIBS([clock_gettime], [rt posix4], - [test "$ac_cv_search_clock_gettime" = "none required" || - LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) - AC_CHECK_FUNCS([clock_gettime clock_settime]) + [if test "$ac_cv_search_clock_gettime" = "none required"; then + AC_SEARCH_LIBS([clock_getcpuclockid], [rt posix4], + [test "$ac_cv_search_clock_getcpuclockid" = "none required" \ + || LIB_CLOCK_GETTIME=$ac_cv_search_clock_getcpuclockid], + [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) + else + LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime + fi]) + AC_CHECK_FUNCS([clock_gettime clock_settime clock_getcpuclockid]) LIBS=$gl_saved_libs ]) diff --git a/configure.ac b/configure.ac index 682a9c494..067e395a4 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,8 @@ AC_PROG_LN_S dnl Gnulib. gl_INIT dnl FIXME: remove me and the acinclude.m4 code when clock-gettime is -dnl LGPL-compatible and can be imported normally. +dnl fixed for clock_getcpuclockid and can be imported normally from +dnl gnulib. gl_CLOCK_TIME AC_PROG_CC_C89