Table of Contents


1 References

1.1 A tutorial This book is a tutorial. Those I didn't study carefully in this book:

  • Dynamic load library
  • portable bash script
  • m4
  • what makes a GNU project
  • cross compilation

1.6 Other reference discovered by this reading

2 Introduction

This article talks about the GNU build system:

  • autoconf
  • automake
  • libtool: portably create and maintani dynamic linked library

3 Some random staff

Autoconf is a tool for producing shell scripts that automatically configure software source code packages to adapt to many kinds of Posix-like systems. The configuration scripts produced by Autoconf are independent of Autoconf when they are run, so their users do not need to have Autoconf.

4 interaction

There're two files provided by developer: and

  1. is taken by automake to generate
  2. + with help of autoconf, generate configure
  3. Then, use this configure script, generates:
    • config.cache
    • config.log
    • config.status
    • config.h
    • Makefile

4.1 configuration name

config.guess can determines the configuration name for the system it is run on, e.g.

  • i586-pc-linux-gnu
  • i386-pc-cygwin
  • sparc-sun-solaris2.7

All configuration names used to have three parts, and in some documentation they are still called configuration triplets. A three part configuration name is cpu-manufacturer-operatingsystem.

5 A typical workflow

## -- Process this file with automake to produce
bin_PROGRAMS = foo
foo_SOURCES = a.c

dnl Process this file with autoconf to produce a configure script.


AC_INIT([foo], [2.0], [])

AM_INIT_AUTOMAKE([1.9 foreign])




#include <stdio.h>

int main() {
  printf("Hello Automake\n");

Then run

aclocal # generate aclocal.m4
autoconf # generate configure
automake --add-missing # generate, and symbol link depcomp, compile, install-sh, missing
./configure # generate config.status, config.log, Makefile
make all # generate a.o, foo

5.1 bootstrap

From the empty project, how to reach a configure && make && make install ready status?

Create a bootstrap shell script:

#! /bin/sh

aclocal \
&& automake --gnu --add-missing \
&& autoconf

The autoreconf does the same thing. Try it.

Author: Hebi Li

Created: 2017-03-27 Mon 14:36