SoCLib’s configuration file is parsed by soclib_cc.config, and is used by other modules:
SoCLib configuration module will set default parameters, then look for the following files, in order:
All configuration items defined in these files override previously set items. Therefore the soclib.conf file in current directory can override everything else.
Any of these files can be absent, this will be silently ignored.
SoCLib configuration files are:
Some attributes are reserved for special meanings, all other are considered to be build environment specifiers.
Boolean. Whether to print each performed action of The soclib-cc command, overridden by soclib-cc -v.
Boolean. Whether to print as few as possible from The soclib-cc command, overridden by soclib-cc -q.
Boolean. Whether to print debug messages for all actions performed by The soclib-cc command, overridden by soclib-cc -d.
Boolean. Whether to print The soclib-cc command progress as a progress-bar, overridden by soclib-cc -P.
Integer. Filesystem limitation workaround. Sets the maximal file name length for temporary files in Temporary objects reuse.
String. Current compilation mode, overridden by soclib-cc -m.
String. work directory expected by EDA tools, overridden by soclib-cc --work.
Configuration files contain 3 types of objects:
As definition of compiler and library variants are often nearly the same, build-environment specifiers can be inherited. Moreover, some build environment specifiers can be templates where usual data is provided with parts to replace. See inheriting configuration for an example, see soclib_cc.config.objects for implementation details.
There are also some configuration directives.
Sets the build-environment named name as default. This can be overridden with soclib-cc -t.
Adds a path to the Metadata paths. Command line can also add such description paths with soclib-cc -I.
Adds a python module named parser as another metadata provider.
Built-In configuration is made of:
See utils/lib/python/soclib_cc/config/built-in.conf for its implementation. Dont modify this file directly, use configuration file paths.
Library, Toolchain and BuildEnv all can take a parent = construction keyword argument of the same type, and will inherit all their attributes.
Example creating a new toolchain with ccache and gcc-4.2:
config.my_toolchain = Toolchain(
parent = config.toolchain,
tool_CC = ["ccache", "gcc-4.2"],
tool_CXX = ["ccache", "g++-4.2"],
)
This does not define a new build environment, therefore we cant use it yet. We now have to define a new build environment:
config.my_build_env = BuildEnv(
parent = config.build_env,
toolchain = config.my_toolchain,
)
Now if we use soclib-cc, we’ll see:
$ soclib-cc -h
...
--type=TYPE, -t TYPE Use a different configuration: <*build_env,
my_build_env>
So we can use our my_build_env with soclib-cc -t my_build_env. Now if we set my_build_env as default with:
config.set_default("my_build_env")
we’ll have:
$ soclib-cc -h
...
--type=TYPE, -t TYPE Use a different configuration: <*my_build_env,
build_env>
and explicitly setting -t wont be necessary any more.
Parameters: |
|
---|
Parameters: |
|
---|
Parameters: |
|
---|