Chapter 7. Compilation tools

Table of Contents

maker
configure
build-config
Generalities
Portability
Quick start
Commandline options
Components detection and dependencies step
Version change step
Configuration step
Compilation step
Documentation generation step
Packaging step
Developing new projects using build-config

The compilation tools are made up of 3 main python scripts: build-config, configure, and maker. In addition, a fourth tool may be used to generate DocBook documentations: buildDoc. buildDoc has its own documentation and has been used to produce the document you are reading.

build-config is now the only program developers need to use: the other tools are used by the former. build-config performs all configuration, compilation, documentation building, packaging, and several other tasks. We use it both for everyday compilation, and to build binary distributions which we distribute on the web site. configure just calls maker for every target of a given project. maker generates a Makefile from a project file.

To work correctly, all these tools should be installed somewhere in a directory listed in the PATH environment variable. Or at least build-config will look for the other tools in the same installation directory as itself.

The compilation tools can be doanloaded from the download page of BrainVisa/Anatomist web site: http://brainvisa.info/downloadpage.html.

Now we will describe these 3 tools from the lowest-level (older) to the highest-level (newer). This is needed for logical reasons, but feel free to look at the documentation of build-config first, because as long as you are not developing a new project but only compiling existing ones, you only need to know about build-config.

maker

You need GNU make: http://www.gnu.org/software/make/ whatever the platform you are compiling on (Linux, Solaris, Irix, MacOS X, Windows/MinGW).

Maker creates one Makefile from one project file.

The most useful option (apart from the classical -h or --help help option) is the build mode: it determines compiler optimization/debugging options. There are currently 3 modes:

  • default: no debug symbols, no optimization (generally fastest compilations). It is, as suggests its name, the default mode if none is specified
  • debug (-d commandline switch): debug symbols, no optimization (bigger executables and slow execution, but debugging is possible)
  • release (-r commandline switch): no debug symbols, optimization flags on (slow compilations and sometimes needs huge amounts of memory, but executables run faster)

At the beginning, maker was very similar to Trolltech Tmake program, and accepted a similar syntax and variables set. Then Tmake disapeared for Qmake, and maker evolved for a richer syntax.