Autotools

A Standard way to create Build system for Linux

Introduction

There is always a thought that comes to the mind of every developer when they try to work on some project, especially when creating a new one, is ,”How will I make it portable and build it on every Linux system (or at-least on most of the Linux system)?”. Indeed, it is one of the hellish pain that the developer has to face and nevertheless address it.
And here we’ve a set of tools which is informally termed as “Autotools”. Well, there are mainly three tools:
Let me give you brief description of what each of the tools are intended for...

Autoconf

Autoconf is set of Shell and Perl script which is used for getting a clear understanding of how the existing system is actually configured and how it will affect the build process of the software which is intended to be build. Based on the system configuration and availability of library with specific version, project will be build differently where some feature may or may not be available. This configuration can also be controlled based on the users requirement. (We will see how user comes into this)

Automake

Automake is a tool to generate Makefiles for project, automatically (well almost). It take some input files, which are Makefile.am, generate Makefile.in which in-turn are converted into Makefile. The only difference between Makefile.am as compare to writing the whole Makefile on your own is that Makefile.am requires small amount of rules (by rules I mean PLV and PSV). Automake utility using Makefile.am creates a complete Makefile. By complete, I mean all the rules and shell code which required to build all the standard targets (like all, check, docs, clean, etc). Makefile, which are following the GNU Coding Standards (GCS), are mostly boilerplate hence Automake generate a complete Makefile for the project. However, before using Automake refer to Peter Miller, Recursive Make Considered Harmful. (Also refer for non-recursive automake)

Libtool

Libtool provides an abstraction for the portable creation of shared libraries. Creation of shared library with proper versioning interface is a hell lot of work which libtool makes it easier to deal with.
The main objective of this tutorial to get ready to use these tools as soon as possible, but later we can also get into more intricate details as well. Refer to the links for each tools above. I will mention till what point it is enough to start writing and crating our own build system using these tools.