Replacement for autoconf cache load


Caching in autoconf is broken (through version 2.13). The problem is that the cache is read without any check for whether it makes any sense to read it. A common problem is a build on a shared file system; connecting to a different computer and then building within the same directory will lead to at best error messages from configure and at worse a build that is wrong but fails only at run time (e.g., wrong datatype sizes used). Later versions of autoconf do include some checks for changes in the environment that impact the choices, but still misses problems with multiple different systems.

This fixes that by requiring the user to explicitly enable caching before the cache file will be loaded.

To use this version of AC_CACHE_LOAD, you need to include aclocal_cache.m4 in your aclocal.m4 file. The sowing aclocal.m4 file includes this file.

If no --enable-cache or --disable-cache option is selected, the command causes configure to keep track of the system being configured in a config.system file; if the current system matches the value stored in that file (or there is neither a config.cache nor config.system file), configure will enable caching. In order to ensure that the configure tests make sense, the values of CC, F77, F90, and CXX are also included in the config.system file.


This does not work with the Cygnus configure because the enable arguments are processed *after* AC_CACHE_LOAD (!). To address this, we avoid changing the value of enable_cache, and use real_enable_cache, duplicating the "notgiven" value.

See Also