4.1.2.1 Configure Task

The configure task allows Rscons to perform any one-time setup operations required by a project, for example locating compilers and setting any initial construction variable values based on the host environment in use. It will also perform any configuration checks requested by the build script. Such configuration checks can include:

The configure task is implicitly a dependency of every other task unless that task is configured with its autoconf option set to false.

The global build script autoconf setting can also be set to false to disable automatic invocation of the configure task. For example:

autoconf false

configure do
  puts "configure"
end

default do
  puts "default"
end

With the above Rsconscript, even if the project has not yet been configured, a configure operation would not take place when the default task is executed. The user would have to explicitly request the configure task from the command line.

The build script method project_name can be used to set the project name which will be reported to the user during a configure operation. For example:

project_name "My awesome project"

configure do
  check_d_compiler
end

See Configuring the Project for more details on how to make use of the configuration functionality that Rscons provides.

Configure blocks must be defined in the Rsconscript file before any environments are created.