summaryrefslogtreecommitdiffstats
path: root/SCons/Platform/Platform.xml
blob: 5d31f6bb0ceffbb7c7206538571c3988d1087eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<?xml version="1.0"?>
<!--
Copyright The SCons Foundation

This file is processed by the bin/SConsDoc.py module.
See its __doc__ string for a discussion of the format.
-->

<!DOCTYPE sconsdoc [
<!ENTITY % scons SYSTEM '../../doc/scons.mod'>
%scons;
<!ENTITY % builders-mod SYSTEM '../../doc/generated/builders.mod'>
%builders-mod;
<!ENTITY % functions-mod SYSTEM '../../doc/generated/functions.mod'>
%functions-mod;
<!ENTITY % tools-mod SYSTEM '../../doc/generated/tools.mod'>
%tools-mod;
<!ENTITY % variables-mod SYSTEM '../../doc/generated/variables.mod'>
%variables-mod;
]>

<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">

<cvar name="ESCAPE">
<summary>
<para>
A function that will be called to escape shell special characters in
command lines. The function should take one argument: the command line
string to escape; and should return the escaped command line.
</para>
</summary>
</cvar>

<cvar name="LIBPREFIX">
<summary>
<para>
The prefix used for (static) library file names.
A default value is set for each platform
(posix, win32, os2, etc.),
but the value is overridden by individual tools
(ar, mslib, sgiar, sunar, tlib, etc.)
to reflect the names of the libraries they create.
</para>
</summary>
</cvar>

<cvar name="LIBPREFIXES">
<summary>
<para>
A list of all legal prefixes for library file names
on the current platform.
When searching for library dependencies,
SCons will look for files with these prefixes,
the base library name,
and suffixes from the &cv-link-LIBSUFFIXES; list.
</para>
</summary>
</cvar>

<cvar name="LIBSUFFIX">
<summary>
<para>
The suffix used for (static) library file names.
A default value is set for each platform
(posix, win32, os2, etc.),
but the value is overridden by individual tools
(ar, mslib, sgiar, sunar, tlib, etc.)
to reflect the names of the libraries they create.
</para>
</summary>
</cvar>

<cvar name="LIBSUFFIXES">
<summary>
<para>
A list of all legal suffixes for library file names.
on the current platform.
When searching for library dependencies,
SCons will look for files with prefixes from the &cv-link-LIBPREFIXES; list,
the base library name,
and these suffixes.
</para>
</summary>
</cvar>

<cvar name="OBJPREFIX">
<summary>
<para>
The prefix used for (static) object file names.
</para>
</summary>
</cvar>

<cvar name="OBJSUFFIX">
<summary>
<para>
The suffix used for (static) object file names.
</para>
</summary>
</cvar>

<cvar name="PLATFORM">
  <summary>
    <para>
      The name of the platform used to create this &consenv;.
      &SCons; sets this when initializing the platform,
      which by default is auto-detected
      (see the <parameter>platform</parameter>
      argument to &f-link-Environment;).
    </para>

    <example_commands>
env = Environment(tools=[])
if env['PLATFORM'] == 'cygwin':
    Tool('mingw')(env)
else:
    Tool('msvc')(env)
    </example_commands>
  </summary>
</cvar>

<cvar name="HOST_OS">
  <summary>
    <para>
      The name of the host operating system for the platform
      used to create this &consenv;.
      The platform code sets this when initializing
      (see &cv-link-PLATFORM; and the
      <parameter>platform</parameter> argument to &f-link-Environment;).
    </para>
    <para>
      Should be considered immutable.
      &cv-HOST_OS; is not currently used by &SCons;,
      but the option is reserved to do so in future
    </para>
  </summary>
</cvar>

<cvar name="TARGET_OS">
  <summary>
    <para>
      The name of the operating system that objects
      created using this &consenv; should target.
      Can be set when creating a &consenv; by passing as a keyword
      argument in the &f-link-Environment; call;.
    </para>
    <para>
      &cv-TARGET_OS; is not currently used by &SCons;
      but the option is reserved to do so in future
    </para>
  </summary>
</cvar>

<cvar name="HOST_ARCH">
  <summary>
    <para>
      The name of the host hardware architecture
      used to create this &consenv;.
      The platform code sets this when initializing
      (see &cv-link-PLATFORM; and the
      <parameter>platform</parameter> argument to &f-link-Environment;).
      Note the detected name of the architecture may not be identical to
      that returned by the &Python;
      <systemitem>platform.machine</systemitem> method.
    </para>
    <para>
      On the <literal>win32</literal> platform,
      if the &MSVC; compiler is available,
      &t-link-msvc; tool setup is done using
      &cv-HOST_ARCH; and &cv-link-TARGET_ARCH;.
      Changing the values at any later time will not cause
      the tool to be reinitialized.
      Valid host arch values are
      <literal>x86</literal> and <literal>arm</literal>
      for 32-bit hosts and
      <literal>amd64</literal>, <literal>arm64</literal>,
      and <literal>x86_64</literal> for 64-bit hosts.
    </para>
    <para>
      Should be considered immutable.
      &cv-HOST_ARCH; is not currently used by other platforms,
      but the option is reserved to do so in future
    </para>
  </summary>
</cvar>

<cvar name="TARGET_ARCH">
  <summary>
    <para>
      The name of the hardware architecture that objects
      created using this &consenv; should target.
      Can be set when creating a &consenv; by passing as a keyword
      argument in the &f-link-Environment; call.
    </para>
    <para>
      On the <literal>win32</literal> platform,
      if the &MSVC; compiler is available,
      &t-link-msvc; tool setup is done using
      &cv-link-HOST_ARCH; and &cv-TARGET_ARCH;.
      If a value is not specified,
      will be set to the same value as &cv-link-HOST_ARCH;.
      Changing the value after the environment is initialized
      will not cause the tool to be reinitialized.
      Compiled objects will be in the target architecture if
      the compilation system supports generating for that target.
      The latest compiler which can fulfill the requirement will
      be selected, unless a different version is directed by the
      value of the &cv-link-MSVC_VERSION; &consvar;.
    </para>
    <para>
      On the win32/msvc combination, valid target arch values are
      <literal>x86</literal>,
      <literal>arm</literal>,
      <literal>i386</literal>
      for 32-bit targets and
      <literal>amd64</literal>,
      <literal>arm64</literal>,
      <literal>x86_64</literal>
      and <literal>ia64</literal> (Itanium)
      for 64-bit targets.
      For example, if you want to compile 64-bit binaries, you would set
      <literal>TARGET_ARCH='x86_64'</literal> when creating the &consenv;.
      Note that not all target architectures are
      supported for all Visual Studio / MSVC versions.
      Check the relevant Microsoft documentation.
    </para>
    <para>
      &cv-TARGET_ARCH; is not currently used by other compilation tools,
      but the option is reserved to do so in future
    </para>
  </summary>
</cvar>

<cvar name="PROGPREFIX">
<summary>
<para>
The prefix used for executable file names.
</para>
</summary>
</cvar>

<cvar name="PROGSUFFIX">
<summary>
<para>
The suffix used for executable file names.
</para>
</summary>
</cvar>

<cvar name="SHELL">
<summary>
<para>
A string naming the shell program that will be passed to the
&cv-SPAWN;
function.
See the
&cv-SPAWN;
construction variable for more information.
</para>
</summary>
</cvar>

<cvar name="SHLIBPREFIX">
<summary>
<para>
The prefix used for shared library file names.
</para>
</summary>
</cvar>

<cvar name="SHLIBSUFFIX">
<summary>
<para>
The suffix used for shared library file names.
</para>
</summary>
</cvar>

<cvar name="SHOBJPREFIX">
<summary>
<para>
The prefix used for shared object file names.
</para>
</summary>
</cvar>

<cvar name="SHOBJSUFFIX">
<summary>
<para>
The suffix used for shared object file names.
</para>
</summary>
</cvar>

<cvar name="TEMPFILE">
<summary>
<para>
A callable object used to handle overly long command line strings,
since operations which call out to a shell will fail
if the line is longer than the shell can accept.
This tends to particularly impact linking.
The tempfile object stores the command line in a temporary
file in the appropriate format, and returns
an alternate command line so the invoked tool will make
use of the contents of the temporary file.
If you need to replace the default tempfile object,
the callable should take into account the settings of
&cv-link-MAXLINELENGTH;,
&cv-link-TEMPFILEPREFIX;,
&cv-link-TEMPFILESUFFIX;,
&cv-link-TEMPFILEARGJOIN;,
&cv-link-TEMPFILEDIR;
and
&cv-link-TEMPFILEARGESCFUNC;.
</para>
</summary>
</cvar>

<cvar name="TEMPFILEPREFIX">
<summary>
<para>
The prefix for the name of the temporary file used
to store command lines exceeding &cv-link-MAXLINELENGTH;.
The default prefix is <literal>'@'</literal>, which works for the &MSVC;
and GNU toolchains on Windows.
Set this appropriately for other toolchains,
for example <literal>'-@'</literal> for the diab compiler
or <literal>'-via'</literal> for ARM toolchain.
</para>
</summary>
</cvar>

<cvar name="TEMPFILESUFFIX">
<summary>
<para>
The suffix for the name of the temporary file used
to store command lines exceeding &cv-link-MAXLINELENGTH;.
The suffix should include the dot ('.') if one is wanted as
it will not be added automatically.
The default is <filename>.lnk</filename>.
</para>
</summary>
</cvar>

<cvar name="TEMPFILEARGJOIN">
<summary>
<para>
The string to use to join the arguments passed to
&cv-link-TEMPFILE; when the command line exceeds the limit set by
&cv-link-MAXLINELENGTH;.
The default value is a space.
However for MSVC, MSLINK the default is a line separator
as defined by <systemitem>os.linesep</systemitem>.
Note this value is used literally and not expanded by the subst logic.
</para>
</summary>
</cvar>

<cvar name="TEMPFILEDIR">
<summary>
<para>
The directory to create the long-lines temporary file in.
</para>
</summary>
</cvar>

<cvar name="TEMPFILEARGESCFUNC">
<summary>
<para>
The default argument escape function is
<function>SCons.Subst.quote_spaces</function>.
If you need to apply extra operations on a command argument
(to fix Windows slashes, normalize paths, etc.)
before writing to the temporary file,
you can set the &cv-TEMPFILEARGESCFUNC; variable to a custom function.
Such a function takes a single string argument and returns
a new string with any modifications applied.
Example:
</para>

<example_commands>
import sys
import re
from SCons.Subst import quote_spaces

WINPATHSEP_RE = re.compile(r"\\([^\"'\\]|$)")

def tempfile_arg_esc_func(arg):
    arg = quote_spaces(arg)
    if sys.platform != "win32":
        return arg
    # GCC requires double Windows slashes, let's use UNIX separator
    return WINPATHSEP_RE.sub(r"/\1", arg)

env["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func
</example_commands>
</summary>
</cvar>

</sconsdoc>