Autoconf-like configuration support.
In other words, SConf allows to run tests on the build machine to detect
capabilities of system and do some things based on result: generate config
files, header files for C/C++, update variables in environment.
Tests on the build system can detect if compiler sees header files, if
libraries are installed, if some command line options are supported etc.
|
SConfWarning
|
|
SConfError
|
|
ConfigureDryRunError
Raised when a file or directory needs to be updated during a Configure
process, but the user requested a dry-run
|
|
ConfigureCacheError
Raised when a use explicitely requested the cache feature, but the test
is run the first time.
|
|
SConfBuildInfo
Special build info for targets of configure tests. Additional members
are result (did the builder succeed last time?) and string, which
contains messages of the original build phase.
|
|
Streamer
'Sniffer' for a file-like writable object. Similar to the unix tool tee.
|
|
SConfBuildTask
This is almost the same as SCons.Script.BuildTask. Handles SConfErrors
correctly and knows about the current cache_mode.
|
|
SConfBase
This is simply a class to represent a configure context. After
creating a SConf object, you can call any tests. After finished with your
tests, be sure to call the Finish() method, which returns the modified
environment.
Some words about caching: In most cases, it is not necessary to cache
Test results explicitely. Instead, we use the scons dependency checking
mechanism. For example, if one wants to compile a test program
(SConf.TryLink), the compiler is only called, if the program dependencies
have changed. However, if the program could not be compiled in a former
SConf run, we need to explicitely cache this error.
|
|
CheckContext
Provides a context for configure tests. Defines how a test writes to the
screen and log file.
|
|
|
|
SetCacheMode(mode)
Set the Configure cache mode. mode must be one of "auto", "force",
or "cache". |
source code
|
|
|
SetProgressDisplay(display)
Set the progress display to use (called from SCons.Script) |
source code
|
|
|
|
|
|
|
|
|
CreateConfigHBuilder(env)
Called if necessary just before the building targets phase begins. |
source code
|
|
|
|
|
|
|
|
|
CheckFunc(context,
function_name,
header=None,
language=None) |
source code
|
|
|
CheckType(context,
type_name,
includes='
' ,
language=None) |
source code
|
|
|
CheckTypeSize(context,
type_name,
includes='
' ,
language=None,
expect=None) |
source code
|
|
|
CheckDeclaration(context,
declaration,
includes='
' ,
language=None) |
source code
|
|
|
createIncludesFromHeaders(headers,
leaveLast,
include_quotes=' "" ' ) |
source code
|
|
|
CheckHeader(context,
header,
include_quotes=' <> ' ,
language=None)
A test for a C or C++ header file. |
source code
|
|
|
|
|
|
|
|
|
|
|
CheckCHeader(context,
header,
include_quotes=' "" ' )
A test for a C header file. |
source code
|
|
|
CheckCXXHeader(context,
header,
include_quotes=' "" ' )
A test for a C++ header file. |
source code
|
|
|
CheckLib(context,
library=None,
symbol=' main ' ,
header=None,
language=None,
autoadd=1)
A test for a library. See also CheckLibWithHeader.
Note that library may also be None to test whether the given symbol
compiles without flags. |
source code
|
|
|
CheckLibWithHeader(context,
libs,
header,
language,
call=None,
autoadd=1)
Another (more sophisticated) test for a library.
Checks, if library and header is available for language (may be 'C'
or 'CXX'). Call maybe be a valid expression _with_ a trailing ';'.
As in CheckLib, we support library=None, to test if the call compiles
without extra link flags. |
source code
|
|
|
CheckProg(context,
prog_name)
Simple check if a program exists in the path. Returns the path
for the application, or None if not found. |
source code
|
|