📄 ref.cdl-package.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>cdl_package</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="UP"TITLE="CDL Language Specification"HREF="reference.html"><LINKREL="PREVIOUS"TITLE="cdl_component"HREF="ref.cdl-component.html"><LINKREL="NEXT"TITLE="cdl_interface"HREF="ref.cdl-interface.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The <SPANCLASS="APPLICATION">eCos</SPAN> Component Writer's Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="ref.cdl-component.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="ref.cdl-interface.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="REF.CDL-PACKAGE"><TTCLASS="LITERAL">cdl_package</TT></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN3272"></A><H2>Name</H2>Command <TTCLASS="LITERAL">cdl_package</TT> -- Define a package, a component that can be distributed</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN3276"><H2>Synopsis</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SYNOPSIS">cdl_package <name> { …}</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN3278"></A><H2>Description</H2><P>A package is a unit of distribution. It is also a configuration optionin that users can choose whether or not a particular package is loadedinto the configuration, and which version of that package should beloaded. It is also a component in that it can contain additionalcomponents and options in a hierarchy.</P><P>The top-level <SPANCLASS="APPLICATION">CDL</SPAN> script for a package should begin with a <TTCLASS="LITERAL">cdl_package</TT>command. This can contain most of the properties that can be used in a<TTCLASS="LITERAL">cdl_option</TT> command, and a number of additional ones which apply to apackage as a whole. It is also possible to include <TTCLASS="LITERAL">cdl_component</TT>,<TTCLASS="LITERAL">cdl_interface</TT> and <TTCLASS="LITERAL">cdl_option</TT> commands in the body of a package.However all configuration entities that occur at the top level of thescript containing the <TTCLASS="LITERAL">cdl_package</TT> command are automatically placedbelow that package in the configuration hierarchy, so putting theminside the body has no effect.</P><P>The following properties cannot be used in the body of a <TTCLASS="LITERAL">cdl_package</TT>command:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><SPANCLASS="PROPERTY">flavor</SPAN></DT><DD><P>Packages always have the flavor <TTCLASS="LITERAL">booldata</TT>.</P></DD><DT><SPANCLASS="PROPERTY">default_value</SPAN></DT><DD><P>The value of a package is its version number. This is specified at thetime the package is loaded into the configuration, and cannot becalculated afterwards. Typically the most recent version of thepackage will be loaded.</P></DD><DT><SPANCLASS="PROPERTY">legal_values</SPAN></DT><DD><P>The legal values list for a given package is determined by whichversions of that package are installed in the component repository,and cannot be further constrained in the CDL scripts.</P></DD><DT><SPANCLASS="PROPERTY">calculated</SPAN></DT><DD><P>The value of a package is always selected at the time that it isloaded into the configuration, and cannot be re-calculated afterwards.</P></DD><DT><SPANCLASS="PROPERTY">script</SPAN></DT><DD><P>This would be redundant since the CDL script containing the<TTCLASS="LITERAL">cdl_package</TT> command acts as that package's script.</P></DD></DL></DIV><P><TTCLASS="LITERAL">cdl_package</TT> is implemented as a Tcl command that takes twoarguments, a name and a body. The name must be a valid C preprocessoridentifier: a sequence of upper or lower case letters, digits orunderscores, starting with a non-digit character; identifiersbeginning with an underscore should normally be avoided because theymay clash with system packages or with identifiers reserved for use bythe compiler. Packages should always have unique names within a givencomponent repository. For a recommended naming convention see <AHREF="package.contents.html">the Section called <I>Package Contents and Layout</I> in Chapter 2</A>.</P><P>The second argument to <TTCLASS="LITERAL">cdl_package</TT> is a body of properties and othercommands, typically surrounded by braces so that the Tcl interpretertreats it as a single argument. This body will be processed by arecursive invocation of the Tcl interpreter, extended with additionalcommands for the various properties that are allowed inside a<TTCLASS="LITERAL">cdl_package</TT>. The valid commands are:</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT><AHREF="ref.active-if.html"><SPANCLASS="PROPERTY">active_if</SPAN></A></DT><DD><P>Allow additional control over the active state of this package.</P></DD><DT><AHREF="ref.cdl-component.html"><TTCLASS="LITERAL">cdl_component</TT></A></DT><DD><P>Define a component which should appear immediately below this packagein the configuration hierarchy.</P></DD><DT><AHREF="ref.cdl-interface.html"><TTCLASS="LITERAL">cdl_interface</TT></A></DT><DD><P>Define an interface which should appear immediately below thispackage in the configuration hierarchy.</P></DD><DT><AHREF="ref.cdl-option.html"><TTCLASS="LITERAL">cdl_option</TT></A></DT><DD><P>Define an option which should appear immediately belowthis package in the configuration hierarchy.</P></DD><DT><AHREF="ref.compile.html"><SPANCLASS="PROPERTY">compile</SPAN></A></DT><DD><P>List the source files that should be built for this package.</P></DD><DT><AHREF="ref.define.html"><SPANCLASS="PROPERTY">define</SPAN></A></DT><DD><P>Specify additional <TTCLASS="LITERAL">#define</TT> symbols that should gointo the package's configuration header file.</P></DD><DT><AHREF="ref.define-format.html"><SPANCLASS="PROPERTY">define_format</SPAN></A></DT><DD><P>Control how the package's value will appear in the globalconfiguration header file <TTCLASS="FILENAME">pkgconf/system.h</TT></P></DD><DT><AHREF="ref.define-header.html"><SPANCLASS="PROPERTY">define_header</SPAN></A></DT><DD><P>Specify the configuration header file that will be generated for this package.</P></DD><DT><AHREF="ref.define-proc.html"><SPANCLASS="PROPERTY">define_proc</SPAN></A></DT><DD><P>Use a fragment of Tcl code to output additional data toconfiguration header files.</P></DD><DT><AHREF="ref.description.html"><SPANCLASS="PROPERTY">description</SPAN></A></DT><DD><P>Provide a textual description for this component.</P></DD><DT><AHREF="ref.display.html"><SPANCLASS="PROPERTY">display</SPAN></A></DT><DD><P>Provide a short string describing this component.</P></DD><DT><AHREF="ref.doc.html"><SPANCLASS="PROPERTY">doc</SPAN></A></DT><DD><P>The location of on-line documentation for this component.</P></DD><DT><AHREF="ref.hardware.html"><SPANCLASS="PROPERTY">hardware</SPAN></A></DT><DD><P>This package is tied to specific hardware.</P></DD><DT><AHREF="ref.if-define.html"><SPANCLASS="PROPERTY">if_define</SPAN></A></DT><DD><P>Output a common preprocessor construct to a configuration header file. </P></DD><DT><AHREF="ref.implements.html"><SPANCLASS="PROPERTY">implements</SPAN></A></DT><DD><P>Enabling this component provides one instance of a more generalinterface. </P></DD><DT><AHREF="ref.include-dir.html"><SPANCLASS="PROPERTY">include_dir</SPAN></A></DT><DD><P>Specify the desired location of this package's exported header files inthe install tree.</P></DD><DT><AHREF="ref.include-files.html"><SPANCLASS="PROPERTY">include_files</SPAN></A></DT><DD><P>List the header files that are exported by this package.</P></DD><DT><AHREF="ref.library.html"><SPANCLASS="PROPERTY">library</SPAN></A></DT><DD><P>Specify which library should contain the object filesgenerated by building this package.</P></DD><DT><AHREF="ref.make.html"><SPANCLASS="PROPERTY">make</SPAN></A></DT><DD><P>An additional custom build step associated with this component, resultingin a target that should not go directly into a library.</P></DD><DT><AHREF="ref.make-object.html"><SPANCLASS="PROPERTY">make_object</SPAN></A></DT><DD><P>An additional custom build step associated with this component, resultingin an object file that should go into a library.</P></DD><DT><AHREF="ref.no-define.html"><SPANCLASS="PROPERTY">no_define</SPAN></A></DT><DD><P>Suppress the normal generation of the package's<TTCLASS="LITERAL">#define</TT> in the global configuration header file<TTCLASS="FILENAME">pkgconf/system.h</TT>.</P></DD><DT><AHREF="ref.parent.html"><SPANCLASS="PROPERTY">parent</SPAN></A></DT><DD><P>Control the location of this package in the configuration hierarchy. </P></DD><DT><AHREF="ref.requires.html"><SPANCLASS="PROPERTY">requires</SPAN></A></DT><DD><P>List constraints that the configuration should satisfy if this package isactive.</P></DD></DL></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN3468"></A><H2>Example</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">cdl_package CYGPKG_INFRA { display "Infrastructure" include_dir cyg/infra description " Common types and useful macros. Tracing and assertion facilities. Package startup options." compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx \ dummyxxmain.cxx null.cxx simple.cxx fancy.cxx buffer.cxx \ diag.cxx tcdiag.cxx memcpy.c memset.c delete.cxx} </PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN3471"></A><H2>See Also</H2><P>Command <AHREF="ref.cdl-option.html"><TTCLASS="LITERAL">cdl_option</TT></A>,command <AHREF="ref.cdl-component.html"><TTCLASS="LITERAL">cdl_component</TT></A>,command <AHREF="ref.cdl-interface.html"><TTCLASS="LITERAL">cdl_interface</TT></A>.</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="ref.cdl-component.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="cdl-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="ref.cdl-interface.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><TTCLASS="LITERAL">cdl_component</TT></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="reference.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><TTCLASS="LITERAL">cdl_interface</TT></TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -