Next: , Previous: Initializing configure, Up: Setup


4.2 Dealing with Autoconf versions

The following optional macros can be used to help choose the minimum version of Autoconf that can successfully compile a given configure.ac.

— Macro: AC_PREREQ (version)

Ensure that a recent enough version of Autoconf is being used. If the version of Autoconf being used to create configure is earlier than version, print an error message to the standard error output and exit with failure (exit status is 63). For example:

          AC_PREREQ([2.63])
     

This macro is the only macro that may be used before AC_INIT, but for consistency, you are invited not to do so.

— Macro: AC_AUTOCONF_VERSION

This macro was introduced in Autoconf 2.62. It identifies the version of Autoconf that is currently parsing the input file, in a format suitable for m4_version_compare (see m4_version_compare); in other words, for this release of Autoconf, its value is `2.63'. One potential use of this macro is for writing conditional fallbacks based on when a feature was added to Autoconf, rather than using AC_PREREQ to require the newer version of Autoconf. However, remember that the Autoconf philosophy favors feature checks over version checks.

You should not expand this macro directly; use `m4_defn([AC_AUTOCONF_VERSION])' instead. This is because some users might have a beta version of Autoconf installed, with arbitrary letters included in its version string. This means it is possible for the version string to contain the name of a defined macro, such that expanding AC_AUTOCONF_VERSION would trigger the expansion of that macro during rescanning, and change the version string to be different than what you intended to check.