qvrs is the primary configuration tool of the QEF system. This chapter describes its files, syntax, semantics, and variables. |
qvrs controls QEF variables used for software production.
qvrs variables are used to define search paths, tool names and flags,
semantic options, qef controls and miscellaneous
application flags and controls.
Appendix F Qvrs Variables lists
the standard set of qvrs variables.
About 40 qvrs variables are set or initialized automatically by qvrs itself. These variables are those that are dependent on the host/platform or the current directory location (e.g., _Hostname_, User, System[*], CurDir), or variables that are initialized to their default values (e.g., LibMatch, CcInclDirs). The user, project, or host system specific qvrs variables are defined in files collectively known as qvrs files. qvrs's primary purpose is to find and interpret these files and create a database of variable/value tuples that can be consulted by other tools. This database is then accessed by other tools either by invoking qvrs directly and reading the output, or by reading a binary file built by qvrs.
|
qvrs variables are initialized, assigned, overridden, and destroyed in the qvrs files, arranged in a hierarchy. Where you choose to define or override a variable has a significant effect upon its visibility, and therefore upon the construction tools that the generated scripts ultimately call. You control what your production tools know, and when they know it, using the qvrs files. The scope of most the qvrs files is its containing directory and all that directory's sub-directories as well as the corresponding directories in the other trees. The exceptions are leaf.vrs and qeffile, which apply to the current directory only. The qvrs files are:
Typically, the qvrs files for a directory will be the root.vrs file, a @RootDir/conf.vrs file or the default source file @QefAdm/confvrs/confdefl.vrs, a tree.vrs file in the root of the baseline source tree, the system's <qtree>/lib/sysvrs/`system -v`.vrs, and a qeffile in the corresponding baseline tree. Larger projects will typically include prereq.vrs and p_sysvrs.vrs files from the @QefAdm/confvrs directory. For example: % qvrs -f # list current directory's qvrs files /m/guide/object/root.vrs /m/guide/object/conf.vrs /m/guide/baseline/tree.vrs /m/guide/baseline/QefAdm/confvrs/prereq.vrs /m/guide/baseline/QefAdm/confvrs/p_linux2.vrs <qtree>/lib/sysvrs/linux2.vrs /m/guide/baseline/guide/qeffileIn addition to the qvrs files there is another set of significant files and these are the traits files described in Section 8.9 below. qvrs automatically imports all the traits variables that begin with "_T_", "_F_", "_D_", are of the form "_*_" or "_*_[...]", or that are marked as qef_imports.
|
These files are interpreted by the qvrs program. Any utility can make use of the qvrs program and its output. These other tools also create or modify configuration files: |
|
rootvrs |
Creates or modifies the contents of a root.vrs file. Note that mkqtree invokes rootvrs to create a root.vrs file when creating a new tree. |
confvrs |
Views the contents of the conf.vrs or the default confdefl.vrs files. It may also be used to view differences between the two mentioned files or to create a fresh conf.vrs file. |
qconfset |
Adds or changes values in the conf.vrs file. |
qvrsexpr | Evaluates and outputs qvrs expressions without executing qvrs itself if a qvrs database (as named by $QVRS_FILE) already exists. Will invoke qvrs to create the database if $QVRS_FILE is not set. |
qvrsdmp | Processes a qvrs binary database and outputs selected information -- primarily a qvrs debugging tool. |
mktraits | This tool is actually qvrs but modified to process the traits input files to produce a binary file <qtree>/data/traits/host.tab to facilitate the fast retrieval of traits settings -- see Section 8.9. |
traits | This tool reads the files created by mktraits to extract requested information, invoking mktraits to create the file if necessary -- see Section 8.9. |
qvrs without flags or arguments lists the current settings. % qvrs | sed 10q # just list first 10 lines AsSuffix s BeginLine qsg -M Branch guide BuildHost matt BuildPath /m/qtree/linux2_0i/9.1/bin /bin /usr/bin BuildSys Linux-2.0.36-i686 CcInclDirs /usr/include CcLibDirs /lib /usr/lib ConfVrsFile /m/guide/o/conf.vrs ConfVrsPath /m/guide/o /m/guide/s/QefAdm/confvrs Many of the qvrs variables refer to directory paths for finding files of various kinds. Other variables concern the project (Project, RootDir, RootPath) and user (Logname, User, _Hostname_, System). Some variables contain compiler switches, library mappings etc. The command x-qvrs <variable> will explain most of the standard variables, as in: % x-qvrs BuildPath BuildPath : executable path used in builds This path variable is the list of directories to be assigned to Path, that is the directories to be searched for executables. This permits the user to use whatever path they so choose, but the builds will be done using a somewhat saner and approved set of directories. BuildPath is initially set to the Dir/bin, for each Dir named by $QTREE, followed by the directories named by the traits variable BuildPath. Additional directories can be inserted in front of the traits added directories using: addpath BuildPath new-dirs ... See also: traits $PATHThe command x-qvrs L \*vars will list all of the variables documented in the system, as in part: % x-qvrs -L \*vars | sed 10q # just list first 10 ARTMPDIR : name of ar(1)'s temporary directory AsSuffix : suffix of assembler files BeginLine : Begin line arguments Branch : path from RootDir to current qvrs file BuildHost : name of the host used for remote builds BuildSys : type of the system on which build to be done CcAsFlag : cc flag to produce assembler file CcSed_file[X] : ccsed sed script file CcLibDirs : cc's default library search path ConfigName : name of the configurationAnyone can create and assign variables, the system can only document the ones assigned and used by the tools as shipped. See Appendix F Qvrs Variables for the complete list of documented variables. These variables provide the QEF tools with a reference scheme which is independent of file, directory and even system location. This is the key to QEF's ability to construct and walk complex search paths spanning machines, platforms and even networks. From QEF's point of view, everything is relative. When qef generates the back-end scripts, the myriad variable references are replaced with unambiguous references to files, directories, flags and programs. |
The order in which qvrs processes its files takes into account the hierarchical nature of an intelligently arranged tree of directories. The algorithm must walk the directories to find the various qvrs files, and adjust its variables according to the position in the tree where they are initialized, tested, reset, etc. Files are processed according to the following:
|
|||||||||||||||||||||||||||||||||||||||
The root.vrs file |
This file anchors the project tree. It provides the point of reference from which all relative directory displacements occur. The file is usually created by the mkqtree utility. Rather than edit the file directly, you maintain it using the QEF program rootvrs. The following variables are typically set in this file:
|
||||||||||||||||||||||||||||||||||||||
The conf.vrs file |
This file stores user-specific settings and/or system tasks. Typically, it contains tool names and parameter settings for the tools. This file is usually created by copying a default file (@QefAdm/confvrs/confdefl.vrs), and is usually edited manually or using the qconfset utility. Two "magic" prefixes are often found here:
The conf.vrs file is sometimes used as a strfix replacement dictionary to configure data files during the build. As such, it should be limited to those keywords that are also supported by strfix. |
||||||||||||||||||||||||||||||||||||||
The tree.vrs file |
This file specifies tree-specific settings. It affects the resident directory and all sub-directories beneath it. Like leaf.vrs and branch.vrs, tree.vrs files may use the suspend keyword. Most projects will have a tree.vrs file in the source root that sets the Project name, standard qsg, library, and include search paths, special semantic options and controls. tree.vrs may appear in sub-directories, but they are rare and usually small -- one to three lines settings some control that is used within that sub-directory and its tree. For example, a sub-directory may modify @_DestDir_ as in: set _DestDir_ @_DestDir_/gamesor modify @InclPath or @LibPath for the entire sub-project. |
||||||||||||||||||||||||||||||||||||||
The prereq.vrs file |
This file sets and uses @Prereq*[] variables.
Once it has completed qvrs searches the
@PrereqPath path to set @PrereqRoot[X] for
each project X named by @PrereqList.
The other @Prereq* variables are used to specify the
release, configuration, and directory format for the
projects.
A full description of the use and setting of the @Prereq*
variables may be found in prereqvrs(x-qvrs).
The command qvrs XP flag will list all the
Prereq* settings, as in:
% qvrs -XP PrereqPath /ph PrereqList tcl(7.4) PrereqVrs prereq.vrs # default value PrereqFormat <P>/<C>/<V> # default value PrereqConf linux2_4i PrereqRoot[tcl] /ph/tcl/linux2_4i/7.4 |
||||||||||||||||||||||||||||||||||||||
The p_sysnm.vrs file |
This file is used to contain project/system specific settings such as system dependent mappings to third party software or application flags. A project employs such a file if there are a more than few system dependent settings. If there is just one or two, it is usually preferable to put the settings in the top level tree.vrs file using a switch statement. |
||||||||||||||||||||||||||||||||||||||
The sysnm.vrs file |
This file, which is initially provided as part of the QEF package, contains system specific settings. These files are located in the $QTREE/lib/sysvrs. The sysnm.vrs files are used to describe platform-level settings such as library mappings and search paths, and special flags and options. In particular, the sysnm.vrs file sets the flags for the @DEBUGGING or @PROFILING options, as in: if @(option PROFILING) set _CcFlags_index_ Profiling prepend LibMatch lib%_p.a elif @(option DEBUGGING) set _CcFlags_index_ Debug set _Optimize_index_ Debug prepend LibMatch lib%_g.a fi # Set default behaviour for selected options cset _CcFlags_value_[*,Profiling] -pg cset _CcFlags_value_[*,Debug] -g |
||||||||||||||||||||||||||||||||||||||
The qeffile |
Every construction directory of a project must have a corresponding qeffile in the directory's SrcPath list or a file named by @QefFile[@RealBranch]. It defines directory-specific settings and controls. The qeffile has three or four sections:
|
||||||||||||||||||||||||||||||||||||||
Overrides: leaf.vrs and branch.vrs |
The files leaf.vrs and branch.vrs are used to override the established values in certain directories and branches of trees. They are intended for strictly temporary use, providing a way to make a quick change without changing the permanent qvrs source files. To temporarily override or modify a setting in a qeffile or qvrs file, instead of copying the file to the local directory, create a file called leaf.vrs in the local directory, and set the override in this file. For example: addpath SrcPath @(home doug)/src/@Branch which says, in effect, "Add Doug's corresponding directory to the search path for the current directory" -- thus including his maintenance changes along with your own. A leaf.vrs file applies in its containing directory only. A branch.vrs file applies in its containing directory and any of it sub-directory trees. |
Here are the most commonly used keywords, along with brief descriptions of their use. All of these are shown in the tutorials. For a complete list, see Appendix F Qvrs Keywords |
|
addpath |
addpath <pathvar> <newdir> This command adds path <newdir> to the specified <pathvar>. |
cset |
cset <var> <value> This command conditionally sets the specified variable to the value supplied. The setting only takes effect if <var> has not already been set to a value. |
set |
set <var> <value> This command forcibly sets the specified variable to the value supplied. The setting takes effect regardless of the state and contents of <var>. |
if ... fi |
if <condition> ... [elif <condition 2>]* ... [else ...] fi The most basic branching mechanism begins with the "if" keyword and ends with "fi". Between these limits may be any number of "elif" and a single "else" statements. |
The following applies to all *.vrs qvrs files and to the lines up to
and including the Begin line in a qeffile or qeffile2
(the lines that follow a Begin in a qeffile are not processed by qvrs).
qvrs files consist of zero or more standard text lines. All white-space at the beginning and end of lines is removed on input. White-space is a non-empty sequence of space and tab characters. Empty lines or lines that begin with a `#' are ignored, except when they follow a significant (not ignored) line that ends with a `@'. If a significant line ends with a `@', the `@' and the newline are removed and the next input line, minus any leading white-space, is appended to the previously read line.
The resulting line should consist of a keyword and its arguments. The keywords are listed in the keywords(x-qvrs) item and explained in detail in their own individual item. Any embedded `@' characters in the arguments are expanded as explained in the following. A valid qvrs line consists of a keyword followed by arguments. The arguments are processed to replace embedded substrings as follows:
The name of a variable (i.e., Var in the above) may be any sequence of alphanumerics or underbars, the first of which may not be a digit. |
For a summary of the qvrs command-line options, use the command qvrs x or see the qvrs(1) man page. For developers, the flags often used with qvrs are:
|
The traits system provides yet another set of variables
describing the host system.
As the name suggests, these variables specify traits or characteristics
of the host system such as special directories, capabilities,
and special tool names.
To get a list of the traits variables, use traits,
as in:
% traits | sed 5q # just list first five ARFLAGSDASHED 0 BOGUS_CSH 0 BOGUS_RENAME 1 BuildPath /bin:/usr/bin DBLESLASHROOT 0Individual standard traits are described by x-qvrs as in: % x-qvrs ARFLAGSDASHED ARFLAGSDASHED(x-qvrs) specifies ar option preceded by dash This boolean traits-var specifies whether or not the system's ar(1) program requires the action argument to be preceded by a `'. If the setting is 0, the `' is not inserted into ar commands. See also: traits ar(1) There are three tools in the traits system: |
|
mktraits | Actually a special version of qvrs modified to read the traits input files <qtree>/lib/traits.vrs and <qtree>/data/traits.ext and create the binary file <qtree>/data/traits/host.vrs. This is the file that any program that needs a trait, including traits, will read to retrieve traits settings. These tools will invoke mktraits to build this file if it does not exist. |
traits | Outputs variables of the traits database or the values for argument variables. |
mkalltraits |
Run mktraits for all hosts for which qdsrv variable
host.qtree exists.
The <qtree>/lib/traits.vrs file is provided as part of the QEF product and should be left unchanged. In contrast, the <qtree>/data/traits.ext file is used to make local host, site, or platform specific settings. An important setting is that of QDSRV_HOST, the name of the host on which qdsrv is run, as in: cset QDSRV_HOST hostAfter changing this file, mktraits should be run to create the binary <qtree>/data/traits/host.tab on all the hosts that would be affected. A key feature of the traits system is the automatic importation by qvrs of all the traits that are marked for export or whose name begins with "_[TFD]_". |
Summary | |
In this chapter we have explored qvrs and the associated traits
package and the ways qvrs controls and configures your software
production process using variables to abstract the construction
information.
We looked at qvrs with respect to its use, syntax, semantics,
and files.
Using the variables, command keywords and qvrs files,
you describe the environment in which your construction is to run.
The names of tools, flags, file and directory
locations and search paths are all described in qvrs files.
In many ways qvrs is the second most important tool of the QEF system and understanding its use is a large part of mastering QEF. |
c070.qh - 9.4 - 03/10/27 |