Why do the autotools suck?

Started by
33 comments, last by Strife 18 years, 10 months ago
So I've been around Linux for a long time, but I've resisted learning the autotools. Why? Because they're complicated as hell. I really don't want to spend an extra 30 minutes having to remind myself what all the damn macros are and then writing the files just so that I can compile my programs. I'm not really a huge fan of the IDEs that exist for Linux, but one thing I do like about them is that they let me not have to worry about writing any of this configure.in, Makefile.am, etc. BS. It's really a shame that the rest of the IDEs suck. So here's what I would like to know. Does there exist any type of standalone tool that can perform the creation of the makefiles for me? If not, I suppose I'll have to continue using a full-blown IDE just to generate makefiles while using vim to edit my source files...
Advertisement
I've written make files in linux for compiling C code and i honestly didnt find it that hard by hand. Should i be assuming that you are compiling alot of code? I was compiling about 10 CPPs.

ace
I've taken the (long) time needed to learn autotools and Makefiles and IMHO it has been worth it. Their scripted nature allow you to do just about anything. For example it was very simple to have a python script generate source files from csv tables and do it so that
a) when I modify the script or the csv file, the source files get regenerated and rebuilt
b) make clean does not remove the source files (so python is not required to compile the distributed tarball)

Autotools also has the advantage that the configure script makes the package easily adaptable to nearly any unix setup. This is, of course, only important for open source projects.

I've found the easiest way to get started is google for some configure.ac, Makefile.am and autogen.sh files to use as templates.


It would be nice if some GUI (or why not CLI) program existed to create the templates. After that all the programmer would normally have to worry about is listing new files into Makefile.am.
The autotools are horrible because:

1. All open-source software that evolves for this long without being rewritten from scratch is horrible, to some extent.
2. They're designed to run E-VAH-RY-WHERE, with minimal software support. The extra complexity that this requires is mind-boggling.
3. They were developed in the macros-on-macros-on-target-language style common to the time (see TeX), which inevitably leads to a laundry list of ugly side effects and gotchas (see TeX).

The thing is, though, they're standards. And they're not going anywhere, at least in the next few years. Suck it up and use the autotools.
I'm not to fond of the autotools either, so I was very happy when I found SCons (www.scons.org). It works much like autoconf/automake, but in nice python code instead of hard to remember AM macros. I'm using it for all my projects instead of the autotools and have no regrets over the switch. Id used it for the linux port of Doom 3 as well.
CMake is also worth taking a look at, even though the main advantage for cmake is that it generates build files for systems without make as well, such as visual studio project files. The CMake scripts are rather easy to write, and it even got a GUI for configurating it. I use it for all my projects that are either on linux only or cross-platform these days, and is very pleased with it.
It was a pain, but when I finally learned to use autotools, it was tremendous. My program was suddenly a _real_ linux utility with a standard install:

./configure
make
make install

I suppose it depends what you are distributing. If it's a utility you would like to have show up in distros, autotools are going to be the best way to get wide adoption. If you are working on games, something else is probably in order.

My only experience with scons was that it got stuck compiling something (Presumably a loop) and almost took the system down with it before I manually killed it...
One of the problems being that every Unix and Linux distro out there wants to layout the system its very own way.

But whatever, Autotools is utter crap especially with SCONS around. I'm not a makefile wizard so I'm sure I can't see all the beauty there is to Autotools but 500k of autogenerated scripts for a Hello World makefile is simply unacceptable.

Going over the Autotools manual a long time ago left me with the impression that you could 1) program or 2)write makefiles but not both. Autotools are *not* auto \:.
Praise the alternative.
Oh, I don't want the autotools to disappear. I want a program that will generate the input files for me (much as Anjuta and KDevelop do, I just want this to be done without the suck).

Quote:Original post by 255
It would be nice if some GUI (or why not CLI) program existed to create the templates. After that all the programmer would normally have to worry about is listing new files into Makefile.am.

That is *exactly* what I want.

Basically, I just don't want to be spending my time editing files just so I can build my project. I want to just have stuff ready for me, where all I really need to do is maybe add a few libraries to link against here and there, and that be it.

Is that really so much to ask for? Anyone who's used an IDE has been able to do this for years.
Quote:Original post by silmaril
CMake is also worth taking a look at, even though the main advantage for cmake is that it generates build files for systems without make as well, such as visual studio project files. The CMake scripts are rather easy to write, and it even got a GUI for configurating it. I use it for all my projects that are either on linux only or cross-platform these days, and is very pleased with it.


Looking into CMake briefly, it looks like it might be what I'm looking for. However, I can't seem to find the little GUI for it. Is the GUI Windows-only or something? The web site isn't too clear on that...

Turns out, that's what ccmake is for. A curses "GUI" for it.

This topic is closed to new replies.

Advertisement