Configuration system
A waflib.Configure.ConfigurationContext instance is created when waf configure is called, it is used to:
In case of a configuration error, break
In case of a configuration error, continue
Name of the configuration log file
Execute the configuration automatically
Hook to check for the tools which are downloaded. Replace with your function if necessary.
Download a Waf tool from the remote repository defined in waflib.Context.remote_repo:
$ waf configure --download
Bases: waflib.Context.Context
Configure the project.
Waf tools may bind new methods to this class:
from waflib.Configure import conf
@conf
def myhelper(self):
print("myhelper")
def configure(ctx):
ctx.myhelper()
Additional functions to handle configuration errors
Set a new config set for conf.env. If a config set of that name already exists, recall it without modification.
The name is the filename prefix to save to c4che/NAME_cache.py, and it is also used as variants by the build commands. Though related to variants, whatever kind of data may be stored in the config set:
def configure(cfg):
cfg.env.ONE = 1
cfg.setenv('foo')
cfg.env.ONE = 2
def build(bld):
2 == bld.env_of_name('foo').ONE
Parameters: |
|
---|
Getter for the env property
Insert PREFIX, BINDIR and LIBDIR values into env
Parameters: | env (waflib.ConfigSet.ConfigSet) – a ConfigSet, usually conf.env |
---|
Load Waf tools, which will be imported whenever a build is started.
Parameters: |
|
---|
Records the path and a hash of the scripts visited, see waflib.Context.Context.post_recurse()
Parameters: | node (waflib.Node.Node) – script |
---|
Execute the configuration tests. The method waflib.Configure.ConfigurationContext.err_handler() is used to process the eventual exceptions
Parameters: | rules (list of string) – list of configuration method names |
---|
Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.Configure.ConfigurationContext. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:
def configure(conf):
conf.find_program('abc', mandatory=False)
Parameters: | f (function) – method to bind |
---|
Import operating system environment values into conf.env dict:
def configure(conf):
conf.add_os_flags('CFLAGS')
Parameters: |
|
---|
Detect if a command is written in pseudo shell like ccache g++ and return a list.
Parameters: | cmd (a string or a list of string) – command |
---|
check for the waf version
Versions should be supplied as hex. 0x01000000 means 1.0.0, 0x010408 means 1.4.8, etc.
Parameters: |
|
---|
Find a file in a list of paths
Parameters: |
|
---|---|
Returns: | the first occurrence filename or ‘’ if filename could not be found |
Search for a program on the operating system
When var is used, you may set os.environ[var] to help find a specific program version, for example:
$ VALAC=/usr/bin/valac_test waf configure
Parameters: |
|
---|
Search for a perl program on the operating system
Parameters: |
|
---|