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

« back to all changes in this revision

Viewing changes to doc/include/iconfig.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
[include skip.inc]
 
2
 
 
3
It explains the syntax of configuration files and the configuration
 
4
keys used by [package critcl] to configure its build backend, i.e. how
 
5
this part of the system accesses compiler, linker, etc.
 
6
 
 
7
[para]
 
8
 
 
9
It is recommended to open the file containing the standard
 
10
configurations ([file path/to/critcl/Config]) in the editor of your
 
11
choice when reading this section of the documentation, using it as an
 
12
extended set of examples going beyond the simple defaults shown here.
 
13
 
 
14
[para]
 
15
 
 
16
First, the keys and the meaning of their values, plus examples drawn
 
17
from the standard configurations distributed with the package.
 
18
 
 
19
Note that when writing a custom configuration it is not necessary to
 
20
specify all the keys listed below, but only those whose default values
 
21
are wrong or insufficient for the platform in question.
 
22
 
 
23
[list_begin definitions]
 
24
[comment {============================================================}]
 
25
[def version]
 
26
The command to print the compiler version number.
 
27
Defaults to [example { gcc -v }]
 
28
 
 
29
[comment {============================================================}]
 
30
[def compile]
 
31
The command to compile a single C source file to an object file.
 
32
Defaults to [example { gcc -c -fPIC }]
 
33
 
 
34
[comment {============================================================}]
 
35
[def debug_memory]
 
36
The list of flags for the compiler to enable memory debugging in
 
37
Tcl.
 
38
Defaults to [example { -DTCL_MEM_DEBUG }]
 
39
 
 
40
[comment {============================================================}]
 
41
[def debug_symbols]
 
42
The list of flags for the compiler to add symbols to the object files
 
43
and the resulting library.
 
44
Defaults to [example { -g }]
 
45
 
 
46
[comment {============================================================}]
 
47
[def include]
 
48
The compiler flag to add an include directory.
 
49
Defaults to [example { -I }]
 
50
 
 
51
[comment {============================================================}]
 
52
[def tclstubs]
 
53
The compiler flag to set USE_TCL_STUBS.
 
54
Defaults to [example { -DUSE_TCL_STUBS }]
 
55
 
 
56
[comment {============================================================}]
 
57
[def tkstubs]
 
58
The compiler flag to set USE_TK_STUBS.
 
59
Defaults to [example { -DUSE_TK_STUBS }]
 
60
 
 
61
[comment {============================================================}]
 
62
[def threadflags]
 
63
The list of compiler flags to enable a threaded build.
 
64
Defaults to [example {
 
65
    -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1
 
66
    -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1
 
67
    -DTCL_THREADS=1
 
68
}].
 
69
 
 
70
[comment {============================================================}]
 
71
[def noassert]
 
72
The compiler flag to turn off assertions in Tcl code.
 
73
Defaults to [example { -DNDEBUG }]
 
74
 
 
75
[comment {============================================================}]
 
76
[def optimize]
 
77
The compiler flag to specify optimization level.
 
78
Defaults to [example { -O2 }]
 
79
 
 
80
[comment {============================================================}]
 
81
[def output]
 
82
The compiler flags to set the output file of a compilation.
 
83
Defaults to [example { -o [list $outfile] }]
 
84
 
 
85
[para] [emph NOTE] the use of Tcl commands and variables here.  At the
 
86
time [package critcl] uses the value of this key the value of the
 
87
referenced variable is substituted into it. The named variable is the
 
88
only variable whose value is defined for this substitution.
 
89
 
 
90
[comment {============================================================}]
 
91
[def object]
 
92
The file extension for object files on the platform.
 
93
Defaults to [example { .o }]
 
94
 
 
95
[comment {============================================================}]
 
96
[def preproc_define]
 
97
The command to preprocess a C source file without compiling it, but
 
98
leaving #define's in the output. Defaults to [example { gcc -E -dM }]
 
99
 
 
100
[comment {============================================================}]
 
101
[def preproc_enum]
 
102
See [const preproc_define], except that #define's are not left in the
 
103
output. Defaults to [example { gcc -E }]
 
104
 
 
105
[comment {============================================================}]
 
106
[def link]
 
107
The command to link one or more object files and create a shared
 
108
library. Defaults to [example { gcc -shared }]
 
109
 
 
110
[comment {============================================================}]
 
111
[def link_preload]
 
112
The list of linker flags to use when dependent libraries are
 
113
pre-loaded. Defaults to
 
114
[example { --unresolved-symbols=ignore-in-shared-libs }]
 
115
 
 
116
[comment {============================================================}]
 
117
[def strip]
 
118
The flag to tell the linker to strip symbols from the shared library.
 
119
Defaults to [example { -Wl,-s }]
 
120
 
 
121
 
 
122
[comment {============================================================}]
 
123
[def ldoutput]
 
124
Like [const output], but for the linker.
 
125
Defaults to the value of [const output].
 
126
 
 
127
[comment {============================================================}]
 
128
[def link_debug]
 
129
The list of linker flags needed to build a shared library with
 
130
symbols. Defaults to the empty string.
 
131
 
 
132
One platform requiring this are all variants of Windows, which uses
 
133
[example { -debug:full -debugtype:cv }]
 
134
 
 
135
[comment {============================================================}]
 
136
[def link_release]
 
137
The list of linker flags needed to build a shared library without
 
138
symbols, i.e. a regular build. Defaults to the empty string.
 
139
 
 
140
One platform requiring this are all variants of Windows, which uses
 
141
[example { -release -opt:ref -opt:icf,3 -ws:aggressive }]
 
142
 
 
143
[comment {============================================================}]
 
144
[def sharedlibext]
 
145
The file extension for shared library files on the platform.
 
146
Defaults to [example { [info sharedlibextension] }]
 
147
 
 
148
[comment {============================================================}]
 
149
[def platform]
 
150
The identifier of the platform used in generated packages.
 
151
Defaults to [example { [platform::generic] }]
 
152
 
 
153
[comment {============================================================}]
 
154
[def target]
 
155
The presence of this key marks the configuration as a
 
156
cross-compilation target and the value is the actual platform
 
157
identifier of the target.  No default.
 
158
 
 
159
[list_end]
 
160
[para]
 
161
 
 
162
The syntax expected from configuration files is governed by the rules below.
 
163
 
 
164
Again, it is recommended to open the file containing the standard
 
165
configurations ([file path/to/critcl/Config]) in the editor of your
 
166
choice when reading this section of the documentation, using it as an
 
167
extended set of examples for the syntax>
 
168
 
 
169
[list_begin enumerated]
 
170
[comment {============================================================}]
 
171
[enum] Each logical line of the configuration file consists of one or
 
172
more physical lines. In case of the latter the physical lines have to
 
173
follow each other and all but the first must be marked by a trailing
 
174
backslash. This is the same marker for [term {continuation lines}] as
 
175
used by Tcl itself.
 
176
 
 
177
[comment {============================================================}]
 
178
[enum] A (logical) line starting with the character "#" (modulo
 
179
whitespace) is a comment which runs until the end of the line, and is
 
180
otherwise ignored.
 
181
 
 
182
[comment {============================================================}]
 
183
[enum] A (logical) line starting with the word "if" (modulo
 
184
whitespace) is interpreted as Tcl's [cmd if] command and executed as
 
185
such. I.e. this command has to follow Tcl's syntax for the command,
 
186
which may stretch across multiple logical lines. The command will be
 
187
run in a save interpreter.
 
188
 
 
189
[comment {============================================================}]
 
190
[enum] A (logical) line starting with the word "set" (modulo
 
191
whitespace) is interpreted as Tcl's [cmd set] command and executed as
 
192
such. I.e. this command has to follow Tcl's syntax for the command,
 
193
which may stretch across multiple logical lines. The command will be
 
194
run in a save interpreter.
 
195
 
 
196
[comment {============================================================}]
 
197
[enum] A line of the form "[arg platform] [var variable] [arg value]"
 
198
defines a platform specific configuration variable and value.
 
199
 
 
200
The [var variable] has to be the name of one of the configuration keys
 
201
listed earlier in this section, and the [arg platform] string
 
202
identifies the platform the setting is for. All settings with the same
 
203
identification string form the [term {configuration block}] for this
 
204
platform.
 
205
 
 
206
[comment {============================================================}]
 
207
[enum] A line of the special form
 
208
"[arg platform] [const when] [arg expression]" 
 
209
marks the [arg platform] and all the settings in its
 
210
[term {configuration block}] as conditional on the [arg expression].
 
211
 
 
212
[para]
 
213
 
 
214
If the build platform is not a prefix of [arg platform],
 
215
nor vice versa the whole block is ignored.
 
216
 
 
217
Otherwise the [arg expression] is evaluated via [cmd expr], in the
 
218
same safe interpreter used to run any [cmd set] and [cmd if] commands
 
219
found in the configuration file (see above).
 
220
 
 
221
[para]
 
222
 
 
223
If the expression evaluates to [const true] this configuration block
 
224
is considered to be the build platform fo the host and chosen as the
 
225
default configuration.
 
226
 
 
227
An large example of of this feature is the handling of OS X found in
 
228
the standard configuration file, where it selects the architectures to
 
229
build based on the version of the operating system, the available SDK,
 
230
etc. I.e. it chooses whether the output is universal or not, and
 
231
whether it is old-style (ix86 + ppc) versus new-style (ix86 32+64) of
 
232
universality.
 
233
 
 
234
[comment {============================================================}]
 
235
[enum] A line of the special form
 
236
"[arg platform] [const copy] [arg sourceplatform]" 
 
237
copies the configuration variables and values currently defined in the
 
238
[term {configuration block}] for [arg sourceplatform] to that of
 
239
[arg platform], overwriting existing values, and creating missing
 
240
ones. Variables of [arg platform] not defined by by [arg sourceplatform]
 
241
are not touched.
 
242
 
 
243
[para] The copied values can be overridden later in the configuration
 
244
file. Multiple [const copy] lines may exist for a platform and be
 
245
intermixed with normal configuration definitions. If a variable is
 
246
defined multiple times, the last definition will be used.
 
247
 
 
248
[comment {============================================================}]
 
249
[enum] At last, a line of the form "[var variable] [arg value]"
 
250
defines a default configuration variable and value.
 
251
 
 
252
[list_end]