Command cdl_option -- Define a single configuration option
Synopsis
cdl_option <name> {
…
}
Description
The option is the basic unit of configurability. Generally each option
corresponds to a single user choice. Typically there is a certain
amount of information associated with an option to assist the user in
manipulating that option, for example a textual description. There
will also be some limits on the possible values that the user can
choose, so an option may be a simple yes-or-no choice or it may be
something more complicated such as an array size or a device name.
Options may have associated constraints, so if that option is enabled
then certain conditions have to satisfied elsewhere in the
configuration. Options usually have direct consequences such as
preprocessor #define symbols in a configuration
header file.
cdl_option is implemented as a Tcl command that takes two arguments,
a name and a body. The name must be a valid C preprocessor identifier:
a sequence of upper or lower case letters, digits or underscores,
starting with a non-digit character; identifiers beginning with an
underscore should normally be avoided because they may clash with
system packages or with identifiers reserved for use by the compiler.
Within a single configuration, names must be unique. If a
configuration contained two packages which defined the same entity
CYGIMP_SOME_OPTION, any references to that entity
in a requires property or any other expression
would be ambiguous. It is possible for a given name to be used by two
different packages if those packages should never be loaded into a
single configuration. For example, architectural HAL packages are
allowed to re-use names because a single configuration cannot target
two different architectures. For a recommended naming convention see
the Section called Package Contents and Layout in Chapter 2.
The second argument to cdl_option is a body of
properties, typically surrounded by braces so that the Tcl interpreter
treats it as a single argument. This body will be processed by a
recursive invocation of the Tcl interpreter, extended with additional
commands for the various properties that are allowed inside a
cdl_option. The valid properties are:
List constraints that the configuration should satisfy if this option is
active and enabled.
Example
cdl_option CYGDBG_INFRA_DEBUG_PRECONDITIONS {
display "Preconditions"
default_value 1
description "
This option allows individual control of preconditions.
A precondition is one type of assert, which it is
useful to control separately from more general asserts.
The function is CYG_PRECONDITION(condition,msg)."
}