autoconf: Usage, Options & Common CI Errors
autoconf turns configure.ac into a portable configure shell script.
autoconf is the front of the GNU Autotools chain. In CI you usually run autoreconf to regenerate the whole build, and the recurring failure is a missing macro package (like pkg.m4 or libtool) that leaves "possibly undefined macro" in the log.
What it does
autoconf processes configure.ac (using m4 macros) to produce a portable configure script that probes the build host for compilers, headers, and libraries. It is typically driven by autoreconf, which also runs aclocal, automake, and libtoolize as needed.
Common usage
autoreconf -fi # regenerate everything
autoconf # configure.ac -> configure
./configure --prefix=/usr/local
aclocal && autoconf # refresh macros then generate
autoreconf --install --verboseOptions
| Command / flag | What it does |
|---|---|
| autoreconf -fi | Force-rebuild + install missing aux files |
| --install / -i | Copy missing auxiliary scripts |
| --force / -f | Regenerate even if up to date |
| aclocal | Gather m4 macros into aclocal.m4 |
| ./configure --prefix | Run the generated script |
Common errors in CI
"configure.ac:NN: error: possibly undefined macro: AC_MSG_ERROR" (or PKG_CHECK_MODULES) means a macro package is not installed - install pkg-config/pkg.m4, libtool, or gettext and re-run autoreconf -fi. "aclocal: command not found" - install automake (it ships aclocal). "autoreconf: ‘configure.ac’ is required" - wrong directory. Always run autoreconf -fi in CI rather than relying on a committed (possibly stale) configure.