@@ -36,13 +36,13 @@ if it is not already present.
36
36
Example:
37
37
</para >
38
38
39
- <example_commands >
39
+ <programlisting language = " python " >
40
40
# builds foo.c
41
41
env.CFile(target='foo.c', source='foo.l')
42
42
43
43
# builds bar.c
44
44
env.CFile(target='bar', source='bar.y')
45
- </example_commands >
45
+ </programlisting >
46
46
47
47
<!-- para> ** Left here for reference, does not need to be user-visible. **
48
48
Note that for yacc files,
@@ -67,13 +67,13 @@ if it is not already present.
67
67
Example:
68
68
</para >
69
69
70
- <example_commands >
70
+ <programlisting language = " python " >
71
71
# builds foo.cc
72
72
env.CXXFile(target='foo.cc', source='foo.ll')
73
73
74
74
# builds bar.cc
75
75
env.CXXFile(target='bar', source='bar.yy')
76
- </example_commands >
76
+ </programlisting >
77
77
78
78
<!-- para> ** Left here for reference, does not need to be user-visible. **
79
79
Note that for yacc files,
@@ -141,9 +141,9 @@ are automatically added to the target if not already present.
141
141
Example:
142
142
</para >
143
143
144
- <example_commands >
144
+ <programlisting language = " python " >
145
145
env.Program(target='foo', source=['foo.o', 'bar.c', 'baz.f'])
146
- </example_commands >
146
+ </programlisting >
147
147
</summary >
148
148
</builder >
149
149
@@ -187,9 +187,9 @@ it is appended (following a period) to the resulting library name.
187
187
Example:
188
188
</para >
189
189
190
- <example_commands >
190
+ <programlisting language = " python " >
191
191
env.SharedLibrary(target='bar', source=['bar.c', 'foo.o'])
192
- </example_commands >
192
+ </programlisting >
193
193
194
194
<para >
195
195
On Windows systems, the
@@ -228,9 +228,9 @@ adds the version number to the library name, and creates any
228
228
symbolic links that are needed.
229
229
</para >
230
230
231
- <example_commands >
231
+ <programlisting language = " python " >
232
232
env.SharedLibrary(target='bar', source=['bar.c', 'foo.o'], SHLIBVERSION='1.5.2')
233
- </example_commands >
233
+ </programlisting >
234
234
235
235
<para >
236
236
On a POSIX system, supplying a simple version string (no dots)
@@ -264,9 +264,9 @@ up and requiring user attention when it is run. If you change
264
264
For example,
265
265
</para >
266
266
267
- <example_commands >
267
+ <programlisting language = " python " >
268
268
env.SharedLibrary(target='bar', source=['bar.cxx', 'foo.obj'], register=1)
269
- </example_commands >
269
+ </programlisting >
270
270
271
271
<para >
272
272
will register <filename >bar.dll</filename > as a COM object
@@ -281,38 +281,41 @@ when it is done linking it.
281
281
Builds an object file intended for
282
282
inclusion in a shared library.
283
283
Source files must have one of the same set of extensions
284
- specified above for the
285
- &b-StaticObject;
284
+ specified for the
285
+ &b-link- StaticObject;
286
286
builder method.
287
- On some platforms building a shared object requires additional
288
- compiler option
289
- (e.g. <option >-fPIC</option > for <command >gcc</command >)
290
- in addition to those needed to build a
291
- normal (static) object, but on some platforms there is no difference between a
292
- shared object and a normal (static) one. When there is a difference, SCons
293
- will only allow shared objects to be linked into a shared library, and will
294
- use a different suffix for shared objects. On platforms where there is no
295
- difference, SCons will allow both normal (static)
296
- and shared objects to be linked into a
297
- shared library, and will use the same suffix for shared and normal
298
- (static) objects.
299
287
The target object file prefix,
300
288
specified by the &cv-link-SHOBJPREFIX; &consvar;
301
289
(by default, the same as &cv-link-OBJPREFIX; ),
302
290
and suffix,
303
291
specified by the &cv-link-SHOBJSUFFIX; &consvar; ,
304
292
are automatically added to the target if not already present.
293
+ &b-SharedObject; is a single-source builder.
305
294
Examples:
306
295
</para >
307
296
308
- <example_commands >
297
+ <programlisting language = " python " >
309
298
env.SharedObject(target='ddd', source='ddd.c')
310
299
env.SharedObject(target='eee.o', source='eee.cpp')
311
300
env.SharedObject(target='fff.obj', source='fff.for')
312
- </example_commands >
301
+ env.SharedObject(source=Glob('*.c'))
302
+ </programlisting >
313
303
314
304
<para >
315
- Note that the source files will be scanned
305
+ On some platforms building a shared object requires additional
306
+ compiler option(s)
307
+ (e.g. <option >-fPIC</option > for <command >gcc</command >)
308
+ in addition to those needed to build a
309
+ normal (static) object.
310
+ If shared and static objects differ,
311
+ &SCons; will allow only shared objects
312
+ to be linked into a shared library,
313
+ and will use a different suffix for shared objects
314
+ to help indicate and track the difference.
315
+ </para >
316
+
317
+ <para >
318
+ Source files will be scanned
316
319
according to the suffix mappings in the
317
320
<classname >SourceFileScanner</classname >
318
321
object.
@@ -342,9 +345,9 @@ are automatically added to the target if not already present.
342
345
Example:
343
346
</para >
344
347
345
- <example_commands >
348
+ <programlisting language = " python " >
346
349
env.StaticLibrary(target='bar', source=['bar.c', 'foo.o'])
347
- </example_commands >
350
+ </programlisting >
348
351
349
352
<para >
350
353
Any object files listed in the
@@ -364,10 +367,10 @@ will raise an error if there is any mismatch.
364
367
<para >
365
368
Builds a static object file
366
369
from one or more C, C++, D, or Fortran source files.
367
- Source files must have one of the following extensions :
370
+ The file extension mapping is shown in the table :
368
371
</para >
369
372
370
- <example_commands >
373
+ <literallayout >< literal >
371
374
.asm assembly language file
372
375
.ASM assembly language file
373
376
.c C file
@@ -396,28 +399,30 @@ Source files must have one of the following extensions:
396
399
POSIX: assembly language file + C pre-processor
397
400
.spp assembly language file + C pre-processor
398
401
.SPP assembly language file + C pre-processor
399
- </example_commands >
402
+ </literal ></ literallayout >
400
403
401
404
<para >
402
405
The target object file prefix,
403
406
specified by the &cv-link-OBJPREFIX; &consvar;
404
- (nothing by default),
407
+ (empty string by default),
405
408
and suffix,
406
409
specified by the &cv-link-OBJSUFFIX; &consvar;
407
410
(<filename >.obj</filename > on Windows systems,
408
411
<filename >.o</filename > on POSIX systems),
409
412
are automatically added to the target if not already present.
413
+ &b-StaticObject; is a single-source builder.
410
414
Examples:
411
415
</para >
412
416
413
- <example_commands >
417
+ <programlisting language = " python " >
414
418
env.StaticObject(target='aaa', source='aaa.c')
415
419
env.StaticObject(target='bbb.o', source='bbb.c++')
416
420
env.StaticObject(target='ccc.obj', source='ccc.f')
417
- </example_commands >
421
+ env.StaticObject(source=Glob('*.c'))
422
+ </programlisting >
418
423
419
424
<para >
420
- Note that the source files will be scanned
425
+ Source files will be scanned
421
426
according to the suffix mappings in the
422
427
<classname >SourceFileScanner</classname >
423
428
object.
0 commit comments