User:Drcouzelis/GNU Build System

From ArchWiki


The GNU Build System is a collection of applications and configuration files that assist with compiling software projects. It's the software that developers use to provide the following convenient installation method for end users and package maintainers:

 ./configure --prefix=/usr
 make install

The GNU Build System is also known as "GNU Autotools".


Everything needed to use Autotools is included in the "base-devel" package group.


There are two types of files you need to create to use Autotools:


The file is used by the application autoconf. This file tells autoconf about what is needed to build your application - things like the name of the application and what compiler and libraries to use. Only one file is needed, and it goes in the root directory of your source code tree.

The file is used by the application automake. The file tells automake how to build (or simply what to do with) the files that are in the directory. Each directory will have its own file, including the root directory.

In summary:

  • -> autoconf
  • -> automake

Did you notice that the file extension for the AutoConf file is AC and that the file extension for the AutoMake file is AM? Cute, right?


Now, what do you put in those files?

The file is relatively simple. Here is an example of a project directory structure:


You would need two files:





bin_PROGRAMS = theapp
theapp_SOURCES = resources.c theapp.c

Good news! As for the file, autotools can help you create it. In the root directory of your project run the program autoscan. The autoscan program will look at your files and create a simple file called configure.scan for you to start with.

  • autoscan -> configure.scan

Just rename configure.scan to

Edit the file. There are some nice easy to understand placeholders for you to fill in, such as "FULL-PACKAGE-NAME" and "VERSION".


Now that you've prepared the configuration files it's time to let autotools to do some automating. Run:

autoreconf --install 

to run the autotools scripts. The "--install" command will install any missing files for you, such as the NEWS and README files.

...And that's it! You now have a configure file, ready to be used by the end user.