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.define-header.html"><LINK
29 HREF="ref.description.html"></HEAD
40 SUMMARY="Header navigation table"
52 > Component Writer's Guide</TH
60 HREF="ref.define-header.html"
74 HREF="ref.description.html"
85 NAME="REF.DEFINE-PROC"><SPAN
99 > -- Use a fragment of Tcl code to output additional data to
100 configuration header files.</DIV
102 CLASS="REFSYNOPSISDIV"
114 >cdl_option <name> {
115 define_proc <Tcl script>
130 >For most configuration options it is sufficient to have an entry in
131 the configuration header file of the form:</P
139 CLASS="PROGRAMLISTING"
140 >#define <name> <value></PRE
145 >In some cases it is desirable to perform some more complicated
146 processing when generating a configuration header file. There are a
147 number of CDL properties for this, including <SPAN
154 >. The most flexible is <SPAN
158 component writer to specify a Tcl script that gets invoked whenever
159 the configuration system generates the header file for the owning
160 package. The script can output anything to the header file, for
161 example it could generate a C data structure based on various
162 configuration values.</P
164 >At the point that the <SPAN
167 > script is invoked there will be
168 two channels to open files, accessible via Tcl variables:
172 > is a channel to the current package's
173 own header file for example
176 >pkgconf/kernel.h</TT
180 >cdl_system_header</TT
181 > is a channel to the global
185 >pkgconf/system.h</TT
190 > script will use the <TT
194 output data to one of these channels.</P
199 > properties only take effect if the current option is
200 active and enabled. The default behavior of the configuration system
201 for an option with the <TT
204 > flavor corresponds to
216 CLASS="PROGRAMLISTING"
220 puts $cdl_header "#define XXX 1"
245 >In the current implementation it is not possible for a <SPAN
249 property to examine the current values of various configuration
250 options and adapt accordingly. This is a major limitation, and will be
251 addressed in future versions of the configuration tools.</P
271 CLASS="PROGRAMLISTING"
272 >cdl_package CYGPKG_HAL_ARM_PID {
273 display "ARM PID evaluation board"
274 parent CYGPKG_HAL_ARM
275 define_header hal_arm_pid.h
280 puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H <pkgconf/hal_arm.h>"
281 puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_pid.h>"
282 puts $::cdl_header ""
283 puts $::cdl_header "#define HAL_PLATFORM_CPU \"ARM 7TDMI\""
284 puts $::cdl_header "#define HAL_PLATFORM_BOARD \"PID\""
285 puts $::cdl_header "#define HAL_PLATFORM_EXTRA \"\""
286 puts $::cdl_header ""
303 HREF="ref.define.html"
310 HREF="ref.define-format.html"
317 HREF="ref.define-header.html"
324 HREF="ref.if-define.html"
331 HREF="ref.no-define.html"
343 SUMMARY="Footer navigation table"
354 HREF="ref.define-header.html"
363 HREF="cdl-guide.html"
372 HREF="ref.description.html"
391 HREF="reference.html"