Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting started with autotools

Anyone recommend how a person could get started with autotools in building a C project?

like image 230
joemoe Avatar asked Nov 17 '09 01:11

joemoe


People also ask

How do I setup a script autoconf?

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.

What is Autotools configure?

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.

How does autoconf work?

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.


2 Answers

Alexandre Duret-Lutz's tutorial is my resource of choice.

There are also:

  • Autotools: a practitioner's guide to Autoconf, Automake and Libtool
  • Autotools Mythbuster

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.

like image 121
Gregory Pakosz Avatar answered Oct 24 '22 05:10

Gregory Pakosz


Follow the autotools tutorial.

You can also get the autobook. Chapter 4 covers a minimal GNU autotools project.

like image 29
Gonzalo Avatar answered Oct 24 '22 06:10

Gonzalo