If you use the XLF_USR_CONFIG environment variable to instruct the compiler to use a custom user-defined configuration file, the compiler examines and processes the settings in that user-defined configuration file before looking at the settings in the default system configuration file.
To create a custom user-defined configuration file, you add stanzas which specify multiple levels of the use attribute. The user-defined configuration file can reference definitions specified elsewhere in the same file, as well as those specified in the system configuration file. For a given compilation, when the compiler looks for a given stanza, it searches from the beginning of the user-defined configuration file and follows any other stanza named in the use attribute, including those specified in the system configuration file.
If the stanza named in the use attribute has a name different from the stanza currently being processed, the search for the use stanza starts from the beginning of the user-defined configuration file. This is the case for stanzas A, C, and D which you see in the following example. However, if the stanza in the use attribute has the same name as the stanza currently being processed, as is the case of the two B stanzas in the example, the search for the use stanza starts from the location of the current stanza.
Figure 1. Sample configuration fileA: use =DEFLT options=<set of options A> B: use =B options=<set of options B1> B: use =D options=<set of options B2> C: use =A options=<set of options C> D: use =A options=<set of options D> DEFLT: options=<set of options Z>
- stanza A uses option sets A and Z
- stanza B uses option sets B1, B2, D, A, and Z
- stanza C uses option sets C, A, and Z
- stanza D uses option sets D, A, and Z
Attributes are processed in the same order as the stanzas. The order in which the options are specified is important for option resolution. Ordinarily, if an option is specified more than once, the last specified instance of that option wins.
Figure 2. Custom user-defined
configuration file ~/userconfig1
|
Figure 3. Default configuration
file xlf.cfg
|