When autogen.sh fails with “autoreconf not found,” install Autotools and rerun autoreconf -fi to regenerate configure files.
Seeing autogen.sh bail out with that message can stall a build in seconds. The good news: the failure is predictable and the cure is clear on most systems. This guide explains what the script is trying to do, why the tool goes missing on Linux, macOS, and Windows shells, and the exact commands to install what’s needed. You’ll also learn quick checks, common macro errors, and the right order to run tools so the project reaches a clean configure and make.
What Autogen.sh And Autoreconf Actually Do
Projects that use the GNU Build System ship files like configure.ac and Makefile.am. The autogen.sh helper usually calls autoreconf, which chains other tools to refresh generated files. The GNU manual states that autoreconf runs autoconf, autoheader, aclocal, automake, libtoolize, and autopoint as needed, updating only what’s older than its sources. That’s why the script fails when the binary isn’t installed or not on PATH.
Think of it as one command that lines up the usual suspects in the correct order. It rebuilds configure from templates, refreshes headers, and drops helper files when Gettext or Libtool are used. Man pages echo the same role and mention the –force and –install switches, which many projects expect.
One detail trips many builders: autoconf and autoreconf aren’t the same. Autoconf generates the configure script from templates; autoreconf is a wrapper that calls the Autotools in the right order. If you only install autoconf, the wrapper may still be missing.
Autogen.sh ‘Autoreconf’ Not Found: Causes And Fixes
Many logs print the exact line autogen.sh ‘autoreconf’ not found before exiting. The error text points to two root causes. Either the tool isn’t installed at all, or it’s installed but the shell can’t find it. A third case shows up on older images: the toolchain exists, but versions don’t match macros in the tree.
PATH quirks also bite. In non-login shells, Homebrew’s prefix may not be sourced, and in CI images a step can reset PATH between phases. On Windows shells, MSYS2 and Git Bash keep separate PATH layouts. When the wrong shell launches autogen.sh, the script can’t see the freshly installed binary, so the same line repeats.
- Install Missing Tools — Autotools come as three linked packages: autoconf, automake, and libtool. Install them together so the chain runs clean.
- Fix PATH Problems — Use command -v autoreconf. If nothing prints, your PATH doesn’t include the tool’s bin directory or the tool isn’t installed. Man pages confirm the expected binary name.
- Align Versions — Projects may require a newer Autoconf. The AC_PREREQ macro enforces a minimum version, so upgrade when you see version complaints.
Install Autotools On Your Platform
Quick run: use the package set shown below, then re-run autoreconf -fi. Homebrew and common Linux repos ship recent releases. Arch groups the build chain in base-devel.
| OS | Packages | Command |
|---|---|---|
| Ubuntu/Debian | autoconf automake libtool pkg-config m4 make | sudo apt install autoconf automake libtool pkg-config m4 make |
| Fedora/RHEL | autoconf automake libtool gettext-devel | sudo dnf install autoconf automake libtool gettext-devel |
| Arch Linux | base-devel autoconf automake libtool | sudo pacman -S --needed base-devel autoconf automake libtool |
| macOS (Homebrew) | autoconf automake libtool pkg-config | brew install autoconf automake libtool pkg-config |
| Windows | MSYS2 toolchain (autoconf automake libtool) | pacman -S --needed autoconf automake libtool |
Ask Ubuntu threads show that simply installing autoconf resolves the immediate “autoreconf not found” failure on Debian based systems. Homebrew formula pages document the brew commands for macOS. The Arch package page and manual confirm tool names and grouping. MSYS2 is the usual route on Windows shells if you’re not using WSL.
On macOS, install Apple’s Command Line Tools once per machine so compilers and headers exist. Then add Homebrew and the Autotools packages. The brew pages state the commands plainly and keep versions current. On Debian based systems, the apt packages are in main repos and require no extra taps.
When packages aren’t available or you need a newer release, build from source. Follow the classic order m4 → Autoconf → Automake → Libtool, and install the trio under one prefix so their macros and helper scripts align. The Open MPI developer notes call this out, since a mixed prefix can produce odd macro lookups or stale libtool scripts during configure.
Run The Minimal Fix Command Sequence
Once the tools are present, this short run tends to clear the build tree and produce a fresh configure.
- Clean Stale Files — Remove broken runs:
git clean -fdxor delete onlym4,aclocal.m4, and oldconfigureif you must keep other changes. - Regenerate Build Files — From the project root, run
autoreconf -fi. The manual notes that –install drops missing helper files and –force refreshes everything. - Bootstrap Libtool — If the project uses Libtool, the chain will call libtoolize. Install the package first if the log says it’s missing.
- Configure And Build — Run
./configurewith flags you need, thenmake -j. If configure still fails on macros, jump to the next section.
If you’re unsure the tree picked up new macros, nuke the aclocal.m4 and the autom4te.cache directory before running the command. That keeps the wrapper from reusing stale data and hides a class of timestamp bugs on network filesystems.
Then rerun the bootstrap script from a clean tree for a predictable outcome.
Common Macro And Tooling Errors After The Fix
Hitting new errors right after installing tools is common, since a single missing package can mask others. These are the usual follow-ups and how to clear them.
- AM_INIT_AUTOMAKE Undefined — Install automake, then rerun the chain. This macro comes from automake’s aclocal files.
- AC_PROG_LIBTOOL Or LT_INIT Missing — Install libtool and rerun. Libtool macros drive shared library glue across platforms.
- Gettext Files Missing — Pass
autoreconf -fiso autopoint can copy helper files when the project uses translations. - AM_GNU_GETTEXT Issues — If autopoint can’t find message catalogs, add the Gettext dev package and rerun with
--install. - Undefined Macro AX_* — Many projects carry macros under
m4/. Ensure that dir exists in the repo and is included byAC_CONFIG_MACRO_DIRinconfigure.ac. - Version Too Old — The log may ask for a newer Autoconf. The AC_PREREQ rule in the book sample shows why. Upgrade the package to match.
- PATH Still Wrong — Print
echo $PATH. On macOS, open a fresh shell after Homebrew installs. On CI or Docker, export PATH with the new prefix.
Verification Checklist Before You Re-Run The Script
Do these quick checks to avoid another red run. They catch PATH mistakes, missing helpers, and stale caches.
- Confirm Binaries — Run
command -v autoreconf autoconf automake libtoolize. Each should print a path. Man pages and manuals confirm tool names and roles. - Confirm Macro Path — Run
aclocal --print-ac-dir. If it points to a non-existent directory, reinstall automake. - Check M4 Presence — Autoconf depends on m4. If your distro didn’t pull it in, install the package and rerun. The Arch page shows dependencies and the Autoconf site documents the tool.
- Force A Clean Rebuild — Use
autoreconf -fito refresh everything and install missing helper files across subdirs. The manual notes this behavior.
Autoreconf Missing In Autogen.sh — Quick Reference
This compact list gives you the repeatable path from failure to a working configure across common platforms. It’s safe to paste into a fresh shell.
- Install The Toolchain — Debian:
sudo apt install autoconf automake libtool pkg-config m4 make. Fedora:sudo dnf install autoconf automake libtool gettext-devel. Arch:sudo pacman -S --needed base-devel autoconf automake libtool. macOS:brew install autoconf automake libtool pkg-config. MSYS2:pacman -S --needed autoconf automake libtool. - Verify PATH — Run
command -v autoreconf. If empty, fix PATH or the install. - Regenerate — From the project root:
autoreconf -fi. - Configure — Run
./configureand pass required flags. - Build — Run
make -jand watch for macro prompts that hint at one more package.
With the steps above, the dreaded string autogen.sh ‘autoreconf’ not found turns into a short checklist: install the trio, refresh the tree, and proceed to configure. The Autoconf manual and distro pages back each command and switch, so you can fix the build with confidence.
