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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [libcdl/] [doc/] [reference.sgml] - Blame information for rev 790

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

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

powered by: WebSVN 2.1.0

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