Autotools. Respect.

Wed, 7 May, 2008

GNU Autotools allow a developer to allow users to build the software for themselves from source. Typically, a user who downloads a source tarball has only to invoke a few standard commands:

./configure
make
make install

or, more succinctly:

./configure && make && make install

If the build succeeds, the user is ready to run the software. If the build fails, it was probably early during configure, whose job it is to ensure all the dependencies are available and the correct versions. The make compiles, and the make install runs a special target of the makefile that shuffles the resulting binaries into the correct places on the filesystem (with the help of libtool to handle the platform-specific quirks, if I understand correctly).

There are some special standard make targets, including make clean which cleans up the intermediate build garbage. make distclean re-packages all the sources for re-distribution, which exemplifies the open source world's anyone-can-program mindset.

The configure and makefile are themselves generated by Autotools "autoconf" and "automake". These tools mean that busy developers don't have to skimp on configure checking or make targets. To be clear, I haven't yet worked with these tools.

Autotools is hated. Critics cite its complexity and over-engineering. They certainly appear complicated.

But, let's use some perspective here. What problem is Autotools trying to solve? The goal is to let any user build software from source with no development experience, in a standardized way, and with only a few ubiquitous tools.

No one, before or since, has attempted to solve this problem.


I mean no one. Java's Ant is neither ubiquitous or novice-friendly. Visual Studio's F5 key (Build) is not even a build.

The only system that comes to mind is Ruby's Gem system, which is dependency-heavy and usually breaks for me. Anyway, it's less like Autotools and more like Gentoo's Portage system.

Autotools, with all its gnarly warts, has enabled open source software builds to Joe Everyman. The problems to overcome for such a goal are considerable, and Autotools has addressed them the best it knows how.

About Me

Erik Mackdanz is a software developer in Austin, Texas, along with everybody else.

Links