This is the home of my tutorial for Autotools.
This tutorial covers:
It targets people familiar with Unix development (i.e., basic knowledge of shell, make, C, and Unix is assumed) who want to learn using these tools, or simply understand their purpose.
- The tutorial in PDF
- Handout version in PDF (4 slides per pages without animations, for printing)
- LaTeX sources (using the Beamer class)
These files are released under the Creative Commons Attribution-ShareAlike 2.0 license. However trivial source code examples displayed in this tutorial (such as the C files, Makefile.am, and configure.ac of all the amhello projects) can be reused as if they were in the public domain.
I welcome suggestions and corrections for this tutorial (send them to adl@gnu.org).
However, please, do not mail me any generic question about the Autotools. If you cannot find the answer to your question in the manuals or on the web, there are a lot of mailing lists where you will get help (and faster than writing to me), just pick the most appropriate:
autoconf@gnu.org | questions and discussions about Autoconf |
bug-autoconf@gnu.org | bug reports about Autoconf |
automake@gnu.org | questions and discussions about Automake |
bug-automake@gnu.org | bug reports about Automake |
libtool@gnu.org | questions and discussions about Libtool |
bug-libtool@gnu.org | bug reports about Libtool |
bug-gnu-gettext@gnu.org | bug reports about Gettext |
translation-i18n@lists.sourceforge.net | methodology questions around internationalization, and discussions of translator tools (not only Gettext) |
mentors@gnu.org | help list for new maintainers of GNU packages (requires subscription) |
Update to Libtool 2.2.6b and use LT_INIT instead of AC_PROG_LIBTOOL. Update to Autoconf 2.65 and Automake 1.11.1. Replace the obsolete AC_TRY_COMPILE by AC_COMPILE_IFELSE in the mkdir() macro example.
Jack Kelly suggested using foreign -Wall -Werror instead of -Wall -Werror foreign because the foreign option may alter the -W settings. Lorenzo Bettini pointed out that HP's test drive had been closed, so I'm now suggesting to Google for "free shell account" instead of pointing to specific services. Laurent Lyaudet reported several typos. Nicolas Cherel suggested to highlight a change in an example, because he did not notice it on first read.
Fix the the Cross Compilation slide. It is still important to specify --build in addition to --host, and the handout version needs two pages.
I have also posted a first draft of an introductory chapter for the Automake manual, it mostly covers the first part of this tutorial.
Use #include <config.h> instead of #include "config.h" as suggested by the Autoconf manual and pointed out by Florian Stoehr. Upgrade to Gettext 0.14.5, Libtool 1.5.22, and Automake 1.9.6 (no change needed).
Upgrade the drawing macros used in the LaTeX source to the brand new version 1.00 of pgf (the graphic package that comes with beamer). The change was hard since I couldn't find how to define the control points of the curved arrows in the same way as in version 0.67, but the resulting source is now much more readable.
Autotools versions are displayed at the very beginning, (1) to invite newcomers to start with up-to-date tools, and (2) to help people judge when the tutorial has become obsolete.
Added a slide, Lost?, at the end of Part 2, following an advice read in Mathematical Writings (Donald E. Knuth, Tracy L. Larrabee, and Paul M. Roberts):
Don's wife commented that one thing she always needs to know is “How do I get out of a mess if I do something wrong?” Don said that this is something manuals almost never explain—perhaps it never occurs to their authors that somebody will eventually want to stop playing with their program.
(Although completely unrelated to Autotools, Mathematical Writings is pleasant and instructive reading. You can find a PDF version of the initial report on-line.)
Applied two patches to Beamer's classes to fix the slide count glitch mentioned yesterday and to display parts in the PDF bookmarks.
Seven more slides for the Gettext section: the beginning of a start-to-finish Hello World.
Do not use aclocal -I m4 in the Libtool example. This is only useful for the upcoming Libtool 2.0, and would cause distcheck failures in this little example (can't use AC_CONFIG_AUX_DIR with an empty directory).
First two slides of the Gettext section.
I just realized that the slides are not numbered with consecutive numbers. Where are slides 7, 9, 11, 21, ..., 180? It seems the frame counter is incremented before each fragile frame.
There is at least three reasons why I started writing this tutorial.
In the course of preparing this tutorial, I have found the more dynamic nature of such presentation to be an advantage over a still article. For instance I'm quite proud of the presentation of M4 that shows how M4 processes its input step by step. Describing how M4 works using sentences is not terribly difficult, however my experience is that people who read these sentences will not really understand them. Maybe they think “Oh, so it's just a macro processor” and then assume it works like C's with a slightly different syntax. I remember this happened to me when I learned Autoconf. Only after my first incomprehensible Autoconf error did I start wondering what underquoted meant...
Warning
I have yet to sort this collection of links. Beware that some of these may discuss old Autotools versions such as Autoconf 2.13 and Automake 1.4. Syntaxes and conventions have improved quite a bit with Autoconf 2.50 and Automake 1.7. However even these versions should be regarded as relics.
While old syntaxes will usually still work, it is a bad idea to use them in a new project. Better start with up-to-date Autotools and learn today's usages.
As an easy test, if a document uses configure.in instead of configure.ac, it is most likely discussing older releases. This does not mean the contents are meaningless, but you should worry before copying examples.