OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [tools/] [src/] [libcdl/] [doc/] [reference.sgml] - Blame information for rev 26

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 unneback
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
36
37
 
38
39
CDL Language Specification
40
 
41
42
This chapter contains reference information for the main &CDL;
43
commands &cdl-option;, &cdl-component;, &cdl-package; and
44
&cdl-interface;, followed by the various properties such as
45
&active-if; and &compile; in alphabetical order.
46
47
 
48
49
 
50
51
52
&cdl-option;
53
54
 
55
56
Command &cdl-option;
57
Define a single configuration option
58
59
 
60
61
62
cdl_option <name> {
63
64
}
65
66
67
 
68
Description
69
70
The option is the basic unit of configurability. Generally each option
71
corresponds to a single user choice. Typically there is a certain
72
amount of information associated with an option to assist the user in
73
manipulating that option, for example a textual description. There
74
will also be some limits on the possible values that the user can
75
choose, so an option may be a simple yes-or-no choice or it may be
76
something more complicated such as an array size or a device name.
77
Options may have associated constraints, so if that option is enabled
78
then certain conditions have to satisfied elsewhere in the
79
configuration. Options usually have direct consequences such as
80
preprocessor #define symbols in a configuration
81
header file.
82
83
84
&cdl-option; is implemented as a Tcl command that takes two arguments,
85
a name and a body. The name must be a valid C preprocessor identifier:
86
a sequence of upper or lower case letters, digits or underscores,
87
starting with a non-digit character; identifiers beginning with an
88
underscore should normally be avoided because they may clash with
89
system packages or with identifiers reserved for use by the compiler.
90
Within a single configuration, names must be unique. If a
91
configuration contained two packages which defined the same entity
92
CYGIMP_SOME_OPTION, any references to that entity
93
in a &requires; property or any other expression
94
would be ambiguous. It is possible for a given name to be used by two
95
different packages if those packages should never be loaded into a
96
single configuration. For example, architectural HAL packages are
97
allowed to re-use names because a single configuration cannot target
98
two different architectures. For a recommended naming convention see
99
.
100
101
102
The second argument to cdl_option is a body of
103
properties, typically surrounded by braces so that the Tcl interpreter
104
treats it as a single argument. This body will be processed by a
105
recursive invocation of the Tcl interpreter, extended with additional
106
commands for the various properties that are allowed inside a
107
&cdl-option;. The valid properties are:
108
109
 
110
111
 
112
&active-if;
113
114
Allow additional control over the active state of this option.
115
116
 
117
&calculated;
118
119
The option's value is not directly user-modifiable, it is calculated
120
using a suitable CDL expression.
121
122
 
123
&compile;
124
125
List the source files that should be built if this option is active
126
and enabled.
127
128
 
129
&default-value;
130
131
Provide a default value for this option using a CDL expression.
132
133
 
134
&define;
135
136
Specify additional #define symbols that should go
137
into the owning package's configuration header file.
138
139
 
140
&define-format;
141
142
Control how the option's value will appear in the configuration header
143
file.
144
145
 
146
&define-proc;
147
148
Use a fragment of Tcl code to output additional data to
149
configuration header files.
150
151
 
152
&description;
153
154
Provide a textual description for this option.
155
156
 
157
&display;
158
159
Provide a short string describing this option.
160
161
 
162
&doc;
163
164
The location of on-line documentation for this option.
165
166
 
167
&flavor;
168
169
Specify the nature of this option.
170
171
 
172
&if-define;
173
174
Output a common preprocessor construct to a configuration header file.
175
176
 
177
&implements;
178
179
Enabling this option provides one instance of a more general
180
interface.
181
182
 
183
&legal-values;
184
185
Impose constraints on the possible values for this option.
186
187
 
188
&make;
189
190
An additional custom build step associated with this option, resulting
191
in a target that should not go directly into a library.
192
193
 
194
&make-object;
195
196
An additional custom build step associated with this option, resulting
197
in an object file that should go into a library.
198
199
 
200
&no-define;
201
202
Suppress the normal generation of a preprocessor
203
#define symbol in a configuration header file.
204
205
 
206
&parent;
207
208
Control the location of this option in the configuration hierarchy.
209
210
 
211
&requires;
212
213
List constraints that the configuration should satisfy if this option is
214
active and enabled.
215
216
 
217
218
 
219
220
 
221
Example
222
223
cdl_option CYGDBG_INFRA_DEBUG_PRECONDITIONS {
224
    display       "Preconditions"
225
    default_value 1
226
    description   "
227
        This option allows individual control of preconditions.
228
        A precondition is one type of assert, which it is
229
        useful to control separately from more general asserts.
230
        The function is CYG_PRECONDITION(condition,msg)."
231
}
232
233
234
 
235
See Also
236
237
Command &cdl-component;,
238
command &cdl-package;,
239
command &cdl-interface;.
240
241
242
 
243
244
 
245
246
247
 
248
249
250
&cdl-component;
251
252
 
253
254
Command &cdl-component;
255
Define a component, a collection of configuration options
256
257
 
258
259
260
cdl_component <name> {
261
262
}
263
264
265
 
266
Description
267
268
A component is a configuration option that can contain additional
269
options and sub-components. The body of a &cdl-component; can contain
270
the same properties as that of a &cdl-option;. There is an additional
271
property, &script; which allows configuration data to be split into
272
multiple files. It is also possible for a component body to include
273
&cdl-component;, &cdl-option; and &cdl-interface; entities that should
274
go below this component in the configuration hierarchy.
275
276
277
&cdl-component; is implemented as a Tcl command that takes two
278
arguments, a name and a body. The name must be a valid C preprocessor
279
identifier: a sequence of upper or lower case letters, digits or
280
underscores, starting with a non-digit character; identifiers
281
beginning with an underscore should normally be avoided because they
282
may clash with system packages or with identifiers reserved for use by
283
the compiler. Within a single configuration, names must be unique. If
284
a configuration contained two packages which defined the same entity
285
CYGIMP_SOME_OPTION, any references to that entity
286
in a &requires; property or any other expression would be ambiguous.
287
It is possible for a given name to be used by two different packages
288
if those packages should never be loaded into a single configuration.
289
For example, architectural HAL packages are allowed to re-use certain
290
names because a single configuration cannot target two different
291
architectures. For a recommended naming convention see 
292
linkend="package.contents">.
293
294
295
The second argument to &cdl-component; is a body of properties and
296
other commands, typically surrounded by braces so that the Tcl
297
interpreter treats it as a single argument. This body will be
298
processed by a recursive invocation of the Tcl interpreter, extended
299
with additional commands for the various properties that are allowed
300
inside a &cdl-component;. The valid commands are:
301
302
 
303
304
 
305
&active-if;
306
307
Allow additional control over the active state of this component.
308
309
 
310
&calculated;
311
312
The component's value is not directly user-modifiable, it is calculated
313
using a suitable CDL expression.
314
315
 
316
&cdl-component
317
318
Define a sub-component.
319
320
 
321
&cdl-interface;
322
323
Define an interface which should appear immediately below this
324
component in the configuration hierarchy.
325
326
 
327
&cdl-option;
328
329
Define a configuration option which should appear immediately below
330
this component in the configuration hierarchy.
331
332
 
333
&compile;
334
335
List the source files that should be built if this component is active
336
and enabled.
337
338
 
339
&default-value;
340
341
Provide a default value for this component using a CDL expression.
342
343
 
344
&define;
345
346
Specify additional #define symbols that should go
347
into the owning package's configuration header file.
348
349
 
350
&define-format;
351
352
Control how the component's value will appear in the configuration header
353
file.
354
355
 
356
&define-proc;
357
358
Use a fragment of Tcl code to output additional data to
359
configuration header files.
360
361
 
362
&description;
363
364
Provide a textual description for this component.
365
366
 
367
&display;
368
369
Provide a short string describing this component.
370
371
 
372
&doc;
373
374
The location of on-line documentation for this component.
375
376
 
377
&flavor;
378
379
Specify the nature of this component.
380
381
 
382
&if-define;
383
384
Output a common preprocessor construct to a configuration header file.
385
386
 
387
&implements;
388
389
Enabling this component provides one instance of a more general
390
interface.
391
392
 
393
&legal-values;
394
395
Impose constraints on the possible values for this component.
396
397
 
398
&make;
399
400
An additional custom build step associated with this component, resulting
401
in a target that should not go directly into a library.
402
403
 
404
&make-object;
405
406
An additional custom build step associated with this component, resulting
407
in an object file that should go into a library.
408
409
 
410
&no-define;
411
412
Suppress the normal generation of a preprocessor
413
#define symbol in a configuration header file.
414
415
 
416
&parent;
417
418
Control the location of this component in the configuration hierarchy.
419
420
 
421
&requires;
422
423
List constraints that the configuration should satisfy if this component is
424
active and enabled.
425
426
 
427
&script;
428
429
Include additional configuration information from another
430
CDL script
431
432
 
433
434
 
435
436
 
437
Example
438
439
440
cdl_component CYGDBG_USE_ASSERTS {
441
    display       "Use asserts"
442
    default_value 1
443
    description   "
444
        If this component is enabled, assertions in the code are
445
        tested at run-time. Assert functions (CYG_ASSERT()) are
446
        defined in 'include/cyg/infra/cyg_ass.h' within the 'install'
447
        tree. If the component is disabled, these result in no
448
        additional object code and no checking of the asserted
449
        conditions."
450
    script        assert.cdl
451
}
452
453
454
455
 
456
See Also
457
458
Command &cdl-option;,
459
command &cdl-package;,
460
command &cdl-interface;.
461
462
463
 
464
465
 
466
467
468
 
469
470
471
&cdl-package;
472
473
 
474
475
Command &cdl-package;
476
Define a package, a component that can be distributed
477
478
 
479
480
481
cdl_package <name> {
482
483
}
484
485
486
 
487
Description
488
489
A package is a unit of distribution. It is also a configuration option
490
in that users can choose whether or not a particular package is loaded
491
into the configuration, and which version of that package should be
492
loaded. It is also a component in that it can contain additional
493
components and options in a hierarchy.
494
495
496
The top-level &CDL; script for a package should begin with a &cdl-package;
497
command. This can contain most of the properties that can be used in a
498
&cdl-option; command, and a number of additional ones which apply to a
499
package as a whole. It is also possible to include &cdl-component;,
500
&cdl-interface; and &cdl-option; commands in the body of a package.
501
However all configuration entities that occur at the top level of the
502
script containing the &cdl-package; command are automatically placed
503
below that package in the configuration hierarchy, so putting them
504
inside the body has no effect.
505
506
507
The following properties cannot be used in the body of a &cdl-package;
508
command:
509
510
511
 
512
&flavor;
513
514
Packages always have the flavor booldata.
515
516
 
517
&default-value;
518
519
The value of a package is its version number. This is specified at the
520
time the package is loaded into the configuration, and cannot be
521
calculated afterwards. Typically the most recent version of the
522
package will be loaded.
523
524
 
525
&legal-values;
526
527
The legal values list for a given package is determined by which
528
versions of that package are installed in the component repository,
529
and cannot be further constrained in the CDL scripts.
530
531
 
532
&calculated;
533
534
The value of a package is always selected at the time that it is
535
loaded into the configuration, and cannot be re-calculated afterwards.
536
537
 
538
&script;
539
540
This would be redundant since the CDL script containing the
541
&cdl-package; command acts as that package's script.
542
543
 
544
545
 
546
547
&cdl-package; is implemented as a Tcl command that takes two
548
arguments, a name and a body. The name must be a valid C preprocessor
549
identifier: a sequence of upper or lower case letters, digits or
550
underscores, starting with a non-digit character; identifiers
551
beginning with an underscore should normally be avoided because they
552
may clash with system packages or with identifiers reserved for use by
553
the compiler. Packages should always have unique names within a given
554
component repository. For a recommended naming convention see 
555
linkend="package.contents">.
556
557
558
The second argument to &cdl-package; is a body of properties and other
559
commands, typically surrounded by braces so that the Tcl interpreter
560
treats it as a single argument. This body will be processed by a
561
recursive invocation of the Tcl interpreter, extended with additional
562
commands for the various properties that are allowed inside a
563
&cdl-package;. The valid commands are:
564
565
 
566
567
 
568
&active-if;
569
570
Allow additional control over the active state of this package.
571
572
 
573
&cdl-component;
574
575
Define a component which should appear immediately below this package
576
in the configuration hierarchy.
577
578
 
579
&cdl-interface;
580
581
Define an interface which should appear immediately below this
582
package in the configuration hierarchy.
583
584
 
585
&cdl-option;
586
587
Define an option which should appear immediately below
588
this package in the configuration hierarchy.
589
590
 
591
&compile;
592
593
List the source files that should be built for this package.
594
595
 
596
&define;
597
598
Specify additional #define symbols that should go
599
into the package's configuration header file.
600
601
 
602
&define-format;
603
604
Control how the package's value will appear in the global
605
configuration header file 
606
class="headerfile">pkgconf/system.h
607
608
 
609
&define-header;
610
611
Specify the configuration header file that will be generated for this package.
612
613
 
614
&define-proc;
615
616
Use a fragment of Tcl code to output additional data to
617
configuration header files.
618
619
 
620
&description;
621
622
Provide a textual description for this component.
623
624
 
625
&display;
626
627
Provide a short string describing this component.
628
629
 
630
&doc;
631
632
The location of on-line documentation for this component.
633
634
 
635
&hardware;
636
637
This package is tied to specific hardware.
638
639
 
640
&if-define;
641
642
Output a common preprocessor construct to a configuration header file.
643
644
 
645
&implements;
646
647
Enabling this component provides one instance of a more general
648
interface.
649
650
 
651
&include-dir;
652
653
Specify the desired location of this package's exported header files in
654
the install tree.
655
656
 
657
&include-files;
658
659
List the header files that are exported by this package.
660
661
 
662
&library;
663
664
Specify which library should contain the object files
665
generated by building this package.
666
667
 
668
&make;
669
670
An additional custom build step associated with this component, resulting
671
in a target that should not go directly into a library.
672
673
 
674
&make-object;
675
676
An additional custom build step associated with this component, resulting
677
in an object file that should go into a library.
678
679
 
680
&no-define;
681
682
Suppress the normal generation of the package's
683
#define in the global configuration header file
684
pkgconf/system.h.
685
686
 
687
&parent;
688
689
Control the location of this package in the configuration hierarchy.
690
691
 
692
&requires;
693
694
List constraints that the configuration should satisfy if this package is
695
active.
696
697
 
698
 
699
700
 
701
702
 
703
Example
704
705
cdl_package CYGPKG_INFRA {
706
    display       "Infrastructure"
707
    include_dir   cyg/infra
708
    description   "
709
        Common types and useful macros.
710
        Tracing and assertion facilities.
711
        Package startup options."
712
 
713
    compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx      \
714
            dummyxxmain.cxx null.cxx simple.cxx fancy.cxx buffer.cxx \
715
            diag.cxx tcdiag.cxx memcpy.c memset.c delete.cxx
716
}
717
 
718
719
720
 
721
See Also
722
723
Command &cdl-option;,
724
command &cdl-component;,
725
command &cdl-interface;.
726
727
728
 
729
730
 
731
732
733
 
734
735
736
&cdl-interface;
737
738
 
739
740
Command &cdl-interface;
741
Define an interface, functionality that can be provided by
742
a number of different implementations.
743
744
 
745
746
747
cdl_interface <name> {
748
749
}
750
751
752
 
753
Description
754
755
An interface is a special type of calculated configuration option.
756
It provides an abstraction mechanism that is often useful in &CDL;
757
expressions. As an example, suppose that some package relies on the
758
presence of code that implements the standard kernel scheduling
759
interface. However the requirement is no more stringent than this, so
760
the constraint can be satisfied by the mlqueue scheduler, the bitmap
761
scheduler, or any additional schedulers that may get implemented in
762
future. A first attempt at expressing the dependency might be:
763
764
765
    requires CYGSEM_KERNEL_SCHED_MLQUEUE || CYGSEM_KERNEL_SCHED_BITMAP
766
767
768
This constraint is limited, it may need to be changed if a new
769
scheduler were to be added to the system. Interfaces provide a way of
770
expressing more general relationships:
771
772
773
    requires CYGINT_KERNEL_SCHEDULER
774
775
776
The interface CYGINT_KERNEL_SCHEDULER is
777
implemented by both the mlqueue and bitmap
778
schedulers, and may be implemented by future schedulers as well. The
779
value of an interface is the number of implementors that are active
780
and enabled, so in a typical configuration only one scheduler will be
781
in use and the value of the interface will be 1. If
782
all schedulers are disabled then the interface will have a value
783
0 and the &requires; constraint will not be
784
satisfied.
785
786
787
Some component writers may prefer to use the first &requires;
788
constraint on the grounds that the code will only have been tested
789
with the mlqueue and bitmap schedulers and cannot be guaranteed to
790
work with any new schedulers. Other component writers may take a more
791
optimistic view and assume that their code will work with any
792
scheduler until proven otherwise.
793
794
795
Interfaces must be defined in CDL scripts, just like options,
796
components and packages. This involves the command &cdl-interface;
797
which takes two arguments, a name and a body. The name must be a valid
798
C preprocessor identifier: a sequence of upper or lower case letters,
799
digits or underscores, starting with a non-digit character;
800
identifiers beginning with an underscore should normally be avoided
801
because they may clash with system packages or with identifiers
802
reserved for use by the compiler. Within a single configuration, names
803
must be unique. If a configuration contained two packages which
804
defined the same entity CYGIMP_SOME_OPTION, any
805
references to that entity in a &requires; property or any other
806
expression would be ambiguous. It is possible for a given name to be
807
used by two different packages if those packages should never be
808
loaded into a single configuration. For example, architectural HAL
809
packages are allowed to re-use names because a single configuration
810
cannot target two different architectures. For a recommended naming
811
convention see .
812
813
814
The second argument to &cdl-interface; is a body of properties,
815
typically surrounded by braces so that the Tcl interpreter treats it
816
as a single argument. This body will be processed by a recursive
817
invocation of the Tcl interpreter, extended with additional commands
818
for the various properties that are allowed inside a &cdl-interface;.
819
The valid properties are a subset of those for a &cdl-option;.
820
821
 
822
823
 
824
&active-if;
825
826
Allow additional control over the active state of this interface.
827
828
 
829
&compile;
830
831
List the source files that should be built if this interface is active.
832
833
 
834
&define;
835
836
Specify additional #define symbols that should go
837
into the owning package's configuration header file.
838
839
 
840
&define-format;
841
842
Control how the interface's value will appear in the configuration header
843
file.
844
845
 
846
&define-proc;
847
848
Use a fragment of Tcl code to output additional data to
849
configuration header files.
850
851
 
852
&description;
853
854
Provide a textual description for this interface.
855
856
 
857
&display;
858
859
Provide a short string describing this interface.
860
861
 
862
&doc;
863
864
The location of on-line documentation for this interface.
865
866
 
867
&flavor;
868
869
Interfaces have the data flavor by default, but
870
they can also be given the bool or
871
booldata flavor when necessary. A
872
bool interface is disabled if there are no active
873
and enabled implementors, otherwise it is enabled. A
874
booldata interface is also disabled if there are no
875
active and enabled implementors, otherwise it is enabled and the data
876
is a number corresponding to the number of these implementors.
877
878
 
879
&if-define;
880
881
Output a common preprocessor construct to a configuration header file.
882
883
 
884
&implements;
885
886
If this interface is active it provides one instance of a more general
887
interface.
888
889
 
890
&legal-values;
891
892
Interfaces always have a small numerical value. The &legal-values; can
893
be used to apply additional constraints such as an upper limit.
894
895
 
896
&make;
897
898
An additional custom build step associated with this option, resulting
899
in a target that should not go directly into a library.
900
901
 
902
&make-object;
903
904
An additional custom build step associated with this option, resulting
905
in an object file that should go into a library.
906
907
 
908
&no-define;
909
910
Suppress the normal generation of a preprocessor
911
#define symbol in a configuration header file.
912
913
 
914
&parent;
915
916
Control the location of this option in the configuration hierarchy.
917
918
 
919
&requires;
920
921
List constraints that the configuration should satisfy if this option is
922
active and enabled.
923
924
 
925
926
 
927
928
A number of properties are not applicable to interfaces:
929
930
931
 
932
&calculated;
933
934
Interfaces are always calculated, based on the number of active and
935
enabled entities that implement the interface.
936
937
 
938
&default-value;
939
940
Interface values are calculated so a &default-value; property would be
941
meaningless.
942
943
 
944
945
 
946
947
Interfaces are not containers, so they cannot hold other entities such
948
as options or components.
949
950
951
A commonly used constraint on interface values takes the form:
952
953
954
    requires CYGINT_KERNEL_SCHEDULER == 1
955
956
957
This constraint specifies that there can be only one scheduler in the
958
system. In some circumstances it is possible for the configuration
959
tools to detect this pattern and act accordingly, so for example
960
enabling the bitmap scheduler would automatically disable the mlqueue
961
scheduler.
962
963
 
964
965
 
966
Example
967
968
cdl_interface CYGINT_KERNEL_SCHEDULER {
969
    display  "Number of schedulers in this configuration"
970
    requires 1 == CYGINT_KERNEL_SCHEDULER
971
}
972
973
974
 
975
See Also
976
977
Property &implements;,
978
command &cdl-option;.
979
command &cdl-component;,
980
command &cdl-package;.
981
982
983
 
984
985
 
986
987
 
988
989
 
990
991
992
&active-if;
993
994
 
995
996
Property &active-if;
997
Allow additional control over the active state of an
998
option or other CDL entity.
999
1000
 
1001
1002
1003
cdl_option <name> {
1004
    active_if <condition>
1005
1006
}
1007
1008
1009
 
1010
Description
1011
1012
Configuration options or other entities may be either active or
1013
inactive. Typically this is controlled by the option's location in the
1014
overall hierarchy. Consider the option
1015
CYGDBG_INFRA_DEBUG_PRECONDITIONS, which exists
1016
below the component CYGDBG_USE_ASSERT. If the whole
1017
component is disabled then the options it contains are inactive: there
1018
is no point in enabling preconditions unless there is generic
1019
assertion support; any &requires; constraints associated with
1020
preconditions are irrelevant; any &compile; property or other
1021
build-related property is ignored.
1022
1023
1024
In some cases the hierarchy does not provide sufficient control over
1025
whether or not a particular option should be active. For example, the
1026
math library could have support for floating point exceptions which
1027
is only worthwhile if the hardware implements appropriate
1028
functionality, as specified by the architectural HAL. The relevant
1029
math library configuration options should remain below the
1030
CYGPKG_LIBM package in the overall hierarchy, but
1031
should be inactive unless there is appropriate hardware support. In
1032
cases like this an &active-if; property is appropriate.
1033
1034
1035
Another common use of &active-if; properties is to avoid excessive
1036
nesting in the configuration hierarchy. If some option B is only
1037
relevant if option A is enabled, it is possible to turn A into a
1038
component that contains B. However adding another level to the
1039
hierarchy for a component which will contain just one entry may be
1040
considered excessive. In such cases it is possible for B to have an
1041
&active-if; dependency on A.
1042
1043
1044
&active-if; takes a goal expression as argument. For details of goal
1045
expression syntax see . In
1046
most cases the goal expression will be very simple, often involving
1047
just one other option, but more complicated expressions can be used
1048
when appropriate. It is also possible to have multiple &active-if;
1049
conditions in a single option, in which case all of the conditions
1050
have to be satisfied if the option is to be active.
1051
1052
1053
The &active-if; and &requires; properties have certain similarities,
1054
but they serve a different purpose. Suppose there are two options A
1055
and B, and option B relies on functionality provided by A. This could
1056
be expressed as either active_if A or as
1057
requires A. The points to note are:
1058
1059
1060
 
1061
1062
If active_if A is used and A is disabled or
1063
inactive, then graphical tools will generally prevent any attempt at
1064
modifying B. For example the text for B could be grayed out, and the
1065
associated checkbutton (if B is a boolean option) would be disabled.
1066
If the user needs the functionality provided by option B then it is
1067
necessary to go to option A first and manipulate it appropriately.
1068
1069
 
1070
1071
If requires A is used and A is disabled or
1072
inactive, graphical tools will still allow B to be manipulated and
1073
enabled. This would result in a new conflict which may get resolved
1074
automatically or which may need user intervention.
1075
1076
 
1077
1078
If there are hardware dependencies then an &active-if; condition is
1079
usually the preferred approach. There is no point in allowing the user
1080
to manipulate a configuration option if the corresponding
1081
functionality cannot possibly work on the currently-selected hardware.
1082
Much the same argument applies to coarse-grained dependencies, for
1083
example if an option depends on the presence of a TCP/IP stack then an
1084
active_if CYGPKG_NET condition is appropriate:
1085
it may be possible to satisfy the condition, but it requires the
1086
fairly drastic step of loading another package; further more, if the
1087
user wanted a TCP/IP stack in the configuration then it would probably
1088
have been loaded already. 
1089
 
1090
1091
If option B exists to provide additional debugging information about
1092
the functionality provided by A then again an &active-if; constraint
1093
is appropriate. There is no point in letting users enable extra
1094
debugging facilities for a feature that is not actually present.
1095
1096
 
1097
1098
The configuration system's inference engine will cope equally well
1099
with &active-if; and &requires; properties. Suppose there is a
1100
conflict because some third option depends on B. If B is
1101
active_if A then the inference engine will
1102
attempt to make A active and enabled, and then to enable B if
1103
necessary. If B requires A then the inference
1104
engine will attempt to enable B and resolve the resulting conflict by
1105
causing A to be both active and enabled. Although the inference occurs
1106
in a different order, in most cases the effect will be the same.
1107
1108
 
1109
1110
 
1111
1112
 
1113
Example
1114
1115
# Do not provide extra semaphore debugging if there are no semaphores
1116
cdl_option CYGDBG_KERNEL_INSTRUMENT_BINSEM {
1117
    active_if CYGPKG_KERNEL_SYNCH
1118
1119
}
1120
 
1121
# Avoid another level in the configuration hierarchy
1122
cdl_option CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE_RELAY {
1123
    active_if CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE
1124
1125
}
1126
 
1127
# Functionality that is only relevant if another package is loaded
1128
cdl_option CYGSEM_START_UITRON_COMPATIBILITY {
1129
    active_if CYGPKG_UITRON
1130
1131
}
1132
 
1133
# Check that the hardware or HAL provide the appropriate functionality
1134
cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
1135
    active_if CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
1136
1137
}
1138
1139
1140
 
1141
See Also
1142
1143
Property &requires;.
1144
1145
1146
 
1147
1148
 
1149
1150
1151
 
1152
1153
1154
&calculated;
1155
1156
 
1157
1158
Property &calculated;
1159
Used if the current option's value is not user-modifiable,
1160
but is calculated using a suitable CDL expression.
1161
1162
 
1163
1164
1165
cdl_option <name> {
1166
    calculated <expression>
1167
1168
}
1169
1170
1171
 
1172
Description
1173
1174
In some cases it is useful to have a configuration option whose value
1175
cannot be modified directly by the user. This can be achieved using a
1176
&calculated;, which takes a CDL expression as argument (see 
1177
linkend="language.expression"> for a description of expression
1178
syntax). The configuration system evaluates the expression when the
1179
current package is loaded and whenever there is a change to any other
1180
option referenced in the expression. The result depends on the
1181
option's flavor:
1182
1183
 
1184
1185
 
1186
flavor none
1187
1188
Options with this flavor have no value, so the &calculated;
1189
property is not applicable.
1190
1191
 
1192
flavor bool
1193
1194
If the expression evaluates to a non-zero result the option is
1195
enabled, otherwise it is disabled.
1196
1197
 
1198
flavor booldata
1199
1200
If the result of evaluating the expression is zero then the option is
1201
disabled, otherwise the option is enabled and its value is the result.
1202
1203
 
1204
flavor data
1205
1206
The value of the option is the result of evaluating the expression.
1207
1208
 
1209
1210
 
1211
1212
There are a number of valid uses for calculated options, and there are
1213
also many cases where some other CDL facility would be more
1214
appropriate. Valid uses of calculated options include the following:
1215
1216
1217
 
1218
1219
On some target hardware a particular feature may be user-configurable,
1220
while on other targets it is fixed. For example some processors can
1221
operate in either big-endian or little-endian mode, while other
1222
processors do not provide any choice. It is possible to have an
1223
option CYGARC_BIGENDIAN which is calculated in
1224
some architectural HAL packages but user-modifiable in others.
1225
1226
 
1227
1228
Calculated options can provide an alternative way for one package to
1229
affect the behavior of another one. Suppose a package may provide two
1230
possible implementations, a preferred one involving self-modifying
1231
code and a slower alternative. If the system involves a ROM bootstrap
1232
then the slower alternative must be used, but it would be
1233
inappropriate to modify the startup option in every HAL to impose
1234
constraints on this package. Instead it is possible to have a
1235
calculated option whose value is
1236
{ CYG_HAL_STARTUP == "ROM" },
1237
and which has appropriate consequences. Arguably this is a spurious
1238
example, and it should be a user choice whether or not to use
1239
self-modifying code with a &default-value; based on
1240
CYG_HAL_STARTUP, but that is for the component
1241
writer to decide.
1242
1243
 
1244
1245
Sometimes it should be possible to perform a particular test at
1246
compile-time, for example by using a C preprocessor
1247
#if construct. However the preprocessor has only
1248
limited functionality, for example it cannot perform string
1249
comparisons. CDL expressions are more powerful.
1250
1251
 
1252
1253
Occasionally a particular sub-expression may occur multiple times in
1254
a CDL script. If the sub-expression is sufficiently complex then it
1255
may be worthwhile to have a calculated option whose value is the
1256
sub-expression, and then reference that calculated option in the
1257
appropriate places.
1258
1259
 
1260
1261
 
1262
1263
Alternatives to using calculated options include the following:
1264
1265
1266
 
1267
1268
CDL interfaces are a form of
1269
calculated option intended as an abstraction mechanism. An interface
1270
can be used to express the concept of any
1271
scheduler, as opposed to a specific one such as the bitmap scheduler.
1272
1273
 
1274
1275
If a calculated option would serve only to add additional information
1276
to a configuration header file, it may be possible to achieve the same
1277
effect using a &define-proc
1278
property or one of the other properties related to header file
1279
generation.
1280
1281
 
1282
1283
 
1284
1285
1286
If the first entry in a &calculated; expression is a negative
1287
number, for example calculated -1 then this
1288
can be misinterpreted as an option instead of as part of the
1289
expression. Currently the &calculated; property does not take any
1290
options, but this may change in future. Option processing halts at the
1291
sequence --, so the desired value can be expressed
1292
safely using
1293
calculated -- -1
1294
1295
1296
 
1297
1298
1299
Some of the CDL scripts in current &eCos; releases make excessive use
1300
of calculated options. This is partly because the recommended
1301
alternatives were not always available at the time the scripts were
1302
written. It is also partly because there is still some missing
1303
functionality, for example &define-proc; properties cannot yet access
1304
the configuration data so it may be necessary to use &calculated;
1305
properties to access the data and perform the desired manipulation via
1306
a &CDL; expression. New scripts should use calculated options only in
1307
accordance with the guidelines.
1308
1309
1310
 
1311
1312
1313
For options with the booldata flavor the current CDL syntax does not
1314
allow the enabled flag and the value to be calculated separately.
1315
Functionality to permit this may be added in a future release.
1316
1317
1318
 
1319
1320
1321
It has been suggested that having options which are not
1322
user-modifiable is potentially confusing, and that a top-level
1323
cdl_constant command should be added to the
1324
language instead of or in addition to the &calculated; property. Such
1325
a change is under consideration. However because the value of a
1326
calculated option can depend on other options, it is not necessarily
1327
constant.
1328
1329
1330
 
1331
1332
 
1333
Example
1334
1335
# A constant on some target hardware, perhaps user-modifiable on other
1336
# targets.
1337
cdl_option CYGNUM_HAL_RTC_PERIOD {
1338
    display       "Real-time clock period"
1339
    flavor        data
1340
    calculated    12500
1341
}
1342
1343
1344
 
1345
See Also
1346
1347
Properties &default-value;,
1348
&flavor; and
1349
&legal-values;,
1350
1351
1352
 
1353
1354
 
1355
1356
1357
 
1358
1359
1360
&compile;
1361
1362
 
1363
1364
Property &compile;
1365
List the source files that should be built if this option
1366
is active and enabled.
1367
1368
 
1369
1370
1371
cdl_option <name> {
1372
    compile [-library=libxxx.a] <list of files>
1373
1374
}
1375
1376
1377
 
1378
Description
1379
1380
The &compile; property allows component developers to specify source
1381
files which should be compiled and added to one of the target
1382
libraries. Usually each source file will end up the library
1383
libtarget.a. It is possible for component writers
1384
to specify an alternative library for an entire package using the
1385
&library; property. Alternatively
1386
the desired library can be specified on the &compile; line itself. For
1387
example, to add a particular source file to the
1388
libextras.a library the following could be used:
1389
1390
1391
cdl_package CYGPKG_IO_SERIAL {
1392
1393
    compile -library=libextras.a common/tty.c
1394
}
1395
1396
1397
Details of the build process including such issues as compiler flags
1398
and the order in which things happen can be found in
1399
.
1400
1401
1402
&compile; properties can occur in any of &cdl-option;,
1403
&cdl-component;, &cdl-package; or &cdl-interface;. A &compile;
1404
property has effect if and only if the entity that contains it is
1405
active and enabled. Typically the body of a &cdl-package; will define
1406
any source files that need to be built irrespective of individual
1407
options, and each &cdl-component;, &cdl-option;, and &cdl-interface;
1408
will define source files that are more specific. A single &compile;
1409
property can list any number of source files, all destined for the
1410
same library. A &cdl-option; or other entity can contain multiple
1411
&compile; properties, each of which can specify a different library.
1412
It is possible for a given source file to be specified in &compile;
1413
properties for several different options, in which case the source
1414
file will get built if any of these options are active and enabled.
1415
1416
1417
If the package follows the directory
1418
layout conventions then the configuration tools will search for
1419
the specified source files first in the
1420
src subdirectory of the
1421
package, then relative to the package directory itself.
1422
1423
 
1424
1425
1426
A shortcoming of the current specification of &compile; properties is
1427
that there is no easy way to specify source files that should be built
1428
unless an option is enabled. It would sometimes be useful to be able
1429
to say: “if option A is enabled then compile
1430
file x.c, otherwise compile file
1431
y.c. There are two simple ways of achieving this:
1432
1433
1434
1435
Always compile y.c, typically by listing it in
1436
the body of the &cdl-package;, but use
1437
#ifndef A to produce an empty object file if
1438
option A is not enabled. This has the big
1439
disadvantage that the file always gets compiled and hence for some
1440
configurations builds will take longer than necessary.
1441
1442
1443
Use a &calculated; option whose value is !A, and
1444
have a compile y.c property in its body. This
1445
has the big disadvantage of adding another calculated option to the
1446
configuration.
1447
1448
1449
1450
It is likely that this will be resolved in the future, possibly by
1451
using some sort of expression as the argument to a &compile; property.
1452
1453
1454
 
1455
1456
1457
Currently it is not possible to control the priority of a &compile;
1458
property, in other words the order in which a file gets compiled
1459
relative to other build steps. This functionality might prove useful
1460
for complicated packages and should be added.
1461
1462
1463
1464
 
1465
Example
1466
1467
cdl_package CYGPKG_INFRA {
1468
    display       "Infrastructure"
1469
    include_dir   cyg/infra
1470
    description   "
1471
        Common types and useful macros.
1472
        Tracing and assertion facilities.
1473
        Package startup options."
1474
 
1475
    compile startup.cxx prestart.cxx pkgstart.cxx userstart.cxx \
1476
            dummyxxmain.cxx memcpy.c memset.c delete.cxx \
1477
            diag.cxx tcdiag.cxx
1478
}
1479
1480
1481
 
1482
See Also
1483
1484
Properties make,
1485
make_object and
1486
library.
1487
1488
1489
 
1490
1491
 
1492
1493
1494
 
1495
1496
1497
&default-value;
1498
1499
 
1500
1501
Property &default-value;
1502
Provide a default value for this option using a CDL expression.
1503
1504
 
1505
1506
1507
cdl_option <name> {
1508
    default_value <expression>
1509
1510
}
1511
1512
1513
 
1514
Description
1515
1516
The &default-value; property allows the initial value of a
1517
configuration option to depend on other configuration options. The
1518
arguments to the property should be a &CDL; expression, see
1519
 for the syntactic details.
1520
In many cases a simple constant value will suffice, for example:
1521
1522
1523
cdl_component CYGPKG_KERNEL_EXCEPTIONS {
1524
1525
    default_value 1
1526
 
1527
    cdl_option CYGSEM_KERNEL_EXCEPTIONS_DECODE {
1528
1529
        default_value 0
1530
    }
1531
}
1532
1533
1534
However it is also possible for an option's default value to depend on
1535
other options. For example the common HAL package provides some
1536
support functions that are needed by the &eCos; kernel, but are
1537
unlikely to be useful if the kernel is not being used. This
1538
relationship can be expressed using:
1539
1540
1541
cdl_option CYGFUN_HAL_COMMON_KERNEL_SUPPORT {
1542
    ...
1543
    default_value CYGPKG_KERNEL
1544
}
1545
1546
1547
If the kernel is loaded then this HAL option is automatically enabled,
1548
although the user can still disable it explicitly should this prove
1549
necessary. If the kernel is not loaded then the option is disabled,
1550
although it can still be enabled by the user if desired.
1551
&default-value; expressions can be more complicated than this if
1552
appropriate, and provide a very powerful facility for component
1553
writers who want their code to “just do the right thing”
1554
in a wide variety of configurations.
1555
1556
1557
The &CDL; configuration system evaluates the &default-value;
1558
expression when the current package is loaded and whenever there is a
1559
change to any other option referenced in the expression. The result
1560
depends on the option's flavor:
1561
1562
 
1563
1564
 
1565
flavor none
1566
1567
Options with this flavor have no value, so the &default-value;
1568
property is not applicable.
1569
1570
 
1571
flavor bool
1572
1573
If the expression evaluates to a non-zero result the option is
1574
enabled by default, otherwise it is disabled.
1575
1576
 
1577
flavor booldata
1578
1579
If the result of evaluating the expression is zero then the option is
1580
disabled, otherwise the option is enabled and its value is the result.
1581
1582
 
1583
flavor data
1584
1585
The default value of the option is the result of evaluating the
1586
expression.
1587
1588
 
1589
1590
 
1591
1592
A &cdl-option; or other entity can have at most one &default-value;
1593
property, and it is illegal to have both a &calculated; and a
1594
&default-value; property in one body. If an option does not have
1595
either a &default-value; or a &calculated; property and it does not
1596
have the flavor none then the configuration tools
1597
will assume a default value expression of 0.
1598
1599
1600
On occasion it is useful to have a configuration option
1601
A which has both a &requires; constraint on some
1602
other option B and a &default-value; expression of
1603
B. If option B is not enabled
1604
then A will also be disabled by default and no
1605
conflict arises. If B is enabled then
1606
A also becomes enabled and again no conflict
1607
arises. If a user attempts to enable B but not
1608
A then there will be a conflict. Users should be
1609
able to deduce that the two options are closely interlinked and should
1610
not be manipulated independently except in very unusual circumstances.
1611
1612
 
1613
1614
1615
If the first entry in a &default-value; expression is a negative
1616
number, for example default_value -1 then this
1617
can be misinterpreted as an option instead of as part of the
1618
expression. Currently the &default-value; property does not take any
1619
options, but this may change in future. Option processing halts at the
1620
sequence --, so the desired value can be expressed
1621
safely using
1622
default_value -- -1
1623
1624
1625
 
1626
1627
1628
In many cases it would be useful to calculate default values using
1629
some global preferences, for example:
1630
1631
1632
cdl_option CYGIMP_LIBC_STRING_PREFER_SMALL_TO_FAST {
1633
1634
    default_value CYGGLO_CODESIZE > CYGGLO_SPEED
1635
}
1636
1637
1638
Such global preference options do not yet exist, but are likely to be
1639
added in a future version.
1640
1641
1642
 
1643
1644
1645
For options with the booldata flavor the current syntax does not allow
1646
the default values of the enabled flag and the value to be controlled
1647
separately. Functionality to permit this may be added in a future
1648
release.
1649
1650
1651
 
1652
1653
 
1654
Example
1655
1656
cdl_option CYGDBG_HAL_DEBUG_GDB_THREAD_SUPPORT {
1657
    display       "Include GDB multi-threading debug support"
1658
    requires      CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT
1659
    default_value CYGDBG_KERNEL_DEBUG_GDB_THREAD_SUPPORT
1660
    description   "
1661
        This option enables some extra HAL code which is needed
1662
        to support multi-threaded source level debugging."
1663
}
1664
1665
1666
 
1667
See Also
1668
1669
Properties &calculated;,
1670
&flavor; and
1671
&legal-values;.
1672
1673
1674
 
1675
1676
 
1677
1678
1679
 
1680
1681
1682
&define;
1683
1684
 
1685
1686
Property &define;
1687
Specify additional #define symbols that
1688
should go into the owning package's configuration header file.
1689
1690
 
1691
1692
1693
cdl_option <name> {
1694
    define [-file=<filename>] [-format=<format>] <symbol>
1695
1696
}
1697
1698
1699
 
1700
Description
1701
1702
Normally the configuration system generates a single
1703
#define for each option that is active and enabled,
1704
with the defined symbol being the name of the option. These
1705
#define's go to the package's own configuration
1706
header file, for example pkgconf/kernel.h
1707
for kernel configuration options. For the majority of options this is
1708
sufficient. Sometimes it is useful to have more control over which
1709
#define's get generated.
1710
1711
1712
The &define; property can be used to generate an addition
1713
#define if the option is both active and enabled,
1714
for example:
1715
1716
1717
cdl_option CYGNUM_LIBC_STDIO_FOPEN_MAX {
1718
1719
    define FOPEN_MAX
1720
}
1721
1722
1723
If this option is given the value 40 then the following
1724
#define's will be generated in the configuration
1725
header pkgconf/libc.h:
1726
1727
1728
#define CYGNUM_LIBC_STDIO_FOPEN_MAX 40
1729
#define FOPEN_MAX 40
1730
1731
1732
The default #define can be suppressed if desired
1733
using the &no-define; property. This is useful if the symbol should
1734
only be defined in
1735
pkgconf/system.h and not in
1736
the package's own configuration header file. The value that will be
1737
used for this #define is the same as for the
1738
default one, and depends on the option's flavor as follows:
1739
1740
 
1741
1742
 
1743
flavor none
1744
1745
Options with this flavor are always enabled and have no value, so the
1746
constant 1 will be used.
1747
1748
 
1749
flavor bool
1750
1751
If the option is disabled then no #define will be
1752
generated. Otherwise the constant 1 will be used.
1753
1754
 
1755
flavor booldata
1756
1757
If the option is disabled then no #define will be
1758
generated. Otherwise the option's current value will be used.
1759
1760
 
1761
flavor data
1762
1763
The option's current value will be used.
1764
1765
 
1766
1767
 
1768
1769
For active options with the data flavor, and for
1770
active and enabled options with the booldata
1771
flavor, either one or two #define's will be
1772
generated. These take the following forms:
1773
1774
1775
#define <symbol> <value>
1776
#define <symbol>_<value>
1777
1778
1779
For the first #define it is possible to control the
1780
format used for the value using a
1781
-format=<format> option. For example, the
1782
following can be used to output some configuration data as a C string:
1783
1784
1785
cdl_option <name> {
1786
1787
    define -format="\\\"%s\\\"" <symbol>
1788
}
1789
1790
1791
The implementation of this facility involves concatenating the
1792
Tcl command format, the format string, and the
1793
string representation of the option's value, and evaluating this in a
1794
Tcl interpreter. Therefore the format string will be processed twice
1795
by a Tcl parser, and appropriate care has to be taken with quoting.
1796
1797
1798
The second #define will be generated only if is a
1799
valid C preprocessor macro symbol. By default the symbols generated by
1800
&define; properties will end up in the package's own configuration
1801
header file. The -file option can be used to
1802
specify an alternative destination. At the time of writing the only
1803
valid alternative definition is -file=system.h,
1804
which will send the output to the global configuration header file
1805
pkgconf/system.h.
1806
1807
1808
1809
Care has to be taken with the -format option.
1810
Because the Tcl interpreter's format command is
1811
used, this property is subject to any problems with the implementation
1812
of this in the Tcl library. Generally there should be no problems with
1813
string data or with integers up to 32 bits, but there may well be
1814
problems if 64-bit data is involved. This issue may be addressed in a
1815
future release.
1816
1817
1818
1819
 
1820
Example
1821
1822
cdl_component CYG_HAL_STARTUP {
1823
    display       "Startup type"
1824
    flavor        data
1825
    legal_values  {"RAM" "ROM" }
1826
    default_value {"RAM"}
1827
    no_define
1828
    define -file=system.h CYG_HAL_STARTUP
1829
1830
}
1831
1832
1833
 
1834
See Also
1835
1836
Properties &define-format;,
1837
&define-header;,
1838
&define-proc;,
1839
&if-define; and
1840
&no-define;.
1841
1842
1843
 
1844
1845
 
1846
1847
1848
 
1849
1850
1851
&define-format;
1852
1853
 
1854
1855
Property &define-format;
1856
Control how an option's value will appear in the
1857
configuration header file.
1858
1859
 
1860
1861
1862
cdl_option <name> {
1863
    define_format <format string>
1864
1865
}
1866
1867
1868
 
1869
Description
1870
1871
For active options with the data flavor, and for
1872
active and enabled options with the booldata
1873
flavor, the configuration tools will normally generate two
1874
#define's in the package's configuration header
1875
file. These take the following forms:
1876
1877
1878
#define <name> <value>
1879
#define <name>_<value>
1880
1881
1882
The &define-format; property can be used to control exactly what
1883
appears as the value for the first of these
1884
#define's. For example, the following can be used
1885
to output some configuration data as a C string:
1886
1887
1888
cdl_option <name> {
1889
1890
    define -format="\\\"%s\\\"" <symbol>
1891
}
1892
1893
1894
The implementation of &define-format; involves concatenating the Tcl
1895
command format, the format string, and the string
1896
representation of the option's value, and evaluating this in a Tcl
1897
interpreter. Therefore the format string will be processed twice by a
1898
Tcl parser, and appropriate care has to be taken with quoting.
1899
1900
1901
The second #define will be generated only if is a
1902
valid C preprocessor macro symbol, and is not affected by the
1903
&define-format; property. Also, the property is only relevant for
1904
options with the data or
1905
booldata flavor, and cannot be used in
1906
conjunction with the &no-define; property since it makes no sense to
1907
specify the format if no #define is generated.
1908
1909
1910
1911
Because the Tcl interpreter's format command is
1912
used, this property is subject to any problems with the implementation
1913
of this in the Tcl library. Generally there should be no problems with
1914
string data or with integers up to 32 bits, but there may well be
1915
problems if 64-bit data is involved. This issue may be addressed in a
1916
future release.
1917
1918
1919
 
1920
1921
 
1922
Example
1923
1924
cdl_option CYGNUM_UITRON_VER_ID     {
1925
    display       "OS identification"
1926
    flavor        data
1927
    legal_values  0 to 0xFFFF
1928
    default_value 0
1929
    define_format "0x%04x"
1930
    description   "
1931
        This value is returned in the 'id'
1932
        field of the T_VER structure in
1933
        response to a get_ver() system call."
1934
}
1935
1936
1937
 
1938
See Also
1939
1940
Properties &define;,
1941
&define-header;,
1942
&define-proc;,
1943
&if-define; and
1944
&no-define;.
1945
1946
1947
 
1948
1949
 
1950
1951
1952
 
1953
1954
1955
&define-header;
1956
1957
 
1958
1959
Property &define-header;
1960
Specify the  configuration header file that
1961
will be generated for a given package.
1962
1963
 
1964
1965
1966
cdl_package <name> {
1967
    define_header <file name>
1968
1969
}
1970
1971
1972
 
1973
Description
1974
1975
When the configuration tools generate a build tree, one of the steps
1976
is to output each package's configuration data to a header file. For
1977
example the kernel's configuration data gets output to
1978
pkgconf/kernel.h. This allows
1979
each package's source code to #include the
1980
appropriate header file and adapt to the choices made by the user.
1981
1982
1983
By default the configuration tools will synthesize a file name from
1984
the package name. This involves removing any prefix such as
1985
CYGPKG_, up to and including the first underscore,
1986
and then converting the remainder of the name to lower case. In some
1987
cases it may be desirable to use a different header file, for example
1988
an existing package may have been ported to &eCos; and the source code
1989
may already #include a particular file for
1990
configuration data. In such cases a &define-header; property can be
1991
used to specify an alternative filename.
1992
1993
1994
The &define-header; property can only be used in the body of a
1995
&cdl-package; command. It applies to a package as a whole and cannot
1996
be used at a finer grain. The name specified in a &define-header;
1997
property will always be interpreted as relative to the
1998
include/pkgconf sub-directory
1999
of the install tree.
2000
2001
2002
2003
For hardware-specific packages such as device drivers and HAL
2004
packages, the current scheme of generating a configuration header file
2005
name based on the package name may be abandoned. Instead all hardware
2006
packages would send their configuration data to a single header file,
2007
pkgconf/hardware.h. This would
2008
make it easier for code to obtain details of the current hardware, but
2009
obviously there are compatibility issues. For now it is recommended
2010
that all hardware packages specify their configuration header file
2011
explicitly.
2012
2013
2014
2015
 
2016
Example
2017
2018
cdl_package CYGPKG_HAL_ARM {
2019
    display       "ARM architecture"
2020
    parent        CYGPKG_HAL
2021
    hardware
2022
    include_dir   cyg/hal
2023
    define_header hal_arm.h
2024
2025
}
2026
2027
2028
 
2029
See Also
2030
2031
Properties &define;,
2032
&define-format;,
2033
&define-proc;,
2034
&if-define;,
2035
&no-define; and
2036
&hardware;,
2037
2038
2039
 
2040
2041
 
2042
2043
2044
 
2045
2046
2047
&define-proc;
2048
2049
 
2050
2051
Property &define-proc;
2052
Use a fragment of Tcl code to output additional data to
2053
configuration header files.
2054
2055
 
2056
2057
2058
cdl_option <name> {
2059
    define_proc <Tcl script>
2060
2061
}
2062
2063
2064
 
2065
Description
2066
2067
For most configuration options it is sufficient to have an entry in
2068
the configuration header file of the form:
2069
2070
2071
#define <name> <value>
2072
2073
2074
In some cases it is desirable to perform some more complicated
2075
processing when generating a configuration header file. There are a
2076
number of CDL properties for this, including &define-format; and
2077
&if-define;. The most flexible is &define-proc;: this allows the
2078
component writer to specify a Tcl script that gets invoked whenever
2079
the configuration system generates the header file for the owning
2080
package. The script can output anything to the header file, for
2081
example it could generate a C data structure based on various
2082
configuration values.
2083
2084
2085
At the point that the &define-proc; script is invoked there will be
2086
two channels to open files, accessible via Tcl variables:
2087
cdl_header is a channel to the current package's
2088
own header file for example
2089
pkgconf/kernel.h;
2090
cdl_system_header is a channel to the global
2091
configuration file
2092
pkgconf/system.h. A typical
2093
&define-proc; script will use the puts command to
2094
output data to one of these channels.
2095
2096
2097
&define-proc; properties only take effect if the current option is
2098
active and enabled. The default behavior of the configuration system
2099
for an option with the bool flavor corresponds to
2100
the following &define-proc;:
2101
2102
2103
    cdl_option XXX {
2104
2105
        define_proc {
2106
            puts $cdl_header "#define XXX 1"
2107
        }
2108
}
2109
2110
2111
2112
In the current implementation it is not possible for a &define-proc;
2113
property to examine the current values of various configuration
2114
options and adapt accordingly. This is a major limitation, and will be
2115
addressed in future versions of the configuration tools.
2116
2117
2118
 
2119
2120
 
2121
Example
2122
2123
cdl_package CYGPKG_HAL_ARM_PID {
2124
    display       "ARM PID evaluation board"
2125
    parent        CYGPKG_HAL_ARM
2126
    define_header hal_arm_pid.h
2127
    include_dir   cyg/hal
2128
    hardware
2129
 
2130
    define_proc {
2131
        puts $::cdl_system_header "#define CYGBLD_HAL_TARGET_H   <pkgconf/hal_arm.h>"
2132
        puts $::cdl_system_header "#define CYGBLD_HAL_PLATFORM_H <pkgconf/hal_arm_pid.h>"
2133
        puts $::cdl_header ""
2134
        puts $::cdl_header "#define HAL_PLATFORM_CPU    \"ARM 7TDMI\""
2135
        puts $::cdl_header "#define HAL_PLATFORM_BOARD  \"PID\""
2136
        puts $::cdl_header "#define HAL_PLATFORM_EXTRA  \"\""
2137
        puts $::cdl_header ""
2138
    }
2139
2140
}
2141
2142
2143
 
2144
See Also
2145
2146
Properties &define;,
2147
&define-format;,
2148
&define-header;,
2149
&if-define; and
2150
&no-define;.
2151
2152
2153
 
2154
2155
 
2156
2157
2158
 
2159
2160
2161
&description;
2162
2163
 
2164
2165
Property &description;
2166
Provide a textual description for an option.
2167
2168
 
2169
2170
2171
cdl_option <name> {
2172
    description <text>
2173
2174
}
2175
2176
2177
 
2178
Description
2179
2180
Users can only be expected to manipulate configuration options
2181
sensibly if they are given sufficient information about these options.
2182
There are three properties which serve to explain an option in plain
2183
text: the &display; property gives a textual alias for an option,
2184
which is usually more comprehensible than something like
2185
CYGPKG_LIBC_TIME_ZONES; the &description; property
2186
gives a longer description, typically a paragraph or so; the &doc;
2187
property specifies the location of additional on-line documentation
2188
related to a configuration option. In the context of a graphical tool
2189
the &display; string will be the primary way for users to identify
2190
configuration options; the &description; paragraph will be visible
2191
whenever the option is selected; the on-line documentation will only
2192
be accessed when the user explicitly requests it.
2193
2194
2195
At present there is no way of providing any sort of formatting mark-up
2196
in a description. It is possible that future versions of the
2197
configuration tools will provide some control over the way the
2198
description text gets rendered.
2199
2200
2201
 
2202
Example
2203
2204
cdl_option CYGDBG_INFRA_DEBUG_TRACE_MESSAGE {
2205
    display       "Use trace text"
2206
    default_value 1
2207
    description   "
2208
        All trace calls within eCos contain a text message
2209
        which should give some information about the circumstances.
2210
        These text messages will end up being embedded in the
2211
        application image and hence there is a significant penalty
2212
        in terms of image size.
2213
        It is possible to suppress the use of these messages by
2214
        disabling this option.
2215
        This results in smaller code size, but there is less
2216
        human-readable information available in the trace output,
2217
        possibly only filenames and line numbers."
2218
}
2219
2220
2221
 
2222
See Also
2223
2224
Properties &display; and
2225
&doc;.
2226
2227
2228
 
2229
2230
 
2231
2232
2233
 
2234
2235
2236
&display;
2237
2238
 
2239
2240
Property &display;
2241
Provide a short string describing this option.
2242
2243
 
2244
2245
2246
cdl_option <name> {
2247
    display <string>
2248
2249
}
2250
2251
2252
 
2253
Description
2254
2255
Users can only be expected to manipulate configuration options
2256
sensibly if they are given sufficient information about these options.
2257
There are three properties which serve to explain an option in plain
2258
text: the &display; property gives a textual alias for an option,
2259
which is usually more comprehensible than something like
2260
CYGPKG_LIBC_TIME_ZONES; the &description; property
2261
gives a longer description, typically a paragraph or so; the &doc;
2262
property specifies the location of additional on-line documentation
2263
related to a configuration option. In the context of a graphical tool
2264
the &display; string will be the primary way for users to identify
2265
configuration options; the &description; paragraph will be visible
2266
whenever the option is selected; the on-line documentation will only
2267
be accessed when the user explicitly requests it.
2268
2269
2270
 
2271
Example
2272
2273
cdl_option CYGNUM_KERNEL_SYNCH_MBOX_QUEUE_SIZE {
2274
    display       "Message box queue size"
2275
    flavor        data
2276
    legal_values  1 to 65535
2277
    default_value 10
2278
    description   "
2279
        This configuration option controls the number of messages
2280
        that can be queued in a message box before a non-blocking
2281
        put() operation will fail or a blocking put() operation will
2282
        block. The cost in memory is one pointer per message box for
2283
        each possible message."
2284
}
2285
2286
2287
 
2288
See Also
2289
2290
Properties &description; and
2291
&doc;.
2292
2293
2294
 
2295
2296
 
2297
2298
2299
 
2300
2301
2302
&doc;
2303
2304
 
2305
2306
Property &doc;
2307
The location of online-documentation for a configuration option.
2308
2309
 
2310
2311
2312
cdl_option <name> {
2313
    doc <URL;>
2314
2315
}
2316
2317
2318
 
2319
Description
2320
2321
Users can only be expected to manipulate configuration options
2322
sensibly if they are given sufficient information about these options.
2323
There are three properties which serve to explain an option in plain
2324
text: the &display; property gives a textual alias for an option,
2325
which is usually more comprehensible than something like
2326
CYGPKG_LIBC_TIME_ZONES; the &description; property
2327
gives a longer description, typically a paragraph or so; the &doc;
2328
property specifies the location of additional on-line documentation
2329
related to a configuration option. In the context of a graphical tool
2330
the &display; string will be the primary way for users to identify
2331
configuration options; the &description; paragraph will be visible
2332
whenever the option is selected; the on-line documentation will only
2333
be accessed when the user explicitly requests it.
2334
2335
2336
The documentation may be an absolute URL, but more generally the
2337
on-line documentation will be shipped with the package and can be
2338
accessed via a relative URL. If the package follows the 
2339
linkend="package.hierarchy">directory layout conventions then
2340
the configuration tools will search for the specified html file
2341
first in the doc subdirectory
2342
of the package, then relative to the package directory itself. The URL
2343
may contain a # character to specify an anchor
2344
within a page.
2345
2346
2347
2348
At the time of writing the &eCos; packages in the standard
2349
distribution do not conform to the directory layout conventions when
2350
it comes to the documentation. Instead of organizing the documentation
2351
on a per-package basis and placing it in the corresponding
2352
doc sub-directories, all the
2353
documentation is kept in a central location. This should get addressed
2354
in a future release of the system. Third party component writers
2355
should follow the layout conventions.
2356
2357
2358
2359
 
2360
Example
2361
2362
cdl_package CYGPKG_KERNEL {
2363
    display       "eCos kernel"
2364
    doc           ref/ecos-ref.4.html
2365
    include_dir   cyg/kernel
2366
    description   "
2367
        This package contains the core functionality of the eCos
2368
        kernel. It relies on functionality provided by various HAL
2369
        packages and by the eCos infrastructure. In turn the eCos
2370
        kernel provides support for other packages such as the device
2371
        drivers and the uITRON compatibility layer."
2372
2373
}
2374
2375
2376
 
2377
See Also
2378
2379
Properties &description; and
2380
&display;.
2381
2382
2383
 
2384
2385
 
2386
2387
2388
 
2389
2390
2391
&flavor;
2392
2393
 
2394
2395
Property &flavor;
2396
Specify the nature of a configuration option.
2397
2398
 
2399
2400
2401
cdl_option <name> {
2402
    flavor <flavor>
2403
2404
}
2405
2406
2407
 
2408
Description
2409
2410
The state of a &CDL; configuration option is a somewhat complicated
2411
concept. This state determines what happens when a build tree is
2412
generated: it controls what files get built and what
2413
#define's end up in configuration header files. The
2414
state also controls the values used during expression evaluation. The
2415
key concepts are:
2416
2417
2418
2419
An option may or may not be loaded into the current configuration.
2420
However it is still possible for packages to reference options which
2421
are not loaded in a &requires; constraint or other expression. If an
2422
option is not loaded then it will have no direct effect on the build
2423
process, and 0 will be used for expression
2424
evaluation.
2425
2426
 
2427
2428
Even if an option is loaded it may still be inactive. Usually this is
2429
controlled by the option's location in the configuration hierarchy. If
2430
an option's parent is active and enabled then the option will normally
2431
be active. If the parent is either inactive or disabled then the
2432
option will be inactive. For example, if kernel timeslicing is diabled
2433
then the option CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS
2434
is irrelevant and must have no effect. The &active-if; property can be
2435
used to specify additional constraints. If an option is inactive then
2436
it will have no direct effect on the build process, in other words it
2437
will not cause any files to get built or #define's
2438
to be generated. For the purposes of expression evaluation an inactive
2439
option has a value of 0.
2440
2441
 
2442
2443
An option may be enabled or disabled. Most options are boolean in
2444
nature, for example a particular function may get inlined or it may
2445
involve a full procedure call. If an option is disabled then it has no
2446
direct effect on the build process, and for the purposes of expression
2447
evaluation it has a value of 0.
2448
2449
2450
An option may also have additional data associated with it, for
2451
example a numerical value used to control the size of an array.
2452
2453
2454
2455
Most options are boolean in nature and do not have any additional
2456
associated data. For some options only the data part makes sense and
2457
users should be unable to manipulate the enabled/disabled part of the
2458
state. For a comparatively small number of options it makes sense to
2459
have the ability to disable that option or to enable it and associate
2460
data as well. Finally, when constructing an option hierarchy it is
2461
occasionally useful to have entities which serve only as placeholders.
2462
The &flavor; property can be used to control all this. There are four
2463
possible values. It should be noted that the active or inactive state
2464
of an option takes priority over the flavor: if an option is inactive
2465
then no #define's will be generated and any
2466
build-related properties such as &compile; will be ignored.
2467
2468
 
2469
2470
 
2471
flavor none
2472
2473
The none is intended primarily for placeholder
2474
components in the hierarchy, although it can be used for other
2475
purposes. Options with this flavor are always enabled and do not have
2476
any additional data associated with them, so there is no way for users
2477
to modify the option. For the purposes of expression evaluation an
2478
option with flavor none always has the value
2479
1. Normal #define processing
2480
will take place, so typically a single #define will
2481
be generated using the option name and a value of
2482
1. Similarly build-related properties such as
2483
&compile; will take effect.
2484
2485
 
2486
flavor bool
2487
2488
Boolean options can be either enabled or disabled, and there is no
2489
additional data associated with them. If a boolean option is disabled
2490
then no #define will be generated and any
2491
build-related properties such as &compile; will be ignored. For the
2492
purposes of expression evaluation a disabled option has the value
2493
0. If a boolean option is enabled then normal
2494
#define processing will take place, all
2495
build-related properties take effect, and the option's value will be
2496
1.
2497
2498
 
2499
flavor data
2500
2501
Options with this flavor are always enabled, and have some additional
2502
data associated with them which can be edited by the user. This data
2503
can be any sequence of characters, although in practice the
2504
&legal-values; property will often be used to impose constraints. In
2505
appropriate contexts such as expressions the configuration tools will
2506
attempt to interpret the data as integer or floating point numbers.
2507
Since an option with the data flavor cannot be
2508
disabled, normal #define processing takes place and
2509
the data will be used for the value. Similarly all build-related
2510
properties take effect, and the option's value for the purposes of
2511
expression evaluation is the data.
2512
2513
 
2514
flavor booldata
2515
2516
This combines the bool and data
2517
flavors. The option may be enabled or disabled, and in addition the
2518
option has some associated data. If the option is disabled then no
2519
#define will be generated, the build-related
2520
properties have no effect, and for the purposes of expression
2521
evaluation the option's value is 0. If the option
2522
is enabled then a #define will be generated using
2523
the data as the value, all build-related properties take effect, and
2524
the option's value for the purposes of expression evaluation is the
2525
data. If 0 is legal data then it is not possible to
2526
distinguish this case from the option being disabled or inactive.
2527
2528
 
2529
2530
 
2531
2532
Options and components have the bool flavor by
2533
default, but this can be changed as desired. Packages always have the
2534
booldata flavor, and this cannot be changed.
2535
Interfaces have the data flavor by default, since
2536
the value of an interface is a count of the number of active and
2537
enabled interfaces, but they can be given the bool
2538
or booldata flavors.
2539
2540
 
2541
2542
2543
The expression syntax needs to be extended to allow the loaded,
2544
active, enabled and data aspects of an option's state to be examined
2545
individually. This would allow component writers to distinguish
2546
between a disabled booldata option and an enabled
2547
one which has a value of 0. Such an enhancement to
2548
the expression syntax may also prove useful in other circumstances.
2549
2550
2551
 
2552
2553
 
2554
Example
2555
2556
 
2557
cdl_component CYGPKG_LIBM_COMPATIBILITY {
2558
 
2559
    cdl_component CYGNUM_LIBM_COMPATIBILITY {
2560
        flavor booldata
2561
2562
 
2563
        cdl_option CYGNUM_LIBM_COMPAT_DEFAULT {
2564
            flavor data
2565
2566
        }
2567
    }
2568
 
2569
2570
}
2571
 
2572
cdl_component CYGPKG_LIBM_TRACE {
2573
    flavor        bool
2574
2575
}
2576
2577
2578
 
2579
See Also
2580
2581
Properties &calculated;,
2582
&default-value; and
2583
&legal-values;,
2584
2585
2586
 
2587
2588
 
2589
2590
2591
 
2592
2593
2594
&hardware;
2595
2596
 
2597
2598
Property &hardware;
2599
Specify that a package is tied to specific hardware.
2600
2601
 
2602
2603
2604
cdl_option <name> {
2605
    active_if <condition>
2606
2607
}
2608
2609
2610
 
2611
Description
2612
2613
Some packages such as device drivers and HAL packages are
2614
hardware-specific, and generally it makes no sense to add such
2615
packages to a configuration unless the corresponding hardware is
2616
present on your target system. Typically hardware package selection
2617
happens automatically when you select your target. The &hardware;
2618
property can be used in the body of a &cdl-package; command to
2619
indicate that the package is hardware-specific.
2620
2621
 
2622
2623
2624
At the time of writing the &hardware; property is largely ignored by
2625
the configuration tools, but this may change in future. Amongst other
2626
possible changes, for hardware-specific packages such as device
2627
drivers and HAL packages, the current scheme of generating a
2628
configuration header file name based purely on the package name may be
2629
abandoned. Instead all hardware packages would send their
2630
configuration data to a single header file, 
2631
class="HeaderFile">pkgconf/hardware.h. This would make it
2632
easier for code to obtain details of the current hardware, but
2633
obviously there are compatibility issues. For now it is recommended
2634
that all hardware packages specify their configuration header file
2635
explicitly.
2636
2637
2638
2639
 
2640
Example
2641
2642
cdl_package CYGPKG_HAL_ARM {
2643
    display       "ARM architecture"
2644
    parent        CYGPKG_HAL
2645
    hardware
2646
    include_dir   cyg/hal
2647
    define_header hal_arm.h
2648
2649
}
2650
2651
2652
 
2653
See Also
2654
2655
Property &define-header;, and
2656
command &cdl-package;.
2657
2658
2659
 
2660
2661
 
2662
2663
2664
 
2665
2666
2667
&if-define;
2668
2669
 
2670
2671
Property &if-define;
2672
Output a common preprocessor construct to a configuration
2673
header file.
2674
2675
 
2676
2677
2678
cdl_option <name> {
2679
    if_define [-file=<filename>] <symbol1> <symbol2>
2680
2681
}
2682
2683
2684
 
2685
Description
2686
2687
The purpose of the &if-define; property is best explained by an
2688
example. Suppose you want finer-grained control over assertions, say
2689
on a per-package or even a per-file basis rather than globally. The
2690
assertion macros can be defined by an exported header file in an
2691
infrastructure package, using code like the following:
2692
2693
2694
#ifdef CYGDBG_USE_ASSERTS
2695
# define CYG_ASSERT( _bool_, _msg_ )    \
2696
        CYG_MACRO_START                 \
2697
        if ( ! ( _bool_ ) )             \
2698
            CYG_ASSERT_DOCALL( _msg_ ); \
2699
        CYG_MACRO_END
2700
#else
2701
# define CYG_ASSERT( _bool_, _msg_ ) CYG_EMPTY_STATEMENT
2702
#endif
2703
2704
2705
Assuming this header file is #include'd directly or
2706
indirectly by any code which may need to be built with assertions
2707
enabled, the challenge is now to control whether or not
2708
CYGDBG_USE_ASSERTS is defined for any given source
2709
file. This is the purpose of the &if-define; property:
2710
2711
2712
cdl_option CYGDBG_KERNEL_USE_ASSERTS {
2713
2714
    if_define CYGSRC_KERNEL CYGDBG_USE_ASSERTS
2715
    requires  CYGDBG_INFRA_ASSERTION_SUPPORT
2716
}
2717
2718
2719
If this option is active and enabled then the kernel's configuration
2720
header file would end up containing the following:
2721
2722
2723
#ifdef CYGSRC_KERNEL
2724
# define CYGDBG_USE_ASSERTS 1
2725
#endif
2726
2727
2728
Kernel source code can now begin with the following construct:
2729
2730
2731
#define CYGSRC_KERNEL 1
2732
#include <pkgconf/kernel.h>
2733
#include <cyg/infra/cyg_ass.h>
2734
2735
2736
The configuration option only affects kernel source code, assuming
2737
nothing else #define's the symbol
2738
CYGSRC_KERNEL. If the per-package assertion option
2739
is disabled then CYGDBG_USE_ASSERTS will not get
2740
defined. If the option is enabled then
2741
CYGDBG_USE_ASSERTS will get defined and assertions
2742
will be enabled for the kernel sources. It is possible to use the same
2743
mechanism for other facilities such as tracing, and to apply it at a
2744
finer grain such as individual source files by having multiple options
2745
with &if-define; properties and multiple symbols such as
2746
CYGSRC_KERNEL_SCHED_BITMAP_CXX.
2747
2748
2749
The &if-define; property takes two arguments, both of which must be
2750
valid C preprocessor symbols. If the current option is active and
2751
enabled then three lines will be output to the configuration header
2752
file:
2753
2754
2755
#ifdef <symbol1>
2756
# define <symbol2>
2757
#endif
2758
2759
2760
If the option is inactive or disabled then these lines will not be
2761
output. By default the current package's configuration header file
2762
will be used, but it is possible to specify an alternative destination
2763
using a -file option. At present the only
2764
legitimate alternative destination is system.h, the
2765
global configuration header. &if-define; processing happens in
2766
addition to, not instead of, the normal #define
2767
processing or the handling of other header-file related properties.
2768
2769
2770
2771
The infrastructure in the current &eCos; release does not yet work
2772
this way. In future it may do so, and the intention is that suitable
2773
configuration options get generated semi-automatically by the
2774
configuration system rather than having to be defined explicitly.
2775
2776
2777
2778
2779
As an alternative to changing the configuration, updating the build
2780
tree, and so on, it is possible to enable assertions by editing a
2781
source file directly, for example:
2782
2783
2784
#define CYGSRC_KERNEL 1
2785
#define CYGDBG_USE_ASSERTS 1
2786
#include <pkgconf/kernel.h>
2787
#include <cyg/infra/cyg_ass.h>
2788
2789
2790
The assertion header file does not care whether
2791
CYGDBG_USE_ASSERTS is #define'd
2792
via a configuration option or by explicit code. This technique can be
2793
useful to component writers when debugging their source code, although
2794
care has to be taken to remove any such #define's
2795
later on.
2796
2797
2798
 
2799
2800
 
2801
Example
2802
2803
cdl_option CYGDBG_KERNEL_USE_ASSERTS {
2804
    display "Assertions in the kernel package"
2805
2806
    if_define CYGSRC_KERNEL CYGDBG_USE_ASSERTS
2807
    requires  CYGDBG_INFRA_ASSERTION_SUPPORT
2808
}
2809
2810
2811
 
2812
See Also
2813
2814
Properties &define;,
2815
&define-format;,
2816
&define-header;,
2817
&define-proc; and
2818
&no-define;.
2819
2820
2821
 
2822
2823
 
2824
2825
2826
 
2827
2828
2829
&implements;
2830
2831
 
2832
2833
Property &implements;
2834
Enabling this option provides one instance of a more
2835
general interface.
2836
2837
 
2838
2839
2840
cdl_option <name> {
2841
    implements <interface>
2842
2843
}
2844
2845
2846
 
2847
Description
2848
2849
The &CDL; interface concept provides an abstraction mechanism that can
2850
be useful in many different circumstances. Essentially an interface is
2851
a calculated option whose value is the number of active and enabled
2852
options which implement that interface. For example the interface
2853
CYGINT_KERNEL_SCHEDULER has a value corresponding
2854
to the number of schedulers in the system, typically just one.
2855
2856
2857
The &implements; property takes a single argument, which should be the
2858
name of an interface. This interface may be defined in the same
2859
package as the implementor or in some other package. In the latter
2860
case it may sometimes be appropriate for the implementor or the
2861
implementor's package to have a &requires; property for the package
2862
containing the interface. An option may contain multiple &implements;
2863
properties. It is possible for an option to implement a given
2864
interface multiple times, and on occasion this is actually useful.
2865
2866
2867
 
2868
Example
2869
2870
cdl_option CYGSEM_KERNEL_SCHED_MLQUEUE {
2871
    display       "Multi-level queue scheduler"
2872
    default_value 1
2873
    implements    CYGINT_KERNEL_SCHEDULER
2874
2875
}
2876
2877
2878
 
2879
See Also
2880
2881
Command &cdl-interface;.
2882
2883
2884
 
2885
2886
 
2887
2888
2889
 
2890
2891
2892
&include-dir;
2893
2894
 
2895
2896
Property &include-dir;
2897
Specify the desired location of a package's exported
2898
header files in the install tree.
2899
2900
 
2901
2902
2903
cdl_package <name> {
2904
    include_dir <sub-directory>
2905
2906
}
2907
2908
2909
 
2910
Description
2911
2912
Most packages export one or more header files defining their public
2913
interface. For example the C library exports header files such as
2914
stdio.h and
2915
ctype.h.
2916
If the package follows the directory
2917
layout conventions then the exported header files will normally
2918
be found in the package's
2919
include sub-directory.
2920
Alternatively the &include-files; property can be used to specify
2921
which header files should be exported.
2922
2923
2924
By default a package's exported header files will be copied to
2925
the include sub-directory of
2926
the install tree. This is correct for packages like the C library
2927
because that is the correct location for files such as
2928
stdio.h. However to reduce the
2929
probability of name clashes it is desirable for packages to use
2930
different sub-directories, for example infrastructure header files get
2931
copied to include/cyg/infra
2932
rather than to the top-level
2933
include directory itself.
2934
2935
2936
It would be possible to replicate these sub-directories in each
2937
package's source tree, such that the infrastructure header file
2938
sources lived in
2939
include/cyg/infra in the source
2940
tree as well as in the install tree. This would make things more
2941
difficult for the package developers. Instead it is possible to
2942
specify the desired install tree sub-directory using an &include-dir;
2943
property, for example include_dir cyg/infra.
2944
2945
2946
The &include-dir; property can only be used in the body of a
2947
&cdl-package; command, since it applies to all of the header files
2948
exported by a package, and only one &include-dir; property can be
2949
used. If there is no &include-dir; property then exported header files
2950
will end up in the top-level include
2951
directory of the install tree.
2952
2953
2954
 
2955
Example
2956
2957
cdl_package CYGPKG_INFRA {
2958
    display       "Infrastructure"
2959
    include_dir   cyg/infra
2960
    description   "
2961
        Common types and useful macros.
2962
        Tracing and assertion facilities.
2963
        Package startup options."
2964
2965
}
2966
2967
2968
 
2969
See Also
2970
2971
Property &include-files;, and
2972
command &cdl-package;.
2973
2974
2975
 
2976
2977
 
2978
2979
2980
 
2981
2982
2983
&include-files;
2984
2985
 
2986
2987
Property &include-files;
2988
List the header files that are exported by a package.
2989
2990
 
2991
2992
2993
cdl_package <name> {
2994
    include_files <file1> …
2995
2996
}
2997
2998
2999
 
3000
Description
3001
3002
Most packages export one or more header files defining their public
3003
interface. For example the C library exports header files such as
3004
stdio.h and
3005
ctype.h.
3006
If the package follows the directory
3007
layout conventions then the exported header files will normally
3008
be found in the package's
3009
include sub-directory. For
3010
packages which do not follow these conventions, typically simple ones
3011
for which a complicated sub-directory hierarchy is undesirable, there
3012
has to be an alternative way of specifying which header file or files
3013
define the public interface. The &include-files; property provides
3014
support for this.
3015
3016
3017
By default, if a package does not have an
3018
include subdirectory and it
3019
does not have an &include-files; property then all files with a suffix
3020
of .h, .hxx,
3021
.inl or .inc will be treated as
3022
public header files. However some of these may be private files
3023
containing implementation details. If there is an
3024
&include-files; property then only the files listed in that property
3025
will be exported.
3026
3027
3028
If a package should not export any header files but does contain
3029
private implementation headers, an &include-files; property with no
3030
arguments should be used.
3031
3032
3033
 
3034
Example
3035
3036
cdl_package <SOME_PACKAGE> {
3037
3038
    include_dir   <some directory>
3039
    include_files interface.h
3040
}
3041
 
3042
cdl_package <ANOTHER_PACKAGE> {
3043
3044
    include_files
3045
}
3046
3047
3048
 
3049
See Also
3050
3051
Property &include-dir;, and
3052
command &cdl-package;.
3053
3054
3055
 
3056
3057
 
3058
3059
3060
 
3061
3062
3063
&legal-values;
3064
3065
 
3066
3067
Property &legal-values;
3068
Impose constraints on the possible values for an option.
3069
3070
 
3071
3072
3073
cdl_option <name> {
3074
    legal_values <list expression>
3075
3076
}
3077
3078
3079
 
3080
Description
3081
3082
Options with the data or
3083
booldata flavors can have an arbitrary sequence of
3084
characters as their data. In nearly all cases some restrictions have
3085
to be imposed, for example the data should correspond to a number
3086
within a certain range, or it should be one of a small number of
3087
constants. The &legal-values; property can be used to impose such
3088
constraints. The arguments to the property should be a &CDL; list
3089
expression, see  for the
3090
syntactic details. Common examples include:
3091
3092
3093
    legal_values 0 to 0x7fff
3094
    legal_values 9600 19200 38400
3095
    legal_values { "RAM" "ROM" }
3096
3097
3098
The &legal-values; property can only be used for options with the
3099
data or booldata flavors, since
3100
it makes little sense to further constrain the legal values of a
3101
boolean option. An option can have at most one &legal-values;
3102
property.
3103
3104
 
3105
3106
3107
If the first entry in a &legal-values; list expression is a negative
3108
number, for example
3109
legal_values -1 to 1  then this can
3110
be misinterpreted as an option instead of as part of the expression.
3111
Currently the &legal-values; property does not take any options, but
3112
this may change in future. Option processing halts at the sequence
3113
--, so the desired range can be expressed safely
3114
using legal_values -- -1 to 1
3115
3116
3117
 
3118
3119
3120
Architectural HAL packages should provide constants which can be used
3121
in &legal-values; list expressions. For example it should be possible
3122
to specify a numeric range such as
3123
0 to CYGARC_MAXINT, rather than
3124
hard-wiring numbers such as 0x7fffffff which may
3125
not be valid on all targets. Current HAL packages do not define such
3126
constants.
3127
3128
3129
 
3130
3131
3132
The &legal-values; property is restricted mainly to numerical ranges
3133
and simple enumerations, and cannot cope with more complicated data
3134
items. Future versions of the configuration system will provide
3135
additional data validation facilities, for example a
3136
check_proc property which specifies a Tcl script
3137
that can be used to perform the validation.
3138
3139
3140
3141
 
3142
Example
3143
3144
cdl_option CYGNUM_LIBC_TIME_STD_DEFAULT_OFFSET {
3145
    display       "Default Standard Time offset"
3146
    flavor        data
3147
    legal_values  -- -90000 to 90000
3148
    default_value -- 0
3149
    description   "
3150
        This option controls the offset from UTC in
3151
        seconds when in local Standard Time. This
3152
        value can be positive or negative. It
3153
        can also be set at run time using the
3154
        cyg_libc_time_setzoneoffsets() function."
3155
}
3156
3157
3158
 
3159
See Also
3160
3161
Properties &calculated;,
3162
&default-value;, and
3163
&flavor;.
3164
3165
3166
 
3167
3168
 
3169
3170
3171
 
3172
3173
3174
&library;
3175
3176
 
3177
3178
Property &library;
3179
Specify which library should contain the object files
3180
generated by building this package.
3181
3182
 
3183
3184
3185
cdl_package <name> {
3186
    library <library name>
3187
3188
}
3189
3190
3191
 
3192
Description
3193
3194
By default all object files that get built for all packages end up in
3195
a single library, libtarget.a. This makes things
3196
easier for the typical application developer because it is only
3197
necessary to link with a single library, rather than with separate
3198
libraries for each package. It is possible to specify an alternative
3199
library for specific files as an option to the &compile; and
3200
&make-object; properties, and there is one library 
3201
linkend="build">libextras.a which serves a
3202
specific purpose in the build system. The &library; property allows an
3203
alternative library to be specified for all the object files that will
3204
be generated for a given package.
3205
3206
3207
The use of the &library; property should be avoided, since it makes
3208
things more difficult for application developers. The property is
3209
intended only for special cases, for example if there are legal
3210
objections to mingling object files from different packages in a
3211
single library. It could also be used to work around name clash
3212
problems if two packages happen to define an exported symbol with the
3213
same name, but any attempt to use multiple libraries in this way is
3214
error-prone and should be avoided.
3215
3216
3217
The &library; property takes a single argument, the name of a library,
3218
which should follow the standard naming convention of
3219
lib<something>.a. A &library; property can
3220
only occur in the body of a &cdl-package; command and applies to all
3221
object files generated for that package (except where explicitly
3222
overwritten with a -library= option to one of the
3223
build-related properties). A &cdl-package; body can contain at most
3224
one &library; property.
3225
3226
3227
 
3228
Example
3229
3230
cdl_package <SOME_PACKAGE> {
3231
3232
    library  libSomePackage.a
3233
}
3234
3235
3236
 
3237
See Also
3238
3239
Properties &compile;,
3240
&make;, and
3241
&make-object;,
3242
command &cdl-package;.
3243
3244
3245
 
3246
3247
 
3248
3249
3250
 
3251
3252
3253
&make;
3254
3255
 
3256
3257
Property &make;
3258
Define an additional custom build step associated with an
3259
option, resulting in a target that should not go directly into a library.
3260
3261
 
3262
3263
3264
cdl_option <name> {
3265
    make [-priority=<pri>]  {
3266
        <custom build step>
3267
    }
3268
3269
}
3270
3271
3272
 
3273
Description
3274
3275
When building an &eCos; configuration the primary target is a single
3276
library, libtarget.a. In some cases it is
3277
necessary to build some additional targets. For example architectural
3278
HAL packages typically build a linker script and some start-up code.
3279
Such additional targets can be specified by a &make; property. Any
3280
option can have one or more &make; properties, although typically such
3281
properties only occur in the body of a &cdl-package; command.
3282
3283
3284
The &make; property takes a single argument, which resembles a
3285
makefile rule: it consists of a target, a list of dependencies, and
3286
one or more commands that should be executed. However the argument is
3287
not a makefile fragment, and custom build steps may get executed in
3288
build environments that do not involve make. For full details of
3289
custom build steps see .
3290
3291
3292
3293
The exact syntax and limitations of custom build steps have not yet
3294
been finalized, and are subject to change in future versions of the
3295
configuration tools.
3296
3297
3298
3299
The &make; property takes an optional priority argument indicating the
3300
order in which build steps take place. This priority complements the
3301
dependency list, and avoids problems with packages needing to know
3302
details of custom build steps in other packages (which may change
3303
between releases). The defined order is:
3304
3305
3306
 
3307
Priority 0
3308
3309
The header files exported by the current set of packages are copied
3310
to the appropriate places in the
3311
include subdirectory of the
3312
install tree. Any unnecessary copies are avoided, to prevent rebuilds
3313
of package and application source modules caused by header file dependencies.
3314
3315
3316
A possible future enhancement of the build system may result in the
3317
build and install trees being updated automatically if there has been
3318
a change to the ecos.ecc configuration savefile.
3319
3320
3321
 
3322
Priority 100
3323
3324
All files specified in &compile; properties will get built, producing
3325
the corresponding object files. In addition any custom build steps
3326
defined by &make-object; properties get executed, unless there is
3327
a -priority= option.
3328
3329
3330
 
3331
Priority 200
3332
3333
The libraries now get built using the appropriate object files.
3334
3335
3336
 
3337
Priority 300
3338
3339
Any custom build steps specified by &make; properties now get
3340
executed, unless the priority for a particular build step is changed
3341
from its default.
3342
3343
3344
3345
 
3346
3347
For example, if a custom build step needs to take place before any of
3348
the normal source files get compiled then it should be given a
3349
priority somewhere between 0 and 100. If a custom build step involves
3350
post-processing an object file prior to its incorporation into a
3351
library then a priority between 100 and 200 should be used.
3352
3353
 
3354
3355
 
3356
Example
3357
3358
cdl_package CYGPKG_HAL_MN10300_AM33 {
3359
    display       "MN10300 AM33 variant"
3360
    parent        CYGPKG_HAL_MN10300
3361
    implements    CYGINT_HAL_MN10300_VARIANT
3362
    hardware
3363
    include_dir   cyg/hal
3364
    define_header hal_mn10300_am33.h
3365
    description   "
3366
           The MN10300 AM33 variant HAL package provides generic
3367
           support for this processor architecture. It is also
3368
           necessary to select a specific target platform HAL
3369
           package."
3370
 
3371
    make {
3372
        <PREFIX>/lib/target.ld: <PACKAGE>/src/mn10300_am33.ld
3373
        $(CC) -E -P -Wp,-MD,target.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
3374
        @echo $@ ": \\" > $(notdir $@).deps
3375
        @tail +2 target.tmp >> $(notdir $@).deps
3376
        @echo >> $(notdir $@).deps
3377
        @rm target.tmp
3378
    }
3379
}
3380
3381
3382
 
3383
See Also
3384
3385
Properties compile,
3386
make_object and
3387
library.
3388
3389
3390
 
3391
3392
 
3393
3394
3395
 
3396
3397
3398
&make-object;
3399
3400
 
3401
3402
Property &make-object;
3403
Define a custom build step, resulting in an object file
3404
that should go into a library.
3405
3406
 
3407
3408
3409
cdl_option <name> {
3410
    make_object [-library=<library>] [-priority=<pri>]  {
3411
        <custom build step>
3412
    }
3413
3414
}
3415
3416
3417
 
3418
Description
3419
3420
When building an &eCos; configuration the primary target is a single
3421
library, libtarget.a. Most of the object files
3422
which go into this library will be generated as a result of &compile;
3423
properties. Occasionally it may be necessary to have special build
3424
steps for a given object file, and this can be achieved with a
3425
&make-object; property. The use of this property should be avoided
3426
whenever possible because it greatly increases the risk of portability
3427
problems, both on the host side because of possible problems with the
3428
tools, and on the target side because a custom build step may not
3429
allow adequately for the wide variety of architectures supported by
3430
&eCos;.
3431
3432
3433
The &make-object; property takes a single argument, which resembles a
3434
makefile rule: it consists of a target, a list of dependencies, and
3435
one or more commands that should be executed. The target should be an
3436
object file. However the &make-object; argument is not a makefile
3437
fragment, and custom build steps may get executed in build
3438
environments that do not involve make. For full details of custom
3439
build steps see .
3440
3441
3442
3443
The exact syntax and limitations of custom build steps have not yet
3444
been finalized, and may change in future versions of the
3445
configuration tools.
3446
3447
3448
3449
The &make-object; property takes an optional library argument. If no
3450
library is specified then the default library for the current package
3451
will be used, which will be libtarget.a unless
3452
the &cdl-package; command contains a &library; property.
3453
3454
3455
The &make-object; property also takes an optional priority argument
3456
indicating the order in which build steps take place. This priority
3457
complements the dependency list, and avoids problems with packages
3458
needing to know details of custom build steps in other packages (which
3459
may change between releases). The defined order is:
3460
3461
3462
 
3463
Priority 0
3464
3465
The header files exported by the current set of packages are copied
3466
to the appropriate places in the
3467
include subdirectory of the
3468
install tree. Any unnecessary copies are avoided, to prevent rebuilds
3469
of package and application source modules caused by header file dependencies.
3470
3471
3472
A possible future enhancement of the build system may result in the
3473
build and install trees being updated automatically if there has been
3474
a change to the ecos.ecc configuration savefile.
3475
3476
3477
 
3478
Priority 100
3479
3480
All files specified in &compile; properties will get built, producing
3481
the corresponding object files. In addition any custom build steps
3482
defined by &make-object; properties get executed, unless there is a
3483
-priority= option.
3484
3485
3486
 
3487
Priority 200
3488
3489
The libraries now get built using the appropriate object files.
3490
3491
3492
 
3493
Priority 300
3494
3495
Any custom build steps specified by &make; properties now get
3496
executed, unless the priority for a particular build step is changed
3497
from its default.
3498
3499
3500
3501
 
3502
3503
For example, if a custom build step needs to take place before any of
3504
the normal source files get compiled then it should be given a
3505
priority somewhere between 0 and 100. If a custom build step involves
3506
post-processing an object file prior to its incorporation into a
3507
library then a priority between 100 and 200 should be used. It is not
3508
sensible to have a priority above 200, since that would imply building
3509
an additional object file for a library that has already been created.
3510
3511
3512
 
3513
Example
3514
3515
cdl_option XXX {
3516
3517
    make_object {
3518
        parser.o: parser.y
3519
                yacc $<
3520
                $(CC) $(CFLAGS) -o $@ y.tab.c
3521
    }
3522
}
3523
3524
3525
 
3526
See Also
3527
3528
Properties compile,
3529
make and
3530
library.
3531
3532
3533
 
3534
3535
 
3536
3537
3538
 
3539
3540
3541
&no-define;
3542
3543
 
3544
3545
Property &no-define;
3546
Suppress the normal generation of a preprocessor
3547
#define symbol in a configuration header file.
3548
3549
 
3550
3551
3552
cdl_option <name> {
3553
    no_define
3554
3555
}
3556
3557
3558
 
3559
Description
3560
3561
By default all active and enabled properties result in either one or
3562
two #define'd symbols in the package's
3563
configuration header file, and this is one of the main ways in which
3564
options can affect packages at build-time. It is possible to suppress
3565
the default #define's by specifying a
3566
&no-define; property in the body of an option or other &CDL; entity.
3567
This property takes no arguments and should occur only once in a given
3568
body.
3569
3570
3571
The &no-define; property is frequently used in conjunction with one of
3572
the other header-file related properties such as &define;. If one of
3573
the other properties is used to export the required information to a
3574
configuration header file then often there is little point in
3575
exporting the default #define as
3576
well &mdash  in fact there could be a name clash. The
3577
&no-define; property can also be useful if the sole purpose of an
3578
option is to affect which files get built, and the default
3579
#define would never get tested in any source code.
3580
However in such cases the default #define is
3581
mostly harmless and there is little to be gained by suppressing it.
3582
3583
 
3584
3585
 
3586
Example
3587
3588
cdl_component CYG_HAL_STARTUP {
3589
    display       "Startup type"
3590
    flavor        data
3591
    legal_values  { "RAM" "ROM" }
3592
    default_value {"RAM"}
3593
    no_define
3594
    define -file system.h CYG_HAL_STARTUP
3595
3596
}
3597
3598
3599
 
3600
See Also
3601
3602
Properties &define;,
3603
&define-format;,
3604
&define-header;,
3605
&define-proc; and
3606
&if-define;.
3607
3608
3609
 
3610
3611
 
3612
3613
3614
 
3615
3616
3617
&parent;
3618
3619
 
3620
3621
Property &parent;
3622
Control the location of an option in the configuration hierarchy.
3623
3624
 
3625
3626
3627
cdl_option <name> {
3628
    parent <component or package>
3629
3630
}
3631
3632
3633
 
3634
Description
3635
3636
Configuration options live in a hierarchy of packages and components.
3637
By default a given option's position in the hierarchy is a simple
3638
consequence of its position within the CDL scripts. Packages are
3639
generally placed at the top-level of the configuration. Any components
3640
or options that are defined at the same level as the &cdl-package;
3641
command in a package's top-level CDL script are placed immediately
3642
below that package in the hierarchy. Any options or components that
3643
are defined in the body of a &cdl-package; or &cdl-component; command,
3644
or that are read in as a result of processing a component's &script;
3645
property, will be placed immediately below that package or component
3646
in the hierarchy.
3647
3648
3649
In some circumstances it is useful to specify an alternative position
3650
in the hierarchy for a given option. For example it is often
3651
convenient to re-parent device driver packages below
3652
CYGPKG_IO in the configuration hierarchy, thus
3653
reducing the number of packages at the top level of the hierarchy and
3654
making navigation easier. The &parent; property can be used to achieve
3655
this.
3656
3657
3658
The &parent; property takes a single argument, which should be the
3659
name of a package or component. The body of a &cdl-option; or other
3660
CDL entity can contain at most one &parent; property.
3661
3662
3663
Although the &parent; property affects an option's position in the
3664
overall hierarchy and hence whether or not that option is active, a
3665
re-parented option still belongs to the package that defines it. By
3666
default any #define's will be exported to that
3667
package's configuration header file. Any &compile; properties can only
3668
reference source files present in that package, and it is not directly
3669
possible to cause some file in another package to be built by
3670
re-parenting.
3671
3672
3673
As a special case, if an empty string is specified for the parent then
3674
the option is placed at the top of the hierarchy, ahead of any
3675
packages which are not explicitly re-parented in this way. This
3676
facility is useful for configuration options such as global
3677
preferences and default compiler flags.
3678
3679
 
3680
3681
3682
If an option is re-parented somewhere below another package and that
3683
other package is not actually loaded, the option is an orphan and its
3684
active/inactive state is undefined. In such cases it is a good idea
3685
for the owning package to require the presence of the other one.
3686
Unfortunately this technique does not work if a package as a whole is
3687
reparented below another one that has not been loaded: the package is
3688
orphaned so it may be automatically inactive, and hence any &requires;
3689
properties would have no effect.
3690
3691
3692
 
3693
3694
 
3695
Example
3696
3697
cdl_package CYGPKG_HAL_I386 {
3698
    display       "i386 architecture"
3699
    parent        CYGPKG_HAL
3700
    hardware
3701
    include_dir   cyg/hal
3702
    define_header hal_i386.h
3703
3704
}
3705
 
3706
cdl_component CYGBLD_GLOBAL_OPTIONS {
3707
    display       "Global build options"
3708
    parent        ""
3709
3710
}
3711
3712
3713
 
3714
See Also
3715
3716
Property &script;,
3717
commands &cdl-component; and
3718
&cdl-package;.
3719
3720
3721
 
3722
3723
 
3724
3725
3726
 
3727
3728
3729
&requires;
3730
3731
 
3732
3733
Property &requires;
3734
List constraints that the configuration should satisfy if
3735
a given option is active and enabled..
3736
3737
 
3738
3739
3740
cdl_option <name> {
3741
    requires <goal expression>
3742
3743
}
3744
3745
3746
 
3747
Description
3748
3749
Configuration options are not independent. For example the C library
3750
can provide thread-safe implementations of certain functions, but only
3751
if the kernel is present, if the kernel provides multi-threading, and
3752
if the kernel options related to per-thread data are enabled. It is
3753
possible to express such constraints using &requires; properties.
3754
3755
3756
The arguments to a &requires; property should constitute a goal
3757
expression, as described in .
3758
Most goal expressions are relatively simple because the constraints
3759
being described are simple, but complicated expressions can be used
3760
when necessary. The body of an option or other CDL entity can contain
3761
any number of &requires; constraints. If the option is active and
3762
enabled then all these constraints should be satisfied, and any goal
3763
expressions which evaluate to 0 will result in
3764
conflicts being raised. It is possible for users to ignore such
3765
conflicts and attempt to build the current configuration anyway, but
3766
there is no guarantee that anything will work. If an option is
3767
inactive or disabled then its &requires; constraints will be ignored.
3768
3769
3770
The configuration system contains an inference engine which can
3771
resolve many types of conflicts automatically. For example, if option
3772
A is enabled and requires an option
3773
B that is currently disabled then the inference
3774
engine may attempt to resolve the conflict by enabling
3775
B. However this will not always be possible, for
3776
example there may be other constraints in the configuration which
3777
force B to be disabled at present, in which case
3778
user intervention is required.
3779
3780
3781
 
3782
Example
3783
3784
cdl_component CYGPKG_IO_SERIAL_POWERPC_COGENT_SERIAL_A {
3785
    display       "Cogent PowerPC serial port A driver"
3786
    flavor        bool
3787
    default_value 0
3788
    requires      (CYGIMP_KERNEL_INTERRUPTS_CHAIN || \
3789
                   !CYGPKG_IO_SERIAL_POWERPC_COGENT_SERIAL_B)
3790
3791
}
3792
3793
3794
 
3795
See Also
3796
3797
Property &active-if;.
3798
3799
3800
 
3801
3802
 
3803
3804
3805
 
3806
3807
3808
&script;
3809
3810
 
3811
3812
Property &script;
3813
Include additional configuration information from another
3814
CDL script.
3815
3816
 
3817
3818
3819
cdl_component <name> {
3820
    script <filename>
3821
3822
}
3823
3824
3825
 
3826
Description
3827
3828
It is possible to define all the configuration options and
3829
sub-components for a given package in a single CDL script, either by
3830
nesting them in the appropriate command bodies, by extensive use of
3831
the &parent; property, or by some combination of these two. However
3832
for large packages this is inconvenient and it is better to split the
3833
raw configuration data over several different files. The &script;
3834
property can be used to achieve this. It takes a single filename as
3835
argument. If the package follows the 
3836
linkend="package.hierarchy">directory layout conventions then
3837
the configuration tools will look for the specified file in the
3838
cdl sub-directory of the
3839
package, otherwise it will look for the file relative to the package's
3840
top-level directory.
3841
3842
3843
The &script; property can only occur in the body of a &cdl-component
3844
command, and only one &script; property per body is allowed.
3845
3846
3847
 
3848
Example
3849
3850
cdl_component CYGPKG_UITRON_TASKS {
3851
    display      "Tasks"
3852
    flavor        none
3853
    description   "
3854
        uITRON Tasks are the basic blocks of multi-tasking
3855
        in the uITRON world; they are threads or lightweight
3856
        processes, sharing the address space and the CPU.
3857
        They communicate using the primitives outlined above.
3858
        Each has a stack, an entry point (a C or C++ function),
3859
        and (where appropriate) a scheduling priority."
3860
 
3861
    script        tasks.cdl
3862
}
3863
3864
3865
 
3866
See Also
3867
3868
Command  &cdl-component;,
3869
and property &parent;.
3870
3871
3872
 
3873
3874
 
3875
3876
 
3877

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.