Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to learn the Joy of Autotools? [closed]

So a couple years back I took some time to grok make, and it's paid off enormously. Writing little makefiles for building my projects and automating tasks is fun and productive.

The downside is, of course, that my makefiles are overspecific, especially when it comes to platforms and library locations.

So this is the point at which people tell me "autotools to the rescue!" And they certainly seem to do the trick when other people do them (I love downloading something and running configure && make && sudo make install and watching it just work), but I can't wrap my head around them.

I've looked in some configure.ac and Makefile.am files, and I just don't understand what's going on. I don't know what part of identifiers is developer's choice, and what part is meaningful to the autotools. I'm not sure I understand the entire flow and the point of Makefile.in. I think I'm just hitting a mental wall going from the system I'm used to (make) to something that's a layer or two above that.

Can anyone point me towards a tutorial or book (preferably not an overly dry one) that can teach me the joy of autotools? What the steps are, and how I can use them, how I can write my own configure.ac and Makefile.am from scratch? Show me how to be effective and have fun with them?

like image 680
rampion Avatar asked Jul 08 '10 21:07

rampion


2 Answers

I am not sure you can have fun with build systems... Have you been reading the Autotools Tutorial?

http://www.lrde.epita.fr/~adl/autotools.html

There are various resources about autotools, the problem is they tend to be incomplete, a bit outdated etc...

One recent and excellent document is Autotools Mythbuster, although it's not an introduction:

http://www.flameeyes.eu/autotools-mythbuster/index.html

like image 89
elmarco Avatar answered Oct 21 '22 09:10

elmarco


Although I consider Alexandre Duret-Lutz's Autotools Tutorial, mentioned in elmarco's answer, to be the very best available, you should also know about the Goat Book:

http://sourceware.org/autobook/

The versions of the tools it deals with are rather old, but it's a nice introduction and it's presented in a logical order. It's also more complete than the Tutorial. It is perhaps best used as supplementary reading after you've worked through the Tutorial.

UPDATE There's also John Calcote's book, it was published around August 2010 and it's really good. I'm not sure whether the whole book is online at that link, but at least part of it is.

like image 43
ptomato Avatar answered Oct 21 '22 08:10

ptomato