Skip to content

Commit 65a1581

Browse files
committed
Minor doc fixes for linking
Some of the linker-related entities needed some rewording; others needed a cleanup where emphasized references were turned into live links to entities elsewhere. Most of the remaining references to command-line options were turned into live links (the addition of anchors for those is relatively recent, they didn't originally use live-linking). Signed-off-by: Mats Wichmann <mats@linux.com>
1 parent 90834f1 commit 65a1581

10 files changed

Lines changed: 78 additions & 47 deletions

File tree

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
8383
and tweak wording a bit.
8484
- zip tool now uses zipfile module's "from_file" method to populate
8585
ZipInfo records, rather than doing manually.
86+
- Update documentation for linking-related construction variables.
87+
Add a few more live links.
8688

8789

8890
RELEASE 4.10.1 - Sun, 16 Nov 2025 10:51:57 -0700

RELEASE.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ DOCUMENTATION
121121
- Clarify VariantDir behavior when switching to not duplicate sources
122122
and tweak wording a bit.
123123

124+
- Update documentation for linking-related construction variables.
125+
Add a few more live links.
126+
124127
DEVELOPMENT
125128
-----------
126129

SCons/Environment.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2783,7 +2783,7 @@ and added to the following &consvars;:
27832783
Any other strings not associated with options
27842784
are assumed to be the names of libraries
27852785
and added to the
2786-
&cv-LIBS; &consvar;.
2786+
&cv-link-LIBS; &consvar;.
27872787
</para>
27882788

27892789
<para>

SCons/Script/Main.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ as long as they can be unambiguously resolved.
8282
For example, if
8383
<function>add_option</function> is called to
8484
define a <option>--devicename</option> option,
85-
it will recognize <option>--device</option>,
85+
it will also recognize <option>--device</option>,
8686
<option>--dev</option>
8787
and so forth as long as there is no other option
8888
which could also match to the same abbreviation.
@@ -200,9 +200,11 @@ Future versions of &SCons; will likely forbid such usage.
200200
</arguments>
201201
<summary>
202202
<para>
203-
Allows setting options for SCons debug options. Currently, the only supported value is
204-
<emphasis>json</emphasis> which sets the path to the JSON file created when
205-
<literal>--debug=json</literal> is set.
203+
Allows setting values for SCons debug options.
204+
Currently, the only supported value is
205+
<emphasis>json</emphasis> which sets the path to the JSON file created when the
206+
<link linkend="opt-debug"><option>--debug=json</option></link>
207+
argument is given.
206208
</para>
207209
<example_commands>
208210
DebugOptions(json='#/build/output/scons_stats.json')
@@ -436,7 +438,7 @@ processed prior to the &f-GetOption; call in the &SConscript; files.
436438
</row>
437439
<row>
438440
<entry><varname>config</varname></entry>
439-
<entry><option>--config</option></entry>
441+
<entry><link linkend="opt-config"><option>--config</option></link></entry>
440442
</row>
441443
<row>
442444
<entry><varname>debug</varname></entry>
@@ -1171,13 +1173,13 @@ SetOption('max_drift', 0)
11711173
</para>
11721174

11731175
<screen>
1174-
$ <userinput>scons --compilers=mingw</userinput> # the correct flag is --compiler
1176+
$ <userinput>scons --complier=mingw</userinput> # the correct flag is --compiler
11751177
</screen>
11761178

11771179
<para>
1178-
Here &SCons; could go off and run a bunch of configure steps with
1179-
the default value of <literal>--compiler</literal>, since the
1180-
incorrect command line did not actually supply a value to it,
1180+
Here &SCons; could go off and run a bunch of configure steps using
1181+
the default value of <option>--compiler</option>, since the
1182+
misspelled option causes it not to be supplied the intended value,
11811183
costing developer time to track down why the configure logic
11821184
made the "wrong" choices. This example shows catching this:
11831185
</para>

SCons/Script/SConscript.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ file is found.
278278
<para>
279279
Adds <parameter>text</parameter> to the help message shown when
280280
&scons; is called with the
281-
<option>-h</option> or <option>--help</option>
281+
<link linkend="opt-"><option>-h</option> or <option>--help</option></link>
282282
argument.
283283
</para>
284284
<para>

SCons/Tool/Tool.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,11 @@ general information on specifying emitters.
523523
<summary>
524524
<para>
525525
When this &consvar; is defined, a versioned loadable module
526-
is created by &b-link-LoadableModule; builder. This activates the
526+
is created by the &b-link-LoadableModule; builder. This activates the
527527
&cv-link-_LDMODULEVERSIONFLAGS; and thus modifies the &cv-link-LDMODULECOM; as
528528
required, adds the version number to the library name, and creates the symlinks
529-
that are needed. &cv-link-LDMODULEVERSION; versions should exist in the same
530-
format as &cv-link-SHLIBVERSION;.
529+
that are needed. &cv-link-LDMODULEVERSION; versions should be
530+
specified in the same format as &cv-link-SHLIBVERSION;.
531531
</para>
532532
</summary>
533533
</cvar>
@@ -572,9 +572,12 @@ When this &consvar; is defined, a versioned shared library
572572
is created by the &b-link-SharedLibrary; builder. This activates the
573573
&cv-link-_SHLIBVERSIONFLAGS; and thus modifies the &cv-link-SHLINKCOM; as
574574
required, adds the version number to the library name, and creates the symlinks
575-
that are needed. &cv-link-SHLIBVERSION; versions should exist as alphanumeric,
576-
decimal-delimited values as defined by the regular expression "\w+[\.\w+]*".
577-
Example &cv-link-SHLIBVERSION; values include '1', '1.2.3', and '1.2.gitaa412c8b'.
575+
that are needed. &cv-link-SHLIBVERSION; versions are specified
576+
as alphanumeric, decimal-delimited values which can be
577+
recognized by the regular expression
578+
<literal>"\w+[\.\w+]*"</literal>
579+
Example valid &cv-SHLIBVERSION; values include
580+
'1', '1.2.3', and '1.2.gitaa412c8b'.
578581
</para>
579582
</summary>
580583
</cvar>

SCons/Tool/install.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ in this case.
6969
</para>
7070

7171
<para>
72-
If the <option>--install-sandbox</option> command line
72+
If the
73+
<link linkend="opt-install-sandbox"><option>--install-sandbox</option></link>
7374
option is given, the target directory will be prefixed
7475
by the directory path specified.
7576
This is useful to test installation behavior without installing to

SCons/Tool/lex.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ command-line option. Use this in preference to including
123123
<cvar name="LEXUNISTD">
124124
<summary>
125125
<para>
126-
Used only in Windows environments to set a lex flag to prevent 'unistd.h' from being included. The default value is '--nounistd'.
126+
Used only in Windows environments to set a lex flag to prevent
127+
<literal>unistd.h</literal> from being included.
128+
The default value is <option>--nounistd</option>.
127129
</para>
128130
</summary>
129131
</cvar>

SCons/Tool/link.xml

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ if &cv-link-SHLIBVERSION; is set. Otherwise, it evaluates to an empty string.
8383
<cvar name="_LDMODULESONAME">
8484
<summary>
8585
<para>
86-
A macro that automatically generates loadable module's SONAME based on $TARGET,
87-
$LDMODULEVERSION and $LDMODULESUFFIX. Used by &b-link-LoadableModule; builder
86+
A macro that automatically generates a loadable module's &cv-link-SONAME;
87+
based on <literal>$TARGET</literal>,
88+
&cv-link-LDMODULEVERSION; and &cv-link-LDMODULESUFFIX;.
89+
Used by the &b-link-LoadableModule; builder
8890
when the linker tool supports SONAME (e.g. &t-link-gnulink;).
8991
</para>
9092
</summary>
@@ -94,11 +96,12 @@ when the linker tool supports SONAME (e.g. &t-link-gnulink;).
9496
<summary>
9597
<para>
9698
This macro automatically introduces extra flags to &cv-link-LDMODULECOM; when
97-
building versioned &b-link-LoadableModule; (that is when
98-
&cv-link-LDMODULEVERSION; is set). <literal>_LDMODULEVERSIONFLAGS</literal>
99+
building a versioned &b-link-LoadableModule;
100+
(that is, when &cv-link-LDMODULEVERSION; is set).
101+
&cv-_LDMODULEVERSIONFLAGS;
99102
usually adds &cv-link-SHLIBVERSIONFLAGS; and some extra dynamically generated
100-
options (such as <literal>-Wl,-soname=$_LDMODULESONAME</literal>). It is unused
101-
by plain (unversioned) loadable modules.
103+
options (such as <literal>-Wl,-soname=$_LDMODULESONAME</literal>).
104+
It is unused by plain (unversioned) loadable modules.
102105
</para>
103106
</summary>
104107
</cvar>
@@ -107,20 +110,23 @@ by plain (unversioned) loadable modules.
107110
<summary>
108111
<para>
109112
This macro automatically introduces extra flags to &cv-link-SHLINKCOM; when
110-
building versioned &b-link-SharedLibrary; (that is when &cv-link-SHLIBVERSION;
111-
is set). <literal>_SHLIBVERSIONFLAGS</literal> usually adds &cv-link-SHLIBVERSIONFLAGS;
112-
and some extra dynamically generated options (such as
113-
<literal>-Wl,-soname=$_SHLIBSONAME</literal>. It is unused by "plain"
114-
(unversioned) shared libraries.
113+
building a versioned &b-link-SharedLibrary;
114+
(that is, when &cv-link-SHLIBVERSION; is set).
115+
&cv-_SHLIBVERSIONFLAGS; usually adds &cv-link-SHLIBVERSIONFLAGS;
116+
and some extra dynamically generated options
117+
(such as <literal>-Wl,-soname=$_SHLIBSONAME</literal>).
118+
It is unused by "plain" (unversioned) shared libraries.
115119
</para>
116120
</summary>
117121
</cvar>
118122

119123
<cvar name="_SHLIBSONAME">
120124
<summary>
121125
<para>
122-
A macro that automatically generates shared library's SONAME based on $TARGET,
123-
$SHLIBVERSION and $SHLIBSUFFIX. Used by &b-link-SharedLibrary; builder when
126+
A macro that automatically generates a shared library's &cv-link-SONAME;
127+
based on <literal>$TARGET</literal>,
128+
&cv-link-SHLIBVERSION; and &cv-link-SHLIBSUFFIX;.
129+
Used by the &b-link-SharedLibrary; builder when
124130
the linker tool supports SONAME (e.g. &t-link-gnulink;).
125131
</para>
126132
</summary>
@@ -202,8 +208,9 @@ General user options passed to the linker for building loadable modules.
202208
<cvar name="LDMODULENOVERSIONSYMLINKS">
203209
<summary>
204210
<para>
205-
Instructs the &b-link-LoadableModule; builder to not automatically create symlinks
206-
for versioned modules. Defaults to <literal>$SHLIBNOVERSIONSYMLINKS</literal>
211+
Instructs the &b-link-LoadableModule; builder
212+
not to automatically create symlinks for versioned modules.
213+
Defaults to &cv-link-SHLIBNOVERSIONSYMLINKS;.
207214
</para>
208215
</summary>
209216
</cvar>
@@ -234,8 +241,8 @@ the same as $SHLIBSUFFIX.
234241
<summary>
235242
<para>
236243
Extra flags added to &cv-link-LDMODULECOM; when building versioned
237-
&b-link-LoadableModule;. These flags are only used when &cv-link-LDMODULEVERSION; is
238-
set.
244+
&b-link-LoadableModule;.
245+
These flags are only used when &cv-link-LDMODULEVERSION; is set.
239246
</para>
240247
</summary>
241248
</cvar>
@@ -399,29 +406,37 @@ See also &cv-link-LINKFLAGS; for linking static objects.
399406
<cvar name="SONAME">
400407
<summary>
401408
<para>
402-
Variable used to hard-code SONAME for versioned shared library/loadable module.
409+
The name of a versioned shared library/loadable module.
410+
If specified, it is an explicit statement of the name;
411+
if unspecified, the value is generated.
412+
&cv-SONAME; and &cv-link-SOVERSION; may not both be specified
413+
in the same &consenv; or override.
403414
<example_commands>
415+
# Will cause libtest.so.2 to exist and be a symlink to libtest.so.0.1.2
404416
env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2')
405417
</example_commands>
406-
The variable is used, for example, by &t-link-gnulink; linker tool.
418+
</para>
419+
<para>
420+
This variable is used by toolchains that support versioned shared objects.
407421
</para>
408422
</summary>
409423
</cvar>
410424

411425
<cvar name="SOVERSION">
412426
<summary>
413427
<para>
414-
This will construct the <varname>SONAME</varname> using on the base library name
415-
(<parameter>test</parameter> in the example below) and use specified <varname>SOVERSION</varname>
416-
to create <varname>SONAME</varname>.
428+
Version string used in construction of &cv-link-SONAME;.
429+
The version is added to the base library name
430+
(<parameter>test</parameter> in the example below).
431+
&cv-SONAME; and &cv-SOVERSION; may not both be specified
432+
in the same &consenv; or override.
417433
<example_commands>
434+
# SONAME will be libtest.so.2, and will be a symlink to libtest.so.0.1.2
418435
env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SOVERSION='2')
419436
</example_commands>
420-
The variable is used, for example, by &t-link-gnulink; linker tool.
421437
</para>
422438
<para>
423-
In the example above <varname>SONAME</varname> would be <filename>libtest.so.2</filename>
424-
which would be a symlink and point to <filename>libtest.so.0.1.2</filename>
439+
This variable is used by toolchains that support versioned shared objects.
425440
</para>
426441
</summary>
427442
</cvar>

SCons/Tool/packaging/packaging.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ This file is processed by the bin/SConsDoc.py module
2828
<summary>
2929
<para>
3030
Sets construction variables for the &b-link-Package; Builder.
31-
If this tool is enabled, the <option>--package-type</option>
32-
command-line option is also enabled.
31+
If this tool is enabled, the
32+
<link linkend="opt-package-type"><option>--package-type</option></link>
33+
command-line option is made available.
3334
</para>
3435
</summary>
3536
<sets>
@@ -56,7 +57,9 @@ env = Environment(tools=['default', 'packaging'])
5657
&SCons; can build packages in a number of well known packaging formats.
5758
The target package type may be selected with the
5859
&cv-link-PACKAGETYPE; construction variable
59-
or the <option>--package-type</option> command line option.
60+
or the
61+
<link linkend="opt-package-type"><option>--package-type</option></link>
62+
command line option.
6063
The package type may be a list, in which case &SCons; will attempt
6164
to build packages for each type in the list. Example:
6265
</para>

0 commit comments

Comments
 (0)