The Shortest configure.ac File

The simplest possible configure.ac file has just two lines, as shown in Example 3-1.

Example 3-1. The simplest configure.ac file

AC_INIT([Jupiter], [1.0])
AC_OUTPUT

To those new to Autoconf, these two lines appear to be a couple of function calls, perhaps in the syntax of some obscure programming language. Don't let their appearance throw you—these are M4 macro calls. The macros are defined in files distributed with the autoconf package. You can find the definition of AC_INIT, for example, in the autoconf/general.m4 file in Autoconf's installation directory (usually /usr/(local/)share/autoconf). AC_OUTPUT is defined in autoconf/status.m4.

Get Autotools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.