bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: bug-gnulib@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: [PATCH] timer-time: port better to OpenBSD 6.9
Date: Sat,  2 Oct 2021 17:53:23 -0700	[thread overview]
Message-ID: <20211003005323.252458-1-eggert@cs.ucla.edu> (raw)

* 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        |  4 ++++
 m4/timer_time.m4 | 11 ++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9bae3c4a3..232d2dec3 100644
--- 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
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4
index f0e5785e9..003e36e9d 100644
--- a/m4/timer_time.m4
+++ b/m4/timer_time.m4
@@ -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
+  ])
 ])
-- 
2.30.2



                 reply	other threads:[~2021-10-03  0:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211003005323.252458-1-eggert@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).