]> Savannah Git Hosting - gnulib.git/commitdiff
Add back gl_SILENT.
authorBruno Haible <bruno@clisp.org>
Fri, 18 Sep 2020 23:58:12 +0000 (01:58 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 18 Sep 2020 23:58:12 +0000 (01:58 +0200)
* m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): New macros.

ChangeLog
m4/gnulib-common.m4

index 703da605853e85ed886f17775eda10bdb45fe59c..eedff8894e04c53b6a28d906488822e0dcb4782d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-18  Bruno Haible  <bruno@clisp.org>
+
+       Add back gl_SILENT.
+       * m4/gnulib-common.m4 (GL_TMP_FD, gl_SILENT): New macros.
+
 2020-09-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        c-stack-tests: fix -fsanitize=undefined false alarm
index c9f8ca6db67df52dd72a46383287039ba4a81a5f..57343e440a18855108a8961d1a9b02ee2d555b12 100644 (file)
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 59
+# gnulib-common.m4 serial 60
 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,
@@ -630,6 +630,22 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
+AC_DEFUN([gl_SILENT],
+[
+  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+  $1
+  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
+])
+
 # 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.