@@ -281,38 +281,41 @@ when it is done linking it.
281281Builds an object file intended for
282282inclusion in a shared library.
283283Source 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;
286286builder 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.
299287The target object file prefix,
300288specified by the &cv-link-SHOBJPREFIX; &consvar;
301289(by default, the same as &cv-link-OBJPREFIX; ),
302290and suffix,
303291specified by the &cv-link-SHOBJSUFFIX; &consvar; ,
304292are automatically added to the target if not already present.
293+ &b-SharedObject; is a single-source builder.
305294Examples:
306295</para >
307296
308297<example_commands >
309298env.SharedObject(target='ddd', source='ddd.c')
310299env.SharedObject(target='eee.o', source='eee.cpp')
311300env.SharedObject(target='fff.obj', source='fff.for')
301+ env.SharedObject(source=Glob('*.c'))
312302</example_commands >
313303
314304<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
316319according to the suffix mappings in the
317320<classname >SourceFileScanner</classname >
318321object.
@@ -364,10 +367,10 @@ will raise an error if there is any mismatch.
364367<para >
365368Builds a static object file
366369from 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 :
368371</para >
369372
370- <example_commands >
373+ <literallayout >< literal >
371374 .asm assembly language file
372375 .ASM assembly language file
373376 .c C file
@@ -396,28 +399,30 @@ Source files must have one of the following extensions:
396399 POSIX: assembly language file + C pre-processor
397400 .spp assembly language file + C pre-processor
398401 .SPP assembly language file + C pre-processor
399- </example_commands >
402+ </literal ></ literallayout >
400403
401404<para >
402405The target object file prefix,
403406specified by the &cv-link-OBJPREFIX; &consvar;
404- (nothing by default),
407+ (empty string by default),
405408and suffix,
406409specified by the &cv-link-OBJSUFFIX; &consvar;
407410(<filename >.obj</filename > on Windows systems,
408411<filename >.o</filename > on POSIX systems),
409412are automatically added to the target if not already present.
413+ &b-StaticObject; is a single-source builder.
410414Examples:
411415</para >
412416
413417<example_commands >
414418env.StaticObject(target='aaa', source='aaa.c')
415419env.StaticObject(target='bbb.o', source='bbb.c++')
416420env.StaticObject(target='ccc.obj', source='ccc.f')
421+ env.StaticObject(source=Glob('*.c'))
417422</example_commands >
418423
419424<para >
420- Note that the source files will be scanned
425+ Source files will be scanned
421426according to the suffix mappings in the
422427<classname >SourceFileScanner</classname >
423428object.
0 commit comments