autoconf: File Descriptor Macros

1 
1 9.4 File Descriptor Macros
1 ==========================
1 
1 The following macros define file descriptors used to output messages
1 (or input values) from `configure' scripts.  For example:
1 
1      echo "$wombats found" >&AS_MESSAGE_LOG_FD
1      echo 'Enter desired kangaroo count:' >&AS_MESSAGE_FD
1      read kangaroos <&AS_ORIGINAL_STDIN_FD`
1 
1 However doing so is seldom needed, because Autoconf provides higher
1 level macros as described below.
1 
1  -- Macro: AS_MESSAGE_FD
1      The file descriptor for `checking for...'  messages and results.
1      By default, `AS_INIT' sets this to `1' for standalone M4sh
1      clients.  However, `AC_INIT' shuffles things around to another file
1      descriptor, in order to allow the `-q' option of `configure' to
1      choose whether messages should go to the script's standard output
1      or be discarded.
1 
1      If you want to display some messages, consider using one of the
1      printing macros (⇒Printing Messages) instead.  Copies of
1      messages output via these macros are also recorded in `config.log'.
1 
1  -- Macro: AS_MESSAGE_LOG_FD
1      This must either be empty, or expand to a file descriptor for log
1      messages.  By default, `AS_INIT' sets this macro to the empty
1      string for standalone M4sh clients, thus disabling logging.
1      However, `AC_INIT' shuffles things around so that both `configure'
1      and `config.status' use `config.log' for log messages.  Macros
11      that run tools, like `AC_COMPILE_IFELSE' (⇒Running the
      Compiler), redirect all output to this descriptor.  You may want
1      to do so if you develop such a low-level macro.
1 
1  -- Macro: AS_ORIGINAL_STDIN_FD
1      This must expand to a file descriptor for the original standard
1      input.  By default, `AS_INIT' sets this macro to `0' for standalone
1      M4sh clients.  However, `AC_INIT' shuffles things around for
1      safety.
1 
1      When `configure' runs, it may accidentally execute an interactive
1      command that has the same name as the non-interactive meant to be
1      used or checked.  If the standard input was the terminal, such
1      interactive programs would cause `configure' to stop, pending some
1      user input.  Therefore `configure' redirects its standard input
1      from `/dev/null' during its initialization.  This is not normally
1      a problem, since `configure' normally does not need user input.
1 
1      In the extreme case where your `configure' script really needs to
1      obtain some values from the original standard input, you can read
1      them explicitly from `AS_ORIGINAL_STDIN_FD'.
1