1Remove when clock-gettime is fixed for clock_getcpuclockid.
2
3See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00227.html>
4for details.
5
6diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
7index 0bec0ef..fb3a17a 100644
8--- a/m4/clock_time.m4
9+++ b/m4/clock_time.m4
10@@ -24,8 +24,15 @@ AC_DEFUN([gl_CLOCK_TIME],
11   AC_SUBST([LIB_CLOCK_GETTIME])
12   gl_saved_libs=$LIBS
13     AC_SEARCH_LIBS([clock_gettime], [rt posix4],
14-                   [test "$ac_cv_search_clock_gettime" = "none required" ||
15-                    LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
16-    AC_CHECK_FUNCS([clock_gettime clock_settime])
17+                   [if test "$ac_cv_search_clock_gettime" = "none required"; then
18+                      AC_SEARCH_LIBS([clock_getcpuclockid], [rt posix4],
19+                                     [test "$ac_cv_search_clock_getcpuclockid" = "none required" \
20+                                      || LIB_CLOCK_GETTIME=$ac_cv_search_clock_getcpuclockid],
21+                                     [test "$ac_cv_search_clock_gettime" = "none required" \
22+                                      || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
23+                    else
24+                      LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
25+                    fi])
26+    AC_CHECK_FUNCS([clock_gettime clock_settime clock_getcpuclockid])
27   LIBS=$gl_saved_libs
28 ])
29