Back to the Main Page. | peti_silent_mode |
Download the M4 Source. |
PETI_SILENT_MODE(on/off)
1.1.1.1 (2001/07/26) Miscellaneous @ ac-archive-0.5.39
Peter Simons <simons@computer.org>
Some macros provided by autoconf do automatically issue screen output when called, for example AC_CHECK_LIB. This may be undesirable at times, for example when these routines are called within a more complex macro consisting of several tests in a row.
Hence this macro provides a mechanism to switch screen output by autoconf generally off. All screen i/o within configure scripts takes place on file descriptor "6", which is in fact a copy of the standard output. By setting this file descriptor to "/dev/null" or to standard output again, silent mode can be enabled or disabled.
PETI_SILENT_MODE(on) dnl be silent
AC_PROG_CXX
PETI_SILENT_MODE(off) dnl talk to me again
AC_PROG_RANLIB
This macro was proposed and inspired by Paolo Bonzini <bonzini@gnu.org>.
AC_DEFUN([PETI_SILENT_MODE], [ case "$1" in on) exec 6>/dev/null ;; off) exec 6>&1 ;; *) AC_MSG_ERROR(Silent mode can only be switched "on" or "off".) ;; esac ])