Autotools is a suite of programming tools designed to make source code packages portable across various Unix-like systems. It automates the configuration and build process, allowing developers to write software that can be compiled on a wide range of platforms without manual adjustments. The core components are Autoconf, Automake, and Libtool.
configure.ac (or the older configure.in) is the primary input file for Autoconf. It is a shell script template written in the M4 macro language. This file contains a series of M4 macros that test for system features, libraries, headers, and programs required by the software. Based on these tests, Autoconf processes configure.ac to generate a configure script.
When an end-user runs the generated configure script, it probes their specific system environment and generates Makefiles (from Makefile.in templates provided by Automake) and other necessary files specific to that system. This ensures that the software can be compiled correctly on the target machine, abstracting away platform-specific differences. In essence, configure.ac defines the build requirements and configuration logic for a project using the Autotools system, making it a crucial file for any Autotools-based software distribution.