@@ -150,13 +150,24 @@ env.Program(target='foo', source=['foo.o', 'bar.c', 'baz.f'])
150
150
<summary >
151
151
<para >
152
152
Builds a shared library
153
- (<filename >.so</filename > on a POSIX system,
154
- <filename >.dll</filename > on Windows)
155
153
given one or more object files
156
- or C, C++, D or Fortran source files.
157
- If any source files are given,
158
- then they will be automatically
159
- compiled to object files.
154
+ and/or C, C++, D or Fortran source files.
155
+ Any source files listed in the
156
+ <parameter >source</parameter > parameter
157
+ will be automatically
158
+ compiled to object files suitable
159
+ for use in a shared library.
160
+ Any object files listed in the
161
+ <parameter >source</parameter > parameter
162
+ must have been built for a shared library
163
+ (that is, using the
164
+ &b-SharedObject;
165
+ builder method).
166
+ &scons;
167
+ will raise an error if there is any mismatch.
168
+ </para >
169
+
170
+ <para >
160
171
The target library file prefix,
161
172
specified by the &cv-link-SHLIBPREFIX; &consvar;
162
173
(by default, <filename >lib</filename > on POSIX systems,
@@ -165,7 +176,13 @@ and suffix,
165
176
specified by the &cv-link-SHLIBSUFFIX; &consvar;
166
177
(by default, <filename >.dll</filename > on Windows systems,
167
178
<filename >.so</filename > on POSIX systems),
168
- are automatically added to the target if not already present.
179
+ are automatically added (if not already present)
180
+ to the target name to make up the library filename.
181
+ On a POSIX system, if the &cv-link-SHLIBVERSION; &consvar; is set,
182
+ it is appended (following a period) to the resulting library name.
183
+ </para >
184
+
185
+ <para >
169
186
Example:
170
187
</para >
171
188
@@ -195,16 +212,6 @@ if there is not already a <filename>.dll.a</filename> file explicitly
195
212
listed in the targets.
196
213
</para >
197
214
198
- <para >
199
- Any object files listed in the
200
- <parameter >source</parameter >
201
- must have been built for a shared library
202
- (that is, using the
203
- &b-SharedObject;
204
- builder method).
205
- &scons;
206
- will raise an error if there is any mismatch.
207
- </para >
208
215
209
216
<para >
210
217
On some platforms, there is a distinction between a shared library
@@ -214,7 +221,7 @@ For maximum portability, use the &b-link-LoadableModule; builder for the latter.
214
221
</para >
215
222
216
223
<para >
217
- When the &cv-link-SHLIBVERSION; &consvar ; is defined, a versioned
224
+ If &cv-link-SHLIBVERSION; is defined, a versioned
218
225
shared library is created. This modifies &cv-link-SHLINKFLAGS; as required,
219
226
adds the version number to the library name, and creates any
220
227
symbolic links that are needed.
@@ -225,17 +232,25 @@ env.SharedLibrary(target='bar', source=['bar.c', 'foo.o'], SHLIBVERSION='1.5.2')
225
232
</example_commands >
226
233
227
234
<para >
228
- On a POSIX system, versions with a single token create exactly one symlink:
229
- <filename >libbar.so.6</filename > would have symlink <filename >libbar.so</filename > only.
230
- On a POSIX system, versions with two or more
231
- tokens create exactly two symlinks: <filename >libbar.so.2.3.1</filename > would have symlinks
232
- <filename >libbar.so</filename > and <filename >libbar.so.2</filename >; on a Darwin (OSX) system the library would be
233
- <filename >libbar.2.3.1.dylib</filename > and the link would be <filename >libbar.dylib</filename >.
235
+ On a POSIX system, supplying a simple version string (no dots)
236
+ creates exactly one symbolic link: <literal >SHLIBVERSION="1"</literal >
237
+ would create (for example) library <filename >libbar.so.1</filename >
238
+ and symbolic link <filename >libbar.so</filename >.
239
+ Supplying a dotted version string will create two symbolic links
240
+ (irrespective of the number of segments in the version):
241
+ <literal >SHLIBVERSION="1.5.2"</literal > for the same library
242
+ would create library <filename >libbar.so.1.5.2</filename >
243
+ and symbolic links <filename >libbar.so</filename > and
244
+ <filename >libbar.so.1</filename >. A Darwin (OSX)
245
+ system creates one symlink in either case,
246
+ for the second example the library would be
247
+ <filename >libbar.1.5.2.dylib</filename >
248
+ and the link would be <filename >libbar.dylib</filename >.
234
249
</para >
235
250
236
251
<para >
237
- On Windows systems, specifying
238
- <parameter >register=1</parameter >
252
+ On Windows systems, specifying the
253
+ <parameter >register=1</parameter > keyword argument
239
254
will cause the <filename >.dll</filename > to be
240
255
registered after it is built.
241
256
The command that is run is determined by the &cv-link-REGSVR; &consvar;
0 commit comments