autoconf

Generate configure scripts from templates

TLDR

Generate configure script
$ autoconf
Generate with specific template
$ autoconf -o [configure] [configure.ac]
Trace a specific macro in configure.ac
$ autoconf --trace=[AC_CHECK_LIB]
Show version
$ autoconf --version

SYNOPSIS

autoconf [-o output] [input]

DESCRIPTION

autoconf generates configure scripts from templates (configure.ac or configure.in). These scripts probe the system for available features, libraries, and tools, producing Makefiles tailored to the build environment.Autoconf is part of the GNU Build System (autotools), used by thousands of open source projects.

PARAMETERS

-o file

Output file (default: configure)
-W category
Warning category
-I dir
Add directory to search path
-f, --force
Force regeneration
-v, --verbose
Verbose output
--trace=macro
Trace macro calls in configure.ac
-B dir
Prepend directory to search path

WORKFLOW

1. Write configure.ac2. Run autoconf to generate configure3. Distribute configure with source4. Users run ./configure to generate Makefile

INSTALL

sudo dnf install autoconf
sudo pacman -S autoconf
sudo apk add autoconf
sudo zypper install autoconf
brew install autoconf
nix profile install nixpkgs#autoconf

CAVEATS

Requires M4 macro processor. Complex syntax based on M4. Generated configure scripts are large. Learning curve is steep.

HISTORY

Autoconf was created by David MacKenzie in 1991 to address the portability problems of Unix software. It became the standard build system for GNU and many other projects.

SEE ALSO

automake(1), autoreconf(1), configure(1), m4(1), libtool(1)