Re: document how to override test results

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Parent Message unknown Re: document how to override test results

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Bruno,

* Bruno Haible wrote on Tue, Sep 01, 2009 at 10:46:41PM CEST:
> Ralf Wildenhues wrote:
> > the user
> > will prefer the simplest and fastest way to get over a build failure.
>
> So, please document the possible ways of getting over a build failure.
> Currently, the manual is silent about this.

I understand that you would like the process to be formalized; and I
agree with you that formalizing it where it is possible and not
detrimental may be useful.  However, to some extent debugging will
always remain an area that requires some experimentation, and also
allows (and sometimes requires) looking under the hood: when debugging,
internal details are fair game, and nothing is forbidden, no full
portability is needed, only whatever necessary to build the package at
hand, or similar task.

That said, let's see how we can improve the documentation here.

> > I think it would be better if Automake stated plainly:
> >
> >    Prefer using $(variable) over @variable@.  That enables the user
> >    to override the setting of the variable at `make' run time.
> >
> > I thought the manual already said this, but I can't find it right now.
>
> This is only a partial answer to the problem. It helps only if one of
> the AC_PROG_*, AC_CHECK_PROG*, AC_CHECK_TOOL* macros guessed wrong.

Sure.  But often, package authors also know of other potential trouble
spots.  As a practical example I happened to run over, cross compilation
of packages that also use generator programs (i.e., code written for the
$build compiler, not the $host compiler), as a very first preliminary
step for good cross compilation support you can often get away with
putting this in your Makefile.am:
  CC_FOR_BUILD = $(CC)
  CFLAGS_FOR_BUILD = $(CFLAGS)
  FOOLIB_FOR_BUILD = $(FOOLIB)

  generator:
        $(CC_FOR_BUILD) ...

That way, the package works for a native setup, and fails for a cross
setup, but one can easily override CC_FOR_BUILD and FOOLIB_FOR_BUILD
at 'make' time , and proceed from there (those of your users that cross
compile typically aren't afraid to use such workarounds to proceed,
either); you can then take your time to set up a properly
cross-compilable package.

> What if the user wants to override the results of the following
> autoconf tests?
>   - AC_CHECK_TYPES([uid_t])
>   - AC_CHECK_LIB([nsl], [gethostname])
>   - AC_FUNC_GETGROUPS
>   - AC_FUNC_MKTIME
>   - AC_CHECK_FUNC([foo])
>   - AC_REPLACE_FUNCS([foo])
>   - AC_CHECK_HEADER([stdbool.h])
>   - AC_CHECK_DECL([errno],,,[#include <errno.h>])
>   - AC_CHECK_MEMBER([struct stat.st_blksize])
>   - AC_SYS_LARGEFILE
>   - AC_CANONICAL_HOST
>
> Currently only a few autoconf wizards know how to do it. The doc does
> not say it.

It is true that the docs do not say it.  However, configure is still a
shell script, and while granted that they are pretty complex, it is not
impossible to find out how things work or how variables are named, even
if they are not defined.  Debuggability was one of the main reasons to
use a scripting language IIRC.  Maybe we have departed too far from that
today, I don't know.

Anyway, it may be a good idea to go through the list of tests, both
particular and generic ones, and consider documenting the cache
variables and their semantics where feasible.  I'll reply with a patch
series to start the ball on this, on autoconf-patches.

Documenting cache variables (names and semantics) of course make changes
to them interface changes.  While this has been a problem in practice on
several occasions already anyway, we'd definitely now need to treat them
as such: keep them at the minimum amount, list changes in NEWS etc.

Thanks,
Ralf



[PATCH 1/5] Document AM_MAKEFLAGS workaround to the macro override problem.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* doc/autoconf.texi (Macros and Submakes): Automake makefiles
provide AM_MAKEFLAGS to help with overriding macros in submake
invocations.
Prompted by bug report from Bruno Haible.
---
 doc/autoconf.texi |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 72ebde0..5a425d7 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -18106,6 +18106,10 @@ Macros and Submakes
 You need to foresee all macros that a user might want to override if
 you do that.
 
+Makefiles generated by @command{automake} expand @code{$(AM_MAKEFLAGS)}
+on the command line of submakes, which can be used for propagated overrides
+(@pxref{Subdirectories, , Automake, automake, @acronym{GNU} Automake}).
+
 @node The Make Macro MAKEFLAGS
 @section The Make Macro MAKEFLAGS
 @cindex @code{MAKEFLAGS} and @command{make}
--
1.6.3.2.388.gb7132




[PATCH 2/5] New FAQ node: Debugging.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* doc/autoconf.texi (Debugging): New node.
(Top, FAQ): Adjust menus.
Report by Bruno Haible.
---
 doc/autoconf.texi |  105 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 105 insertions(+), 0 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 5a425d7..1244ef3 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -621,6 +621,7 @@ Top
 * Autom4te Cache::              What is it?  Can I remove it?
 * Present But Cannot Be Compiled::  Compiler and Preprocessor Disagree
 * Expanded Before Required::    Expanded Before Required
+* Debugging::                   Debugging @command{configure} scripts
 
 History of Autoconf
 
@@ -23326,6 +23327,7 @@ FAQ
 * Autom4te Cache::              What is it?  Can I remove it?
 * Present But Cannot Be Compiled::  Compiler and Preprocessor Disagree
 * Expanded Before Required::    Expanded Before Required
+* Debugging::                   Debugging @command{configure} scripts
 @end menu
 
 @node Distributing
@@ -23851,6 +23853,109 @@ Expanded Before Required
 @end example
 
 
+@node Debugging
+@section Debugging @command{configure} scripts
+
+While in general, @command{configure} scripts generated by Autoconf
+strive to be fairly portable to various systems, compilers, shells, and
+other tools, it may still be necessary to debug a failing test, broken
+script or makefile, or fix or override an incomplete or wrong test,
+especially during macro development.  Failures can occur on all levels,
+in M4 syntax or semantics, shell script issues, or due to bugs in the
+test or the tools invoked by @command{configure}.  Together with the
+rather arcane error message which @command{m4} and @command{make} may
+produce when their input has syntax errors, this can make debugging
+rather painful.
+
+Nevertheless, here is a list of hints and strategies that may help:
+
+@itemize
+@item
+When @command{autoconf} fails, common causes for error include:
+
+@itemize
+@item
+mismatched or unbalanced parentheses or braces (@pxref{Balancing
+Parentheses}),
+
+@item under- or overquoted macro arguments (@pxref{Autoconf
+Language}, @pxref{Quoting and Parameters}, @pxref{Quotation and Nested
+Macros}),
+
+@item spaces between macro name and opening parenthesis (@pxref{Autoconf
+Language}).
+@end itemize
+
+Typically, it helps to go back to the last working version of the input
+and compare the differences for each of these errors.  Another
+possibility is to sprinkle pairs of @code{m4_traceon} and
+@code{m4_traceoff} judiciously in the code, either without a parameter
+or listing some macro names and watch @command{m4} expand its input
+verbosely (@pxref{Debugging via autom4te}).
+
+@item
+Debugging @command{configure} script execution may be done by sprinkling
+pairs of @code{set -x} and @code{set +x} into the shell script before
+and after the region that contains a bug.  Running the whole script with
+@samp{@var{shell} ./configure -vx 2>&1 | tee @var{log-file}} with a decent
+@var{shell} may work, but produces lots of output.  Here, it can help to
+search for markers like @samp{checking for} a particular test in the
+@var{log-file}.
+
+@item
+When @command{configure} tests produce wrong or insufficient results for
+your system, it may be necessary to override them:
+
+@itemize
+@item
+For programs, tools or libraries variables, preprocessor, compiler, or
+linker flags, it is often sufficient to override them at @command{make}
+run time with some care (@pxref{Macros and Submakes}).  Since this
+normally won't cause @command{configure} to be run again with these
+changed settings, it may fail if the changed variable would have caused
+different test results from @command{configure}, so this may work only
+for simple differences.  Erroneous test results that only define macros
+in a @file{config.h} header file may be worked around by editing said
+header file and rebuilding; be sure to have dependency tracking enabled
+or run @code{make clean} beforehand, so that objects are recompiled
+appropriately.
+
+@item
+Most tests which produce their result in a substituted variable allow to
+override the test by setting the variable on the @command{configure}
+command line (@pxref{Compilers and Options}, @pxref{Defining Variables},
+@pxref{Particular Systems}).
+
+@item
+Many tests store their result in a cache variable (@pxref{Caching
+Results}).  This allows to override them either on the
+@command{configure} command line as above, or through a primed cache or
+site file (@pxref{Cache Files}, @pxref{Site Defaults}).  The name of a
+cache variable is documented with a test macro or may be inferred from
+@ref{Cache Variable Names}; the precise semantics of undocumented
+variables are often internal details, subject to change.
+@end itemize
+@end itemize
+
+Conversely, as macro author, you can make it easier for users of your
+macro:
+
+@itemize
+@item
+by minimizing dependencies between tests and between test results as far
+as possible,
+
+@item
+by using @command{make} variables to factorize and allow
+override of settings at @command{make} run time,
+
+@item
+by honoring the @acronym{GNU} Coding Standards and not overriding flags
+reserved for the user except temporarily during @command{configure}
+tests.
+@end itemize
+
+
 @c ===================================================== History of Autoconf.
 
 @node History
--
1.6.3.2.388.gb7132




[PATCH 3/5] New cache variable index in the manual.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* doc/autoconf.texi: Define new index `CA' for cache variables.
(caindex): New macro.
(Cache Variable Index): New appendix node.
(Top, Indices): Adjust menus.
(Cache Variable Names, Site Defaults): Adjust text.
* doc/Makefile.am (CLEANFILES): Add files generated for CA index.
---

I wanted to use 'cv' as defcodeindex for the cache variable index this
but that was already used for CPP variables.  Hmm.

Cheers,
Ralf

 doc/Makefile.am   |    1 +
 doc/autoconf.texi |   43 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 1e4e53e..fd1ab33 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -30,4 +30,5 @@ EXTRA_DIST = gendocs_template
 # not know.
 CLEANFILES = autoconf.ACs  autoconf.cvs  autoconf.MSs  autoconf.prs \
      autoconf.ATs  autoconf.evs  autoconf.fns  autoconf.ovs \
+     autoconf.ca   autoconf.CA   autoconf.cas  autoconf.CAs \
      autoconf.tmp
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 1244ef3..0b0cbee 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -52,6 +52,8 @@
 @defcodeindex ov
 @c Define a CPP variable index.
 @defcodeindex cv
+@c Define a cache variable index.
+@defcodeindex CA
 @c Define an Autoconf macro index that @defmac doesn't write to.
 @defcodeindex AC
 @c Define an Autotest macro index that @defmac doesn't write to.
@@ -154,6 +156,20 @@
 @end ifclear
 
 
+@c @caindex{VARIABLE}
+@c ------------------
+@c Registering an ac_cv_\VARIABLE\ cache variable.
+@ifset shortindexflag
+@macro caindex{macro}
+@CAindex \macro\
+@end macro
+@end ifset
+@ifclear shortindexflag
+@macro caindex{macro}
+@CAindex ac_cv_\macro\
+@end macro
+@end ifclear
+
 @c Define an index for functions: `alloca' etc.  Used for the
 @c portability sections and so on.  We can't use `fn' (aka `fnindex),
 @c since `@defmac' goes into it => we'd get all the macros too.
@@ -636,6 +652,7 @@ Top
 * Environment Variable Index::  Index of environment variables used
 * Output Variable Index::       Index of variables set in output files
 * Preprocessor Symbol Index::   Index of C preprocessor symbols defined
+* Cache Variable Index::        Index of documented cache variables
 * Autoconf Macro Index::        Index of Autoconf macros
 * M4 Macro Index::              Index of M4, M4sugar, and M4sh macros
 * Autotest Macro Index::        Index of Autotest macros
@@ -9234,6 +9251,9 @@ Cache Variable Names
 The values assigned to cache variables may not contain newlines.
 Usually, their values are Boolean (@samp{yes} or @samp{no}) or the
 names of files or functions; so this is not an important restriction.
+@ref{Cache Variable Index} for an index of cache variables with
+documented semantics.
+
 
 @node Cache Files
 @subsection Cache Files
@@ -20385,9 +20405,12 @@ Site Defaults
 that require running a test program.  You could ``prime the cache'' by
 setting those values correctly for that system in
 @file{@var{prefix}/etc/config.site}.  To find out the names of the cache
-variables you need to set, look for shell variables with @samp{_cv_} in
-their names in the affected @command{configure} scripts, or in the Autoconf
-M4 source code for those macros.
+variables you need to set, see the documentation of the respective
+Autoconf macro.  If the variables or their semantics are undocumented,
+you may need to look for shell variables with @samp{_cv_} in their names
+in the affected @command{configure} scripts, or in the Autoconf M4
+source code for those macros; but in that case, their name or semantics
+may change in a future Autoconf version.
 
 The cache file is careful to not override any variables set in the site
 files.  Similarly, you should not override command-line options in the
@@ -24178,6 +24201,7 @@ Indices
 * Environment Variable Index::  Index of environment variables used
 * Output Variable Index::       Index of variables set in output files
 * Preprocessor Symbol Index::   Index of C preprocessor symbols defined
+* Cache Variable Index::        Index of documented cache variables
 * Autoconf Macro Index::        Index of Autoconf macros
 * M4 Macro Index::              Index of M4, M4sugar, and M4sh macros
 * Autotest Macro Index::        Index of Autotest macros
@@ -24212,6 +24236,19 @@ Preprocessor Symbol Index
 
 @printindex cv
 
+@node Cache Variable Index
+@appendixsec Cache Variable Index
+
+This is an alphabetical list of documented cache variables used
+by macros defined in Autoconf.  Autoconf macro may use additional cache
+variables internally.
+@ifset shortindexflag
+To make the list easier to use, the variables are listed without their
+preceding @samp{ac_cv_}.
+@end ifset
+
+@printindex CA
+
 @node Autoconf Macro Index
 @appendixsec Autoconf Macro Index
 
--
1.6.3.2.388.gb7132




[PATCH 4/5] Documentation of specific and general cache variables.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* doc/autoconf.texi (Default Includes, Alternative Programs)
(Particular Programs, Generic Programs, Files, Libraries)
(Function Portability, Particular Functions, Generic Functions)
(Particular Headers, Generic Headers, Declarations)
(Generic Declarations, Particular Structures, Particular Types)
(Specific Compiler Characteristics)
(Generic Compiler Characteristics, C Compiler, System Services):
Document lots of cache variables.
* NEWS: Update.
Suggested by Bruno Haible.
---


Here is a list of macros that are listed in the non-obsolete part of
the manual but whose cache variables I have not documented, including
rationale:

1) Complex semantics and/or contents of the cache variables:

AC_*TOOL*
AC_FUNC_SELECT_ARGTYPES
AC_HEADER_MAJOR
AC_HEADER_RESOLV
AC_HEADER_TIOCGWINSZ
AC_PROG_CPP
AC_C_BIGENDIAN
AC_STRUCT_DIRENT_D_INO
AC_STRUCT_TIMEZONE
AC_TYPE_INTMAX_T
AC_TYPE_UINTMAX_T

2) It's likely that the test might (need to) evolve further (we might
find new bugs in systems or similar), requiring changes in cache
variabls semantics:

AC_FUNC_MMAP
AC_OPENMP

3) Obsolescence:

AC_FUNC_STRFTIME
AC_C_BACKSLASH_A
AC_STRUCT_TM
some more (most of the obsolete ones)

4) Both (1) and (2):

AC_FUNC_VPRITNF
AC_HEADER_DIRENT
AS_HEADER_STAT
AC_C_LONG_DOUBLE

5) Complex semantics; also, on some systems these macros requires a
compile test even with a fully populated cache (which defeats at least
one purpose of cache variables: overriding a bogus test result):

AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T

6) AC_PROG_LN_S has no cache override; this used to be different, and
in fact can be a problem on lesser common systems like DJGPP.

Cheers,
Ralf


 NEWS              |    2 +
 doc/autoconf.texi |  318 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 310 insertions(+), 10 deletions(-)

diff --git a/NEWS b/NEWS
index 262be0c..3fdea30 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,8 @@ GNU Autoconf NEWS - User visible changes.
 
 ** config.status now provides a --config option to produce the configuration.
 
+** Many cache variables used by Autoconf's macros are documented now.
+
 * Major changes in Autoconf 2.64 (2009-07-26) [stable]
   Released by Eric Blake, based on git versions 2.63b.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 0b0cbee..9206475 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -3859,36 +3859,44 @@ Particular Programs
 @defmac AC_PROG_AWK
 @acindex{PROG_AWK}
 @ovindex AWK
+@caindex prog_AWK
 Check for @code{gawk}, @code{mawk}, @code{nawk}, and @code{awk}, in that
 order, and set output variable @code{AWK} to the first one that is found.
 It tries @code{gawk} first because that is reported to be the
-best implementation.
+best implementation.  The result is cached in the @code{ac_cv_prog_AWK}
+variable.
 @end defmac
 
 @defmac AC_PROG_GREP
 @acindex{PROG_GREP}
 @ovindex GREP
+@caindex prog_GREP
 Look for the best available @code{grep} or @code{ggrep} that accepts the
 longest input lines possible, and that supports multiple @option{-e} options.
 Set the output variable @code{GREP} to whatever is chosen.
 @xref{grep, , Limitations of Usual Tools}, for more information about
-portability problems with the @command{grep} command family.
+portability problems with the @command{grep} command family.  The result
+is cached in the @code{ac_cv_path_GREP} variable.
 @end defmac
 
 @defmac AC_PROG_EGREP
 @acindex{PROG_EGREP}
 @ovindex EGREP
+@caindex prog_EGREP
 Check whether @code{$GREP -E} works, or else look for the best available
 @code{egrep} or @code{gegrep} that accepts the longest input lines possible.
-Set the output variable @code{EGREP} to whatever is chosen.
+Set the output variable @code{EGREP} to whatever is chosen.  The result
+is cached in the @code{ac_cv_path_EGREP} variable.
 @end defmac
 
 @defmac AC_PROG_FGREP
 @acindex{PROG_FGREP}
 @ovindex FGREP
+@caindex prog_FGREP
 Check whether @code{$GREP -F} works, or else look for the best available
 @code{fgrep} or @code{gfgrep} that accepts the longest input lines possible.
-Set the output variable @code{FGREP} to whatever is chosen.
+Set the output variable @code{FGREP} to whatever is chosen.  The result
+is cached in the @code{ac_cv_path_FGREP} variable.
 @end defmac
 
 @defmac AC_PROG_INSTALL
@@ -3897,6 +3905,7 @@ Particular Programs
 @ovindex INSTALL_PROGRAM
 @ovindex INSTALL_DATA
 @ovindex INSTALL_SCRIPT
+@caindex path_install
 Set output variable @code{INSTALL} to the name of a @acronym{BSD}-compatible
 @command{install} program, if one is found in the current @env{PATH}.
 Otherwise, set @code{INSTALL} to @samp{@var{dir}/install-sh -c},
@@ -3929,11 +3938,15 @@ Particular Programs
 not found in standard @command{install} programs, there is no reason to use
 @code{AC_PROG_INSTALL}; just put the file name of your program into your
 @file{Makefile.in} files.
+
+The result of the test is cached in the @code{ac_cv_path_install} variable,
+if an @command{install} program other than the in-tree script is found.
 @end defmac
 
 @defmac AC_PROG_MKDIR_P
 @acindex{PROG_MKDIR_P}
 @ovindex MKDIR_P
+@caindex path_mkdir
 Set output variable @code{MKDIR_P} to a program that ensures that for
 each argument, a directory named by this argument exists, creating it
 and its parent directories if needed, and without race conditions when
@@ -3964,6 +3977,9 @@ Particular Programs
 
 @samp{@@MKDIR_P@@} is special, as its value may vary for different
 configuration files.
+
+The result of the test is cached in the @code{ac_cv_path_mkdir} variable,
+if a @command{mkdir} program other than an in-tree script is found.
 @end defmac
 
 @anchor{AC_PROG_LEX}
@@ -3973,6 +3989,7 @@ Particular Programs
 @ovindex LEXLIB
 @cvindex YYTEXT_POINTER
 @ovindex LEX_OUTPUT_ROOT
+@caindex prog_LEX
 If @code{flex} is found, set output variable @code{LEX} to @samp{flex}
 and @code{LEXLIB} to @option{-lfl}, if that library is in a standard
 place.  Otherwise set @code{LEX} to @samp{lex} and @code{LEXLIB} to
@@ -4022,6 +4039,8 @@ Particular Programs
 
 As part of running the test, this macro may delete any file in the
 configuration directory named @file{lex.yy.c} or @file{lexyy.c}.
+
+The result of this test is cached in the @code{ac_cv_prog_LEX} variable.
 @end defmac
 
 @anchor{AC_PROG_LN_S}
@@ -4054,6 +4073,8 @@ Particular Programs
 @defmac AC_PROG_RANLIB
 @acindex{PROG_RANLIB}
 @ovindex RANLIB
+@c @caindex prog_RANLIB
+@c @caindex prog_ac_ct_RANLIB
 Set output variable @code{RANLIB} to @samp{ranlib} if @code{ranlib}
 is found, and otherwise to @samp{:} (do nothing).
 @end defmac
@@ -4061,10 +4082,13 @@ Particular Programs
 @defmac AC_PROG_SED
 @acindex{PROG_SED}
 @ovindex SED
+@caindex prog_SED
 Set output variable @code{SED} to a Sed implementation that conforms to
 Posix and does not have arbitrary length limits.  Report an error if no
 acceptable Sed is found.  @xref{sed, , Limitations of Usual Tools}, for more
 information about portability problems with Sed.
+
+The result of this test is cached in the @code{ac_cv_prog_SED} variable.
 @end defmac
 
 @defmac AC_PROG_YACC
@@ -4072,9 +4096,11 @@ Particular Programs
 @evindex YACC
 @evindex YFLAGS
 @ovindex YACC
+@caindex prog_YACC
 If @code{bison} is found, set output variable @code{YACC} to @samp{bison
 -y}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
 @samp{byacc}.  Otherwise set @code{YACC} to @samp{yacc}.
+The result of this test is cached in the @code{ac_cv_prog_YACC} variable.
 @end defmac
 
 @node Generic Programs
@@ -4103,6 +4129,7 @@ Generic Programs
   @var{value-if-found}, @ovar{value-if-not-found}, @dvar{path, $PATH}, @
   @ovar{reject})
 @acindex{CHECK_PROG}
+@caindex prog_@var{variable}
 Check whether program @var{prog-to-check-for} exists in @var{path}.  If
 it is found, set @var{variable} to @var{value-if-found}, otherwise to
 @var{value-if-not-found}, if given.  Always pass over @var{reject} (an
@@ -4110,20 +4137,23 @@ Generic Programs
 that case, set @var{variable} using the absolute file name of the
 @var{prog-to-check-for} found that is not @var{reject}.  If
 @var{variable} was already set, do nothing.  Calls @code{AC_SUBST} for
-@var{variable}.
+@var{variable}.  The result of this test is cached in the
+@code{ac_cv_prog_@var{variable}} variable.
 @end defmac
 
 @anchor{AC_CHECK_PROGS}
 @defmac AC_CHECK_PROGS (@var{variable}, @var{progs-to-check-for}, @
   @ovar{value-if-not-found}, @dvar{path, $PATH})
 @acindex{CHECK_PROGS}
+@caindex prog_@var{variable}
 Check for each program in the blank-separated list
 @var{progs-to-check-for} existing in the @var{path}.  If one is found, set
 @var{variable} to the name of that program.  Otherwise, continue
 checking the next program in the list.  If none of the programs in the
 list are found, set @var{variable} to @var{value-if-not-found}; if
 @var{value-if-not-found} is not specified, the value of @var{variable}
-is not changed.  Calls @code{AC_SUBST} for @var{variable}.
+is not changed.  Calls @code{AC_SUBST} for @var{variable}.  The result of
+this test is cached in the @code{ac_cv_prog_@var{variable}} variable.
 @end defmac
 
 @defmac AC_CHECK_TARGET_TOOL (@var{variable}, @var{prog-to-check-for}, @
@@ -4147,6 +4177,8 @@ Generic Programs
 @defmac AC_CHECK_TOOL (@var{variable}, @var{prog-to-check-for}, @
   @ovar{value-if-not-found}, @dvar{path, $PATH})
 @acindex{CHECK_TOOL}
+@c @caindex prog_@var{VARIABLE}
+@c @caindex prog_ac_ct_@var{VARIABLE}
 Like @code{AC_CHECK_PROG}, but first looks for @var{prog-to-check-for}
 with a prefix of the host type as specified by @option{--host}, followed by a
 dash.  For example, if the user runs
@@ -4201,14 +4233,17 @@ Generic Programs
 @defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for}, @
   @ovar{value-if-not-found}, @dvar{path, $PATH})
 @acindex{PATH_PROG}
+@caindex path_@var{variable}
 Like @code{AC_CHECK_PROG}, but set @var{variable} to the absolute
-name of @var{prog-to-check-for} if found.
+name of @var{prog-to-check-for} if found.  A positive result of this
+test is cached in the @code{ac_cv_path_@var{variable}} variable.
 @end defmac
 
 @anchor{AC_PATH_PROGS}
 @defmac AC_PATH_PROGS (@var{variable}, @var{progs-to-check-for}, @
   @ovar{value-if-not-found}, @dvar{path, $PATH})
 @acindex{PATH_PROGS}
+@caindex path_@var{variable}
 Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for}
 are found, set @var{variable} to the absolute name of the program
 found.
@@ -4218,6 +4253,7 @@ Generic Programs
   @var{progs-to-check-for}, @var{feature-test}, @
   @ovar{action-if-not-found}, @dvar{path, $PATH})
 @acindex{PATH_PROGS_FEATURE_CHECK}
+@caindex path_@var{variable}
 This macro was introduced in Autoconf 2.62.  If @var{variable} is not
 empty, then set the cache variable @code{$ac_cv_path_@var{variable}} to
 its value.  Otherwise, check for each program in the blank-separated
@@ -4288,17 +4324,23 @@ Files
 @defmac AC_CHECK_FILE (@var{file}, @ovar{action-if-found}, @
   @ovar{action-if-not-found})
 @acindex{CHECK_FILE}
+@caindex file_@var{file}
 Check whether file @var{file} exists on the native system.  If it is
 found, execute @var{action-if-found}, otherwise do
-@var{action-if-not-found}, if given.
+@var{action-if-not-found}, if given.  The result of this test is cached
+in the @code{ac_cv_file_@var{file}} variable, with characters not
+suitable for a variable name mapped to underscores.
 @end defmac
 
 @defmac AC_CHECK_FILES (@var{files}, @ovar{action-if-found}, @
   @ovar{action-if-not-found})
 @acindex{CHECK_FILES}
+@caindex file_@var{file}
 Executes @code{AC_CHECK_FILE} once for each file listed in @var{files}.
 Additionally, defines @samp{HAVE_@var{file}} (@pxref{Standard Symbols})
-for each file found.
+for each file found.  The results of each test are cached in the
+@code{ac_cv_file_@var{file}} variable, with characters not suitable for
+a variable name mapped to underscores.
 @end defmac
 
 
@@ -4313,6 +4355,7 @@ Libraries
 @defmac AC_CHECK_LIB (@var{library}, @var{function}, @
   @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{other-libraries})
 @acindex{CHECK_LIB}
+@caindex lib_@var{library}_@var{function}
 Test whether the library @var{library} is available by trying to link
 a test program that calls function @var{function} with the library.
 @var{function} should be a function provided by the library.
@@ -4348,12 +4391,16 @@ Libraries
 contain variant implementations that you may not want to use.  These
 days it is normally better to use @code{AC_SEARCH_LIBS([gethostbyname],
 [nsl])} instead of @code{AC_CHECK_LIB([nsl], [gethostbyname])}.
+
+The result of this test is cached in the
+@code{ac_cv_lib_@var{library}_@var{function}} variable.
 @end defmac
 
 @anchor{AC_SEARCH_LIBS}
 @defmac AC_SEARCH_LIBS (@var{function}, @var{search-libs}, @
   @ovar{action-if-found}, @ovar{action-if-not-found}, @ovar{other-libraries})
 @acindex{SEARCH_LIBS}
+@caindex search_@var{function}
 Search for a library defining @var{function} if it's not already
 available.  This equates to calling
 @samp{AC_LINK_IFELSE([AC_LANG_CALL([], [@var{function}])])} first with
@@ -4369,6 +4416,11 @@ Libraries
 e.g., @option{-lXt -lX11}.  Otherwise, this macro fails to detect
 that @var{function} is present, because linking the test program
 always fails with unresolved symbols.
+
+The result of this test is cached in the
+@code{ac_cv_search_@var{function}} variable as @samp{no}, if no library
+containing @var{function} was found, otherwise as the
+@option{-l@var{library}} option that needs to be added to @code{LIBS}.
 @end defmac
 
 
@@ -4668,6 +4720,7 @@ Particular Functions
 @c @fuindex alloca
 @prindex @code{alloca}
 @hdrindex{alloca.h}
+@caindex working_alloca_h
 Check how to get @code{alloca}.  Tries to get a builtin version by
 checking for @file{alloca.h} or the predefined C preprocessor macros
 @code{__GNUC__} and @code{_AIX}.  If this macro finds @file{alloca.h},
@@ -4714,6 +4767,9 @@ Particular Functions
 #endif
 @end group
 @end example
+
+The result of this macro is cached in the @code{ac_cv_working_alloca_h}
+variable.
 @end defmac
 
 @defmac AC_FUNC_CHOWN
@@ -4721,9 +4777,11 @@ Particular Functions
 @cvindex HAVE_CHOWN
 @c @fuindex chown
 @prindex @code{chown}
+@caindex func_chown_works
 If the @code{chown} function is available and works (in particular, it
 should accept @option{-1} for @code{uid} and @code{gid}), define
-@code{HAVE_CHOWN}.
+@code{HAVE_CHOWN}.  The result of this macro is cached in the
+@code{ac_cv_func_chown_works} variable.
 @end defmac
 
 @anchor{AC_FUNC_CLOSEDIR_VOID}
@@ -4732,6 +4790,7 @@ Particular Functions
 @cvindex CLOSEDIR_VOID
 @c @fuindex closedir
 @prindex @code{closedir}
+@caindex func_closedir_void
 If the @code{closedir} function does not return a meaningful value,
 define @code{CLOSEDIR_VOID}.  Otherwise, callers ought to check its
 return value for an error indicator.
@@ -4740,6 +4799,9 @@ Particular Functions
 cross compiling the pessimistic assumption that @code{closedir} does not
 return a meaningful value is made.
 
+The result of this macro is cached in the @code{ac_cv_func_closedir_void}
+variable.
+
 This macro is obsolescent, as @code{closedir} returns a meaningful value
 on current systems.  New programs need not use this macro.
 @end defmac
@@ -4748,14 +4810,19 @@ Particular Functions
 @acindex{FUNC_ERROR_AT_LINE}
 @c @fuindex error_at_line
 @prindex @code{error_at_line}
+@caindex lib_error_at_line
 If the @code{error_at_line} function is not found, require an
 @code{AC_LIBOBJ} replacement of @samp{error}.
+
+The result of this macro is cached in the @code{ac_cv_lib_error_at_line}
+variable.
 @end defmac
 
 @defmac AC_FUNC_FNMATCH
 @acindex{FUNC_FNMATCH}
 @c @fuindex fnmatch
 @prindex @code{fnmatch}
+@caindex func_fnmatch_works
 If the @code{fnmatch} function conforms to Posix, define
 @code{HAVE_FNMATCH}.  Detect common implementation bugs, for example,
 the bugs in Solaris 2.4.
@@ -4765,6 +4832,9 @@ Particular Functions
 broken/missing @code{fnmatch}.  This is for historical reasons.
 See @code{AC_REPLACE_FNMATCH} below.
 
+The result of this macro is cached in the @code{ac_cv_func_fnmatch_works}
+variable.
+
 This macro is obsolescent.  New programs should use Gnulib's
 @code{fnmatch-posix} module.  @xref{Gnulib}.
 @end defmac
@@ -4773,11 +4843,15 @@ Particular Functions
 @acindex{FUNC_FNMATCH_GNU}
 @c @fuindex fnmatch
 @prindex @code{fnmatch}
+@caindex func_fnmatch_gnu
 Behave like @code{AC_REPLACE_FNMATCH} (@emph{replace}) but also test
 whether @code{fnmatch} supports @acronym{GNU} extensions.  Detect common
 implementation bugs, for example, the bugs in the @acronym{GNU} C
 Library 2.1.
 
+The result of this macro is cached in the @code{ac_cv_func_fnmatch_gnu}
+variable.
+
 This macro is obsolescent.  New programs should use Gnulib's
 @code{fnmatch-gnu} module.  @xref{Gnulib}.
 @end defmac
@@ -4794,6 +4868,8 @@ Particular Functions
 @c @fuindex vfork
 @prindex @code{vfork}
 @hdrindex{vfork.h}
+@c @caindex func_fork
+@c @caindex func_fork_works
 This macro checks for the @code{fork} and @code{vfork} functions.  If a
 working @code{fork} is found, define @code{HAVE_WORKING_FORK}.  This macro
 checks whether @code{fork} is just a stub by trying to run it.
@@ -4828,6 +4904,7 @@ Particular Functions
 @prindex @code{fseeko}
 @c @fuindex ftello
 @prindex @code{ftello}
+@c @caindex sys_largefile_source
 If the @code{fseeko} function is available, define @code{HAVE_FSEEKO}.
 Define @code{_LARGEFILE_SOURCE} if necessary to make the prototype
 visible on some systems (e.g., glibc 2.2).  Otherwise linkage problems
@@ -4842,6 +4919,7 @@ Particular Functions
 @ovindex GETGROUPS_LIBS
 @c @fuindex getgroups
 @prindex @code{getgroups}
+@caindex func_getgroups_works
 If the @code{getgroups} function is available and works (unlike on
 Ultrix 4.3, where @samp{getgroups (0, 0)} always fails), define
 @code{HAVE_GETGROUPS}.  Set @code{GETGROUPS_LIBS} to any libraries
@@ -4915,10 +4993,14 @@ Particular Functions
 @cvindex HAVE_GETMNTENT
 @c @fuindex getmntent
 @prindex @code{getmntent}
+@caindex func_getmntent
 Check for @code{getmntent} in the standard C library, and then in the
 @file{sun}, @file{seq}, and @file{gen} libraries, for @sc{unicos},
 @sc{irix} 4, @sc{ptx}, and UnixWare, respectively.  Then, if
 @code{getmntent} is available, define @code{HAVE_GETMNTENT}.
+
+The result of this macro is cached in the @code{ac_cv_func_getmntent}
+variable.
 @end defmac
 
 @defmac AC_FUNC_GETPGRP
@@ -4928,6 +5010,7 @@ Particular Functions
 @c @fuindex getpgrp
 @prindex @code{getpgid}
 @prindex @code{getpgrp}
+@caindex func_getpgrp_void
 Define @code{GETPGRP_VOID} if it is an error to pass 0 to
 @code{getpgrp}; this is the Posix behavior.  On older @acronym{BSD}
 systems, you must pass 0 to @code{getpgrp}, as it takes an argument and
@@ -4945,6 +5028,9 @@ Particular Functions
 @code{getpgrp} exists at all; if you need to work in that situation,
 first call @code{AC_CHECK_FUNC} for @code{getpgrp}.
 
+The result of this macro is cached in the @code{ac_cv_func_getpgrp_void}
+variable.
+
 This macro is obsolescent, as current systems have a @code{getpgrp}
 whose signature conforms to Posix.  New programs need not use this macro.
 @end defmac
@@ -4954,6 +5040,7 @@ Particular Functions
 @cvindex LSTAT_FOLLOWS_SLASHED_SYMLINK
 @c @fuindex lstat
 @prindex @code{lstat}
+@caindex func_lstat_dereferences_slashed_symlink
 If @file{link} is a symbolic link, then @code{lstat} should treat
 @file{link/} the same as @file{link/.}.  However, many older
 @code{lstat} implementations incorrectly ignore trailing slashes.
@@ -4965,6 +5052,9 @@ Particular Functions
 If @code{lstat} behaves properly, define
 @code{LSTAT_FOLLOWS_SLASHED_SYMLINK}, otherwise require an
 @code{AC_LIBOBJ} replacement of @code{lstat}.
+
+The result of this macro is cached in the
+@code{ac_cv_func_lstat_dereferences_slashed_symlink} variable.
 @end defmac
 
 @defmac AC_FUNC_MALLOC
@@ -4973,6 +5063,7 @@ Particular Functions
 @cvindex malloc
 @c @fuindex malloc
 @prindex @code{malloc}
+@caindex func_malloc_0_nonnull
 If the @code{malloc} function is compatible with the @acronym{GNU} C
 library @code{malloc} (i.e., @samp{malloc (0)} returns a valid
 pointer), define @code{HAVE_MALLOC} to 1.  Otherwise define
@@ -5002,6 +5093,9 @@ Particular Functions
   return malloc (n);
 }
 @end verbatim
+
+The result of this macro is cached in the
+@code{ac_cv_func_malloc_0_nonnull} variable.
 @end defmac
 
 @defmac AC_FUNC_MEMCMP
@@ -5009,12 +5103,16 @@ Particular Functions
 @ovindex LIBOBJS
 @c @fuindex memcmp
 @prindex @code{memcmp}
+@caindex func_memcmp_working
 If the @code{memcmp} function is not available, or does not work on
 8-bit data (like the one on SunOS 4.1.3), or fails when comparing 16
 bytes or more and with at least one buffer not starting on a 4-byte
 boundary (such as the one on NeXT x86 OpenStep), require an
 @code{AC_LIBOBJ} replacement for @samp{memcmp}.
 
+The result of this macro is cached in the
+@code{ac_cv_func_memcmp_working} variable.
+
 This macro is obsolescent, as current systems have a working
 @code{memcmp}.  New programs need not use this macro.
 @end defmac
@@ -5024,8 +5122,12 @@ Particular Functions
 @cvindex HAVE_MBRTOWC
 @c @fuindex mbrtowc
 @prindex @code{mbrtowc}
+@caindex func_mbrtowc
 Define @code{HAVE_MBRTOWC} to 1 if the function @code{mbrtowc} and the
 type @code{mbstate_t} are properly declared.
+
+The result of this macro is cached in the @code{ac_cv_func_mbrtowc}
+variable.
 @end defmac
 
 @defmac AC_FUNC_MKTIME
@@ -5033,11 +5135,15 @@ Particular Functions
 @ovindex LIBOBJS
 @c @fuindex mktime
 @prindex @code{mktime}
+@caindex func_working_mktime
 If the @code{mktime} function is not available, or does not work
 correctly, require an @code{AC_LIBOBJ} replacement for @samp{mktime}.
 For the purposes of this test, @code{mktime} should conform to the
 Posix standard and should be the inverse of
 @code{localtime}.
+
+The result of this macro is cached in the
+@code{ac_cv_func_working_mktime} variable.
 @end defmac
 
 @anchor{AC_FUNC_MMAP}
@@ -5046,17 +5152,25 @@ Particular Functions
 @cvindex HAVE_MMAP
 @c @fuindex mmap
 @prindex @code{mmap}
+@caindex func_mmap_fixed_mapped
 If the @code{mmap} function exists and works correctly, define
 @code{HAVE_MMAP}.  This checks only private fixed mapping of already-mapped
 memory.
+
+The result of this macro is cached in the
+@code{ac_cv_func_mmap_fixed_mapped} variable.
 @end defmac
 
 @defmac AC_FUNC_OBSTACK
 @acindex{FUNC_OBSTACK}
 @cvindex HAVE_OBSTACK
 @cindex obstack
+@caindex func_obstack
 If the obstacks are found, define @code{HAVE_OBSTACK}, else require an
 @code{AC_LIBOBJ} replacement for @samp{obstack}.
+
+The result of this macro is cached in the @code{ac_cv_func_obstack}
+variable.
 @end defmac
 
 @defmac AC_FUNC_REALLOC
@@ -5065,6 +5179,7 @@ Particular Functions
 @cvindex realloc
 @c @fuindex realloc
 @prindex @code{realloc}
+@caindex func_realloc_0_nonnull
 If the @code{realloc} function is compatible with the @acronym{GNU} C
 library @code{realloc} (i.e., @samp{realloc (NULL, 0)} returns a
 valid pointer), define @code{HAVE_REALLOC} to 1.  Otherwise define
@@ -5072,6 +5187,9 @@ Particular Functions
 @samp{realloc}, and define @code{realloc} to @code{rpl_realloc} so that
 the native @code{realloc} is not used in the main project.  See
 @code{AC_FUNC_MALLOC} for details.
+
+The result of this macro is cached in the
+@code{ac_cv_func_realloc_0_nonnull} variable.
 @end defmac
 
 @defmac AC_FUNC_SELECT_ARGTYPES
@@ -5081,6 +5199,7 @@ Particular Functions
 @cvindex SELECT_TYPE_ARG5
 @c @fuindex select
 @prindex @code{select}
+@c @caindex func_select_args
 Determines the correct type to be passed for each of the
 @code{select} function's arguments, and defines those types
 in @code{SELECT_TYPE_ARG1}, @code{SELECT_TYPE_ARG234}, and
@@ -5097,12 +5216,16 @@ Particular Functions
 @cvindex SETPGRP_VOID
 @c @fuindex setpgrp
 @prindex @code{setpgrp}
+@caindex func_setpgrp_void
 If @code{setpgrp} takes no argument (the Posix version), define
 @code{SETPGRP_VOID}.  Otherwise, it is the @acronym{BSD} version, which takes
 two process IDs as arguments.  This macro does not check whether
 @code{setpgrp} exists at all; if you need to work in that situation,
 first call @code{AC_CHECK_FUNC} for @code{setpgrp}.
 
+The result of this macro is cached in the @code{ac_cv_func_setpgrp_void}
+variable.
+
 This macro is obsolescent, as current systems have a @code{setpgrp}
 whose signature conforms to Posix.  New programs need not use this macro.
 @end defmac
@@ -5117,6 +5240,8 @@ Particular Functions
 @prindex @code{stat}
 @c @fuindex lstat
 @prindex @code{lstat}
+@caindex func_stat_empty_string_bug
+@caindex func_lstat_empty_string_bug
 Determine whether @code{stat} or @code{lstat} have the bug that it
 succeeds when given the zero-length file name as argument.  The @code{stat}
 and @code{lstat} from SunOS 4.1.4 and the Hurd (as of 1998-11-01) do
@@ -5126,6 +5251,10 @@ Particular Functions
 @code{HAVE_LSTAT_EMPTY_STRING_BUG}) and ask for an @code{AC_LIBOBJ}
 replacement of it.
 
+The results of these macros are cached in the
+@code{ac_cv_func_stat_empty_string_bug} and the
+@code{ac_cv_func_stat_empty_string_bug} variables, respectively.
+
 These macros are obsolescent, as no current systems have the bug.
 New programs need not use these macros.
 @end defmac
@@ -5136,10 +5265,14 @@ Particular Functions
 @cvindex HAVE_STRCOLL
 @c @fuindex strcoll
 @prindex @code{strcoll}
+@caindex func_strcoll_works
 If the @code{strcoll} function exists and works correctly, define
 @code{HAVE_STRCOLL}.  This does a bit more than
 @samp{AC_CHECK_FUNCS(strcoll)}, because some systems have incorrect
 definitions of @code{strcoll} that should not be used.
+
+The result of this macro is cached in the @code{ac_cv_func_strcoll_works}
+variable.
 @end defmac
 
 @defmac AC_FUNC_STRERROR_R
@@ -5148,6 +5281,7 @@ Particular Functions
 @cvindex HAVE_DECL_STRERROR_R
 @cvindex STRERROR_R_CHAR_P
 @c @fuindex strerror_r
+@caindex func_strerror_r_char_p
 @prindex @code{strerror_r}
 If @code{strerror_r} is available, define @code{HAVE_STRERROR_R}, and if
 it is declared, define @code{HAVE_DECL_STRERROR_R}.  If it returns a
@@ -5157,6 +5291,9 @@ Particular Functions
 many systems (including, for example, version 2.2.4 of the @acronym{GNU} C
 Library) return a @code{char *} value that is not necessarily equal to
 the buffer argument.
+
+The result of this macro is cached in the
+@code{ac_cv_func_strerror_r_char_p} variable.
 @end defmac
 
 @anchor{AC_FUNC_STRFTIME}
@@ -5177,18 +5314,26 @@ Particular Functions
 @ovindex POW_LIB
 @c @fuindex strtod
 @prindex @code{strtod}
+@caindex func_strtod
+@caindex func_pow
 If the @code{strtod} function does not exist or doesn't work correctly,
 ask for an @code{AC_LIBOBJ} replacement of @samp{strtod}.  In this case,
 because @file{strtod.c} is likely to need @samp{pow}, set the output
 variable @code{POW_LIB} to the extra library needed.
+
+This macro caches its result in the @code{ac_cv_func_strtod} variable
+and depends upon the result in the @code{ac_cv_func_pow} variable.
 @end defmac
 
 @defmac AC_FUNC_STRTOLD
 @acindex{FUNC_STRTOLD}
 @cvindex HAVE_STRTOLD
 @prindex @code{strtold}
+@caindex func_strtold
 If the @code{strtold} function exists and conforms to C99, define
 @code{HAVE_STRTOLD}.
+
+This macro caches its result in the @code{ac_cv_func_strtold} variable.
 @end defmac
 
 @defmac AC_FUNC_STRNLEN
@@ -5196,8 +5341,12 @@ Particular Functions
 @cvindex HAVE_STRNLEN
 @c @fuindex strnlen
 @prindex @code{strnlen}
+@caindex func_strnlen_working
 If the @code{strnlen} function is not available, or is buggy (like the one
 from @acronym{AIX} 4.3), require an @code{AC_LIBOBJ} replacement for it.
+
+This macro caches its result in the @code{ac_cv_func_strnlen_working}
+variable.
 @end defmac
 
 @anchor{AC_FUNC_UTIME_NULL}
@@ -5206,9 +5355,13 @@ Particular Functions
 @cvindex HAVE_UTIME_NULL
 @c @fuindex utime
 @prindex @code{utime}
+@caindex func_utime_null
 If @samp{utime (@var{file}, NULL)} sets @var{file}'s timestamp to
 the present, define @code{HAVE_UTIME_NULL}.
 
+This macro caches its result in the @code{ac_cv_func_utime_null}
+variable.
+
 This macro is obsolescent, as all current systems have a @code{utime}
 that behaves this way.  New programs need not use this macro.
 @end defmac
@@ -5236,6 +5389,7 @@ Particular Functions
 @c @fuindex fnmatch
 @prindex @code{fnmatch}
 @hdrindex{fnmatch.h}
+@caindex func_fnmatch_works
 If the @code{fnmatch} function does not conform to Posix (see
 @code{AC_FUNC_FNMATCH}), ask for its @code{AC_LIBOBJ} replacement.
 
@@ -5246,6 +5400,9 @@ Particular Functions
 @file{fnmatch_.h} file is linked to @file{fnmatch.h} so that it can be
 included in place of the system @code{<fnmatch.h>}.
 
+This macro caches its result in the @code{ac_cv_func_fnmatch_works}
+variable.
+
 This macro is obsolescent, as it assumes the use of particular source
 files.  New programs should use Gnulib's @code{fnmatch-posix} module,
 which provides this macro along with the source files.  @xref{Gnulib}.
@@ -5267,6 +5424,7 @@ Generic Functions
 @defmac AC_CHECK_FUNC (@var{function}, @ovar{action-if-found}, @
   @ovar{action-if-not-found})
 @acindex{CHECK_FUNC}
+@caindex func_@var{function}
 If C function @var{function} is available, run shell commands
 @var{action-if-found}, otherwise @var{action-if-not-found}.  If you just
 want to define a symbol if the function is available, consider using
@@ -5274,6 +5432,9 @@ Generic Functions
 linkage even when @code{AC_LANG(C++)} has been called, since C is more
 standardized than C++.  (@pxref{Language Choice}, for more information
 about selecting the language for checks.)
+
+This macro caches its result in the @code{ac_cv_func_@var{function}}
+variable.
 @end defmac
 
 @anchor{AC_CHECK_FUNCS}
@@ -5288,6 +5449,8 @@ Generic Functions
 @samp{break} to break out of the loop on the first match.  If
 @var{action-if-not-found} is given, it is executed when one of the
 functions is not found.
+
+Results are cached for each @var{function} as in @code{AC_CHECK_FUNC}.
 @end defmac
 
 @defmac AC_CHECK_FUNCS_ONCE (@var{function}@dots{})
@@ -5665,6 +5828,7 @@ Particular Headers
 @cvindex HAVE__BOOL
 @hdrindex{stdbool.h}
 @hdrindex{system.h}
+@caindex header_stdbool_h
 If @file{stdbool.h} exists and conforms to C99, define
 @code{HAVE_STDBOOL_H} to 1; if the type @code{_Bool} is defined, define
 @code{HAVE__BOOL} to 1.  To fulfill the C99 requirements, your
@@ -5692,6 +5856,8 @@ Particular Headers
 (@pxref{Gnulib}); it packages the above code into a replacement header
 and contains a few other bells and whistles.
 
+This macro caches its result in the @code{ac_cv_header_stdbool_h}
+variable.
 @end defmac
 
 @anchor{AC_HEADER_STDC}
@@ -5703,6 +5869,7 @@ Particular Headers
 @hdrindex{string.h}
 @hdrindex{float.h}
 @hdrindex{ctype.h}
+@caindex header_stdc
 Define @code{STDC_HEADERS} if the system has C header files
 conforming to @acronym{ANSI} C89 (@acronym{ISO} C90).
 Specifically, this macro checks for @file{stdlib.h}, @file{stdarg.h},
@@ -5718,6 +5885,8 @@ Particular Headers
 determine whether the system has conforming header files (and probably C
 library functions).
 
+This macro caches its results in the @code{ac_cv_header_stdc} variable.
+
 This macro is obsolescent, as current systems have conforming header
 files.  New programs need not use this macro.
 
@@ -5786,6 +5955,7 @@ Particular Headers
 @acindex{HEADER_SYS_WAIT}
 @cvindex HAVE_SYS_WAIT_H
 @hdrindex{sys/wait.h}
+@caindex header_sys_wait_h
 If @file{sys/wait.h} exists and is compatible with Posix, define
 @code{HAVE_SYS_WAIT_H}.  Incompatibility can occur if @file{sys/wait.h}
 does not exist, or if it uses the old @acronym{BSD} @code{union wait} instead
@@ -5810,6 +5980,9 @@ Particular Headers
 @end example
 
 @noindent
+This macro caches its result in the @code{ac_cv_header_sys_wait_h}
+variable.
+
 This macro is obsolescent, as current systems are compatible with Posix.
 New programs need not use this macro.
 @end defmac
@@ -5842,6 +6015,7 @@ Particular Headers
 @cvindex TIME_WITH_SYS_TIME
 @hdrindex{time.h}
 @hdrindex{sys/time.h}
+@caindex header_time
 If a program may include both @file{time.h} and @file{sys/time.h},
 define @code{TIME_WITH_SYS_TIME}.  On some ancient systems,
 @file{sys/time.h} included @file{time.h}, but @file{time.h} was not
@@ -5868,6 +6042,8 @@ Particular Headers
 @end example
 
 @noindent
+This macro caches its result in the @code{ac_cv_header_time} variable.
+
 This macro is obsolescent, as current systems can include both files
 when they exist.  New programs need not use this macro.
 @end defmac
@@ -5910,6 +6086,7 @@ Generic Headers
 @defmac AC_CHECK_HEADER (@var{header-file}, @ovar{action-if-found}, @
   @ovar{action-if-not-found}, @ovar{includes})
 @acindex{CHECK_HEADER}
+@caindex header_@var{header-file}
 If the system header file @var{header-file} is compilable, execute shell
 commands @var{action-if-found}, otherwise execute
 @var{action-if-not-found}.  If you just want to define a symbol if the
@@ -5936,6 +6113,10 @@ Generic Headers
 a last resort (it is safer to determine the actual prerequisites and
 perform a compiler check, or else use @code{AC_PREPROC_IFELSE} to make
 it obvious that only a preprocessor check is desired).
+
+This macro caches its result in the @code{ac_cv_header_@var{header-file}}
+variable, with characters not suitable for a variable name mapped to
+underscores.
 @end defmac
 
 @anchor{AC_CHECK_HEADERS}
@@ -5944,6 +6125,7 @@ Generic Headers
   @ovar{includes})
 @acindex{CHECK_HEADERS}
 @cvindex HAVE_@var{header}
+@caindex header_@var{header-file}
 For each given system header file @var{header-file} in the
 blank-separated argument list that exists, define
 @code{HAVE_@var{header-file}} (in all capitals).  If @var{action-if-found}
@@ -5955,6 +6137,10 @@ Generic Headers
 @var{includes} is interpreted as in @code{AC_CHECK_HEADER}, in order to
 choose the set of preprocessor directives supplied before the header
 under test.
+
+This macro caches its result in the @code{ac_cv_header_@var{header-file}}
+variable, with characters not suitable for a variable name mapped to
+underscores.
 @end defmac
 
 Previous versions of Autoconf merely checked whether the header was
@@ -6028,6 +6214,7 @@ Generic Declarations
 @defmac AC_CHECK_DECL (@var{symbol}, @ovar{action-if-found}, @
   @ovar{action-if-not-found}, @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_DECL}
+@caindex have_decl_@var{symbol}
 If @var{symbol} (a function, variable, or constant) is not declared in
 @var{includes} and a declaration is needed, run the shell commands
 @var{action-if-not-found}, otherwise @var{action-if-found}.
@@ -6039,6 +6226,10 @@ Generic Declarations
 can be used as an r-value, not whether it is really declared, because it
 is much safer to avoid
 introducing extra declarations when they are not needed.
+
+This macro caches its result in the @code{have_decl_@var{symbol}}
+variable, with characters not suitable for a variable name mapped to
+underscores.
 @end defmac
 
 @anchor{AC_CHECK_DECLS}
@@ -6046,6 +6237,7 @@ Generic Declarations
   @ovar{action-if-not-found}, @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_DECLS}
 @cvindex HAVE_DECL_@var{symbol}
+@caindex have_decl_@var{symbol}
 For each of the @var{symbols} (@emph{comma}-separated list), define
 @code{HAVE_DECL_@var{symbol}} (in all capitals) to @samp{1} if
 @var{symbol} is declared, otherwise to @samp{0}.  If
@@ -6092,6 +6284,10 @@ Generic Declarations
 You fall into the second category only in extreme situations: either
 your files may be used without being configured, or they are used during
 the configuration.  In most cases the traditional approach is enough.
+
+This macro caches its results in @code{have_decl_@var{symbol}}
+variables, with characters not suitable for a variable name mapped to
+underscores.
 @end defmac
 
 @defmac AC_CHECK_DECLS_ONCE (@var{symbols})
@@ -6130,6 +6326,8 @@ Particular Structures
 @defmac AC_STRUCT_DIRENT_D_INO
 @acindex{STRUCT_DIRENT_D_INO}
 @cvindex HAVE_STRUCT_DIRENT_D_INO
+@c @caindex header_dirent_dirent_h
+@c @caindex member_struct_dirent_d_ino
 Perform all the actions of @code{AC_HEADER_DIRENT} (@pxref{Particular
 Headers}).  Then, if @code{struct dirent} contains a @code{d_ino}
 member, define @code{HAVE_STRUCT_DIRENT_D_INO}.
@@ -6146,6 +6344,8 @@ Particular Structures
 @defmac AC_STRUCT_DIRENT_D_TYPE
 @acindex{STRUCT_DIRENT_D_TYPE}
 @cvindex HAVE_STRUCT_DIRENT_D_TYPE
+@c @caindex header_dirent_dirent_h
+@c @caindex member_struct_dirent_d_type
 Perform all the actions of @code{AC_HEADER_DIRENT} (@pxref{Particular
 Headers}).  Then, if @code{struct dirent} contains a @code{d_type}
 member, define @code{HAVE_STRUCT_DIRENT_D_TYPE}.
@@ -6157,11 +6357,15 @@ Particular Structures
 @cvindex HAVE_STRUCT_STAT_ST_BLOCKS
 @cvindex HAVE_ST_BLOCKS
 @ovindex LIBOBJS
+@caindex member_struct_stat_st_blocks
 If @code{struct stat} contains an @code{st_blocks} member, define
 @code{HAVE_STRUCT_STAT_ST_BLOCKS}.  Otherwise, require an
 @code{AC_LIBOBJ} replacement of @samp{fileblocks}.  The former name,
 @code{HAVE_ST_BLOCKS} is to be avoided, as its support will cease in the
 future.
+
+This macro caches its result in the @code{ac_cv_member_struct_stat_st_blocks}
+variable.
 @end defmac
 
 @defmac AC_STRUCT_TM
@@ -6184,6 +6388,8 @@ Particular Structures
 @cvindex HAVE_STRUCT_TM_TM_ZONE
 @cvindex HAVE_TM_ZONE
 @cvindex HAVE_TZNAME
+@c @caindex member_struct_tm_tm_zone
+@c @caindex struct_tm
 Figure out how to get the current timezone.  If @code{struct tm} has a
 @code{tm_zone} member, define @code{HAVE_STRUCT_TM_TM_ZONE} (and the
 obsoleted @code{HAVE_TM_ZONE}).  Otherwise, if the external array
@@ -6201,6 +6407,7 @@ Generic Structures
   @ovar{action-if-found}, @ovar{action-if-not-found}, @
   @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_MEMBER}
+@caindex member_@var{aggregate}_@var{member}
 Check whether @var{member} is a member of the aggregate @var{aggregate}.
 If no @var{includes} are specified, the default includes are used
 (@pxref{Default Includes}).
@@ -6216,6 +6423,10 @@ Generic Structures
 @example
 AC_CHECK_MEMBER(struct top.middle.bot)
 @end example
+
+This macro caches its result in the
+@code{member_@var{aggregate}_@var{member}} variable, with characters not
+suitable for a variable name mapped to underscores.
 @end defmac
 
 @anchor{AC_CHECK_MEMBERS}
@@ -6276,14 +6487,19 @@ Particular Types
 @defmac AC_TYPE_GETGROUPS
 @acindex{TYPE_GETGROUPS}
 @cvindex GETGROUPS_T
+@caindex type_getgroups
 Define @code{GETGROUPS_T} to be whichever of @code{gid_t} or @code{int}
 is the base type of the array argument to @code{getgroups}.
+
+This macro caches the base type in the @code{ac_cv_type_getgroups}
+variable.
 @end defmac
 
 @defmac AC_TYPE_INT8_T
 @acindex{TYPE_INT8_T}
 @cvindex HAVE_INT8_T
 @cvindex int8_t
+@caindex c_int8_t
 If @file{stdint.h} or @file{inttypes.h} does not define the type
 @code{int8_t}, define @code{int8_t} to a signed
 integer type that is exactly 8 bits wide and that uses two's complement
@@ -6301,12 +6517,15 @@ Particular Types
  @emph{complicated alternative using >8-bit 'signed char'}
 #endif
 @end example
+
+This macro caches the type in the @code{ac_cv_c_int8_t} variable.
 @end defmac
 
 @defmac AC_TYPE_INT16_T
 @acindex{TYPE_INT16_T}
 @cvindex HAVE_INT16_T
 @cvindex int16_t
+@caindex c_int16_t
 This is like @code{AC_TYPE_INT8_T}, except for 16-bit integers.
 @end defmac
 
@@ -6314,6 +6533,7 @@ Particular Types
 @acindex{TYPE_INT32_T}
 @cvindex HAVE_INT32_T
 @cvindex int32_t
+@caindex c_int32_t
 This is like @code{AC_TYPE_INT8_T}, except for 32-bit integers.
 @end defmac
 
@@ -6321,6 +6541,7 @@ Particular Types
 @acindex{TYPE_INT64_T}
 @cvindex HAVE_INT64_T
 @cvindex int64_t
+@caindex c_int64_t
 This is like @code{AC_TYPE_INT8_T}, except for 64-bit integers.
 @end defmac
 
@@ -6328,6 +6549,7 @@ Particular Types
 @acindex{TYPE_INTMAX_T}
 @cvindex HAVE_INTMAX_T
 @cvindex intmax_t
+@c @caindex type_intmax_t
 If @file{stdint.h} or @file{inttypes.h} defines the type @code{intmax_t},
 define @code{HAVE_INTMAX_T}.  Otherwise, define @code{intmax_t} to the
 widest signed integer type.
@@ -6337,6 +6559,7 @@ Particular Types
 @acindex{TYPE_INTPTR_T}
 @cvindex HAVE_INTPTR_T
 @cvindex intptr_t
+@c @caindex type_intptr_t
 If @file{stdint.h} or @file{inttypes.h} defines the type @code{intptr_t},
 define @code{HAVE_INTPTR_T}.  Otherwise, define @code{intptr_t} to a
 signed integer type wide enough to hold a pointer, if such a type
@@ -6346,10 +6569,14 @@ Particular Types
 @defmac AC_TYPE_LONG_DOUBLE
 @acindex{TYPE_LONG_DOUBLE}
 @cvindex HAVE_LONG_DOUBLE
+@caindex type_long_double
 If the C compiler supports a working @code{long double} type, define
 @code{HAVE_LONG_DOUBLE}.  The @code{long double} type might have the
 same range and precision as @code{double}.
 
+This macro caches its result in the @code{ac_cv_type_long_double}
+variable.
+
 This macro is obsolescent, as current C compilers support @code{long
 double}.  New programs need not use this macro.
 @end defmac
@@ -6357,67 +6584,94 @@ Particular Types
 @defmac AC_TYPE_LONG_DOUBLE_WIDER
 @acindex{TYPE_LONG_DOUBLE_WIDER}
 @cvindex HAVE_LONG_DOUBLE_WIDER
+@caindex type_long_double_wider
 If the C compiler supports a working @code{long double} type with more
 range or precision than the @code{double} type, define
 @code{HAVE_LONG_DOUBLE_WIDER}.
+
+This macro caches its result in the @code{ac_cv_type_long_double_wider}
+variable.
 @end defmac
 
 @defmac AC_TYPE_LONG_LONG_INT
 @acindex{TYPE_LONG_LONG_INT}
 @cvindex HAVE_LONG_LONG_INT
+@caindex type_long_long_int
 If the C compiler supports a working @code{long long int} type, define
 @code{HAVE_LONG_LONG_INT}.  However, this test does not test
 @code{long long int} values in preprocessor @code{#if} expressions,
 because too many compilers mishandle such expressions.
 @xref{Preprocessor Arithmetic}.
+
+This macro caches its result in the @code{ac_cv_type_long_long_int}
+variable.
 @end defmac
 
 @defmac AC_TYPE_MBSTATE_T
 @acindex{TYPE_MBSTATE_T}
 @cvindex mbstate_t
 @hdrindex{wchar.h}
+@caindex type_mbstate_t
 Define @code{HAVE_MBSTATE_T} if @code{<wchar.h>} declares the
 @code{mbstate_t} type.  Also, define @code{mbstate_t} to be a type if
 @code{<wchar.h>} does not declare it.
+
+This macro caches its result in the @code{ac_cv_type_mbstate_t}
+variable.
 @end defmac
 
 @anchor{AC_TYPE_MODE_T}
 @defmac AC_TYPE_MODE_T
 @acindex{TYPE_MODE_T}
 @cvindex mode_t
+@caindex type_mode_t
 Define @code{mode_t} to a suitable type, if standard headers do not
 define it.
+
+This macro caches its result in the @code{ac_cv_type_mode_t} variable.
 @end defmac
 
 @anchor{AC_TYPE_OFF_T}
 @defmac AC_TYPE_OFF_T
 @acindex{TYPE_OFF_T}
 @cvindex off_t
+@caindex type_off_t
 Define @code{off_t} to a suitable type, if standard headers do not
 define it.
+
+This macro caches its result in the @code{ac_cv_type_off_t} variable.
 @end defmac
 
 @anchor{AC_TYPE_PID_T}
 @defmac AC_TYPE_PID_T
 @acindex{TYPE_PID_T}
 @cvindex pid_t
+@caindex type_pid_t
 Define @code{pid_t} to a suitable type, if standard headers do not
 define it.
+
+This macro caches its result in the @code{ac_cv_type_pid_t} variable.
 @end defmac
 
 @anchor{AC_TYPE_SIZE_T}
 @defmac AC_TYPE_SIZE_T
 @acindex{TYPE_SIZE_T}
 @cvindex size_t
+@caindex type_size_t
 Define @code{size_t} to a suitable type, if standard headers do not
 define it.
+
+This macro caches its result in the @code{ac_cv_type_size_t} variable.
 @end defmac
 
 @defmac AC_TYPE_SSIZE_T
 @acindex{TYPE_SSIZE_T}
 @cvindex ssize_t
+@caindex type_ssize_t
 Define @code{ssize_t} to a suitable type, if standard headers do not
 define it.
+
+This macro caches its result in the @code{ac_cv_type_ssize_t} variable.
 @end defmac
 
 @anchor{AC_TYPE_UID_T}
@@ -6425,14 +6679,18 @@ Particular Types
 @acindex{TYPE_UID_T}
 @cvindex uid_t
 @cvindex gid_t
+@caindex type_uid_t
 Define @code{uid_t} and @code{gid_t} to suitable types, if standard
 headers do not define them.
+
+This macro caches its result in the @code{ac_cv_type_uid_t} variable.
 @end defmac
 
 @defmac AC_TYPE_UINT8_T
 @acindex{TYPE_UINT8_T}
 @cvindex HAVE_UINT8_T
 @cvindex uint8_t
+@caindex c_uint8_t
 If @file{stdint.h} or @file{inttypes.h} does not define the type
 @code{uint8_t}, define @code{uint8_t} to an
 unsigned integer type that is exactly 8 bits wide, if such a type
@@ -6444,6 +6702,7 @@ Particular Types
 @acindex{TYPE_UINT16_T}
 @cvindex HAVE_UINT16_T
 @cvindex uint16_t
+@caindex c_uint16_t
 This is like @code{AC_TYPE_UINT8_T}, except for 16-bit integers.
 @end defmac
 
@@ -6451,6 +6710,7 @@ Particular Types
 @acindex{TYPE_UINT32_T}
 @cvindex HAVE_UINT32_T
 @cvindex uint32_t
+@caindex c_uint32_t
 This is like @code{AC_TYPE_UINT8_T}, except for 32-bit integers.
 @end defmac
 
@@ -6458,6 +6718,7 @@ Particular Types
 @acindex{TYPE_UINT64_T}
 @cvindex HAVE_UINT64_T
 @cvindex uint64_t
+@caindex c_uint64_t
 This is like @code{AC_TYPE_UINT8_T}, except for 64-bit integers.
 @end defmac
 
@@ -6465,6 +6726,7 @@ Particular Types
 @acindex{TYPE_UINTMAX_T}
 @cvindex HAVE_UINTMAX_T
 @cvindex uintmax_t
+@c @caindex type_uintmax_t
 If @file{stdint.h} or @file{inttypes.h} defines the type @code{uintmax_t},
 define @code{HAVE_UINTMAX_T}.  Otherwise, define @code{uintmax_t} to the
 widest unsigned integer type.
@@ -6474,6 +6736,7 @@ Particular Types
 @acindex{TYPE_UINTPTR_T}
 @cvindex HAVE_UINTPTR_T
 @cvindex uintptr_t
+@c @caindex type_uintptr_t
 If @file{stdint.h} or @file{inttypes.h} defines the type @code{uintptr_t},
 define @code{HAVE_UINTPTR_T}.  Otherwise, define @code{uintptr_t} to an
 unsigned integer type wide enough to hold a pointer, if such a type
@@ -6483,11 +6746,15 @@ Particular Types
 @defmac AC_TYPE_UNSIGNED_LONG_LONG_INT
 @acindex{TYPE_UNSIGNED_LONG_LONG_INT}
 @cvindex HAVE_UNSIGNED_LONG_LONG_INT
+@caindex type_unsigned_long_long_int
 If the C compiler supports a working @code{unsigned long long int} type,
 define @code{HAVE_UNSIGNED_LONG_LONG_INT}.  However, this test does not test
 @code{unsigned long long int} values in preprocessor @code{#if} expressions,
 because too many compilers mishandle such expressions.
 @xref{Preprocessor Arithmetic}.
+
+This macro caches its result in the @code{ac_cv_type_unsigned_long_long_int}
+variable.
 @end defmac
 
 @node Generic Types
@@ -6499,6 +6766,7 @@ Generic Types
 @defmac AC_CHECK_TYPE (@var{type}, @ovar{action-if-found}, @
   @ovar{action-if-not-found}, @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_TYPE}
+@caindex type_@var{type}
 Check whether @var{type} is defined.  It may be a compiler builtin type
 or defined by the @var{includes}.  @var{includes} is a series of include
 directives, defaulting to @code{AC_INCLUDES_DEFAULT} (@pxref{Default
@@ -6509,6 +6777,10 @@ Generic Types
 same test is applied when compiling for C++, which means that in C++
 @var{type} should be a type-id and should not be an anonymous
 @samp{struct} or @samp{union}.
+
+This macro caches its result in the @code{ac_cv_type_@var{type}}
+variable, with @samp{*} mapped to @samp{p} and other characters not
+suitable for a variable name mapped to underscores.
 @end defmac
 
 
@@ -6607,6 +6879,7 @@ Generic Compiler Characteristics
   @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_SIZEOF}
 @cvindex SIZEOF_@var{type-or-expr}
+@caindex sizeof_@var{type-or-expr}
 Define @code{SIZEOF_@var{type-or-expr}} (@pxref{Standard Symbols}) to be
 the size in bytes of @var{type-or-expr}, which may be either a type or
 an expression returning a value that has a size.  If the expression
@@ -6626,16 +6899,25 @@ Generic Compiler Characteristics
 
 @noindent
 defines @code{SIZEOF_INT_P} to be 8 on DEC Alpha AXP systems.
+
+This macro caches its result in the @code{ac_cv_sizeof_@var{type-or-expr}}
+variable, with @samp{*} mapped to @samp{p} and other characters not
+suitable for a variable name mapped to underscores.
 @end defmac
 
 @defmac AC_CHECK_ALIGNOF (@var{type}, @dvar{includes, AC_INCLUDES_DEFAULT})
 @acindex{CHECK_ALIGNOF}
 @cvindex ALIGNOF_@var{type}
+@caindex alignof_@var{type-or-expr}
 Define @code{ALIGNOF_@var{type}} (@pxref{Standard Symbols}) to be the
 alignment in bytes of @var{type}.  @samp{@var{type} y;} must be valid as
 a structure member declaration.  If @samp{type} is unknown, the result
 is 0.  If no @var{includes} are specified, the default includes are used
 (@pxref{Default Includes}).
+
+This macro caches its result in the @code{ac_cv_alignof_@var{type-or-expr}}
+variable, with @samp{*} mapped to @samp{p} and other characters not
+suitable for a variable name mapped to underscores.
 @end defmac
 
 @defmac AC_COMPUTE_INT (@var{var}, @var{expression}, @
@@ -6783,6 +7065,7 @@ C Compiler
 @evindex CFLAGS
 @ovindex CC
 @ovindex CFLAGS
+@caindex prog_cc_c89
 Determine a C compiler to use.  If @code{CC} is not already set in the
 environment, check for @code{gcc} and @code{cc}, then for other C
 compilers.  Set output variable @code{CC} to the name of the compiler
@@ -6830,12 +7113,16 @@ C Compiler
 @defmac AC_PROG_CC_C_O
 @acindex{PROG_CC_C_O}
 @cvindex NO_MINUS_C_MINUS_O
+@caindex prog_cc_@var{compiler}_c_o
 If the C compiler does not accept the @option{-c} and @option{-o} options
 simultaneously, define @code{NO_MINUS_C_MINUS_O}.  This macro actually
 tests both the compiler found by @code{AC_PROG_CC}, and, if different,
 the first @code{cc} in the path.  The test fails if one fails.  This
 macro was created for @acronym{GNU} Make to choose the default C compilation
 rule.
+
+For the compiler @var{compiler}, this macro caches its result in the
+@code{ac_cv_prog_cc_@var{compiler}_c_o} variable.
 @end defmac
 
 
@@ -6873,6 +7160,7 @@ C Compiler
 
 @defmac AC_PROG_CC_STDC
 @acindex{PROG_CC_STDC}
+@caindex prog_cc_stdc
 If the C compiler cannot compile @acronym{ISO} Standard C (currently
 C99), try to add an option to output variable @code{CC} to make it work.
 If the compiler does not support C99, fall back to supporting
@@ -6885,6 +7173,7 @@ C Compiler
 
 @defmac AC_PROG_CC_C89
 @acindex{PROG_CC_C89}
+@caindex prog_cc_c89
 If the C compiler is not in @acronym{ANSI} C89 (@acronym{ISO} C90) mode by
 default, try to add an option to output variable @code{CC} to make it
 so.  This macro tries various options that select @acronym{ANSI} C89 on
@@ -6901,6 +7190,7 @@ C Compiler
 
 @defmac AC_PROG_CC_C99
 @acindex{PROG_CC_C99}
+@caindex prog_cc_c99
 If the C compiler is not in C99 mode by default, try to add an
 option to output variable @code{CC} to make it so.  This macro tries
 various options that select C99 on some system or another, preferring
@@ -6970,6 +7260,7 @@ C Compiler
 @defmac AC_C_CONST
 @acindex{C_CONST}
 @cvindex const
+@caindex c_const
 If the C compiler does not fully support the @code{const} keyword,
 define @code{const} to be empty.  Some C compilers that do
 not define @code{__STDC__} do support @code{const}; some compilers that
@@ -6996,6 +7287,8 @@ C Compiler
 installers who run into trouble in this area should get a C compiler
 like @acronym{GCC} to compile their C code.
 
+This macro caches its result in the @code{ac_cv_c_const} variable.
+
 This macro is obsolescent, as current C compilers support @code{const}.
 New programs need not use this macro.
 @end defmac
@@ -7003,6 +7296,7 @@ C Compiler
 @defmac AC_C_RESTRICT
 @acindex{C_RESTRICT}
 @cvindex restrict
+@caindex c_restrict
 If the C compiler recognizes a variant spelling for the @code{restrict}
 keyword (@code{__restrict}, @code{__restrict__}, or @code{_Restrict}),
 then define @code{restrict} to that; this is more likely to do the right
@@ -7017,6 +7311,9 @@ C Compiler
 Although support in C++ for the @code{restrict} keyword is not
 required, several C++ compilers do accept the keyword.
 This macro works for them, too.
+
+This macro caches @samp{no} in the @code{ac_cv_c_restrict} variable
+if @code{restrict} is not supported, and a supported spelling otherwise.
 @end defmac
 
 @defmac AC_C_VOLATILE
@@ -7802,6 +8099,7 @@ System Services
 @acindex{SYS_POSIX_TERMIOS}
 @cindex Posix termios headers
 @cindex termios Posix headers
+@caindex sys_posix_termios
 Check to see if the Posix termios headers and functions are available on the
 system.  If so, set the shell variable @code{ac_cv_sys_posix_termios} to
 @samp{yes}.  If not, set the variable to @samp{no}.
--
1.6.3.2.388.gb7132




[PATCH 5/5] Use consistent notation for cache variables.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* doc/autoconf.texi (Generic Programs): Remove `$' before
variable name.
---
 doc/autoconf.texi |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 9206475..379a553 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -4255,13 +4255,13 @@ Generic Programs
 @acindex{PATH_PROGS_FEATURE_CHECK}
 @caindex path_@var{variable}
 This macro was introduced in Autoconf 2.62.  If @var{variable} is not
-empty, then set the cache variable @code{$ac_cv_path_@var{variable}} to
+empty, then set the cache variable @code{ac_cv_path_@var{variable}} to
 its value.  Otherwise, check for each program in the blank-separated
 list @var{progs-to-check-for} existing in @var{path}.  For each program
-found, execute @var{feature-test} with @code{$ac_path_@var{variable}}
+found, execute @var{feature-test} with @code{ac_path_@var{variable}}
 set to the absolute name of the candidate program.  If no invocation of
 @var{feature-test} sets the shell variable
-@code{$ac_cv_path_@var{variable}}, then @var{action-if-not-found} is
+@code{ac_cv_path_@var{variable}}, then @var{action-if-not-found} is
 executed.  @var{feature-test} will be run even when
 @code{ac_cv_path_@var{variable}} is set, to provide the ability to
 choose a better candidate found later in @var{path}; to accept the
--
1.6.3.2.388.gb7132




Re: [PATCH 2/5] New FAQ node: Debugging.

by Jim Meyering :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ralf Wildenhues wrote:
...
> +@node Debugging
> +@section Debugging @command{configure} scripts

Nice tips!
I've proposed an addition to one of your lists
and made a few very subjective style suggestions:

> +While in general, @command{configure} scripts generated by Autoconf
> +strive to be fairly portable to various systems, compilers, shells, and
> +other tools, it may still be necessary to debug a failing test, broken
> +script or makefile, or fix or override an incomplete or wrong test,

s/wrong/faulty or erroneous/

> +especially during macro development.  Failures can occur on all levels,

s/on/at/

> +in M4 syntax or semantics, shell script issues, or due to bugs in the
> +test or the tools invoked by @command{configure}.  Together with the
> +rather arcane error message which @command{m4} and @command{make} may

s/which/that/

> +produce when their input has syntax errors, this can make debugging

s/has/contains/

> +rather painful.
> +
...
> +@item
> +When @command{configure} tests produce wrong or insufficient results for

How about s/wrong or insufficient/invalid/ ?

> +your system, it may be necessary to override them:
> +
> +@itemize
> +@item
> +For programs, tools or libraries variables, preprocessor, compiler, or
> +linker flags, it is often sufficient to override them at @command{make}
> +run time with some care (@pxref{Macros and Submakes}).  Since this
> +normally won't cause @command{configure} to be run again with these
> +changed settings, it may fail if the changed variable would have caused
> +different test results from @command{configure}, so this may work only
> +for simple differences.  Erroneous test results that only define macros
> +in a @file{config.h} header file may be worked around by editing said
> +header file and rebuilding; be sure to have dependency tracking enabled
> +or run @code{make clean} beforehand, so that objects are recompiled
> +appropriately.
> +
> +@item
> +Most tests which produce their result in a substituted variable allow to

Imho this reads better:
s/allow to/let you/

> +override the test by setting the variable on the @command{configure}
> +command line (@pxref{Compilers and Options}, @pxref{Defining Variables},
> +@pxref{Particular Systems}).
> +
> +@item
> +Many tests store their result in a cache variable (@pxref{Caching
> +Results}).  This allows to override them either on the

s/allows to/lets you/

> +@command{configure} command line as above, or through a primed cache or
> +site file (@pxref{Cache Files}, @pxref{Site Defaults}).  The name of a
> +cache variable is documented with a test macro or may be inferred from
> +@ref{Cache Variable Names}; the precise semantics of undocumented
> +variables are often internal details, subject to change.
> +@end itemize
> +@end itemize
> +
> +Conversely, as macro author, you can make it easier for users of your
> +macro:

One more tip:

  Do not require users of your macro to use the cache variables.
  Instead, expose the result of the test via RUN-IF-TRUE and RUN-IF-FALSE
  parameters.

> +@itemize
> +@item
> +by minimizing dependencies between tests and between test results as far
> +as possible,
> +
> +@item
> +by using @command{make} variables to factorize and allow
> +override of settings at @command{make} run time,
> +
> +@item
> +by honoring the @acronym{GNU} Coding Standards and not overriding flags
> +reserved for the user except temporarily during @command{configure}
> +tests.
> +@end itemize



Re: [PATCH 1/5] Document AM_MAKEFLAGS workaround to the macro override problem.

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/13/2009 2:31 AM:
> * doc/autoconf.texi (Macros and Submakes): Automake makefiles
> provide AM_MAKEFLAGS to help with overriding macros in submake
> invocations.

Good to go.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwZX4ACgkQ84KuGfSFAYCnMQCgnO2vwitkCnykW04dY/6wlkor
skAAoLI+ZtneGQQxei7Qrq0X25qNzIqI
=rYQi
-----END PGP SIGNATURE-----



Re: [PATCH 2/5] New FAQ node: Debugging.

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 9/13/2009 1:36 PM:
> Ralf Wildenhues wrote:
> ...
>> +@node Debugging
>> +@section Debugging @command{configure} scripts
>
> Nice tips!
> I've proposed an addition to one of your lists
> and made a few very subjective style suggestions:

The ideas are nice, and I agree with Jim's feedback.  Once it's touched
up, I'd like to see it go in.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwZe8ACgkQ84KuGfSFAYBMhwCgm/ZzrCeGf7SNhX8Q+Z9CjHTL
nqcAn0/Pq+ovN0dUJ+8ZzC9ThqgPs3aC
=0t1E
-----END PGP SIGNATURE-----



Re: [PATCH 3/5] New cache variable index in the manual.

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/13/2009 2:33 AM:
> * doc/autoconf.texi: Define new index `CA' for cache variables.
> (caindex): New macro.
> (Cache Variable Index): New appendix node.
> (Top, Indices): Adjust menus.
> (Cache Variable Names, Site Defaults): Adjust text.
> * doc/Makefile.am (CLEANFILES): Add files generated for CA index.

Yes, I think our use of _cv_ variables in many of the existing autoconf
macros is unlikely to change without causing major headaches (for example,
gnulib inspects ac_cv_func_NAME all over the place to see what happened
with AC_CHECK_FUNCS_ONCE), so documenting stable cache variables is a good
step.  I take it you've inspected dvi and/or pdf output, to make sure the
new index looks reasonable?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwZo8ACgkQ84KuGfSFAYDxNgCeM/WhBWkdrpRRxT3oBBnHvRS4
AIQAn0sJctuYm1hQshT+c6OTIHADy2p/
=CS5W
-----END PGP SIGNATURE-----



Re: [PATCH 4/5] Documentation of specific and general cache variables.

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/13/2009 2:36 AM:
> * doc/autoconf.texi (Default Includes, Alternative Programs)
> (Particular Programs, Generic Programs, Files, Libraries)
> (Function Portability, Particular Functions, Generic Functions)
> (Particular Headers, Generic Headers, Declarations)
> (Generic Declarations, Particular Structures, Particular Types)
> (Specific Compiler Characteristics)
> (Generic Compiler Characteristics, C Compiler, System Services):
> Document lots of cache variables.
> * NEWS: Update.

This list looked generally reasonable to me.  A couple of nits before
applying:

>  
> +** Many cache variables used by Autoconf's macros are documented now.

s/documented now/now documented/

> +
> +The result of this macro is cached in the @code{ac_cv_working_alloca_h}
> +variable.

That doesn't match our conventions, it seems like
ac_cv_header_alloca_works might be nicer.  If we document this one, we are
stuck with the name.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwaBAACgkQ84KuGfSFAYCyqQCdGPEMBb5MqGzKGJXdyvdho+3b
7XwAn1HJSfzfEtffw6PqyDLt/7z0qdGO
=C4WQ
-----END PGP SIGNATURE-----



Re: [PATCH 5/5] Use consistent notation for cache variables.

by Eric Blake :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Ralf Wildenhues on 9/13/2009 2:36 AM:
> * doc/autoconf.texi (Generic Programs): Remove `$' before
> variable name.

Good to go.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqwaCIACgkQ84KuGfSFAYDC0gCeOCuvkh8jSjVSbN1UqOe9emnl
bBIAn0M3uYrT+41bWyOLkCLBK3YCQxOU
=qRDT
-----END PGP SIGNATURE-----



Re: [PATCH 3/5] New cache variable index in the manual.

by Paolo Bonzini-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 09/16/2009 06:16 AM, Eric Blake wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Ralf Wildenhues on 9/13/2009 2:33 AM:
>> * doc/autoconf.texi: Define new index `CA' for cache variables.
>> (caindex): New macro.
>> (Cache Variable Index): New appendix node.
>> (Top, Indices): Adjust menus.
>> (Cache Variable Names, Site Defaults): Adjust text.
>> * doc/Makefile.am (CLEANFILES): Add files generated for CA index.
>
> Yes, I think our use of _cv_ variables in many of the existing autoconf
> macros is unlikely to change without causing major headaches (for example,
> gnulib inspects ac_cv_func_NAME all over the place to see what happened
> with AC_CHECK_FUNCS_ONCE)

I think a _lot_ more clients than gnulib only do!

Paolo



Re: [PATCH 4/5] Documentation of specific and general cache variables.

by Paolo Bonzini-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


>> +The result of this macro is cached in the @code{ac_cv_working_alloca_h}
>> +variable.
>
> That doesn't match our conventions, it seems like
> ac_cv_header_alloca_works might be nicer.  If we document this one, we are
> stuck with the name.

I think we already are stuck with the existing names for all cache
variables, especially because it would be a gratuitous incompatibility
that autoupdate could not really help with.

Paolo



Re: [PATCH 2/5] New FAQ node: Debugging.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Eric Blake wrote on Wed, Sep 16, 2009 at 06:13:35AM CEST:

> According to Jim Meyering on 9/13/2009 1:36 PM:
> > Ralf Wildenhues wrote:
> > ...
> >> +@node Debugging
> >> +@section Debugging @command{configure} scripts
> >
> > Nice tips!
> > I've proposed an addition to one of your lists
> > and made a few very subjective style suggestions:
>
> The ideas are nice, and I agree with Jim's feedback.  Once it's touched
> up, I'd like to see it go in.

Committed with this squashed in.  (git reflog is great even if you only
use it for 'rebase -i'ing a patch series and then, after you're done
amending patches, writing diff emails with 'git diff HEAD@{N+1} HEAD@{N}').

Thanks for the reviews,
Ralf

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 6053578..51bdef7 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -23958,12 +23958,12 @@ Debugging
 While in general, @command{configure} scripts generated by Autoconf
 strive to be fairly portable to various systems, compilers, shells, and
 other tools, it may still be necessary to debug a failing test, broken
-script or makefile, or fix or override an incomplete or wrong test,
-especially during macro development.  Failures can occur on all levels,
+script or makefile, or fix or override an incomplete, faulty, or erroneous
+test, especially during macro development.  Failures can occur at all levels,
 in M4 syntax or semantics, shell script issues, or due to bugs in the
 test or the tools invoked by @command{configure}.  Together with the
-rather arcane error message which @command{m4} and @command{make} may
-produce when their input has syntax errors, this can make debugging
+rather arcane error message that @command{m4} and @command{make} may
+produce when their input contains syntax errors, this can make debugging
 rather painful.
 
 Nevertheless, here is a list of hints and strategies that may help:
@@ -24002,8 +24002,8 @@ Debugging
 @var{log-file}.
 
 @item
-When @command{configure} tests produce wrong or insufficient results for
-your system, it may be necessary to override them:
+When @command{configure} tests produce invalid results for your system,
+it may be necessary to override them:
 
 @itemize
 @item
@@ -24023,7 +24023,7 @@ Debugging
 
 @item
 Many tests store their result in a cache variable (@pxref{Caching
-Results}).  This allows to override them either on the
+Results}).  This lets you override them either on the
 @command{configure} command line as above, or through a primed cache or
 site file (@pxref{Cache Files}, @pxref{Site Defaults}).  The name of a
 cache variable is documented with a test macro or may be inferred from
@@ -24047,7 +24047,12 @@ Debugging
 @item
 by honoring the @acronym{GNU} Coding Standards and not overriding flags
 reserved for the user except temporarily during @command{configure}
-tests.
+tests,
+
+@item
+by not requiring users of your macro to use the cache variables.
+Instead, expose the result of the test via @var{run-if-true} and
+@var{run-if-false} parameters.
 @end itemize
 
 



Re: [PATCH 4/5] Documentation of specific and general cache variables.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Paolo Bonzini wrote on Wed, Sep 16, 2009 at 07:28:22AM CEST:

>
> >>+The result of this macro is cached in the @code{ac_cv_working_alloca_h}
> >>+variable.
> >
> >That doesn't match our conventions, it seems like
> >ac_cv_header_alloca_works might be nicer.  If we document this one, we are
> >stuck with the name.
>
> I think we already are stuck with the existing names for all cache
> variables, especially because it would be a gratuitous
> incompatibility that autoupdate could not really help with.

We can still introduce new names, and document them, mention they are
new, and their old, obsolete versions, and let the code set *both*
variables.  At least it allows new users to remember only the consistent
rules.

For now, I've not documented ac_cv_working_alloca_h, and added a few
missing 'ac_cv_' prefixes I forgot in the text.

Cheers, and thanks for the reviews,
Ralf



Re: [PATCH 3/5] New cache variable index in the manual.

by Ralf Wildenhues :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

an addendum:

* Eric Blake wrote on Wed, Sep 16, 2009 at 06:16:15AM CEST:

> According to Ralf Wildenhues on 9/13/2009 2:33 AM:
> > * doc/autoconf.texi: Define new index `CA' for cache variables.
> > (caindex): New macro.
> > (Cache Variable Index): New appendix node.
> > (Top, Indices): Adjust menus.
> > (Cache Variable Names, Site Defaults): Adjust text.
> > * doc/Makefile.am (CLEANFILES): Add files generated for CA index.
>
> Yes, I think our use of _cv_ variables in many of the existing autoconf
> macros is unlikely to change without causing major headaches (for example,
> gnulib inspects ac_cv_func_NAME all over the place to see what happened
> with AC_CHECK_FUNCS_ONCE), so documenting stable cache variables is a good
> step.

FWIW, I agree with Paolo that taking gnulib as only or just major
reference point is vastly underestimating the problem domain here.

> I take it you've inspected dvi and/or pdf output, to make sure the
> new index looks reasonable?

Yes, it looks good.  However, there is an empty page inserted before the
new index, which makes me wonder about some texinfo.tex setting being
too strict.  I'll try to reproduce with a smaller example and report to
bug-texinfo.

Cheers,
Ralf



Re: [PATCH 2/5] New FAQ node: Debugging.

by Bruno Haible :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ralf,

Thanks a *lot* for this patch series. Here are two proposed additions:

- Mention the trick of running "bash -x -n configure" before even trying
  to execute the configure script. When the configure script has invalid
  shell syntax, this often has the same causes as when autoconf fails
  (bad quoting, bad use of autoconf built-in macros etc.).

- I like Jim's recommendation to not "requiring users of your macro to
  use the cache variables". What we see in many places in gnulib is that
  a macro has a certain purpose/result, which can be stored in a variable
  or a set of variables. The *_cv_* cache variable is the same as this
  result only in simple cases. In more complex cases you often have 5
  *_cv_* cache variable that together determine 1 or 2 result variables.

  OTOH, the recommendation to use "@var{run-if-true} and @var{run-if-false}
  parameters" works only for boolean result variables, and requires the
  user to be familiar with functional programming style.


2009-10-04  Bruno Haible  <bruno@...>

        * doc/autoconf.texi (Debugging): Recommend to use
        "bash -x -n configure". Recommend the use of result variables as an
        alternative to run-if-true/run-if-false parameters.

--- doc/autoconf.texi.orig 2009-10-04 14:12:10.000000000 +0200
+++ doc/autoconf.texi 2009-10-04 14:11:44.000000000 +0200
@@ -24280,6 +24280,13 @@
 verbosely (@pxref{Debugging via autom4te}).
 
 @item
+Sometimes @command{autoconf} succeeds but the generated
+@command{configure} script has invalid shell syntax.  You can detect this
+case by running @samp{bash -x -n configure} or @samp{sh -x -n configure}.
+If this command fails, the same tips apply, as if @command{autoconf} had
+failed.
+
+@item
 Debugging @command{configure} script execution may be done by sprinkling
 pairs of @code{set -x} and @code{set +x} into the shell script before
 and after the region that contains a bug.  Running the whole script with
@@ -24338,8 +24345,8 @@
 
 @item
 by not requiring users of your macro to use the cache variables.
-Instead, expose the result of the test via @var{run-if-true} and
-@var{run-if-false} parameters.
+Instead, expose the result of the test via documented shell variables or
+via @var{run-if-true} and @var{run-if-false} parameters.
 @end itemize
 
 



Re: [PATCH 4/5] Documentation of specific and general cache variables.

by Bruno Haible :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ralf,

>  @defmac AC_PROG_GREP
>  @acindex{PROG_GREP}
>  @ovindex GREP
> +@caindex prog_GREP
>  Look for the best available @code{grep} or @code{ggrep} that accepts the
>  longest input lines possible, and that supports multiple @option{-e} options.
>  Set the output variable @code{GREP} to whatever is chosen.
>  @xref{grep, , Limitations of Usual Tools}, for more information about
> -portability problems with the @command{grep} command family.
> +portability problems with the @command{grep} command family.  The result
> +is cached in the @code{ac_cv_path_GREP} variable.
>  @end defmac

I fear that by reading this, people think that using $ac_cv_path_GREP is
preferred to using $GREP.

Recall that the reason to document the cache variables is
  1) to tell people how to override the results (from the command line
     invocation of configure, or through config.site),
  2) to legitimize the use of e.g. ac_cv_func_foo for autoconf macros
     which have no documented output/result variable - but only for these!

So I propose to reformulate the sentence about the cache variable for those
macros which already have a documented output variable.

Note also that the cache variable for AC_PROG_SED is ac_cv_path_SED, not
ac_cv_prog_SED. And ac_cv_func_getmntent is used as a result variable of
AC_FUNC_GETMNTENT, not as a cache variable name.


2009-10-04  Bruno Haible  <bruno@...>

        * doc/autoconf.texi (AC_PROG_AWK, AC_PROG_GREP, AC_PROG_EGREP,
        AC_PROG_FGREP, AC_PROG_INSTALL, AC_PROG_MKDIR_P, AC_PROG_LEX,
        AC_PROG_YACC, AC_CHECK_PROG, AC_CHECK_PROGS, AC_PATH_PROG,
        AC_PATH_PROGS): Don't suggest to use the cache variable, only to override it.
        (AC_PROG_SED): Likewise. Fix name of cache variable.
        (AC_FUNC_GETMNTENT): Fix name cache variable.
        (AC_FUNC_LSTAT): Fix typo.

--- doc/autoconf.texi.orig 2009-10-04 19:23:44.000000000 +0200
+++ doc/autoconf.texi 2009-10-04 18:44:58.000000000 +0200
@@ -3873,8 +3873,8 @@
 Check for @code{gawk}, @code{mawk}, @code{nawk}, and @code{awk}, in that
 order, and set output variable @code{AWK} to the first one that is found.
 It tries @code{gawk} first because that is reported to be the
-best implementation.  The result is cached in the @code{ac_cv_prog_AWK}
-variable.
+best implementation.  The result can be overridden by setting the
+variable @code{AWK} or the cache variable @code{ac_cv_prog_AWK}.
 @end defmac
 
 @defmac AC_PROG_GREP
@@ -3886,7 +3886,7 @@
 Set the output variable @code{GREP} to whatever is chosen.
 @xref{grep, , Limitations of Usual Tools}, for more information about
 portability problems with the @command{grep} command family.  The result
-is cached in the @code{ac_cv_path_GREP} variable.
+can be overridden by setting the cache variable @code{ac_cv_path_GREP}.
 @end defmac
 
 @defmac AC_PROG_EGREP
@@ -3896,7 +3896,7 @@
 Check whether @code{$GREP -E} works, or else look for the best available
 @code{egrep} or @code{gegrep} that accepts the longest input lines possible.
 Set the output variable @code{EGREP} to whatever is chosen.  The result
-is cached in the @code{ac_cv_path_EGREP} variable.
+can be overridden by setting the cache variable @code{ac_cv_path_EGREP}.
 @end defmac
 
 @defmac AC_PROG_FGREP
@@ -3906,7 +3906,7 @@
 Check whether @code{$GREP -F} works, or else look for the best available
 @code{fgrep} or @code{gfgrep} that accepts the longest input lines possible.
 Set the output variable @code{FGREP} to whatever is chosen.  The result
-is cached in the @code{ac_cv_path_FGREP} variable.
+can be overridden by setting the cache variable @code{ac_cv_path_FGREP}.
 @end defmac
 
 @defmac AC_PROG_INSTALL
@@ -3949,8 +3949,8 @@
 @code{AC_PROG_INSTALL}; just put the file name of your program into your
 @file{Makefile.in} files.
 
-The result of the test is cached in the @code{ac_cv_path_install} variable,
-if an @command{install} program other than the in-tree script is found.
+The result of the test can be overridden by setting the variable
+@code{INSTALL} or the cache variable @code{ac_cv_path_install}.
 @end defmac
 
 @defmac AC_PROG_MKDIR_P
@@ -3988,8 +3988,8 @@
 @samp{@@MKDIR_P@@} is special, as its value may vary for different
 configuration files.
 
-The result of the test is cached in the @code{ac_cv_path_mkdir} variable,
-if a @command{mkdir} program other than an in-tree script is found.
+The result of the test can be overridden by setting the variable
+@code{MKDIR_P} or the cache variable @code{ac_cv_path_mkdir}.
 @end defmac
 
 @anchor{AC_PROG_LEX}
@@ -4050,7 +4050,8 @@
 As part of running the test, this macro may delete any file in the
 configuration directory named @file{lex.yy.c} or @file{lexyy.c}.
 
-The result of this test is cached in the @code{ac_cv_prog_LEX} variable.
+The result of this test can be influenced by setting the variable
+@code{LEX} or the cache variable @code{ac_cv_prog_LEX}.
 @end defmac
 
 @anchor{AC_PROG_LN_S}
@@ -4092,13 +4093,14 @@
 @defmac AC_PROG_SED
 @acindex{PROG_SED}
 @ovindex SED
-@caindex prog_SED
+@caindex path_SED
 Set output variable @code{SED} to a Sed implementation that conforms to
 Posix and does not have arbitrary length limits.  Report an error if no
 acceptable Sed is found.  @xref{sed, , Limitations of Usual Tools}, for more
 information about portability problems with Sed.
 
-The result of this test is cached in the @code{ac_cv_prog_SED} variable.
+The result of this test can be overridden by setting the cache variable
+@code{ac_cv_path_SED}.
 @end defmac
 
 @defmac AC_PROG_YACC
@@ -4110,7 +4112,8 @@
 If @code{bison} is found, set output variable @code{YACC} to @samp{bison
 -y}.  Otherwise, if @code{byacc} is found, set @code{YACC} to
 @samp{byacc}.  Otherwise set @code{YACC} to @samp{yacc}.
-The result of this test is cached in the @code{ac_cv_prog_YACC} variable.
+The result of this test can be influenced by setting the variable
+@code{YACC} or the cache variable @code{ac_cv_prog_YACC}.
 @end defmac
 
 @node Generic Programs
@@ -4147,8 +4150,9 @@
 that case, set @var{variable} using the absolute file name of the
 @var{prog-to-check-for} found that is not @var{reject}.  If
 @var{variable} was already set, do nothing.  Calls @code{AC_SUBST} for
-@var{variable}.  The result of this test is cached in the
-@code{ac_cv_prog_@var{variable}} variable.
+@var{variable}.  The result of this test can be overridden by setting the
+variable @var{variable} or the cache variable
+@code{ac_cv_prog_@var{variable}}.
 @end defmac
 
 @anchor{AC_CHECK_PROGS}
@@ -4163,7 +4167,8 @@
 list are found, set @var{variable} to @var{value-if-not-found}; if
 @var{value-if-not-found} is not specified, the value of @var{variable}
 is not changed.  Calls @code{AC_SUBST} for @var{variable}.  The result of
-this test is cached in the @code{ac_cv_prog_@var{variable}} variable.
+this test can be overridden by setting the variable @var{variable} or the
+cache variable @code{ac_cv_prog_@var{variable}}.
 @end defmac
 
 @defmac AC_CHECK_TARGET_TOOL (@var{variable}, @var{prog-to-check-for}, @
@@ -4245,8 +4250,9 @@
 @acindex{PATH_PROG}
 @caindex path_@var{variable}
 Like @code{AC_CHECK_PROG}, but set @var{variable} to the absolute
-name of @var{prog-to-check-for} if found.  A positive result of this
-test is cached in the @code{ac_cv_path_@var{variable}} variable.
+name of @var{prog-to-check-for} if found.  The result of this test
+can be overridden by setting the cache variable
+@code{ac_cv_path_@var{variable}}.
 @end defmac
 
 @anchor{AC_PATH_PROGS}
@@ -4256,7 +4262,8 @@
 @caindex path_@var{variable}
 Like @code{AC_CHECK_PROGS}, but if any of @var{progs-to-check-for}
 are found, set @var{variable} to the absolute name of the program
-found.
+found.  The result of this test can be overridden by setting the cache
+variable @code{ac_cv_path_@var{variable}}.
 @end defmac
 
 @defmac AC_PATH_PROGS_FEATURE_CHECK (@var{variable}, @
@@ -5000,14 +5007,16 @@
 @cvindex HAVE_GETMNTENT
 @c @fuindex getmntent
 @prindex @code{getmntent}
-@caindex func_getmntent
+@caindex search_getmntent
 Check for @code{getmntent} in the standard C library, and then in the
 @file{sun}, @file{seq}, and @file{gen} libraries, for @sc{unicos},
 @sc{irix} 4, @sc{ptx}, and UnixWare, respectively.  Then, if
-@code{getmntent} is available, define @code{HAVE_GETMNTENT}.
+@code{getmntent} is available, define @code{HAVE_GETMNTENT} and set
+@code{ac_cv_func_getmntent} to @code{yes}.  Otherwise set
+@code{ac_cv_func_getmntent} to @code{no}.
 
-The result of this macro is cached in the @code{ac_cv_func_getmntent}
-variable.
+The result of this macro can be overridden by setting the cache variable
+@code{ac_cv_search_getmntent}.
 @end defmac
 
 @defmac AC_FUNC_GETPGRP
@@ -5260,7 +5269,7 @@
 
 The results of these macros are cached in the
 @code{ac_cv_func_stat_empty_string_bug} and the
-@code{ac_cv_func_stat_empty_string_bug} variables, respectively.
+@code{ac_cv_func_lstat_empty_string_bug} variables, respectively.
 
 These macros are obsolescent, as no current systems have the bug.
 New programs need not use these macros.
@@ -5892,7 +5901,7 @@
 determine whether the system has conforming header files (and probably C
 library functions).
 
-This macro caches its results in the @code{ac_cv_header_stdc} variable.
+This macro caches its result in the @code{ac_cv_header_stdc} variable.
 
 This macro is obsolescent, as current systems have conforming header
 files.  New programs need not use this macro.



Re: [PATCH 1/5] Document AM_MAKEFLAGS workaround to the macro override problem.

by Bruno Haible :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ralf Wildenhues wrote:
> +Makefiles generated by @command{automake} expand @code{$(AM_MAKEFLAGS)}
> +on the command line of submakes, which can be used for propagated overrides
> +(@pxref{Subdirectories, , Automake, automake, @acronym{GNU} Automake}).

Can you add an example for it? Suppose I want to override the MKDIR_P Makefile
variable in all Makefiles - this was what started this discussion -, am I
supposed to use the command

   make MKDIR_P='mkdir -p'

or

   make AM_MAKEFLAGS="MKDIR_P='mkdir -p'"

or even

   make MKDIR_P='mkdir -p' AM_MAKEFLAGS="MKDIR_P='mkdir -p'"

?

With GNU make, the first and the third one work fine. With Solaris make, only
the third one work fine. So probably the syntax to be recommended is the third
one.


Test case:

$ cat > configure.ac <<\EOF
AC_INIT
AM_INIT_AUTOMAKE(dummy,0)
AC_PROG_MKDIR_P
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([2/Makefile])
AC_OUTPUT
EOF
$ cat > Makefile.am <<\EOF
SUBDIRS = 2
all: sub0
sub0:
        $(MKDIR_P) sub0
all-local:
        $(MKDIR_P) sub1
EOF
$ mkdir 2
$ cat > 2/Makefile.am <<\EOF
all: sub2
sub2:
        $(MKDIR_P) sub2
all-local:
        $(MKDIR_P) sub3
EOF
$ touch NEWS README AUTHORS ChangeLog
$ aclocal
$ autoconf
$ automake -a -c

Execution with GNU make:

$ make MKDIR_P='mkdir -p'
Making all in 2
make[1]: entrant dans le répertoire « /tmp/1/2 »
mkdir -p sub3
mkdir -p sub2
make[1]: quittant le répertoire « /tmp/1/2 »
make[1]: entrant dans le répertoire « /tmp/1 »
mkdir -p sub1
make[1]: quittant le répertoire « /tmp/1 »
mkdir -p sub0

$ make AM_MAKEFLAGS="MKDIR_P='mkdir -p'"
Making all in 2
make[1]: entrant dans le répertoire « /tmp/1/2 »
mkdir -p sub3
mkdir -p sub2
make[1]: quittant le répertoire « /tmp/1/2 »
make[1]: entrant dans le répertoire « /tmp/1 »
mkdir -p sub1
make[1]: quittant le répertoire « /tmp/1 »
/arch/x86-linux/gnu/bin/mkdir -p sub0

$ make MKDIR_P='mkdir -p' AM_MAKEFLAGS="MKDIR_P='mkdir -p'"
Making all in 2
make[1]: entrant dans le répertoire « /tmp/1/2 »
mkdir -p sub3
mkdir -p sub2
make[1]: quittant le répertoire « /tmp/1/2 »
make[1]: entrant dans le répertoire « /tmp/1 »
mkdir -p sub1
make[1]: quittant le répertoire « /tmp/1 »
mkdir -p sub0

Execution with Solaris make:

$ make MKDIR_P='mkdir -p'
Making all in 2
/opt/csw/bin/gmkdir -p sub3
/opt/csw/bin/gmkdir -p sub2
/opt/csw/bin/gmkdir -p sub1
mkdir -p sub0

$ make AM_MAKEFLAGS="MKDIR_P='mkdir -p'"
Making all in 2
mkdir -p sub3
mkdir -p sub2
mkdir -p sub1
/opt/csw/bin/gmkdir -p sub0

$ make MKDIR_P='mkdir -p' AM_MAKEFLAGS="MKDIR_P='mkdir -p'"
Making all in 2
mkdir -p sub3
mkdir -p sub2
mkdir -p sub1
mkdir -p sub0

Bruno


< Prev | 1 - 2 | Next >