]> Savannah Git Hosting - gnulib.git/commitdiff
sigprocmask: Small autoconf macro improvement.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Jul 2020 23:54:38 +0000 (01:54 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Jul 2020 23:54:38 +0000 (01:54 +0200)
* m4/signalblocking.m4 (gl_SIGNALBLOCKING): Make it possible for the
user to override the value of gl_cv_func_sigprocmask.
* m4/gnulib-common.m4 (gl_SILENT): New macro.

ChangeLog
m4/gnulib-common.m4
m4/signalblocking.m4

index d81a1d7019080f872bb08f95b7c3dffc592e85b8..e1c40b346c6bb8e253caf89ff14441054da6c555 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-07-25  Bruno Haible  <bruno@clisp.org>
+
+       sigprocmask: Small autoconf macro improvement.
+       * m4/signalblocking.m4 (gl_SIGNALBLOCKING): Make it possible for the
+       user to override the value of gl_cv_func_sigprocmask.
+       * m4/gnulib-common.m4 (gl_SILENT): New macro.
+
 2020-07-25  Bruno Haible  <bruno@clisp.org>
 
        Small autoconf macro improvements.
index dfd4a258e5d455940a42759750c88d9245d517bf..7449648c6ed63e06b55bd577fb8d2415accbb185 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 51
+# gnulib-common.m4 serial 52
 dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -626,6 +626,15 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+AC_DEFUN([gl_SILENT],
+[
+  {
+    $1
+  } AS_MESSAGE_FD>/dev/null
+])
+
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
 # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
 # output a spurious "(cached)" mark in the midst of other configure output.
index 74de53444c10264a9b1f74d1d8ecd3fe8fdb273d..0f72dd2870a8f4e5af718c36d2446dac2c869433 100644 (file)
@@ -1,4 +1,4 @@
-# signalblocking.m4 serial 14
+# signalblocking.m4 serial 15
 dnl Copyright (C) 2001-2002, 2006-2020 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,10 +13,19 @@ AC_DEFUN([gl_SIGNALBLOCKING],
 [
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
-  if test $gl_cv_type_sigset_t = yes; then
-    AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
-  fi
-  if test -z "$gl_cv_func_sigprocmask"; then
+  AC_CACHE_CHECK([for sigprocmask],
+    [gl_cv_func_sigprocmask],
+    [if test $gl_cv_type_sigset_t = yes; then
+       gl_SILENT([
+         AC_CHECK_FUNC([sigprocmask],
+           [gl_cv_func_sigprocmask=yes],
+           [gl_cv_func_sigprocmask=no])
+       ])
+     else
+       gl_cv_func_sigprocmask=no
+     fi
+    ])
+  if test $gl_cv_func_sigprocmask != yes; then
     HAVE_POSIX_SIGNALBLOCKING=0
   fi
 ])