SourceForge Logo
Building Packages with the GNU Autotools

 Understanding GNU Autotools

  • The GNU Autotools consist of Automake, Autoconf, and Libtool.  They are three separate packages when put together, comprise a very powerful tool for building source projects.
  • Libtool
  • Libtool is the only portable mechanism for building shared libraries available.  Simply put, this is a must have for Open CASCADE.  Libtool consists of a set of shell scripts that hide the details of PIC code generation options, specific options for building shared libraries, library naming conventions, versioning, and more.  Libtool is actively being developed by various contributors submitting patches, and four maintainers.  Although AIX 5 and the IA64 chip have not been released yet, support for these has already been incorporated into Libtool's CVS repository.  This is one example of how Libtool has a distinct advantage over hand-building scripts or makefiles to build shared libraries.
  • Autoconf
  • The purpose of Autoconf is to take a general template for a Makefile and using a portable bourne shell script, create a set of Makefiles (and other files) specifically taylored to the system being configured.  This allows someone compiling a source tree to conform the Makefile(s) specifically to the machine being used.  While this could be accomplished by directly writing a shell script to check for header files, definitions of structures and library locations, Autoconf greatly simplifies this process using the m4 language to create scripts.  Autoconf also provides most of the tests that are needed for a typical source project.  The best thing about Autoconf is that systems can be tested for portability issues directly.  Because of this, properly Autoconfiscated projects need no porting whatsoever to run on a new system, just running configure takes care of everything.  Typically the input to Autoconf is a single file,  From this file Autoconf generates the portable bourne shell script "configure".  The configure script takes templates, usually with the suffix ".in" and generates the specific files required for the build.  Users of an "Autoconfiscated" package do not have to have Autoconf installed, the configure script requires only /bin/sh and a few standard UNIX utilities such as rm and sed.
  • Automake
  • Automake is used to easily create the templates that are altered by "configure".  It is not necessary to use Automake, but it creates Makefiles that are very useful, automatically adding rules for compiling, dependency tracking, cleaning, and installing.  Automake takes as input Autoconf's "" as well as a set of makefile templates usually named "".  Because Automake generates most of the rules automatically, the consists of little more than include directories, target names, and source file names.  Automake also has closely integrated support for Libtool, making it an easy choice.
  • Documentation

    Autoconf Manual
    Automake Manual
    Libtool Manual