~ubuntu-branches/ubuntu/utopic/critcl/utopic

« back to all changes in this revision

Viewing changes to doc/include/api_control.inc

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura
  • Date: 2013-05-11 00:08:06 UTC
  • Revision ID: package-import@ubuntu.com-20130511000806-7hq1zc3fnn0gat79
Tags: upstream-3.1.9
ImportĀ upstreamĀ versionĀ 3.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
The package provides thirteen commands to control the details of
 
3
compilation and linking, enabling [file .critcl] files to provide
 
4
custom information about their environment and dependencies.
 
5
 
 
6
[para] In important thing to note about all these commands is that the
 
7
package manages their information on a per-file basis.
 
8
 
 
9
I.e. information provided by and in a file [file FOO.tcl] is kept
 
10
separate from the information provided by and in a file
 
11
[file BAR.tcl], preventing them from interfering with each other.
 
12
 
 
13
[para]
 
14
The commands are:
 
15
 
 
16
[list_begin definitions]
 
17
[comment ---------------------------------------------------------------------]
 
18
[call [cmd ::critcl::cheaders] [opt [arg arg]...]]
 
19
 
 
20
This command provides the compile step with additional header files
 
21
and header locations.
 
22
 
 
23
[para] All arguments matching the glob pattern [const -*] are
 
24
forwarded to the compiler's command line when it is invoked for the
 
25
current [file .critcl] file.
 
26
 
 
27
[para] All other arguments are interpreted as glob pattern and the
 
28
matching files are made available to the compiler when it is invoked
 
29
for the current [file .critcl] file. Patterns matching no file or
 
30
non-existing files cause the command to throw an error.
 
31
 
 
32
[para] [emph Note] that patterns which are not beginning with an
 
33
absolute path are interpreted relative to the directory containing the
 
34
current [file .critcl] file.
 
35
 
 
36
[para] [emph Note] further that this declaration does not cause the
 
37
specified header files to be [const {#include}]'d automatically. This
 
38
still has to be done via [cmd critcl::ccode] where necessary.
 
39
 
 
40
It does simply ensure that the compiler will be able to find these
 
41
files when invoked, by providing the necessary command line flags
 
42
extending the compiler's search paths.
 
43
 
 
44
[para] Multiple invocations of this command accumulate their
 
45
information.
 
46
 
 
47
[comment ---------------------------------------------------------------------]
 
48
[call [cmd ::critcl::csources] [opt [arg pattern]...]]
 
49
 
 
50
This command provides the compile step with additional C source files.
 
51
 
 
52
[para] All arguments are intepreted as glob patterns. Patterns
 
53
matching no file or non-existing files cause the command to throw an
 
54
error. The files matching the patterns are made available to the
 
55
compiler when it is invoked for the current [file .critcl] file. This
 
56
means that the files in question are compiled together with the
 
57
[file .c] file backing the [file .critcl] file into a single object.
 
58
 
 
59
[para] [emph Note] that patterns which are not beginning with an
 
60
absolute path are interpreted relative to the directory containing the
 
61
current [file .critcl] file.
 
62
 
 
63
[para] Multiple invocations of this command accumulate their
 
64
information.
 
65
 
 
66
[comment ---------------------------------------------------------------------]
 
67
[call [cmd ::critcl::clibraries] [opt [arg arg]...]]
 
68
 
 
69
This command provides the link step with additional libraries to link
 
70
and library locations.
 
71
 
 
72
[para] All arguments matching the glob pattern [const -*] are
 
73
forwarded to the linkers's command line when it is invoked for the
 
74
current [file .critcl] file.
 
75
 
 
76
[para] All other arguments are interpreted glob patterns. Patterns
 
77
matching no file or non-existing files cause the command to throw an
 
78
error. The files matching the patterns are made available to the
 
79
linker when it is invoked for the current [file .critcl] file. This
 
80
means that the files in question are linked together with the object
 
81
file backing the [file .critcl] file into a single shared library.
 
82
 
 
83
[para] [emph Note] that patterns which are not beginning with an
 
84
absolute path are interpreted relative to the directory containing the
 
85
current [file .critcl] file.
 
86
 
 
87
[para] Multiple invocations of this command accumulate their
 
88
information.
 
89
 
 
90
[comment ---------------------------------------------------------------------]
 
91
[call [cmd ::critcl::source] [arg path]]
 
92
 
 
93
This command evaluates the critcl commands in the file specified by
 
94
[arg path] in the context of the current [file .critcl] file.
 
95
 
 
96
[para] The argument is actually considered as glob pattern and all
 
97
matching files are evaluated. A pattern matching no file or
 
98
non-existing files cause the command to throw an error.
 
99
 
 
100
[para] [emph Note] that a pattern not beginning with an absolute path
 
101
is interpreted relative to the directory containing the current
 
102
[file .critcl] file.
 
103
 
 
104
[comment ---------------------------------------------------------------------]
 
105
[call [cmd ::critcl::tsources] [arg pattern]...]
 
106
 
 
107
This command provides the critcl package with information about
 
108
additional Tcl script files to source when the shared library is
 
109
loaded.
 
110
 
 
111
[para] All arguments are considered as glob patterns and the matching
 
112
files are made available to generated shared library when it is loaded
 
113
for the current [file .critcl] file. Patterns matching no file or
 
114
non-existing files cause the command to throw an error.
 
115
 
 
116
[para] [emph Note] that patterns which are not beginning with an
 
117
absolute path are interpreted relative to the directory containing the
 
118
current [file .critcl] file.
 
119
 
 
120
[para] Multiple invocations of this command accumulate their
 
121
information.
 
122
 
 
123
[para] The declared files are sourced after the shared library has
 
124
been loaded, in the same order they were provided to [cmd critcl::tsources].
 
125
 
 
126
[comment ---------------------------------------------------------------------]
 
127
[call [cmd ::critcl::owns] [arg pattern]...]
 
128
 
 
129
This command is ignored by the regular build modes, i.e. both "compile
 
130
and run", and "generate package". It is present to support the static
 
131
code scanner of critcl v3's new mode to "generate TEA" packages.
 
132
 
 
133
[para] In that situation it provides the critcl package with
 
134
information about any files which have to be wrapped and could not be
 
135
figured out from the previous commands (i.e. [cmd critcl::csources],
 
136
[cmd critcl::tsources]) because of getting specified dynamically, or
 
137
getting directly sourced and this not visible to critcl in any other
 
138
way.
 
139
 
 
140
 
 
141
[comment ---------------------------------------------------------------------]
 
142
[call [cmd ::critcl::cflags] [opt [arg arg]...]]
 
143
 
 
144
This command provides the compile step with additional compiler flags.
 
145
 
 
146
[para] All arguments are forwarded to the compiler's command line when
 
147
it is invoked for the current [file .critcl] file.
 
148
 
 
149
[para] Multiple invocations of this command accumulate their
 
150
information.
 
151
 
 
152
[comment ---------------------------------------------------------------------]
 
153
[call [cmd ::critcl::ldflags] [opt [arg arg]...]]
 
154
 
 
155
This command provides the link step with additional linker flags.
 
156
 
 
157
[para] All arguments are forwarded to the linkers's command line when
 
158
it is invoked for the current [file .critcl] file.
 
159
 
 
160
[para] Multiple invocations of this command accumulate their
 
161
information.
 
162
 
 
163
[comment ---------------------------------------------------------------------]
 
164
[call [cmd ::critcl::framework] [opt [arg arg]...]]
 
165
 
 
166
This command provides the link step with the names of additional
 
167
frameworks to link on MacOS X. The command is ignored if we are not
 
168
building for OS X. This means that it is possible to declare the OS X
 
169
specific frameworks unconditionally. The package itself takes care to
 
170
not use them when building for non-OS X platforms.
 
171
 
 
172
[para] All arguments are forwarded to the linkers's command line when
 
173
it is invoked for the current [file .critcl] file.
 
174
 
 
175
[para] Multiple invocations of this command accumulate their
 
176
information.
 
177
 
 
178
[comment ---------------------------------------------------------------------]
 
179
[call [cmd ::critcl::tcl] [arg version]]
 
180
 
 
181
This command tells critcl for what minimum version of the Tcl runtime
 
182
to compile and link the package for. If not specified critcl falls
 
183
back to the default of [const 8.4]. 
 
184
 
 
185
[comment ---------------------------------------------------------------------]
 
186
[call [cmd ::critcl::tk]]
 
187
 
 
188
This command informs critcl that the package in question is based on
 
189
Tk, and therefore needs the Tk headers for compilation, and the Tk
 
190
stubs for linking.
 
191
 
 
192
[comment ---------------------------------------------------------------------]
 
193
[call [cmd ::critcl::preload] [arg lib]...]
 
194
 
 
195
This command arranges that the named dependent external shared library is loaded
 
196
before the generated package's shared library.
 
197
 
 
198
[para] Multiple invocations of this command accumulate their
 
199
information.
 
200
 
 
201
[para][include preload_search.inc]
 
202
 
 
203
[comment {
 
204
        XXX preload - compile & run - will it work ?
 
205
}]
 
206
 
 
207
If you are a developer wishing to understand or modify the internals
 
208
of the [package critcl] package then you possibly should read the
 
209
section explaining how the [sectref {Preloading functionality}] is
 
210
implemented.
 
211
 
 
212
[comment ---------------------------------------------------------------------]
 
213
[call [cmd ::critcl::debug] [arg area]...]
 
214
 
 
215
This tells critcl if the package is to be compiled for debugging, and
 
216
which areas to activate. Internally each area is translated into
 
217
area-specific flags for the compiler which are then handed over to
 
218
[cmd critcl::cflags].
 
219
 
 
220
[list_begin definitions]
 
221
[def [const memory]]
 
222
 
 
223
Specification of this area activates Tcl memory debugging
 
224
for the package code.
 
225
 
 
226
[def [const symbols]]
 
227
 
 
228
Specification of this area activates compilation and linking with
 
229
debugging symbols, for use by a debugger or other tool.
 
230
 
 
231
[def [const all]]
 
232
 
 
233
Specification of this area translates ino the activation of all other
 
234
legal areas.
 
235
 
 
236
[list_end]
 
237
[list_end]