Boost logo

Boost-Build :

From: Walter Landry (wlandry_at_[hidden])
Date: 2006-04-24 17:41:19


As promised, I am giving a brief overview of how I use BuildSystem
[1]. First of all, I did not develop BuildSystem, I just use it.
Also, it is not a finished product. But it is the only configuration
system I know of that runs on Windows without installing Cygwin or
mingw [2]. It's autodetection is not as developed on Windows as on

BuildSystem is meant to be a replacement for Autoconf. It runs a
number of tests on your machine to see what compilers, libraries,
headers, executables, etc there are. It has a facility for generating
files for inclusion into make files, and can also generate headers. I
do not, at present, use either of those two facilities. Rather, I use
the ability to perform substitutions in files. I use SCons to build
the software, so I perform substitutions on

BuildSystem is written almost entirely in Python. The only exceptions
are two shell scripts: config.guess and config.sub. Those would have to be replaced

For an example of using BuildSystem, go to

In that file, the real meat is in a try...except block most of the way
down. The rest checks for bad pythons, bad threading libraries,
option parsing, error handling, etc.

In that try...except block, there are a number of calls to
addArgumentSubstition. Those calls tell configure which variables to
do substitutions for. The line with "framework.configure" does the
actual configurations and substitions. That jumps us to the configure
function in

The interesting part there is in setupDependencies which enumerates
which packages to configure. For this code, we need libxml2, petsc,
and mpi. So we will look at the libxml2 package in

The meat of that work is done in configureLibrary(). This is where
the rubber meets the road and tests really get written. It starts by
checking for includes, and can optionally take common directories to
look in. It does a similar thing for libraries, though it really
checks whether you can link with that library. Finally, if include
and library directories are found, then it writes out the

The libxml2 package derives from Package.package.Package

which implements some of these library and include checks. So could probably be shortened.

I realize that this is a brief introduction. So if you have any
questions, please ask.

Walter Landry


[2] MPC, which has been mentioned elsewhere, does not seem to do

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at