wiki:pm-get-autotools

Table of Contents

  1. Working With the GNU Autotools
    1. Introduction
    2. The configure.ac Files
    3. The Makefile.am Files
    4. Running the Autotools
    5. Which Files Should be in the Subversion Repository?
    6. Working On Your Project
  2. Autotools Basics
    1. autoconf
    2. automake
    3. libtool
  3. Basic Structure of the configure.ac File
    1. General Concepts
    2. Beginning of a configure.ac file
    3. The Body of the configure.ac File
    4. The End of the configure.ac File
  4. The Package Base Directory configure.ac File
  5. The Project Directory configure.ac File
    1. Initialization of Tools and Compilers
    2. Check for other COIN-OR Components
    3. Checks for some specific System Libraries
    4. Check for User Libraries
    5. Generation of Links for Data Files
    6. Project Specific Tests
  6. Configuration Header Files
    1. Private and public header files
    2. Header files for non-autotools setups
    3. Bringing them all together
    4. Example
  7. Introduction of Automake Concepts
  8. The Package Base Directory Makefile.am File
  9. The Project Main Directory Makefile.am File
  10. The Source Directories Makefile.am Files
    1. Beginning of the Makefile.am File
    2. Building a Library
    3. Building a Program
    4. Additional Flags
    5. Installation of Header Files
  11. The Test Directory Makefile.am File
    1. Beginning of the File
    2. Compilation of the Unit Test Program
    3. The Test Target
    4. House Cleaning
  12. The pkg-config configuration files of a project
    1. Introduction
    2. The .pc file of an installed COIN-OR project library
    3. The .pc file of an uninstalled COIN-OR project library
    4. The NO pkg-config case
  13. Using the Correct Version of the Autotools
  14. Brief Tutorial on Switching from BuildTools 0.5 to 0.7
    1. What Needs to be Edited
    2. Externals to Dependencies
    3. Changes to Installation Directories
    4. Changes to autotools files
    5. Changes to configuration header files
  15. Hints, tricks, bugs, and suggestions
    1. Using autoreconf

Using the Correct Version of the Autotools

We ask that every developer in COIN-OR uses the same distribution of the same version of the autotools. This is necessary in order to ensure that the custom defined COIN-OR additions work. Also, this way we guarantee that each developer generates the same output files, which avoids the mess that would occur if this were not the case. Specifically, the precompiled versions of autotools included in packaged distributions often contain small modifications to the m4 macros that are supplied with autoconf, automake, and libtool. These differences make their way into generated Makefiles and configure scripts. Allowing these differences to creep into the repository will result in chaos. For this reason, we ask that you download the original source packages for the autotools from GNU and build and install them by hand on your system.

We recommend that you install the self-compiled tools in your $HOME directory, i.e., in $HOME/bin, and other configuration files in $HOME/share. After including $HOME/bin in your PATH, this can be done by:

mkdir tmp
cd tmp
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.59.tar.gz
tar xvzf autoconf-2.59.tar.gz
cd autoconf-2.59
./configure --prefix=$HOME
make install
cd ..
wget http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.gz
tar xvzf automake-1.9.6.tar.gz
cd automake-1.9.6
./configure --prefix=$HOME
make install
cd ..
wget http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz
tar xvzf libtool-1.5.22.tar.gz
cd libtool-1.5.22
./configure --prefix=$HOME
make install
cd ../..
rm -fr tmp

If you would prefer to place them in another directory, you will need to set the environment variable AUTOTOOLS_DIR to this directory in your shell's login or shell initialisation file (e.g., ~/.profile, ~/.bashrc, ~/.login, or ~/.cshrc). Do not specify a standard system directory (e.g., /usr/local) unless you actually installed the autotools into that directory yourself from the GNU source code, otherwise you will encounter many conflicts!!!

The tools that you should install are:

  • autoconf (version 2.59)
  • automake (version 1.9.6)
  • libtool (version 1.5.22)

You need to install them in this order, and you should always specify the same argument to --prefix.

You can get the source code for each package from

Make sure you get the correct version for each tool, as indicated in the list above.

After they are installed, you also need to ensure that your $PATH variable is set so that your self-installed versions of the tools are the ones that are actually used.

When you run configure in your local copy with the --enable-maintainer-mode flag (which you should do as a developer), it will test to see if the above conditions are met and will fail if they are not met.

Last modified 9 years ago Last modified on May 8, 2011 8:05:49 AM