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. -->
12 >CDL Properties</TITLE
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="The CDL Language"
23 HREF="language.html"><LINK
26 HREF="language.commands.html"><LINK
28 TITLE="Option Naming Convention"
29 HREF="language.naming.html"></HEAD
40 SUMMARY="Header navigation table"
52 > Component Writer's Guide</TH
60 HREF="language.commands.html"
68 >Chapter 3. The CDL Language</TD
74 HREF="language.naming.html"
88 NAME="LANGUAGE.PROPERTIES">CDL Properties</H1
90 >Each package, component, option, and interface has a body of
91 properties, which provide the component framework with information
92 about how to handle each option. For example there is a property for a
93 descriptive text message which can be displayed to a user who is
94 trying to figure out just what effect manipulating the option would
95 have on the target application. There is another property for the
96 default value, for example whether a particular option should be
97 enabled or disabled by default.</P
99 >All of the properties are optional, it is legal to define a
100 configuration option which has an empty body. However some properties
101 are more optional than others: users will not appreciate having to
102 manipulate an option if they are not given any sort of description or
103 documentation. Other properties are intended only for very specific
104 purposes, for example <SPAN
113 >Because different properties serve very different purposes, their
114 syntax is not as uniform as the top-level commands. Some properties
115 take no arguments at all. Other properties take a single argument such
116 as a description string, or a list of arguments such as a <SPAN
120 property which specifies the file or files that should be compiled if
121 a given option is active and enabled. The <SPAN
125 as argument a snippet of <SPAN
144 > properties take various
145 expressions. Additional properties may be defined in future which take
146 new kinds of arguments.</P
148 >All property parsing code supports options for every property,
149 although at present the majority of properties do not yet take any
150 options. Any initial arguments that begin with a hyphen character
154 > will be interpreted as an option, for example:</P
162 CLASS="PROGRAMLISTING"
163 >cdl_package CYGPKG_HAL_ARM {
173 >If the option involves additional data, as for the
177 > example above, then this can be written
184 >-priority 1</TT
185 >. On occasion the option parsing
186 code can get in the way, for example:</P
194 CLASS="PROGRAMLISTING"
195 >cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_STATE {
214 > as a valid option, so this will result in
215 syntax errors when the <SPAN
218 > script is read in by the component
219 framework. To avoid problems, the option parsing code will recognize
223 > and will not attempt to interpret any
224 subsequent arguments. Hence this option should be written as:</P
232 CLASS="PROGRAMLISTING"
233 >cdl_option CYGNUM_LIBC_TIME_DST_DEFAULT_STATE {
235 legal_values -- -1 to 1
242 >The property parsing code involves a recursive invocation of the Tcl
243 interpreter that is used to parse the top-level commands. This means
244 that some characters in the body of an option will be treated
248 > character can be used for
249 comments. The backslash character <TT
270 >, and the quote character
274 > may all receive special treatment. Most of the
275 time this is not a problem because these characters are not useful for
276 most properties. On occasion having a <SPAN
280 performing the parser can be very powerful. For more details of
281 how the presence of a <SPAN
284 > interpreter can affect <SPAN
289 HREF="language.tcl.html"
290 >the Section called <I
291 >An Introduction to Tcl</I
295 >Many of the properties can be used in any of <TT
308 >. Other properties are
309 more specific. The <SPAN
312 > property is only relevant to components.
329 > properties apply to a package as a whole, so can only occur
347 relevant to packages, as will be explained later. The <SPAN
354 > properties are also not relevant to interfaces.</P
356 >This section lists the various properties, grouped by purpose. Each
357 property also has a full reference page in <A
358 HREF="reference.html"
361 Properties related to values and expressions are described in more
363 HREF="language.values.html"
364 >the Section called <I
365 >Values and Expressions</I
367 >. Properties related to
368 header file generation and to the build process are described in
378 NAME="LANGUAGE.PROPERTIES.USER">Information-providing Properties</H2
380 >Users can only be expected to manipulate configuration options
381 sensibly if they are given sufficient information about these options.
382 There are three properties which serve to explain an option in plain
384 HREF="ref.display.html"
390 a textual alias for an option, which is usually more comprehensible
391 than something like <TT
393 >CYGPKG_LIBC_TIME_ZONES`</TT
396 HREF="ref.description.html"
402 longer description, typically a paragraph or so; the <A
408 > property specifies the location of
409 additional on-line documentation related to a configuration option. In
410 the context of a graphical tool the <SPAN
414 primary way for users to identify configuration options; the
418 > paragraph will be visible whenever the option is
419 selected; the on-line documentation will only be accessed when the
420 user explicitly requests it.</P
428 CLASS="PROGRAMLISTING"
429 >cdl_package CYGPKG_UITRON {
430 display "uITRON compatibility layer"
431 doc ref/ecos-ref.a.html
433 eCos supports a uITRON Compatibility Layer, providing
434 full Level S (Standard) compliance with Version 3.02 of
435 the uITRON Standard, plus many Level E (Extended) features.
436 uITRON is the premier Japanese embedded RTOS standard."
443 >All three properties take a single argument. For <SPAN
450 > this argument is just a string. For <SPAN
454 pointer to a suitable HTML file, optionally including an anchor within
456 HREF="package.html#PACKAGE.HIERARCHY"
459 > are observed then the component framework will look
460 for the HTML file in the package's <TT
463 > sub-directory, otherwise the <SPAN
467 filename will be treated as relative to the package's top-level directory.</P
474 NAME="LANGUAGE.PROPERTIES.HIERARCHY">The Configuration Hierarchy</H2
476 >There are two properties related to the hierarchical organization of
477 components and options: <A
478 HREF="ref.parent.html"
485 HREF="ref.script.html"
495 > property can be used to move a <SPAN
499 else in the hierarchy. The most common use is for packages, to avoid
500 having all the packages appear at the top-level of the configuration
501 hierarchy. For example an architectural HAL package such as
505 > is placed below the common HAL
520 CLASS="PROGRAMLISTING"
521 >cdl_package CYGPKG_HAL_SH {
522 display "SH architecture"
533 > property can also be used in the body of a
544 common. However care has to be taken since excessive re-parenting can
545 be confusing. Care also has to be taken when reparenting below some
546 other package that may not actually be loaded in a given
547 configuration, since the resulting behavior is undefined.</P
549 >As a special case, if the parent is the empty string then the
553 > entity is placed at the root of the hierarchy. This is useful
554 for global preferences, default compiler flags, and other settings
555 that may affect every package.</P
560 > property can only be used in the body of a
564 > command. The property takes a single filename as
565 argument, and this should be another <SPAN
569 additional options, sub-components and interfaces that should go below
570 the current component in the hierarchy. If the <A
571 HREF="package.html#PACKAGE.HIERARCHY"
572 >directory layout conventions</A
574 observed then the component framework will look for the specified file
579 subdirectory of the package, otherwise the filename will be treated as
580 relative to the package's top-level directory.</P
588 CLASS="PROGRAMLISTING"
589 >cdl_component CYGPKG_LIBC_STDIO {
590 display "Standard input/output functions"
593 requires CYGPKG_IO_SERIAL_HALDIAG
596 This enables support for standard I/O functions from <stdio.h>."
609 NAME="LANGUAGE.PROPERTIES.VALUE">Value-related Properties</H2
611 >There are seven properties which are related to option values and
613 HREF="ref.flavor.html"
620 HREF="ref.calculated.html"
627 HREF="ref.default-value.html"
634 HREF="ref.legal-values.html"
641 HREF="ref.active-if.html"
648 HREF="ref.implements.html"
655 HREF="ref.requires.html"
661 information can be found in <A
662 HREF="language.values.html"
663 >the Section called <I
664 >Values and Expressions</I
668 >In the context of configurability, the concept of an option's value is
669 somewhat non-trivial. First an option may or may not be loaded: it is
670 possible to build a configuration which has the math library but not
671 the kernel; however the math library's <SPAN
674 > scripts still reference
675 kernel options, for example
678 >CYGSEM_LIBM_THREAD_SAFE_COMPAT_MODE</TT
686 >CYGVAR_KERNEL_THREADS_DATA</TT
687 >. Even if an option is
688 loaded it may or may not be active, depending on what is happening
689 higher up in the hierarchy: if the C library's
692 >CYGPKG_LIBC_STDIO</TT
693 > component is disabled then some
694 other options such as <TT
696 >CYGNUM_LIBC_STDIO_BUFSIZE</TT
698 become irrelevant. In addition each option has both a boolean
699 enabled/disabled flag and a data part. For many options only the
700 boolean flag is of interest, while for others only the data part is of
704 > property can be used to control this:</P
717 >This flavor indicates that neither the boolean nor the data parts are
718 user-modifiable: the option is always enabled and the data is always
722 >. The most common use for this is to have a
723 component that just acts as a placeholder in the hierarchy, allowing
724 various options to be grouped below it.</P
733 >Only the boolean part of the option is user-modifiable. The data part
746 >Only the data part of the option is user-modifiable. The boolean part
747 is fixed at enabled.</P
756 >Both the boolean and the data part of the option are user-modifiable.</P
761 >For more details of <SPAN
764 > flavors and how a flavor affects expression
765 evaluation, and other consequences, see <A
766 HREF="language.values.html"
767 >the Section called <I
768 >Values and Expressions</I
773 > property cannot be used for a
774 package because packages always have the <TT
778 flavor. Options and components have the <TT
782 by default, since most configuration choices are simple yes-or-no
783 choices. Interfaces have the <TT
786 > flavor by default.</P
791 > property can be used for options which should not be
792 user-modifiable, but which instead are fixed by the target hardware or
793 determined from the current values of other options. In general
797 > options should be avoided, since they can be confusing to
798 users who need to figure out whether or not a particular option can
799 actually be changed. There are a number of valid uses for <SPAN
803 options, and quite a few invalid ones as well. The <A
804 HREF="ref.calculated.html"
805 >reference packages</A
806 > should be consulted
807 for further details. The property takes an <A
808 HREF="language.values.html#LANGUAGE.EXPRESSION"
814 argument, for example:</P
822 CLASS="PROGRAMLISTING"
823 ># A constant on some target hardware, perhaps user-modifiable on other
825 cdl_option CYGNUM_HAL_RTC_PERIOD {
826 display "Real-time clock period"
837 > property cannot be used for packages or interfaces.
838 The value of a package always corresponds to the version of that
839 package which is loaded, and this is under user control. Interfaces
840 are implicitly calculated, based on the number of active and enabled
846 > property is similar to <SPAN
850 specifies a default value which users can modify. Again this property
851 is not relevant to packages or interfaces. A typical example would be:</P
859 CLASS="PROGRAMLISTING"
860 >cdl_option CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT {
861 display "Include GDB multi-threading debug support"
862 requires CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT
863 default_value CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT
873 > property imposes a constraint on the possible
874 values of the data part of an option. Hence it is only applicable to
882 > flavors. It cannot be used for a package
883 since the only valid value for a package is its version number. The
884 arguments to the <SPAN
887 > property should constitute a <A
888 HREF="language.values.html#LANGUAGE.LIST-EXPRESSION"
901 CLASS="PROGRAMLISTING"
902 >cdl_option CYGNUM_LIBC_TIME_STD_DEFAULT_OFFSET {
903 display "Default Standard Time offset"
905 legal_values -- -90000 to 90000
916 > property does not relate directly to an option's
917 value, but rather to its active state. Usually this is controlled via
918 the configuration hierarchy: if the
921 >CYGPKG_LIBC_STDIO</TT
922 > component is disabled then all
923 options below it are inactive and do not have any consequences.
924 In some cases the hierarchy does not provide sufficient control, for
925 example an option should only be active if two disjoint sets of
926 conditions are satisfied: the hierarchy could be used for one of these
927 conditions, and an additional <SPAN
930 > property could be used for
931 the other one. The arguments to <SPAN
934 > should constitute a
936 HREF="language.values.html#LANGUAGE.GOAL-EXPRESSION"
949 CLASS="PROGRAMLISTING"
950 ># Do not provide extra semaphore debugging if there are no semaphores
951 cdl_option CYGDBG_KERNEL_INSTRUMENT_BINSEM {
952 active_if CYGPKG_KERNEL_SYNCH
962 > property is related to the concept of <A
963 HREF="language.interface.html"
969 active and enabled and it implements a particular interface then it
973 > to that interface's value.</P
981 CLASS="PROGRAMLISTING"
982 >cdl_package CYGPKG_NET_EDB7XXX_ETH_DRIVERS {
983 display "Cirrus Logic ethernet driver"
984 implements CYGHWR_NET_DRIVERS
985 implements CYGHWR_NET_DRIVER_ETH0
995 > property is used to impose constraints on the user's
996 choices. For example it is unreasonable to expect the C library to
997 provide thread-safe implementations of certain functions if the
998 underlying kernel support has been disabled, or even if the kernel is
999 not being used at all.</P
1007 CLASS="PROGRAMLISTING"
1008 >cdl_option CYGSEM_LIBC_PER_THREAD_ERRNO {
1009 display "Per-thread errno"
1010 doc ref/ecos-ref.15.html
1011 requires CYGVAR_KERNEL_THREADS_DATA
1019 >The arguments to the <SPAN
1022 > property should be a <A
1023 HREF="language.values.html#LANGUAGE.GOAL-EXPRESSION"
1027 > goal expression</A
1035 NAME="LANGUAGE.PROPERTIES.DEFINE">Generating the Configuration Header Files</H2
1037 >When creating or updating a build tree the component framework will
1038 also generate configuration header files, one per package. By default
1039 it will generate a <TT
1043 component or interface that is active and enabled. For options with
1054 > will use the option's data part, otherwise
1055 it will use the constant <TT
1058 >. Typical output would
1067 CLASS="PROGRAMLISTING"
1068 >#define CYGFUN_LIBC_TIME_POSIX 1
1069 #define CYGNUM_LIBC_TIME_DST_DEFAULT_STATE -1</PRE
1074 >There are six properties which can be used to control the header file
1077 HREF="ref.define-header.html"
1080 >define_header</SPAN
1084 HREF="ref.no-define.html"
1091 HREF="ref.define-format.html"
1094 >define_format</SPAN
1098 HREF="ref.define.html"
1105 HREF="ref.if-define.html"
1112 HREF="ref.define-proc.html"
1119 >By default the component framework will generate a configuration
1120 header file for each package based on the package's name: everything
1121 up to and including the first underscore is discarded, the rest of the
1122 name is lower-cased, and a <TT
1125 > suffix is appended.
1126 For example the configuration header file for the kernel package
1132 >pkgconf/kernel.h</TT
1135 >define_header</SPAN
1137 property can be used to specify an alternative filename. This applies
1138 to all the components and options within a package, so it can only be
1139 used in the body of a <TT
1142 > command. For example the following
1143 specifies that the configuration header file for the SPARClite HAL
1146 >pkgconf/hal_sparclite.h</TT
1155 CLASS="PROGRAMLISTING"
1156 >cdl_package CYGPKG_HAL_SPARCLITE {
1157 display "SPARClite architecture"
1160 define_header hal_sparclite.h
1173 >At present the main use for the <SPAN
1175 >define_header</SPAN
1176 > property is related
1177 to hardware packages, see the <A
1178 HREF="ref.hardware.html"
1181 > for more details.</P
1188 > property is used to suppress the generation of the
1192 >. This can be useful if an option's
1193 consequences are all related to the build process or to constraints,
1194 and the option is never actually checked in any source code. It can
1195 also be useful in conjunction with the <SPAN
1205 > properties. The <SPAN
1208 > property does not take any
1217 CLASS="PROGRAMLISTING"
1218 >cdl_component CYG_HAL_STARTUP {
1219 display "Startup type"
1221 legal_values { "RAM" "ROM" }
1222 default_value {"RAM"}
1224 define -file system.h CYG_HAL_STARTUP
1231 >This example also illustrates the <SPAN
1234 > property, which can be used
1238 > in addition to the default
1239 one. It takes a single argument, the name of the symbol to be defined.
1240 It also takes options to control the configuration header file in
1241 which the symbol should be defined and the format to be used.</P
1245 >define_format</SPAN
1246 > property can be used to control how the value part
1250 > gets formatted. For example
1251 a format string of <TT
1255 generate a four-digit hexadecimal number. </P
1260 > property is intended for use primarily to control
1261 assertions, tracing, and similar functionality. It supports a specific
1262 implementation model for these, allowing control at the grain of
1263 packages or even individual source files. The <A
1264 HREF="ref.if-define.html"
1266 > provide additional
1272 > property provides an escape mechanism for those
1273 cases where something special has to happen at configuration header
1274 file generation time. It takes a single argument, a fragment of <SPAN
1278 code, which gets executed when the header file is generated. This code
1279 can output arbitrary data to the header file, or perform any other
1280 actions that might be appropriate.</P
1287 NAME="LANGUAGE.PROPERTIES.BUILD">Controlling what gets Built</H2
1289 >There are six properties which affect the build process:
1291 HREF="ref.compile.html"
1298 HREF="ref.make.html"
1305 HREF="ref.make-object.html"
1312 HREF="ref.library.html"
1319 HREF="ref.include-dir.html"
1326 HREF="ref.include-files.html"
1329 >include_files</SPAN
1332 The last three apply to a package as a whole, and can only occur in
1338 >Most of the source files that go into a package should simply be
1339 compiled with the appropriate compiler, selected by the target
1340 architecture, and with the appropriate flags, with an additional set
1341 defined by the target hardware and possible modifications on a
1342 per-package basis. The resulting object files will go into the library
1346 >, which can then be linked against
1347 application code. The <SPAN
1350 > property is used to list these source
1359 CLASS="PROGRAMLISTING"
1360 >cdl_package CYGPKG_ERROR {
1361 display "Common error code support"
1362 compile strerror.cxx
1363 include_dir cyg/error
1370 >The arguments to the <SPAN
1373 > property should be one or more source
1374 files. Typically most of the sources will be needed for the package as
1375 a whole, and hence they will be listed in one or more <SPAN
1379 properties in the body of the <TT
1382 >. Some sources may be
1383 specific to particular configuration options, in other words there is
1384 no point in compiling them unless that option is enabled, in which
1385 case the sources should be listed in a <SPAN
1400 >Some packages may have more complicated build requirements, for
1401 example they may involve a special target such as a linker script
1402 which should not end up in the usual library, or they may involve
1403 special build steps for generating an object file. The <SPAN
1410 > properties provide support for such requirements, for
1419 CLASS="PROGRAMLISTING"
1420 >cdl_package CYGPKG_HAL_MN10300_AM33 {
1421 display "MN10300 AM33 variant"
1424 <PREFIX>/lib/target.ld: <PACKAGE>/src/mn10300_am33.ld
1425 $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) \
1426 $(CFLAGS) -o $@ $<
1427 @echo $@ ": \\" > $(notdir $@).deps
1428 @tail +2 target.tmp >> $(notdir $@).deps
1429 @echo >> $(notdir $@).deps
1437 >For full details of custom build steps and the build process
1443 >By default all object files go into the library
1447 >. It is possible to override this at
1448 the package level using the <SPAN
1451 > property, but this should be
1452 avoided since it complicates application development: instead of just
1453 linking with a single library for all <SPAN
1456 >-related packages, it
1457 suddenly becomes necessary to link with several libraries.</P
1464 >include_files</SPAN
1465 > properties relate to a package's
1466 exported header files. By default a package's header files will be
1469 >install/include</TT
1471 directory. This is the desired behavior for some packages like the C
1472 library, since headers like <TT
1475 > should exist at that level.
1476 However if all header files were to end up in that directory then
1477 there would be a significant risk of a name clash. Instead it is
1478 better for packages to specify some sub-directory for their exported
1479 header files, for example:</P
1487 CLASS="PROGRAMLISTING"
1488 >cdl_package CYGPKG_INFRA {
1489 display "Infrastructure"
1490 include_dir cyg/infra
1497 >The various header files exported by the infrastructure, for example
1504 > will now end up in the
1507 >install/include/cyg/infra</TT
1509 sub-directory, where a name clash is very unlikely.</P
1511 >For packages which follow the <A
1512 HREF="package.html#PACKAGE.HIERARCHY"
1513 >directory layout conventions</A
1515 component framework will assume that the package's
1519 > sub-directory contains
1520 all exported header files. If this is not the case, for example
1521 because the package is sufficiently simple that the layout convention
1522 is inappropriate, then the exported header files can be listed
1523 explicitly in an <SPAN
1525 >include_files</SPAN
1533 NAME="LANGUAGE.PROPERTIES.MISCELLANEOUS">Miscellaneous Properties</H2
1536 HREF="ref.hardware.html"
1542 only relevant to packages. Some packages such as device drivers and
1543 HAL packages are hardware-specific, and generally it makes no sense to
1544 add such packages to a configuration unless the corresponding hardware
1545 is present on your target system. Typically hardware package selection
1546 happens automatically when you select your target. The <SPAN
1550 property should be used to identify a hardware-specific package, and
1551 does not take any arguments.</P
1559 CLASS="PROGRAMLISTING"
1560 >cdl_package CYGPKG_HAL_MIPS {
1561 display "MIPS architecture"
1565 define_header hal_mips.h
1572 >At present the <SPAN
1575 > property is largely ignored by the component
1576 framework. This may change in future releases.</P
1584 SUMMARY="Footer navigation table"
1595 HREF="language.commands.html"
1604 HREF="cdl-guide.html"
1613 HREF="language.naming.html"
1629 HREF="language.html"
1637 >Option Naming Convention</TD