summaryrefslogtreecommitdiffstats
path: root/SCons/Tool/link.xml
blob: f90a33bae47c097846024ef56bffd85b95314a37 (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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
<?xml version="1.0"?>
<!--
__COPYRIGHT__

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">

<tool name="link">
<summary>
<para>
Sets construction variables for generic POSIX linkers. This is
a "smart" linker tool which selects a compiler to complete the linking
based on the types of source files.
</para>
</summary>
<sets>
<item>LINK</item>
<item>LINKFLAGS</item>
<item>LINKCOM</item>
<item>LIBDIRPREFIX</item>
<item>LIBDIRSUFFIX</item>
<item>LIBLINKPREFIX</item>
<item>LIBLINKSUFFIX</item>
<item>SHLINK</item>
<item>SHLINKFLAGS</item>
<item>SHLINKCOM</item>
<item>SHLIBSUFFIX</item>
<item>__SHLIBVERSIONFLAGS</item>
<item>LDMODULE</item>
<item>LDMODULEPREFIX</item>
<item>LDMODULESUFFIX</item>
<item>LDMODULEFLAGS</item>
<item>LDMODULECOM</item>
<item>LDMODULEVERSION</item>
<item>LDMODULENOVERSIONSYMLINKS</item>
<item>LDMODULEVERSIONFLAGS</item>
<item>__LDMODULEVERSIONFLAGS</item>
</sets>
<uses>
<item>LINKCOMSTR</item>
<item>SHLINKCOMSTR</item>
<item>LDMODULECOMSTR</item>
</uses>
</tool>

<cvar name="__LDMODULEVERSIONFLAGS">
<summary>
<para>
This construction variable automatically introduces &cv-link-_LDMODULEVERSIONFLAGS;
if &cv-link-LDMODULEVERSION; is set. Othervise it evaluates to an empty string.
</para>
</summary>
</cvar>

<cvar name="__SHLIBVERSIONFLAGS">
<summary>
<para>
This construction variable automatically introduces &cv-link-_SHLIBVERSIONFLAGS;
if &cv-link-SHLIBVERSION; is set. Othervise it evaluates to an empty string.
</para>
</summary>
</cvar>

<cvar name="_LDMODULESONAME">
<summary>
<para>
A macro that automatically generates loadable module's SONAME based on $TARGET,
$LDMODULEVERSION and $LDMODULESUFFIX. Used by &b-link-LoadableModule; builder
when the linker tool supports SONAME (e.g. &t-link-gnulink;).
</para>
</summary>
</cvar>

<cvar name="_LDMODULEVERSIONFLAGS">
<summary>
<para>
This macro automatically introduces extra flags to &cv-link-LDMODULECOM; when
building versioned &b-link-LoadableModule; (that is when
&cv-link-LDMODULEVERSION; is set). <literal>_LDMODULEVERSIONFLAGS</literal>
usually adds &cv-link-SHLIBVERSIONFLAGS; and some extra dynamically generated
options (such as <literal>-Wl,-soname=$_LDMODULESONAME</literal>).  It is unused
by plain (unversioned) loadable modules.
</para>
</summary>
</cvar>

<cvar name="_SHLIBVERSIONFLAGS">
<summary>
<para>
This macro automatically introduces extra flags to &cv-link-SHLINKCOM; when
building versioned &b-link-SharedLibrary; (that is when &cv-link-SHLIBVERSION;
is set). <literal>_SHLIBVERSIONFLAGS</literal> usually adds &cv-link-SHLIBVERSIONFLAGS;
and some extra dynamically generated options (such as
<literal>-Wl,-soname=$_SHLIBSONAME</literal>. It is unused by "plain"
(unversioned) shared libraries.
</para>
</summary>
</cvar>

<cvar name="_SHLIBSONAME">
<summary>
<para>
A macro that automatically generates shared library's SONAME based on $TARGET,
$SHLIBVERSION and $SHLIBSUFFIX. Used by &b-link-SharedLibrary; builder when
the linker tool supports SONAME (e.g. &t-link-gnulink;).
</para>
</summary>
</cvar>

<cvar name="IMPLIBPREFIX">
<summary>
<para>
The prefix used for import library names. For example, cygwin uses import
libraries (<literal>libfoo.dll.a</literal>) in pair with dynamic libraries
(<literal>cygfoo.dll</literal>). The &t-link-cyglink; linker sets
&cv-link-IMPLIBPREFIX; to <literal>'lib'</literal> and &cv-link-SHLIBPREFIX;
to <literal>'cyg'</literal>.
</para>
</summary>
</cvar>

<cvar name="IMPLIBSUFFIX">
<summary>
<para>
The suffix used for import library names. For example, cygwin uses import
libraries (<literal>libfoo.dll.a</literal>) in pair with dynamic libraries
(<literal>cygfoo.dll</literal>). The &t-link-cyglink; linker sets
&cv-link-IMPLIBSUFFIX; to <literal>'.dll.a'</literal> and &cv-link-SHLIBSUFFIX;
to <literal>'.dll'</literal>.
</para>
</summary>
</cvar>

<cvar name="IMPLIBNOVERSIONSYMLINKS">
<summary>
<para>
Used to override &cv-link-SHLIBNOVERSIONSYMLINKS;/&cv-link-LDMODULENOVERSIONSYMLINKS; when 
creating versioned import library for a shared library/loadable module. If not defined,
then &cv-link-SHLIBNOVERSIONSYMLINKS;/&cv-link-LDMODULENOVERSIONSYMLINKS; is used to determine
whether to disable symlink generation or not.
</para>
</summary>
</cvar>

<cvar name="LDMODULE">
<summary>
<para>
The linker for building loadable modules.
By default, this is the same as &cv-link-SHLINK;.
</para>
</summary>
</cvar>

<cvar name="LDMODULECOM">
<summary>
<para>
The command line for building loadable modules.
On Mac OS X, this uses the &cv-link-LDMODULE;,
&cv-link-LDMODULEFLAGS; and
&cv-link-FRAMEWORKSFLAGS; variables.
On other systems, this is the same as &cv-link-SHLINK;.
</para>
</summary>
</cvar>

<cvar name="LDMODULECOMSTR">
<summary>
<para>
If set, the string displayed when building loadable modules.
If not set, then &cv-link-LDMODULECOM; (the command line) is displayed.
</para>
</summary>
</cvar>

<cvar name="LDMODULEFLAGS">
<summary>
<para>
General user options passed to the linker for building loadable modules.
</para>
</summary>
</cvar>

<cvar name="LDMODULENOVERSIONSYMLINKS">
<summary>
<para>
Instructs the &b-link-LoadableModule; builder to not automatically create symlinks
for versioned modules. Defaults to <literal>$SHLIBNOVERSIONSYMLINKS</literal>
</para>
</summary>
</cvar>

<cvar name="LDMODULEPREFIX">
<summary>
<para>
The prefix used for loadable module file names.
On Mac OS X, this is null;
on other systems, this is
the same as &cv-link-SHLIBPREFIX;.
</para>
</summary>
</cvar>

<cvar name="LDMODULESUFFIX">
<summary>
<para>
The suffix used for loadable module file names.
On Mac OS X, this is null;
on other systems, this is
the same as $SHLIBSUFFIX.
</para>
</summary>
</cvar>

<cvar name="LDMODULEVERSIONFLAGS">
<summary>
<para>
Extra flags added to &cv-link-LDMODULECOM; when building versioned
&b-link-LoadableModule;. These flags are only used when &cv-link-LDMODULEVERSION; is
set.
</para>
</summary>
</cvar>

<cvar name="LINK">
<summary>
<para>
The linker.
See also &cv-link-SHLINK; for linking shared objects.
</para>
</summary>
</cvar>

<cvar name="LINKCOM">
<summary>
<para>
The command line used to link object files into an executable.
See also &cv-link-SHLINKCOM; for linking shared objects.
</para>
</summary>
</cvar>

<cvar name="LINKCOMSTR">
<summary>
<para>
If set, the string displayed when object files
are linked into an executable.
If not set, then &cv-link-LINKCOM; (the command line) is displayed.
See also &cv-link-SHLINKCOMSTR;.  for linking shared objects.
</para>

<example_commands>
env = Environment(LINKCOMSTR = "Linking $TARGET")
</example_commands>
</summary>
</cvar>

<cvar name="LINKFLAGS">
<summary>
<para>
General user options passed to the linker.
Note that this variable should
<emphasis>not</emphasis>
contain
<option>-l</option>
(or similar) options for linking with the libraries listed in &cv-link-LIBS;,
nor
<option>-L</option>
(or similar) library search path options
that scons generates automatically from &cv-link-LIBPATH;.
See
&cv-link-_LIBFLAGS;
above,
for the variable that expands to library-link options,
and
&cv-link-_LIBDIRFLAGS;
above,
for the variable that expands to library search path options.
See also &cv-link-SHLINKFLAGS;.  for linking shared objects.
</para>
</summary>
</cvar>

<cvar name="SHLIBNOVERSIONSYMLINKS">
<summary>
<para>
Instructs the &b-link-SharedLibrary; builder to not create symlinks for versioned
shared libraries.
</para>
</summary>
</cvar>

<cvar name="SHLIBVERSIONFLAGS">
<summary>
<para>
Extra flags added to &cv-link-SHLINKCOM; when building versioned
&b-link-SharedLibrary;. These flags are only used when &cv-link-SHLIBVERSION; is
set.
</para>
</summary>
</cvar>

<cvar name="SHLINK">
<summary>
<para>
The linker for programs that use shared libraries.
See also &cv-link-LINK; for linking static objects.
</para>
</summary>
</cvar>

<cvar name="SHLINKCOM">
<summary>
<para>
The command line used to link programs using shared libraries.
See also &cv-link-LINKCOM; for linking static objects.
</para>
</summary>
</cvar>

<cvar name="SHLINKCOMSTR">
<summary>
<para>
The string displayed when programs using shared libraries are linked.
If this is not set, then &cv-link-SHLINKCOM; (the command line) is displayed.
See also &cv-link-LINKCOMSTR;  for linking static objects.
</para>

<example_commands>
env = Environment(SHLINKCOMSTR = "Linking shared $TARGET")
</example_commands>
</summary>
</cvar>

<cvar name="SHLINKFLAGS">
<summary>
<para>
General user options passed to the linker for programs using shared libraries.
Note that this variable should
<emphasis>not</emphasis>
contain
<option>-l</option>
(or similar) options for linking with the libraries listed in &cv-link-LIBS;,
nor
<option>-L</option>
(or similar) include search path options
that scons generates automatically from &cv-link-LIBPATH;.
See
&cv-link-_LIBFLAGS;
above,
for the variable that expands to library-link options,
and
&cv-link-_LIBDIRFLAGS;
above,
for the variable that expands to library search path options.
See also &cv-link-LINKFLAGS;  for linking static objects.
</para>
</summary>
</cvar>

<cvar name="SONAME">
<summary>
<para>
Variable used to hard-code SONAME for versioned shared library/loadable module.
<example_commands>
env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2')
</example_commands>
The variable is used, for example, by &t-link-gnulink; linker tool.
</para>
</summary>
</cvar>

<cvar name="SOVERSION">
<summary>
<para>
This will construct the <varname>SONAME</varname> using on the base library name 
(<parameter>test</parameter> in the example below) and use specified <varname>SOVERSION</varname>
to create <varname>SONAME</varname>.
<example_commands>
env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SOVERSION='2')
</example_commands>
The variable is used, for example, by &t-link-gnulink; linker tool.
</para>
<para>
In the example above <varname>SONAME</varname> would be <filename>libtest.so.2</filename> 
which would be a symlink and point to <filename>libtest.so.0.1.2</filename>
</para>
</summary>
</cvar>

<cvar name="STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME">
  <summary>
    <para>
      When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library.
    </para>
  </summary>
</cvar>


</sconsdoc>