$linuxjunkies
>

autoconf(1)

Generates a shell script that automatically configures software source code packages.

UbuntuDebianFedoraArch

Synopsis

autoconf [OPTION]... [TEMPLATE-FILE]

Description

autoconf is a tool for producing shell scripts that automatically configure software source code packages. It takes a template file (usually configure.ac or configure.in) containing macro calls that describe the software package's features and generates a portable configure shell script.

The generated configure script probes the system to detect available features, compiler capabilities, and installed libraries, then creates a Makefile and config.h header file tailored to the build environment. This eliminates the need to manually edit Makefiles for different platforms.

autoconf is typically used as part of the GNU Autotools suite (autoconf, automake, libtool) to create maintainable, portable build systems.

Common options

FlagWhat it does
-h, --helpDisplay help message and exit
-V, --versionPrint autoconf version number and exit
-v, --verboseVerbosely report processing steps
-d, --debugDon't remove temporary files; show shell trace during execution
-f, --forceConsider all files obsolete and regenerate configure
-o FILE, --output=FILEWrite output to FILE instead of configure
-W CATEGORY, --warnings=CATEGORYReport warnings for specified category (syntax, cross, deprecated)
-I DIRAppend DIR to macro search path

Examples

Generate configure script from configure.ac in current directory; output is written to stdout

autoconf

Generate configure script and save directly to a file named configure

autoconf -o configure

Force regeneration of configure script, treating input files as modified even if they haven't changed

autoconf -f

Add /usr/local/share/aclocal to macro search path before standard directories

autoconf -I /usr/local/share/aclocal

Generate configure script with all warnings enabled (syntax, cross, deprecated, etc.)

autoconf -W all

Process configure.ac with verbose output to see each macro being processed

autoconf -v configure.ac

Run in debug mode to see the generated shell script commands (use for troubleshooting)

autoconf -d 2>&1 | head -20