Next: , Up: Basic Autoconf macros   [Contents][Index] Initializing configure

Every configure script must call AC_INIT before doing anything else that produces output. See Autoconf Input Layout. Calls to silent macros, such as AC_DEFUN, may also occur prior to AC_INIT.

Macro: AC_INIT (package, version, [bug-report], [tarname], [url])

Process any command-line arguments and perform initialization and verification.

Set the name of the package and its version. These are typically used in --version support, including that of configure. The optional argument bug-report should be the email to which users should send bug reports. The package tarname differs from package: the latter designates the full package name (e.g., ‘GNU Autoconf’), while the former is meant for distribution tar ball names (e.g., ‘autoconf’). It defaults to package with ‘GNU ’ stripped, lower-cased, and all characters other than alphanumerics and underscores are changed to ‘-’. If provided, url should be the home page for the package.

The arguments of AC_INIT must be static, i.e., there should not be any shell computation, quotes, or newlines, but they can be computed by M4. This is because the package information strings are expanded at M4 time into several contexts, and must give the same text at shell time whether used in single-quoted strings, double-quoted strings, quoted here-documents, or unquoted here-documents. It is permissible to use m4_esyscmd or m4_esyscmd_s for computing a version string that changes with every commit to a version control system (in fact, Autoconf does just that, for all builds of the development tree made between releases).

The following M4 macros (e.g., AC_PACKAGE_NAME), output variables (e.g., PACKAGE_NAME), and preprocessor symbols (e.g., PACKAGE_NAME), are defined by AC_INIT:


Exactly package.


Exactly tarname, possibly generated from package.


Exactly version.


Exactly ‘package version’.


Exactly bug-report, if one was provided. Typically an email address, or URL to a bug management web page.


Exactly url, if one was provided. If url was empty, but package begins with ‘GNU ’, then this defaults to ‘’, otherwise, no URL is assumed.

If your configure script does its own option processing, it should inspect ‘$@’ or ‘$*’ immediately after calling AC_INIT, because other Autoconf macros liberally use the set command to process strings, and this has the side effect of updating ‘$@’ and ‘$*’. However, we suggest that you use standard macros like AC_ARG_ENABLE instead of attempting to implement your own option processing. See Adding options to a configure script.

Next: , Up: Basic Autoconf macros   [Contents][Index]