]> Savannah Git Hosting - gnulib.git/commitdiff
timer-time: port better to OpenBSD 6.9
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Oct 2021 00:50:48 +0000 (17:50 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 3 Oct 2021 00:53:04 +0000 (17:53 -0700)
* m4/timer_time.m4 (gl_TIMER_TIME): Also require timer_settime to
be declared, as it exists in OpenBSD but always fails with ENOSYS.

ChangeLog
m4/timer_time.m4

index 9bae3c4a3987a2c366bdd86019394e0d861fe201..232d2dec3b0106bf46feccdb78830c01f18909bc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2021-10-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       timer-time: port better to OpenBSD 6.9
+       * m4/timer_time.m4 (gl_TIMER_TIME): Also require timer_settime to
+       be declared, as it exists in OpenBSD but always fails with ENOSYS.
+
        sys_select: port better to OpenBSD 6.9
        OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
        includes <signal.h>, which caused coreutils/lib/nproc.c compiles
index f0e5785e9aa3f2325edd2e201efb22e0853bda16..003e36e9d14807c4ceeec599f558c02043a90e87 100644 (file)
@@ -1,4 +1,4 @@
-# timer_time.m4 serial 4
+# timer_time.m4 serial 5
 dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -18,9 +18,13 @@ AC_DEFUN([gl_TIMER_TIME],
   dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
   m4_ifdef([gl_][PTHREADLIB], [AC_REQUIRE([gl_][PTHREADLIB])])
 
+  AC_CHECK_DECL([timer_settime], [], [],
+                [[#include <time.h>
+                ]])
   LIB_TIMER_TIME=
   AC_SUBST([LIB_TIMER_TIME])
-  gl_saved_libs=$LIBS
+  AS_IF([test "$ac_cv_have_decl_timer_settime" = yes], [
+    gl_saved_libs=$LIBS
     AC_SEARCH_LIBS([timer_settime], [rt posix4],
                    [test "$ac_cv_search_timer_settime" = "none required" ||
                     LIB_TIMER_TIME=$ac_cv_search_timer_settime])
@@ -40,5 +44,6 @@ AC_DEFUN([gl_TIMER_TIME],
          ],
          [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBPMULTITHREAD"])])
     AC_CHECK_FUNCS([timer_settime])
-  LIBS=$gl_saved_libs
+    LIBS=$gl_saved_libs
+  ])
 ])