1 <?xml version="1.0" encoding="UTF-8"?>
2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3 xmlns="http://unixwork.de/uwproj"
4 targetNamespace="http://unixwork.de/uwproj"
5 elementFormDefault="qualified"
6 version="0.2"
7 >
8 <xs:element name="project" type="ProjectType"/>
9
10 <xs:complexType name="ProjectType">
11 <xs:annotation>
12 <xs:documentation>
13 The root element of an uwproj project.
14 Consists of an optional <code>config</code> element
15 and an arbitrary number of <code>dependency</code>
16 and <code>target</code> elements.
17 </xs:documentation>
18 </xs:annotation>
19 <xs:sequence>
20 <xs:element name="config" type="ConfigType" minOccurs="0"/>
21 <xs:element name="dependency" type="DependencyType" minOccurs="0" maxOccurs="unbounded"/>
22 <xs:element name="target" type="TargetType" minOccurs="0" maxOccurs="unbounded"/>
23 </xs:sequence>
24 </xs:complexType>
25
26 <xs:complexType name="ConfigType">
27 <xs:annotation>
28 <xs:documentation>
29 The configuration section.
30 Consists of an arbitrary number of <code>var</code> elements.
31 </xs:documentation>
32 </xs:annotation>
33 <xs:sequence>
34 <xs:element name="var" type="ConfigVarType" minOccurs="0" maxOccurs="unbounded"/>
35 </xs:sequence>
36 </xs:complexType>
37
38 <xs:complexType name="ConfigVarType">
39 <xs:annotation>
40 <xs:documentation>
41 The definition of a configuration variable.
42 <p>
43 Configuration variables are supposed to be used in the configure script and are also
44 written to the resulting config file (in contrast to make variables, which are only
45 written to the config file).
46 The <code>name</code> attribute is mandatory, the value is defined by the text body of the element.
47 The optional Boolean <code>exec</code> attribute (false by default) controls, whether the entire
48 definition is automatically executed under command substitution.
49 </p>
50 </xs:documentation>
51 </xs:annotation>
52 <xs:simpleContent>
53 <xs:extension base="xs:string">
54 <xs:attribute name="name" type="xs:string" use="required"/>
55 <xs:attribute name="exec" type="xs:boolean" default="false"/>
56 </xs:extension>
57 </xs:simpleContent>
58 </xs:complexType>
59
60 <xs:complexType name="PkgConfigType">
61 <xs:annotation>
62 <xs:documentation>
63 Instructs configure to invoke <code>pkg-config</code>, if present on the system, to determine
64 compiler and linker flags. The text body of this element defines the package name to search.
65 To constrain the allowed versions, use the attributes <code>atleast, exact, max</code>.
66 </xs:documentation>
67 </xs:annotation>
68 <xs:simpleContent>
69 <xs:extension base="xs:string">
70 <xs:attribute name="atleast" type="xs:string"/>
71 <xs:attribute name="exact" type="xs:string"/>
72 <xs:attribute name="max" type="xs:string"/>
73 </xs:extension>
74 </xs:simpleContent>
75 </xs:complexType>
76
77 <xs:simpleType name="LangType">
78 <xs:annotation>
79 <xs:documentation>
80 Requests a compiler for the specified language. Allowed values are
81 c, cpp.
82 </xs:documentation>
83 </xs:annotation>
84 <xs:restriction base="xs:string">
85 <xs:enumeration value="c"/>
86 <xs:enumeration value="cpp"/>
87 </xs:restriction>
88 </xs:simpleType>
89
90 <xs:complexType name="DependencyType">
91 <xs:annotation>
92 <xs:documentation>
93 Declares a dependency.
94 <p>
95 If the optional <code>name</code> attribute is omitted, the dependency is global
96 and must be satisfied, otherwise configuration shall fail.
97 A <em>named dependency</em> can be referenced by a target (or is implicitly referenced
98 by the default target, if no targets are specified).
99 Multiple declarations for the same named dependency may exist, in which case each declaration
100 is checked one after another, until one block is satisfied. The result of the first satisfied
101 dependency declaration is supposed to be applied to the config file.
102 </p>
103 <p>
104 The optional <code>platform</code> attribute may specify a <em>single</em> platform identifier and
105 the optional <code>toolchain</code> attribute may specify a <em>single</em> toolchain.
106 The optional <code>not</code> attribute may specify a comma-separated list of platform and/or
107 toolchain identifiers.
108 The configure script shall skip this dependency declaration if the detected platform and toolchain
109 is not matching the filter specification of these attributes.
110 </p>
111 </xs:documentation>
112 </xs:annotation>
113 <xs:choice minOccurs="0" maxOccurs="unbounded">
114 <xs:element name="lang" type="LangType"/>
115 <xs:element name="cflags" type="FlagsType"/>
116 <xs:element name="cxxflags" type="FlagsType"/>
117 <xs:element name="ldflags" type="FlagsType"/>
118 <xs:element name="pkgconfig" type="PkgConfigType"/>
119 <xs:element name="test" type="xs:string">
120 <xs:annotation>
121 <xs:documentation>
122 Specifies a custom command that shall be executed to test whether this dependency is satisfied.
123 </xs:documentation>
124 </xs:annotation>
125 </xs:element>
126 <xs:element name="make" type="MakeVarType"/>
127 </xs:choice>
128 <xs:attribute name="name" type="xs:string"/>
129 <xs:attribute name="platform" type="xs:string"/>
130 <xs:attribute name="toolchain" type="xs:string"/>
131 <xs:attribute name="not" type="xs:string"/>
132 </xs:complexType>
133
134 <xs:complexType name="FlagsType">
135 <xs:annotation>
136 <xs:documentation>
137 Instructs configure to append the contents of the element's body to the respective flags variable.
138 If the optional <code>exec</code> flag is set to <code>true</code>, the contents are supposed to be
139 executed under command substitution <em>at configuration time</em> before they are applied.
140 </xs:documentation>
141 </xs:annotation>
142 <xs:simpleContent>
143 <xs:extension base="xs:string">
144 <xs:attribute name="exec" type="xs:boolean" default="false"/>
145 </xs:extension>
146 </xs:simpleContent>
147 </xs:complexType>
148
149 <xs:complexType name="TargetType">
150 <xs:annotation>
151 <xs:documentation>
152 Declares a build target that is supposed to be configured.
153 <p>
154 If no build target is declared explicitly, an implicit default
155 target is generated, which has the <code>alldependencies</code>
156 flag set.
157 </p>
158 <p>
159 The optional <code>name</code> attribute is also used to generate a prefix
160 for the compiler and linker flags variables.
161 Furthermore, a target may consist of an arbitrary number of <code>feature</code>,
162 <code>option</code>, and <code>define</code> elements.
163 Named dependencies can be listed (separated by comma) in the <code>dependencies</code>
164 element. If this target shall use <em>all</em> available named dependencies, the empty
165 element <code>alldependencies</code> can be used as a shortcut.
166 </p>
167 </xs:documentation>
168 </xs:annotation>
169 <xs:choice minOccurs="0" maxOccurs="unbounded">
170 <xs:element name="feature" type="FeatureType"/>
171 <xs:element name="option" type="OptionType"/>
172 <xs:element name="define" type="DefineType"/>
173 <xs:element name="dependencies" type="DependenciesType"/>
174 <xs:element name="alldependencies">
175 <xs:complexType/>
176 </xs:element>
177 </xs:choice>
178 <xs:attribute name="name" type="xs:string"/>
179 </xs:complexType>
180
181 <xs:complexType name="FeatureType">
182 <xs:annotation>
183 <xs:documentation>
184 Declares an optional feature, that can be enabled during configuration, if all
185 <code>dependencies</code> are satisfied.
186 If a feature is enabled, all <code>define</code> and <code>make</code> definitions are
187 supposed to be applied to the config file.
188 In case the optional <code>default</code> attribute is set to true, the feature is enabled by default
189 and is supposed to be automatically disabled (without error) when the dependencies are not satisfied.
190 The name that is supposed to be used for the --enable and --disable arguments can be optionally
191 specified with the <code>arg</code> attribute. Otherwise, the <code>name</code> is used by default.
192 Optionally, a description for the help text of the resulting configure script can be specified by
193 adding a <code>desc</code> element.
194 </xs:documentation>
195 </xs:annotation>
196 <xs:choice minOccurs="0" maxOccurs="unbounded">
197 <xs:group ref="TargetDataGroup"/>
198 </xs:choice>
199 <xs:attribute name="name" type="xs:string" use="required"/>
200 <xs:attribute name="arg" type="xs:string"/>
201 <xs:attribute name="default" type="xs:boolean" default="false"/>
202 <xs:element name="desc" type="xs:string"/>
203 </xs:complexType>
204
205 <xs:complexType name="OptionType">
206 <xs:annotation>
207 <xs:documentation>
208 Declares a configuration option.
209 The option argument name is specified with the <code>arg</code> attribute.
210 Then, the children of this element specify possible <code>values</code> by defining the conditions
211 (in terms of dependencies) and effects (in terms of defines and make variables) of each value.
212 Finally, a set of <code>default</code>s is specified which supposed to automagically select the most
213 appropriate value for a specific platform under the available dependencies (in case the option is not
214 explicitly specified by using the command line argument).
215 </xs:documentation>
216 </xs:annotation>
217 <xs:sequence>
218 <xs:element name="value" type="OptionValueType" minOccurs="0" maxOccurs="unbounded"/>
219 <xs:element name="default" type="OptionDefaultType" minOccurs="0" maxOccurs="unbounded"/>
220 </xs:sequence>
221 <xs:attribute name="arg" type="xs:string" use="required"/>
222 </xs:complexType>
223
224 <xs:complexType name="OptionValueType">
225 <xs:annotation>
226 <xs:documentation>
227 Declares a possible value for the option (in the <code>str</code> attribute) and
228 the conditions (<code>dependencies</code>) and effects, the value has.
229 </xs:documentation>
230 </xs:annotation>
231 <xs:choice minOccurs="0" maxOccurs="unbounded">
232 <xs:group ref="TargetDataGroup"/>
233 </xs:choice>
234 <xs:attribute name="str" type="xs:string" use="required"/>
235 </xs:complexType>
236
237 <xs:complexType name="OptionDefaultType">
238 <xs:annotation>
239 <xs:documentation>
240 Specifies a default value for this option. Multiple default values can be specified, in which case
241 they are checked one after another for availability. With the optional <code>platform</code> attribute,
242 the default value can be constrained to a <em>single</em> specific platform and is supposed to be
243 skipped by configure, when this platform is not detected.
244 </xs:documentation>
245 </xs:annotation>
246 <xs:attribute name="value" type="xs:string" use="required"/>
247 <xs:attribute name="platform" type="xs:string"/>
248 </xs:complexType>
249
250 <xs:group name="TargetDataGroup">
251 <xs:choice>
252 <xs:element name="define" type="DefineType" minOccurs="0" maxOccurs="unbounded"/>
253 <xs:element name="dependencies" type="DependenciesType" minOccurs="0" maxOccurs="unbounded"/>
254 <xs:element name="make" type="MakeVarType" minOccurs="0" maxOccurs="unbounded"/>
255 </xs:choice>
256 </xs:group>
257
258 <xs:complexType name="DefineType">
259 <xs:annotation>
260 <xs:documentation>
261 Specifies C/C++ pre-processor definitions that are supposed to
262 be appended to the compiler flags, if supported.
263 (Note: for example, Fortran also supports C/C++ style pre-processor definitions under
264 certain circumstances)
265 </xs:documentation>
266 </xs:annotation>
267 <xs:attribute name="name" type="xs:string" use="required"/>
268 <xs:attribute name="value" type="xs:string"/>
269 </xs:complexType>
270
271 <xs:simpleType name="DependenciesType">
272 <xs:annotation>
273 <xs:documentation>A comma-separated list of named dependencies.</xs:documentation>
274 </xs:annotation>
275 <xs:restriction base="xs:string"/>
276 </xs:simpleType>
277
278 <xs:simpleType name="MakeVarType">
279 <xs:annotation>
280 <xs:documentation>
281 The text contents in the body of this element are supposed to be appended literally
282 to the config file without prior processing.
283 </xs:documentation>
284 </xs:annotation>
285 <xs:restriction base="xs:string"/>
286 </xs:simpleType>
287 </xs:schema>
288