LinuxCommandLibrary

autoconf

TLDR

Generate configure script

$ autoconf
copy
Generate with specific template
$ autoconf -o [configure] [configure.ac]
copy
Generate from configure.in (old)
$ autoconf configure.in > configure
copy
Show version
$ autoconf --version
copy

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

WORKFLOW

1. Write configure.ac
2. Run autoconf to generate configure
3. Distribute configure with source
4. Users run ./configure to generate Makefile

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

Copied to clipboard