Skip to content
Latchkey

autoreconf -i: Regenerate the Autotools Build

autoreconf -i runs the autotools chain (aclocal, autoconf, automake) to regenerate ./configure and installs any missing helper scripts.

When a repo ships only configure.ac and Makefile.am (no generated ./configure), you bootstrap it with autoreconf. The -i flag copies in the auxiliary files the build needs.

What it does

autoreconf orchestrates aclocal, autoconf, autoheader, and automake in the right order to produce configure and Makefile.in from their source templates. With -i it also installs missing auxiliary files like install-sh, missing, and config.guess.

Common usage

Terminal
autoreconf -i
autoreconf -fiv    # force, install, verbose
./configure --prefix="$PWD/stage"
make -j$(nproc)

Options

FlagWhat it does
-i / --installCopy in missing auxiliary and macro files
-f / --forceRegenerate even if outputs look up to date
-v / --verboseReport each tool as it runs
-I <dir>Additional directory to search for m4 macros
-WallEnable all warning categories

In CI

Install autoconf, automake, libtool, and pkg-config before running (the "autotools" toolchain). Use autoreconf -fiv on freshly cloned sources so nothing is skipped. Projects often provide a ./autogen.sh or ./bootstrap wrapper that calls autoreconf; prefer it if present.

Common errors in CI

"autoreconf: command not found" means autoconf is not installed. "possibly undefined macro: AC_MSG_ERROR" or "error: possibly undefined macro: PKG_CHECK_MODULES" means a required m4 macro package is missing (install pkg-config for PKG_CHECK_MODULES, libtool for LT_INIT). "aclocal: warning: couldn't open directory 'm4'" means an ACLOCAL_AMFLAGS dir does not exist yet; -i usually resolves it. "Libtool library used but LIBTOOL is undefined" means libtool is not installed.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →