Wed, 14 Nov 2007

Autoconf brokenness

I believe that autoconf is broken. Autoconf creates a configuration script for a package from a template file that lists the operating system features that the package can use.

The trouble with autoconf is in the configure script it creates. There are several problems with configure. First is that it does standard tests about the operating system, but it doesn't save the result of those tests anywhere. In other words, if you are compiling package A and package B, and they both use autoconf, then both of their completely re-do their configuration tests. If you re-run configure, it remembers the expensive results it got the last time you ran it. But results are not shared across packages.

configure is also used to pass in configuration parameters for the package. These parameters can point to system libraries, or define optional features, or allow for cross-compilation.

configure is also used to detect the presence or absence of necessary system libraries. I've seen it cache that information, and not notice that the library has been installed between runs. I haven't seen that happen lately. Maybe that bug has been fixed?

In all of these cases, the problem is that even the least change invalidates every bit of compilation. Configuration changes aren't tracked between configure and make. When you run configure, it creates a completely new Makefile, so the wise person always runs make clean after running configure.

That's dumb. It's just plain dumb.

The purpose of make is to track dependencies between files. You give it a makefile, and when something is older than something it depends upon, it gets re-built. OR, if something depends on something that will be re-built, it also gets re-built. And so on.

Put configuration changes in individual files, each with its own timestamp. In the makefile, record each configuration's dependency tree. When a configuration entry is changed, that change ripples through everything which uses that configuration, but only those things which use that configuration.

If you object to this, then let me ask you: if you had this, then when would you ever use make clean? make clean is in essence a reboot of the make system. It's an acknowledgement of a bug. So why does every autoconf package support make clean? Simple: because autoconf is buggy.

Posted [18:46] [Filed in: opensource] [permalink] [Google for the title] [Tags , , , ] [digg this]