4.2. Project configuration

Configuration:
set of all options, included by a project.

One must set up the configuration of a project before the start. The main parameter of configuration is its name. In the example above about building of xz the keyword id is configuration name:

    any do id xz-5.2.5

In a simple case the configuration name is a word from latin low register letters, digits and underscore sign _. The word id serves as the base for configuration names in further examples of current guide.

To view all data, defined by your specified configuration, use datardd(1):

    datardd id
If there are no options of any_* series, for example any_abs_path, among listed data, that is a sign of incorrect working directory.

Consider the block in configuration file rdd.def:

[id]
any_newdata=1
As a result of adding the given strings, the configuration with name id begins to include the option any_newdata=1.

Compound configuration

Compound configuration contains several words at once in its name. They are separated by comma:

    any do id,one,two xz-5.2.5
The example above has id,one,two as compound configuration.

Compound configuration includes data from all corresponding words. For the example above the data will be collected from words id, one, two:

[id]
any_main=1

[one]
any_one=1

[two]
any_two=1

Configuration wordchain

Configuration files contain wordchain mechanics. A word may contain inner link to another datawords. Newfound words will automatically extend resulting configuration.

The link to new datawords is implemented via key option rdd_prf_id. The example of its usage:

[id]
rdd_prf_id = linux, arm
The listed block in configuration file rdd.def means specifying the name id provides three words for configuration: id, arm, linux. The data for each of these words will get into resulting configuration. Example:
[id]
any_main = 1
rdd_prf_id = linux, arm

[arm]
any_arm = 1

[linux]
any_linux = 1
Now specifying configuration as id will add options any_main, any_arm and any_linux into resulting data.

The key option rdd_prf_id may reside in newfound words as well. In that way, the wordchain in configuration will grow in length, as extending words will be included.

To show all words from configuration, auserdd(1) may be used:

    auserdd id

With wordchain mechanism it is possible to specify only short configuration name in command line, and the entire data array will be flexibly included via chosen datawords.

See any-do(1) for more details about reading data from configs and command line.

Adding data into configuration

Adding data info configuration is possible in the following ways, in order from high to low priority:

-
with command line option:
            any do id xz-5.2.5 any_newdata=1
            datardd id xz-5.2.5 any_newdata=1
Options may be placed anywhere in cmd after the command any do itself.

-
with the record of a new option into config file rdd.def:
[id]
any_newdata=1
The record affects the generic call with id configuration:
            any do id xz-5.2.5
            datardd id xz-5.2.5
The new option any_newdata=1 will be taken from section [id] of config rdd.def and added to overall data array.

-
with the record of a new option into config file atom.conf, individual for each package. That file is optional. If it exists, it is located inside directory with anybuild. According to project organisation, the paths may be:
--
./packagename/atom.conf
--
ports/packages/packagename/atom.conf

-
with the adding of a new word to specified configuration:
            any do id,new xz-5.2.5
            datardd id,new xz-5.2.5
In the given case the word new will be added to the list of words to read from config files. If configs contain [new] section, all data out of there will be added to overall array:
[id]
# something

[new]
any_fromfile=1
The example above adds new option any_fromfile=1 to data.

-
with the record of a new option into one of configs inside rdd.conf.d/ directory:
[new]
any_fromconfig=1
            any do id,new xz-5.2.5
            datardd id,new xz-5.2.5
The same conventions are valid for files from rdd.conf.d/ and for rdd.def file. The difference between the two is rdd.conf.d/ contains generic library-like data (settings for several platforms), and rdd.def contains settings for certain working directory, debug and temporary settings of project developer.

Data reading priorities

Whatever data from command line can not be redefined with data from files. Likewise any data from rdd.def can not be redefined with data from rdd.conf.d/*.conf of lower priority. In such a way deeply nested library data will not conflict with actual project settings.

Additional rules take place inside data source with single priority.

Words in compound configuration are read from right to left. If the same option is present in different sections of config file, the word to the right has the priority.

        any do id,new zlib-1.2.11
        datardd id,new zlib-1.2.11
[id]
any_conflict=left
[new]
any_conflict=right
The value any_conflict=right will be chosen, as the word new is to the right of word id.

The same goes to rdd_prf_id:

[id]
rdd_prf_id = one, two
[one]
any_conflict=left
[two]
any_conflict=right
The value any_conflict=right will be chosen, as the word two is set at the right inside key option rdd_prf_id.