Anyone recommend how a person could get started with autotools in building a C project?
To create a configure script with Autoconf, you need to write an Autoconf input file `configure.ac' (or `configure.in') and run autoconf on it. If you write your own feature tests to supplement those that come with Autoconf, you might also write files called `aclocal.
Autotools configurationThis file is used by autoconf to create the configure shell script that users run before building. The file must contain, at the very least, the AC_INIT and AC_OUTPUT M4 macros.
Autoconf essentially runs the preprocessor on your script to produce a portable shell script which will perform all the requisite tests, produce handy log files, preprocess template files, for example to generate Makefile from Makefile.in and and take a standard set of command line arguments.
Alexandre Duret-Lutz's tutorial is my resource of choice.
There are also:
To me, the autobook is not up to date anymore and more difficult to read. However it still contains interesting chapters like Writing Portable Bourne Shell.
Also, consider learning about non-recursive automake which addresses the concerns raised by Peter Miller in his Recursive Make Considered Harmful article.
EDIT: for reference, there is also Autotools Tutorial for Beginners.
Follow the autotools tutorial.
You can also get the autobook. Chapter 4 covers a minimal GNU autotools project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With