Chapter 3. The configuration system

Table of Contents

Overview of the configuration files
The configuration environments
Configuration helper execution
Adding new configuration helpers

Overview of the configuration files

Configuring a project consists in finding the parameters that will be used during the build step

$ cd demos/simple_scenarios/init
$ cat wscript

VERSION='0.0.1'
APPNAME='test'
srcdir = '.'
blddir = 'build'

def set_options(opt):
        pass
def configure(conf):
        pass
def build(bld):
        pass
def shutdown():
        pass

$ waf configure
			

Several configuration files are produced and the configuration parameters are stored in the folder c4che located under the build directory

|-- .lock-wscript 1
`-- build
    |-- .wafpickle-6 2
    |-- c4che
    |   |-- build.config.py 3
    |   `-- default.cache.py 4
    `-- config.log 5
			

1

Contains a reference to the build directory and contains the command-line configuration flags. It is located at the root of the source directory.

2

Contains serialized data corresponding to the build information (cache, filesystem representation, etc)

3

Contains the Waf version and the list of Waf modules to open automatically

4

Represents a configuration environment (parameters such as configuration flags used during the build)

5

Contains the configuration test execution details

The file default.cache.py is called a configuration environment, and it may be edited by hand. We will give the details on the following section. The other files are not meant to be modified by hand, even if they are editable.