Personal tools
You are here: Home / cmgui / Zinc / Building With Autotools

Building With Autotools

For an excellent introduction to autotools see:

Autotools, also known as the GNU build system, is a set of tools used to build software from source. They are designed with portability in mind, so that the source for a package can be built on different systems. Many open source development projects use autotools. If you download the source of a package that is built with autotools and want to build it on your system the following will often do the trick (assuming you are in the top level directory or your package):


The ./configure command analyzes your system to see what kind of programs and libraries you have and then produces a Makefile appropriate for your system. The make command uses the generated Makefile to build your executable or library files. Many Makefiles for packages include an install target, so once built you can type 'make install' to install your package.

For the above two commands to work you need both a Makefile template ( and a configure script. Both of these files can be generated from other configuration files by using automake and autoconf.

Automake is a tool for generating Makefile template files ( from automake configuration files ( Once a template Makefile has been generated the configure script can be used to turn the template into an actual Makefile that is specific to your system.

Autoconf is a tool for generating the configure script (and other files) from an autoconf configuration file ( or Running autoconf creates a script called 'configure' (which will be used to generate the Makefiles). It will create other files and scripts too, including a script called 'config.status' which can be run to update Makefiles.

Note that the file may include automake macros it needs to use. The definitions of these macros need to be provided to autoconf or it will fail. Fortunately there is a tool called 'aclocal' which will pull out the required macros by parsing and then generating a file called aclocal.m4 which will contain any necessary automake macros.

If your build directory contains a and a file you can do the following to set up your build files:

aclocal (will generate aclocal.m4)
automake (will generate files)
autoconf (will generate configure script)
./configure (will generate Makefiles)
make (will build source)