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.default-value.html"><LINK
29 HREF="ref.define-format.html"></HEAD
40 SUMMARY="Header navigation table"
52 > Component Writer's Guide</TH
60 HREF="ref.default-value.html"
74 HREF="ref.define-format.html"
85 NAME="REF.DEFINE"><SPAN
99 > -- Specify additional <TT
103 should go into the owning package's configuration header file.</DIV
105 CLASS="REFSYNOPSISDIV"
117 >cdl_option <name> {
118 define [-file=<filename>] [-format=<format>] <symbol>
133 >Normally the configuration system generates a single
137 > for each option that is active and enabled,
138 with the defined symbol being the name of the option. These
142 > go to the package's own configuration
143 header file, for example <TT
145 >pkgconf/kernel.h</TT
147 for kernel configuration options. For the majority of options this is
148 sufficient. Sometimes it is useful to have more control over which
157 > property can be used to generate an addition
161 > if the option is both active and enabled,
170 CLASS="PROGRAMLISTING"
171 >cdl_option CYGNUM_LIBC_STDIO_FOPEN_MAX {
179 >If this option is given the value 40 then the following
183 > will be generated in the configuration
196 >#define CYGNUM_LIBC_STDIO_FOPEN_MAX 40
197 #define FOPEN_MAX 40</PRE
205 > can be suppressed if desired
209 > property. This is useful if the symbol should
213 >pkgconf/system.h</TT
215 the package's own configuration header file. The value that will be
219 > is the same as for the
220 default one, and depends on the option's flavor as follows:</P
233 >Options with this flavor are always enabled and have no value, so the
246 >If the option is disabled then no <TT
250 generated. Otherwise the constant <TT
262 >If the option is disabled then no <TT
266 generated. Otherwise the option's current value will be used.</P
275 >The option's current value will be used.</P
280 >For active options with the <TT
284 active and enabled options with the <TT
288 flavor, either one or two <TT
292 generated. These take the following forms:</P
300 CLASS="PROGRAMLISTING"
301 >#define <symbol> <value>
302 #define <symbol>_<value></PRE
310 > it is possible to control the
311 format used for the value using a
314 >-format=<format></TT
315 > option. For example, the
316 following can be used to output some configuration data as a C string:</P
324 CLASS="PROGRAMLISTING"
325 >cdl_option <name> {
327 define -format="\\\"%s\\\"" <symbol>
333 >The implementation of this facility involves concatenating the
337 >, the format string, and the
338 string representation of the option's value, and evaluating this in a
339 Tcl interpreter. Therefore the format string will be processed twice
340 by a Tcl parser, and appropriate care has to be taken with quoting.</P
345 > will be generated only if is a
346 valid C preprocessor macro symbol. By default the symbols generated by
350 > properties will end up in the package's own configuration
354 > option can be used to
355 specify an alternative destination. At the time of writing the only
356 valid alternative definition is <TT
360 which will send the output to the global configuration header file
363 >pkgconf/system.h</TT
384 >Care has to be taken with the <TT
388 Because the Tcl interpreter's <TT
392 used, this property is subject to any problems with the implementation
393 of this in the Tcl library. Generally there should be no problems with
394 string data or with integers up to 32 bits, but there may well be
395 problems if 64-bit data is involved. This issue may be addressed in a
416 CLASS="PROGRAMLISTING"
417 >cdl_component CYG_HAL_STARTUP {
418 display "Startup type"
420 legal_values {"RAM" "ROM" }
421 default_value {"RAM"}
423 define -file=system.h CYG_HAL_STARTUP
439 HREF="ref.define-format.html"
446 HREF="ref.define-header.html"
453 HREF="ref.define-proc.html"
460 HREF="ref.if-define.html"
467 HREF="ref.no-define.html"
479 SUMMARY="Footer navigation table"
490 HREF="ref.default-value.html"
499 HREF="cdl-guide.html"
508 HREF="ref.define-format.html"
527 HREF="reference.html"