1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="The eCos Component Writer's Guide"
20 HREF="cdl-guide.html"><LINK
22 TITLE="CDL Language Specification"
23 HREF="reference.html"><LINK
26 HREF="ref.doc.html"><LINK
29 HREF="ref.hardware.html"></HEAD
40 SUMMARY="Header navigation table"
52 > Component Writer's Guide</TH
74 HREF="ref.hardware.html"
85 NAME="REF.FLAVOR"><SPAN
99 > -- Specify the nature of a configuration option.</DIV
101 CLASS="REFSYNOPSISDIV"
113 >cdl_option <name> {
114 flavor <flavor>
129 >The state of a <SPAN
132 > configuration option is a somewhat complicated
133 concept. This state determines what happens when a build tree is
134 generated: it controls what files get built and what
138 > end up in configuration header files. The
139 state also controls the values used during expression evaluation. The
147 >An option may or may not be loaded into the current configuration.
148 However it is still possible for packages to reference options which
149 are not loaded in a <SPAN
152 > constraint or other expression. If an
153 option is not loaded then it will have no direct effect on the build
157 > will be used for expression
162 >Even if an option is loaded it may still be inactive. Usually this is
163 controlled by the option's location in the configuration hierarchy. If
164 an option's parent is active and enabled then the option will normally
165 be active. If the parent is either inactive or disabled then the
166 option will be inactive. For example, if kernel timeslicing is diabled
169 >CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS</TT
171 is irrelevant and must have no effect. The <SPAN
175 used to specify additional constraints. If an option is inactive then
176 it will have no direct effect on the build process, in other words it
177 will not cause any files to get built or <TT
181 to be generated. For the purposes of expression evaluation an inactive
182 option has a value of <TT
189 >An option may be enabled or disabled. Most options are boolean in
190 nature, for example a particular function may get inlined or it may
191 involve a full procedure call. If an option is disabled then it has no
192 direct effect on the build process, and for the purposes of expression
193 evaluation it has a value of 0.</P
197 >An option may also have additional data associated with it, for
198 example a numerical value used to control the size of an array.</P
202 >Most options are boolean in nature and do not have any additional
203 associated data. For some options only the data part makes sense and
204 users should be unable to manipulate the enabled/disabled part of the
205 state. For a comparatively small number of options it makes sense to
206 have the ability to disable that option or to enable it and associate
207 data as well. Finally, when constructing an option hierarchy it is
208 occasionally useful to have entities which serve only as placeholders.
212 > property can be used to control all this. There are four
213 possible values. It should be noted that the active or inactive state
214 of an option takes priority over the flavor: if an option is inactive
218 > will be generated and any
219 build-related properties such as <SPAN
222 > will be ignored.</P
238 > is intended primarily for placeholder
239 components in the hierarchy, although it can be used for other
240 purposes. Options with this flavor are always enabled and do not have
241 any additional data associated with them, so there is no way for users
242 to modify the option. For the purposes of expression evaluation an
243 option with flavor <TT
246 > always has the value
254 will take place, so typically a single <TT
258 be generated using the option name and a value of
262 >. Similarly build-related properties such as
266 > will take effect.</P
275 >Boolean options can be either enabled or disabled, and there is no
276 additional data associated with them. If a boolean option is disabled
280 > will be generated and any
281 build-related properties such as <SPAN
284 > will be ignored. For the
285 purposes of expression evaluation a disabled option has the value
289 >. If a boolean option is enabled then normal
293 > processing will take place, all
294 build-related properties take effect, and the option's value will be
307 >Options with this flavor are always enabled, and have some additional
308 data associated with them which can be edited by the user. This data
309 can be any sequence of characters, although in practice the
313 > property will often be used to impose constraints. In
314 appropriate contexts such as expressions the configuration tools will
315 attempt to interpret the data as integer or floating point numbers.
316 Since an option with the <TT
323 > processing takes place and
324 the data will be used for the value. Similarly all build-related
325 properties take effect, and the option's value for the purposes of
326 expression evaluation is the data.</P
335 >This combines the <TT
342 flavors. The option may be enabled or disabled, and in addition the
343 option has some associated data. If the option is disabled then no
347 > will be generated, the build-related
348 properties have no effect, and for the purposes of expression
349 evaluation the option's value is <TT
353 is enabled then a <TT
356 > will be generated using
357 the data as the value, all build-related properties take effect, and
358 the option's value for the purposes of expression evaluation is the
362 > is legal data then it is not possible to
363 distinguish this case from the option being disabled or inactive.</P
368 >Options and components have the <TT
372 default, but this can be changed as desired. Packages always have the
376 > flavor, and this cannot be changed.
377 Interfaces have the <TT
380 > flavor by default, since
381 the value of an interface is a count of the number of active and
382 enabled interfaces, but they can be given the <TT
397 >The expression syntax needs to be extended to allow the loaded,
398 active, enabled and data aspects of an option's state to be examined
399 individually. This would allow component writers to distinguish
400 between a disabled <TT
403 > option and an enabled
404 one which has a value of <TT
407 >. Such an enhancement to
408 the expression syntax may also prove useful in other circumstances.</P
426 CLASS="PROGRAMLISTING"
427 > cdl_component CYGPKG_LIBM_COMPATIBILITY {
429 cdl_component CYGNUM_LIBM_COMPATIBILITY {
433 cdl_option CYGNUM_LIBM_COMPAT_DEFAULT {
442 cdl_component CYGPKG_LIBM_TRACE {
459 HREF="ref.calculated.html"
466 HREF="ref.default-value.html"
473 HREF="ref.legal-values.html"
485 SUMMARY="Footer navigation table"
505 HREF="cdl-guide.html"
514 HREF="ref.hardware.html"
533 HREF="reference.html"