autoconf
Create portable software configuration scripts
TLDR
Generate a configuration script from configure.ac (if present) or configure.in and save this script to configure
Generate a configuration script from the specified template; output to stdout
Generate a configuration script from the specified template (even if the input file has not changed) and write the output to a file
SYNOPSIS
autoconf [OPTION]... [INPUT-FILE]
PARAMETERS
--help
Display a help message and exit.
--version
Display version information and exit.
-o file
Specify the output file name (default: configure).
-W category
Report warnings falling in category.
-v
Verbose mode. Provide more detailed output during processing.
-t template
Use the specified template file. Useful to specify the format and content of the config.status script.
-I dir
Add directory to search path for m4 files.
DESCRIPTION
autoconf is a tool for automatically generating shell scripts to configure software source code packages.
These configure scripts adapt the package to the specific system on which it is being built. It examines the target environment, checking for the presence of necessary programs, libraries, and header files. The output of autoconf is typically a configure script, which is then run by the user to prepare the source code for compilation.
autoconf uses macro definitions stored in files ending in .ac or .m4 to generate the configure script, primarily configure.ac or configure.in. The macros are processed and expanded, resulting in a portable and robust configure script that handles a wide range of system configurations, facilitating cross-platform software development and deployment. Using autoconf helps ensure that software packages can be built and installed on different operating systems with minimal manual intervention.
CAVEATS
autoconf requires the installation of M4 macro processor. Careful planning and understanding of M4 macros is crucial for effective use.
INPUT FILE
The input file, typically named configure.ac or configure.in, contains M4 macro calls that define the configuration process. autoconf processes this file to generate the configure script.
M4 MACROS
autoconf relies on M4 macros to perform various configuration tasks. These macros check for the presence of libraries, header files, and programs, and define variables that can be used to customize the build process. Understanding M4 syntax is key to effectively using autoconf.
HISTORY
autoconf was developed as part of the GNU project to provide a portable and automated way to configure software for different Unix-like systems. It evolved to address the challenges of software distribution and installation across diverse platforms. Early versions focused on basic configuration tasks, while later versions incorporated more sophisticated features for dependency checking and system-specific adaptations. Its usage is widespread in open-source projects.