Command cdl_component — Define a component, a collection of configuration options


cdl_component <name> {


A component is a configuration option that can contain additional options and sub-components. The body of a cdl_component can contain the same properties as that of a cdl_option . There is an additional property, script which allows configuration data to be split into multiple files. It is also possible for a component body to include cdl_component , cdl_option and cdl_interface entities that should go below this component in the configuration hierarchy.

cdl_component 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 certain 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_component is a body of properties and other commands, 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_component . The valid commands are:


Allow additional control over the active state of this component.


The component's value is not directly user-modifiable, it is calculated using a suitable CDL expression.


Define a sub-component.


Define an interface which should appear immediately below this component in the configuration hierarchy.


Define a configuration option which should appear immediately below this component in the configuration hierarchy.


List the source files that should be built if this component is active and enabled.


Provide a default value for this component using a CDL expression.


Specify additional #define symbols that should go into the owning package's configuration header file.


Control how the component's value will appear in the configuration header file.


Use a fragment of Tcl code to output additional data to configuration header files.


Provide a textual description for this component.


Provide a short string describing this component.


The location of on-line documentation for this component.


Specify the nature of this component.


Output a common preprocessor construct to a configuration header file.


Enabling this component provides one instance of a more general interface.


Impose constraints on the possible values for this component.


An additional custom build step associated with this component, resulting in a target that should not go directly into a library.


An additional custom build step associated with this component, resulting in an object file that should go into a library.


Suppress the normal generation of a preprocessor #define symbol in a configuration header file.


Control the location of this component in the configuration hierarchy.


List constraints that the configuration should satisfy if this component is active and enabled.


Include additional configuration information from another CDL script


cdl_component CYGDBG_USE_ASSERTS {
    display       "Use asserts"
    default_value 1
    description   "
        If this component is enabled, assertions in the code are
        tested at run-time. Assert functions (CYG_ASSERT()) are
        defined in 'include/cyg/infra/cyg_ass.h' within the 'install'
        tree. If the component is disabled, these result in no
        additional object code and no checking of the asserted
    script        assert.cdl

See Also

Command cdl_option , command cdl_package , command cdl_interface .