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.calculated.html"><LINK
29 HREF="ref.default-value.html"></HEAD
40 SUMMARY="Header navigation table"
52 > Component Writer's Guide</TH
60 HREF="ref.calculated.html"
74 HREF="ref.default-value.html"
85 NAME="REF.COMPILE"><SPAN
99 > -- List the source files that should be built if this option
100 is active and enabled.</DIV
102 CLASS="REFSYNOPSISDIV"
114 >cdl_option <name> {
115 compile [-library=libxxx.a] <list of files>
133 > property allows component developers to specify source
134 files which should be compiled and added to one of the target
135 libraries. Usually each source file will end up the library
139 >. It is possible for component writers
140 to specify an alternative library for an entire package using the
142 HREF="ref.library.html"
147 > property. Alternatively
148 the desired library can be specified on the <SPAN
152 example, to add a particular source file to the
156 > library the following could be used:</P
164 CLASS="PROGRAMLISTING"
165 >cdl_package CYGPKG_IO_SERIAL {
167 compile -library=libextras.a common/tty.c
173 >Details of the build process including such issues as compiler flags
174 and the order in which things happen can be found in
183 > properties can occur in any of <TT
200 property has effect if and only if the entity that contains it is
201 active and enabled. Typically the body of a <TT
205 any source files that need to be built irrespective of individual
206 options, and each <TT
216 will define source files that are more specific. A single <SPAN
220 property can list any number of source files, all destined for the
224 > or other entity can contain multiple
228 > properties, each of which can specify a different library.
229 It is possible for a given source file to be specified in <SPAN
233 properties for several different options, in which case the source
234 file will get built if any of these options are active and enabled.</P
236 >If the package follows the <A
237 HREF="package.html#PACKAGE.HIERARCHY"
239 layout conventions</A
240 > then the configuration tools will search for
241 the specified source files first in the
245 > subdirectory of the
246 package, then relative to the package directory itself. </P
254 >A shortcoming of the current specification of <SPAN
258 that there is no easy way to specify source files that should be built
259 unless an option is enabled. It would sometimes be useful to be able
260 to say: “if option <TT
263 > is enabled then compile
267 >, otherwise compile file
271 >. There are two simple ways of achieving this: </P
280 >, typically by listing it in
288 > to produce an empty object file if
292 > is not enabled. This has the big
293 disadvantage that the file always gets compiled and hence for some
294 configurations builds will take longer than necessary.</P
301 > option whose value is <TT
307 >compile y.c</TT
308 > property in its body. This
309 has the big disadvantage of adding another calculated option to the
314 >It is likely that this will be resolved in the future, possibly by
315 using some sort of expression as the argument to a <SPAN
328 >Currently it is not possible to control the priority of a <SPAN
332 property, in other words the order in which a file gets compiled
333 relative to other build steps. This functionality might prove useful
334 for complicated packages and should be added.</P
352 CLASS="PROGRAMLISTING"
353 >cdl_package CYGPKG_INFRA {
354 display "Infrastructure"
355 include_dir cyg/infra
357 Common types and useful macros.
358 Tracing and assertion facilities.
359 Package startup options."
361 compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx \
362 dummyxxmain.cxx memcpy.c memset.c delete.cxx \
382 HREF="ref.make-object.html"
386 HREF="ref.library.html"
395 SUMMARY="Footer navigation table"
406 HREF="ref.calculated.html"
415 HREF="cdl-guide.html"
424 HREF="ref.default-value.html"
443 HREF="reference.html"