GNU Info

Info Node: (autoconf.info)Caching Results

(autoconf.info)Caching Results


Next: Printing Messages Prev: Setting Output Variables Up: Results
Enter node , (file) or (file)node

Caching Results
===============

   To avoid checking for the same features repeatedly in various
`configure' scripts (or repeated runs of one script), `configure' saves
the results of many of its checks in a "cache file".  If, when a
`configure' script runs, it finds a cache file, it reads from it the
results from previous runs and avoids rerunning those checks.  As a
result, `configure' can run much faster than if it had to perform all
of the checks every time.

 - Macro: AC_CACHE_VAL (CACHE-ID, COMMANDS-TO-SET-IT)
     Ensure that the results of the check identified by CACHE-ID are
     available.  If the results of the check were in the cache file
     that was read, and `configure' was not given the `--quiet' or
     `--silent' option, print a message saying that the result was
     cached; otherwise, run the shell commands COMMANDS-TO-SET-IT.
     Those commands should have no side effects except for setting the
     variable CACHE-ID.  In particular, they should not call
     `AC_DEFINE'; the code that follows the call to `AC_CACHE_VAL'
     should do that, based on the cached value.  Also, they should not
     print any messages, for example with `AC_MSG_CHECKING'; do that
     before calling `AC_CACHE_VAL', so the messages are printed
     regardless of whether the results of the check are retrieved from
     the cache or determined by running the shell commands.  If the
     shell commands are run to determine the value, the value will be
     saved in the cache file just before `configure' creates its output
     files.  Note: Cache Variable Names, for how to choose the name
     of the CACHE-ID variable.

 - Macro: AC_CACHE_CHECK (MESSAGE, CACHE-ID, COMMANDS)
     A wrapper for `AC_CACHE_VAL' that takes care of printing the
     messages.  This macro provides a convenient shorthand for the most
     common way to use these macros.  It calls `AC_MSG_CHECKING' for
     MESSAGE, then `AC_CACHE_VAL' with the CACHE-ID and COMMANDS
     arguments, and `AC_MSG_RESULT' with CACHE-ID.

 - Macro: AC_CACHE_LOAD
     Loads values from existing cache file, or creates a new cache file
     if a cache file is not found.  Called automatically from `AC_INIT'.

 - Macro: AC_CACHE_SAVE
     Flushes all cached values to the cache file.  Called automatically
     from `AC_OUTPUT', but it can be quite useful to call
     `AC_CACHE_SAVE' at key points in configure.in.  Doing so
     checkpoints the cache in case of an early configure script abort.

Cache Variable Names
Shell variables used in caches.
Cache Files
Files `configure' uses for caching.

automatically generated by info2www version 1.2.2.9