@@ -2419,38 +2419,41 @@ when it is done linking it.
24192419Builds an object file intended for
24202420inclusion in a shared library.
24212421Source files must have one of the same set of extensions
2422- specified above for the
2423- &b-StaticObject;
2422+ specified for the
2423+ &b-link- StaticObject;
24242424builder method.
2425- On some platforms building a shared object requires additional
2426- compiler option
2427- (e.g. <option>-fPIC</option> for <command>gcc</command>)
2428- in addition to those needed to build a
2429- normal (static) object, but on some platforms there is no difference between a
2430- shared object and a normal (static) one. When there is a difference, SCons
2431- will only allow shared objects to be linked into a shared library, and will
2432- use a different suffix for shared objects. On platforms where there is no
2433- difference, SCons will allow both normal (static)
2434- and shared objects to be linked into a
2435- shared library, and will use the same suffix for shared and normal
2436- (static) objects.
24372425The target object file prefix,
24382426specified by the &cv-link-SHOBJPREFIX; &consvar;
24392427(by default, the same as &cv-link-OBJPREFIX;),
24402428and suffix,
24412429specified by the &cv-link-SHOBJSUFFIX; &consvar;,
24422430are automatically added to the target if not already present.
2431+ &b-SharedObject; is a single-source builder.
24432432Examples:
24442433</para>
24452434
24462435<example_commands>
24472436env.SharedObject(target='ddd', source='ddd.c')
24482437env.SharedObject(target='eee.o', source='eee.cpp')
24492438env.SharedObject(target='fff.obj', source='fff.for')
2439+ env.SharedObject(source=Glob('*.c'))
24502440</example_commands>
24512441
24522442<para>
2453- Note that the source files will be scanned
2443+ On some platforms building a shared object requires additional
2444+ compiler option(s)
2445+ (e.g. <option>-fPIC</option> for <command>gcc</command>)
2446+ in addition to those needed to build a
2447+ normal (static) object.
2448+ If shared and static objects differ,
2449+ &SCons; will allow only shared objects
2450+ to be linked into a shared library,
2451+ and will use a different suffix for shared objects
2452+ to help indicate and track the difference.
2453+ </para>
2454+
2455+ <para>
2456+ Source files will be scanned
24542457according to the suffix mappings in the
24552458<classname>SourceFileScanner</classname>
24562459object.
@@ -2502,10 +2505,10 @@ will raise an error if there is any mismatch.
25022505 <listitem><para>
25032506Builds a static object file
25042507from one or more C, C++, D, or Fortran source files.
2505- Source files must have one of the following extensions :
2508+ The file extension mapping is shown in the table :
25062509</para>
25072510
2508- <example_commands >
2511+ <literallayout><literal >
25092512 .asm assembly language file
25102513 .ASM assembly language file
25112514 .c C file
@@ -2534,28 +2537,30 @@ Source files must have one of the following extensions:
25342537 POSIX: assembly language file + C pre-processor
25352538 .spp assembly language file + C pre-processor
25362539 .SPP assembly language file + C pre-processor
2537- </example_commands >
2540+ </literal></literallayout >
25382541
25392542<para>
25402543The target object file prefix,
25412544specified by the &cv-link-OBJPREFIX; &consvar;
2542- (nothing by default),
2545+ (empty string by default),
25432546and suffix,
25442547specified by the &cv-link-OBJSUFFIX; &consvar;
25452548(<filename>.obj</filename> on Windows systems,
25462549<filename>.o</filename> on POSIX systems),
25472550are automatically added to the target if not already present.
2551+ &b-StaticObject; is a single-source builder.
25482552Examples:
25492553</para>
25502554
25512555<example_commands>
25522556env.StaticObject(target='aaa', source='aaa.c')
25532557env.StaticObject(target='bbb.o', source='bbb.c++')
25542558env.StaticObject(target='ccc.obj', source='ccc.f')
2559+ env.StaticObject(source=Glob('*.c'))
25552560</example_commands>
25562561
25572562<para>
2558- Note that the source files will be scanned
2563+ Source files will be scanned
25592564according to the suffix mappings in the
25602565<classname>SourceFileScanner</classname>
25612566object.
0 commit comments