summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/DCommon.xml32
-rw-r--r--src/engine/SCons/Tool/MSCommon/common.py4
-rw-r--r--src/engine/SCons/Tool/__init__.py4
-rw-r--r--src/engine/SCons/Tool/c++.xml17
-rw-r--r--src/engine/SCons/Tool/cc.xml22
-rw-r--r--src/engine/SCons/Tool/f03.xml16
-rw-r--r--src/engine/SCons/Tool/f08.xml16
-rw-r--r--src/engine/SCons/Tool/f77.xml16
-rw-r--r--src/engine/SCons/Tool/f90.xml16
-rw-r--r--src/engine/SCons/Tool/f95.xml16
-rw-r--r--src/engine/SCons/Tool/fortran.xml16
-rw-r--r--src/engine/SCons/Tool/install.xml37
-rw-r--r--src/engine/SCons/Tool/intelc.py8
-rw-r--r--src/engine/SCons/Tool/javac.xml12
-rw-r--r--src/engine/SCons/Tool/link.xml24
-rw-r--r--src/engine/SCons/Tool/msvs.py27
-rw-r--r--src/engine/SCons/Tool/msvsTests.py14
-rw-r--r--src/engine/SCons/Tool/packaging.xml66
-rw-r--r--src/engine/SCons/Tool/packaging/__init__.xml56
-rw-r--r--src/engine/SCons/Tool/packaging/ipk.py2
-rw-r--r--src/engine/SCons/Tool/packaging/rpm.py2
-rw-r--r--src/engine/SCons/Tool/python.py49
-rw-r--r--src/engine/SCons/Tool/python.xml36
-rw-r--r--src/engine/SCons/Tool/suncxx.py18
-rw-r--r--src/engine/SCons/Tool/textfile.py12
-rw-r--r--src/engine/SCons/Tool/textfile.xml10
-rw-r--r--src/engine/SCons/Tool/xgettext.py2
27 files changed, 320 insertions, 230 deletions
diff --git a/src/engine/SCons/Tool/DCommon.xml b/src/engine/SCons/Tool/DCommon.xml
index 7cc47da..6d907c6 100644
--- a/src/engine/SCons/Tool/DCommon.xml
+++ b/src/engine/SCons/Tool/DCommon.xml
@@ -27,6 +27,7 @@ See its __doc__ string for a discussion of the format.
<summary>
<para>
The D compiler to use.
+See also &cv-link-SHDC; for compiling to shared objects.
</para>
</summary>
</cvar>
@@ -37,6 +38,18 @@ The D compiler to use.
The command line used to compile a D file to an object file.
Any options specified in the &cv-link-DFLAGS; construction variable
is included on this command line.
+See also &cv-link-SHDCOM; for compiling to shared objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="DCOMSTR">
+<summary>
+<para>
+If set, the string displayed when a D source file
+is compiled to a (static) object file.
+If not set, then &cv-link-DCOM; (the command line) is displayed.
+See also &cv-link-SHDCOMSTR; for compiling to shared objects.
</para>
</summary>
</cvar>
@@ -181,6 +194,7 @@ DLIBLINKSUFFIX.
<summary>
<para>
Name of the linker to use for linking systems including D sources.
+See also &cv-link-SHDLINK; for linking shared objects.
</para>
</summary>
</cvar>
@@ -189,6 +203,7 @@ Name of the linker to use for linking systems including D sources.
<summary>
<para>
The command line to use when linking systems including D sources.
+See also &cv-link-SHDLINKCOM; for linking shared objects.
</para>
</summary>
</cvar>
@@ -197,6 +212,7 @@ The command line to use when linking systems including D sources.
<summary>
<para>
List of linker flags.
+See also &cv-link-SHDLINKFLAGS; for linking shared objects.
</para>
</summary>
</cvar>
@@ -278,6 +294,7 @@ DVERSUFFIX.
<para>
The name of the compiler to use when compiling D source
destined to be in a shared objects.
+See also &cv-link-DC; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -286,6 +303,18 @@ destined to be in a shared objects.
<summary>
<para>
The command line to use when compiling code to be part of shared objects.
+See also &cv-link-DCOM; for compiling to static objects.
+</para>
+</summary>
+</cvar>
+
+<cvar name="SHDCOMSTR">
+<summary>
+<para>
+If set, the string displayed when a D source file
+is compiled to a (shared) object file.
+If not set, then &cv-link-SHDCOM; (the command line) is displayed.
+See also &cv-link-DCOMSTR; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -311,6 +340,7 @@ SHDLIBVERSIONFLAGS.
<para>
The linker to use when creating shared objects for code bases
include D sources.
+See also &cv-link-DLINK; for linking static objects.
</para>
</summary>
</cvar>
@@ -319,6 +349,7 @@ include D sources.
<summary>
<para>
The command line to use when generating shared objects.
+See also &cv-link-DLINKCOM; for linking static objects.
</para>
</summary>
</cvar>
@@ -327,6 +358,7 @@ The command line to use when generating shared objects.
<summary>
<para>
The list of flags to use when generating a shared object.
+See also &cv-link-DLINKFLAGS; for linking static objects.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py
index 386f445..4ce605b 100644
--- a/src/engine/SCons/Tool/MSCommon/common.py
+++ b/src/engine/SCons/Tool/MSCommon/common.py
@@ -152,8 +152,8 @@ def normalize_env(env, keys, force=False):
Note: the environment is copied."""
normenv = {}
if env:
- for k in list(env.keys()):
- normenv[k] = copy.deepcopy(env[k])
+ for k, v in env.items():
+ normenv[k] = copy.deepcopy(v)
for k in keys:
if k in os.environ and (force or k not in normenv):
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 14306ab..76a0913 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -1130,7 +1130,7 @@ class ToolInitializer(object):
so we no longer copy and re-bind them when the construction
environment gets cloned.
"""
- for method in list(self.methods.values()):
+ for method in self.methods.values():
env.RemoveMethod(method)
def apply_tools(self, env):
@@ -1312,6 +1312,8 @@ def tool_list(platform, env):
'tar', 'zip',
# File builders (text)
'textfile',
+ # Python scanner tool
+ 'python',
], env)
tools = ([linker, c_compiler, cxx_compiler,
diff --git a/src/engine/SCons/Tool/c++.xml b/src/engine/SCons/Tool/c++.xml
index b59816b..019821c 100644
--- a/src/engine/SCons/Tool/c++.xml
+++ b/src/engine/SCons/Tool/c++.xml
@@ -47,6 +47,7 @@ Sets construction variables for generic POSIX C++ compilers.
</sets>
<uses>
<item>CXXCOMSTR</item>
+<item>SHCXXCOMSTR</item>
</uses>
</tool>
@@ -54,6 +55,7 @@ Sets construction variables for generic POSIX C++ compilers.
<summary>
<para>
The C++ compiler.
+See also &cv-link-SHCXX; for compiling to shared objects..
</para>
</summary>
</cvar>
@@ -65,6 +67,7 @@ The command line used to compile a C++ source file to an object file.
Any options specified in the &cv-link-CXXFLAGS; and
&cv-link-CPPFLAGS; construction variables
are included on this command line.
+See also &cv-link-SHCXXCOM; for compiling to shared objects..
</para>
</summary>
</cvar>
@@ -72,9 +75,10 @@ are included on this command line.
<cvar name="CXXCOMSTR">
<summary>
<para>
-The string displayed when a C++ source file
+If set, the string displayed when a C++ source file
is compiled to a (static) object file.
-If this is not set, then &cv-link-CXXCOM; (the command line) is displayed.
+If not set, then &cv-link-CXXCOM; (the command line) is displayed.
+See also &cv-link-SHCXXCOMSTR; for compiling to shared objects..
</para>
<example_commands>
@@ -91,6 +95,7 @@ By default, this includes the value of &cv-link-CCFLAGS;,
so that setting &cv-CCFLAGS; affects both C and C++ compilation.
If you want to add C++-specific flags,
you must set or override the value of &cv-link-CXXFLAGS;.
+See also &cv-link-SHCXXFLAGS; for compiling to shared objects..
</para>
</summary>
</cvar>
@@ -99,6 +104,7 @@ you must set or override the value of &cv-link-CXXFLAGS;.
<summary>
<para>
The C++ compiler used for generating shared-library objects.
+See also &cv-link-CXX; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -111,6 +117,7 @@ to a shared-library object file.
Any options specified in the &cv-link-SHCXXFLAGS; and
&cv-link-CPPFLAGS; construction variables
are included on this command line.
+See also &cv-link-CXXCOM; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -118,9 +125,10 @@ are included on this command line.
<cvar name="SHCXXCOMSTR">
<summary>
<para>
-The string displayed when a C++ source file
+If set, the string displayed when a C++ source file
is compiled to a shared object file.
-If this is not set, then &cv-link-SHCXXCOM; (the command line) is displayed.
+If not set, then &cv-link-SHCXXCOM; (the command line) is displayed.
+See also &cv-link-CXXCOMSTR; for compiling to static objects.
</para>
<example_commands>
@@ -134,6 +142,7 @@ env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET")
<para>
Options that are passed to the C++ compiler
to generate shared-library objects.
+See also &cv-link-CXXFLAGS; for compiling to static objects.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/cc.xml b/src/engine/SCons/Tool/cc.xml
index 06e73ff..e47cf2d 100644
--- a/src/engine/SCons/Tool/cc.xml
+++ b/src/engine/SCons/Tool/cc.xml
@@ -51,6 +51,8 @@ Sets construction variables for generic POSIX C compilers.
</sets>
<uses>
<item>PLATFORM</item>
+<item>CCCOMSTR</item>
+<item>SHCCCOMSTR</item>
</uses>
</tool>
@@ -67,8 +69,8 @@ The C compiler.
<para>
The command line used to compile a C source file to a (static) object
file. Any options specified in the &cv-link-CFLAGS;, &cv-link-CCFLAGS; and
-&cv-link-CPPFLAGS; construction variables are included on this command
-line.
+&cv-link-CPPFLAGS; construction variables are included on this command line.
+See also &cv-link-SHCCCOM; for compiling to shared objects.
</para>
</summary>
</cvar>
@@ -76,9 +78,10 @@ line.
<cvar name="CCCOMSTR">
<summary>
<para>
-The string displayed when a C source file
+If set, the string displayed when a C source file
is compiled to a (static) object file.
-If this is not set, then &cv-link-CCCOM; (the command line) is displayed.
+If not set, then &cv-link-CCCOM; (the command line) is displayed.
+See also &cv-link-SHCCCOMSTR; for compiling to shared objects.
</para>
<example_commands>
@@ -91,6 +94,7 @@ env = Environment(CCCOMSTR = "Compiling static object $TARGET")
<summary>
<para>
General options that are passed to the C and C++ compilers.
+See also &cv-link-SHCCFLAGS; for compiling to shared objects.
</para>
</summary>
</cvar>
@@ -99,6 +103,7 @@ General options that are passed to the C and C++ compilers.
<summary>
<para>
General options that are passed to the C compiler (C only; not C++).
+See also &cv-link-SHCFLAGS; for compiling to shared objects.
</para>
</summary>
</cvar>
@@ -156,6 +161,7 @@ The default list is:
<summary>
<para>
The C compiler used for generating shared-library objects.
+See also &cv-link-CC; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -169,6 +175,7 @@ Any options specified in the &cv-link-SHCFLAGS;,
&cv-link-SHCCFLAGS; and
&cv-link-CPPFLAGS; construction variables
are included on this command line.
+See also &cv-link-CCCOM; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -176,9 +183,10 @@ are included on this command line.
<cvar name="SHCCCOMSTR">
<summary>
<para>
-The string displayed when a C source file
+If set, the string displayed when a C source file
is compiled to a shared object file.
-If this is not set, then &cv-link-SHCCCOM; (the command line) is displayed.
+If not set, then &cv-link-SHCCCOM; (the command line) is displayed.
+See also &cv-link-CCCOMSTR; for compiling to static objects.
</para>
<example_commands>
@@ -192,6 +200,7 @@ env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET")
<para>
Options that are passed to the C and C++ compilers
to generate shared-library objects.
+See also &cv-link-CCFLAGS; for compiling to static objects.
</para>
</summary>
</cvar>
@@ -201,6 +210,7 @@ to generate shared-library objects.
<para>
Options that are passed to the C compiler (only; not C++)
to generate shared-library objects.
+See also &cv-link-CFLAGS; for compiling to static objects.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/f03.xml b/src/engine/SCons/Tool/f03.xml
index c020b81..61c02ef 100644
--- a/src/engine/SCons/Tool/f03.xml
+++ b/src/engine/SCons/Tool/f03.xml
@@ -77,9 +77,9 @@ for all Fortran versions.
<cvar name="F03COMSTR">
<summary>
<para>
-The string displayed when a Fortran 03 source file
+If set, the string displayed when a Fortran 03 source file
is compiled to an object file.
-If this is not set, then &cv-link-F03COM; or &cv-link-FORTRANCOM;
+If not set, then &cv-link-F03COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -217,10 +217,10 @@ for all Fortran versions.
<cvar name="F03PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 03 source file
+If set, the string displayed when a Fortran 03 source file
is compiled to an object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-F03PPCOM; or &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-F03PPCOM; or &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -256,9 +256,9 @@ for all Fortran versions.
<cvar name="SHF03COMSTR">
<summary>
<para>
-The string displayed when a Fortran 03 source file
+If set, the string displayed when a Fortran 03 source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHF03COM; or &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHF03COM; or &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -299,10 +299,10 @@ for all Fortran versions.
<cvar name="SHF03PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 03 source file
+If set, the string displayed when a Fortran 03 source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHF03PPCOM; or &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHF03PPCOM; or &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/f08.xml b/src/engine/SCons/Tool/f08.xml
index 802e4cc..a56d60b 100644
--- a/src/engine/SCons/Tool/f08.xml
+++ b/src/engine/SCons/Tool/f08.xml
@@ -77,9 +77,9 @@ for all Fortran versions.
<cvar name="F08COMSTR">
<summary>
<para>
-The string displayed when a Fortran 08 source file
+If set, the string displayed when a Fortran 08 source file
is compiled to an object file.
-If this is not set, then &cv-link-F08COM; or &cv-link-FORTRANCOM;
+If not set, then &cv-link-F08COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -217,10 +217,10 @@ for all Fortran versions.
<cvar name="F08PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 08 source file
+If set, the string displayed when a Fortran 08 source file
is compiled to an object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-F08PPCOM; or &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-F08PPCOM; or &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -256,9 +256,9 @@ for all Fortran versions.
<cvar name="SHF08COMSTR">
<summary>
<para>
-The string displayed when a Fortran 08 source file
+If set, the string displayed when a Fortran 08 source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHF08COM; or &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHF08COM; or &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -299,10 +299,10 @@ for all Fortran versions.
<cvar name="SHF08PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 08 source file
+If set, the string displayed when a Fortran 08 source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHF08PPCOM; or &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHF08PPCOM; or &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/f77.xml b/src/engine/SCons/Tool/f77.xml
index abfc4a2..70ec721 100644
--- a/src/engine/SCons/Tool/f77.xml
+++ b/src/engine/SCons/Tool/f77.xml
@@ -108,9 +108,9 @@ F77 dialect will be used. By default, this is empty
<cvar name="F77COMSTR">
<summary>
<para>
-The string displayed when a Fortran 77 source file
+If set, the string displayed when a Fortran 77 source file
is compiled to an object file.
-If this is not set, then &cv-link-F77COM; or &cv-link-FORTRANCOM;
+If not set, then &cv-link-F77COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -230,10 +230,10 @@ for all Fortran versions.
<cvar name="F77PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 77 source file
+If set, the string displayed when a Fortran 77 source file
is compiled to an object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-F77PPCOM; or &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-F77PPCOM; or &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -269,9 +269,9 @@ for all Fortran versions.
<cvar name="SHF77COMSTR">
<summary>
<para>
-The string displayed when a Fortran 77 source file
+If set, the string displayed when a Fortran 77 source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHF77COM; or &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHF77COM; or &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -312,10 +312,10 @@ for all Fortran versions.
<cvar name="SHF77PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 77 source file
+If set, the string displayed when a Fortran 77 source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHF77PPCOM; or &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHF77PPCOM; or &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/f90.xml b/src/engine/SCons/Tool/f90.xml
index 94249a3..64dc6e1 100644
--- a/src/engine/SCons/Tool/f90.xml
+++ b/src/engine/SCons/Tool/f90.xml
@@ -77,9 +77,9 @@ for all Fortran versions.
<cvar name="F90COMSTR">
<summary>
<para>
-The string displayed when a Fortran 90 source file
+If set, the string displayed when a Fortran 90 source file
is compiled to an object file.
-If this is not set, then &cv-link-F90COM; or &cv-link-FORTRANCOM;
+If not set, then &cv-link-F90COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -217,9 +217,9 @@ for all Fortran versions.
<cvar name="F90PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 90 source file
+If set, the string displayed when a Fortran 90 source file
is compiled after first running the file through the C preprocessor.
-If this is not set, then &cv-link-F90PPCOM; or &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-F90PPCOM; or &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -255,9 +255,9 @@ for all Fortran versions.
<cvar name="SHF90COMSTR">
<summary>
<para>
-The string displayed when a Fortran 90 source file
+If set, the string displayed when a Fortran 90 source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHF90COM; or &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHF90COM; or &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -298,10 +298,10 @@ for all Fortran versions.
<cvar name="SHF90PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 90 source file
+If set, the string displayed when a Fortran 90 source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHF90PPCOM; or &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHF90PPCOM; or &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/f95.xml b/src/engine/SCons/Tool/f95.xml
index 4a4db46..4bda653 100644
--- a/src/engine/SCons/Tool/f95.xml
+++ b/src/engine/SCons/Tool/f95.xml
@@ -77,9 +77,9 @@ for all Fortran versions.
<cvar name="F95COMSTR">
<summary>
<para>
-The string displayed when a Fortran 95 source file
+If set, the string displayed when a Fortran 95 source file
is compiled to an object file.
-If this is not set, then &cv-link-F95COM; or &cv-link-FORTRANCOM;
+If not set, then &cv-link-F95COM; or &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -217,10 +217,10 @@ for all Fortran versions.
<cvar name="F95PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 95 source file
+If set, the string displayed when a Fortran 95 source file
is compiled to an object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-F95PPCOM; or &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-F95PPCOM; or &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -256,9 +256,9 @@ for all Fortran versions.
<cvar name="SHF95COMSTR">
<summary>
<para>
-The string displayed when a Fortran 95 source file
+If set, the string displayed when a Fortran 95 source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHF95COM; or &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHF95COM; or &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -299,10 +299,10 @@ for all Fortran versions.
<cvar name="SHF95PPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran 95 source file
+If set, the string displayed when a Fortran 95 source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHF95PPCOM; or &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHF95PPCOM; or &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/fortran.xml b/src/engine/SCons/Tool/fortran.xml
index 53bcfb1..7b3c51f 100644
--- a/src/engine/SCons/Tool/fortran.xml
+++ b/src/engine/SCons/Tool/fortran.xml
@@ -73,9 +73,9 @@ are included on this command line.
<cvar name="FORTRANCOMSTR">
<summary>
<para>
-The string displayed when a Fortran source file
+If set, the string displayed when a Fortran source file
is compiled to an object file.
-If this is not set, then &cv-link-FORTRANCOM;
+If not set, then &cv-link-FORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -285,10 +285,10 @@ construction variables are included on this command line.
<cvar name="FORTRANPPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran source file
+If set, the string displayed when a Fortran source file
is compiled to an object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-FORTRANPPCOM;
+If not set, then &cv-link-FORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
@@ -330,9 +330,9 @@ to a shared-library object file.
<cvar name="SHFORTRANCOMSTR">
<summary>
<para>
-The string displayed when a Fortran source file
+If set, the string displayed when a Fortran source file
is compiled to a shared-library object file.
-If this is not set, then &cv-link-SHFORTRANCOM;
+If not set, then &cv-link-SHFORTRANCOM;
(the command line) is displayed.
</para>
</summary>
@@ -364,10 +364,10 @@ are included on this command line.
<cvar name="SHFORTRANPPCOMSTR">
<summary>
<para>
-The string displayed when a Fortran source file
+If set, the string displayed when a Fortran source file
is compiled to a shared-library object file
after first running the file through the C preprocessor.
-If this is not set, then &cv-link-SHFORTRANPPCOM;
+If not set, then &cv-link-SHFORTRANPPCOM;
(the command line) is displayed.
</para>
</summary>
diff --git a/src/engine/SCons/Tool/install.xml b/src/engine/SCons/Tool/install.xml
index 150308b..ce70d91 100644
--- a/src/engine/SCons/Tool/install.xml
+++ b/src/engine/SCons/Tool/install.xml
@@ -50,10 +50,24 @@ a builder.
</para>
<example_commands>
-env.Install('/usr/local/bin', source = ['foo', 'bar'])
+env.Install(target='/usr/local/bin', source=['foo', 'bar'])
</example_commands>
<para>
+Note that if target paths chosen for the
+&Install; builder (and the related &InstallAs; and
+&InstallVersionedLib; builders) are outside the
+project tree, such as in the example above,
+they may not be selected for "building" by default,
+since in the absence of other instructions
+&scons; builds targets that are underneath the top directory
+(the directory that contains the &SConstruct; file,
+usually the current directory).
+Use command line targets or the &Default; function
+in this case.
+</para>
+
+<para>
If the <option>--install-sandbox</option> command line
option is given, the target directory will be prefixed
by the directory path specified.
@@ -86,12 +100,16 @@ arguments list different numbers of files or directories.
</para>
<example_commands>
-env.InstallAs(target = '/usr/local/bin/foo',
- source = 'foo_debug')
-env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'],
- source = ['libFOO.a', 'libBAR.a'])
+env.InstallAs(target='/usr/local/bin/foo',
+ source='foo_debug')
+env.InstallAs(target=['../lib/libfoo.a', '../lib/libbar.a'],
+ source=['libFOO.a', 'libBAR.a'])
</example_commands>
+<para>
+See the note under &Install;.
+</para>
+
</summary>
</builder>
@@ -103,9 +121,14 @@ architecture will be generated based on symlinks of the source library.
</para>
<example_commands>
-env.InstallVersionedLib(target = '/usr/local/bin/foo',
- source = 'libxyz.1.5.2.so')
+env.InstallVersionedLib(target='/usr/local/bin/foo',
+ source='libxyz.1.5.2.so')
</example_commands>
+
+<para>
+See the note under &Install;.
+</para>
+
</summary>
</builder>
diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py
index 5a101b4..778cba1 100644
--- a/src/engine/SCons/Tool/intelc.py
+++ b/src/engine/SCons/Tool/intelc.py
@@ -495,15 +495,15 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0):
'LIB' : libdir,
'PATH' : bindir,
'LD_LIBRARY_PATH' : libdir}
- for p in list(paths.keys()):
- env.PrependENVPath(p, os.path.join(topdir, paths[p]))
+ for p, v in paths.items():
+ env.PrependENVPath(p, os.path.join(topdir, v))
if is_mac:
paths={'INCLUDE' : 'include',
'LIB' : libdir,
'PATH' : bindir,
'LD_LIBRARY_PATH' : libdir}
- for p in list(paths.keys()):
- env.PrependENVPath(p, os.path.join(topdir, paths[p]))
+ for p, v in paths.items():
+ env.PrependENVPath(p, os.path.join(topdir, v))
if is_windows:
# env key reg valname default subdir of top
paths=(('INCLUDE', 'IncludeDir', 'Include'),
diff --git a/src/engine/SCons/Tool/javac.xml b/src/engine/SCons/Tool/javac.xml
index bc89342..893130b 100644
--- a/src/engine/SCons/Tool/javac.xml
+++ b/src/engine/SCons/Tool/javac.xml
@@ -95,9 +95,9 @@ See its __doc__ string for a discussion of the format.
</para>
<example_commands>
- env.Java(target = 'classes', source = 'src')
- env.Java(target = 'classes', source = ['src1', 'src2'])
- env.Java(target = 'classes', source = ['File1.java', 'File2.java'])
+env.Java(target = 'classes', source = 'src')
+env.Java(target = 'classes', source = ['src1', 'src2'])
+env.Java(target = 'classes', source = ['File1.java', 'File2.java'])
</example_commands>
<para>
@@ -114,8 +114,8 @@ See its __doc__ string for a discussion of the format.
</para>
<example_commands>
- env = Environment()
- env['ENV']['LANG'] = 'en_GB.UTF-8'
+env = Environment()
+env['ENV']['LANG'] = 'en_GB.UTF-8'
</example_commands>
</summary>
</builder>
@@ -174,7 +174,7 @@ See its __doc__ string for a discussion of the format.
</para>
<example_commands>
- env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES")
+env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES")
</example_commands>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/link.xml b/src/engine/SCons/Tool/link.xml
index 654dafc..281e147 100644
--- a/src/engine/SCons/Tool/link.xml
+++ b/src/engine/SCons/Tool/link.xml
@@ -32,9 +32,6 @@ based on the types of source files.
</para>
</summary>
<sets>
-<item>SHLINK</item>
-<item>SHLINKFLAGS</item>
-<item>SHLINKCOM</item>
<item>LINK</item>
<item>LINKFLAGS</item>
<item>LINKCOM</item>
@@ -42,6 +39,9 @@ based on the types of source files.
<item>LIBDIRSUFFIX</item>
<item>LIBLINKPREFIX</item>
<item>LIBLINKSUFFIX</item>
+<item>SHLINK</item>
+<item>SHLINKFLAGS</item>
+<item>SHLINKCOM</item>
<item>SHLIBSUFFIX</item>
<item>__SHLIBVERSIONFLAGS</item>
<item>LDMODULE</item>
@@ -55,8 +55,8 @@ based on the types of source files.
<item>__LDMODULEVERSIONFLAGS</item>
</sets>
<uses>
-<item>SHLINKCOMSTR</item>
<item>LINKCOMSTR</item>
+<item>SHLINKCOMSTR</item>
<item>LDMODULECOMSTR</item>
</uses>
</tool>
@@ -184,8 +184,8 @@ On other systems, this is the same as &cv-link-SHLINK;.
<cvar name="LDMODULECOMSTR">
<summary>
<para>
-The string displayed when building loadable modules.
-If this is not set, then &cv-link-LDMODULECOM; (the command line) is displayed.
+If set, the string displayed when building loadable modules.
+If not set, then &cv-link-LDMODULECOM; (the command line) is displayed.
</para>
</summary>
</cvar>
@@ -243,6 +243,7 @@ set.
<summary>
<para>
The linker.
+See also &cv-link-SHLINK; for linking shared objects.
</para>
</summary>
</cvar>
@@ -251,6 +252,7 @@ The linker.
<summary>
<para>
The command line used to link object files into an executable.
+See also &cv-link-SHLINKCOM; for linking shared objects.
</para>
</summary>
</cvar>
@@ -258,9 +260,10 @@ The command line used to link object files into an executable.
<cvar name="LINKCOMSTR">
<summary>
<para>
-The string displayed when object files
+If set, the string displayed when object files
are linked into an executable.
-If this is not set, then &cv-link-LINKCOM; (the command line) is displayed.
+If not set, then &cv-link-LINKCOM; (the command line) is displayed.
+See also &cv-link-SHLINKCOMSTR;. for linking shared objects.
</para>
<example_commands>
@@ -290,6 +293,7 @@ and
&cv-link-_LIBDIRFLAGS;
above,
for the variable that expands to library search path options.
+See also &cv-link-SHLINKFLAGS;. for linking shared objects.
</para>
</summary>
</cvar>
@@ -317,6 +321,7 @@ set.
<summary>
<para>
The linker for programs that use shared libraries.
+See also &cv-link-LINK; for linking static objects.
</para>
</summary>
</cvar>
@@ -325,6 +330,7 @@ The linker for programs that use shared libraries.
<summary>
<para>
The command line used to link programs using shared libraries.
+See also &cv-link-LINKCOM; for linking static objects.
</para>
</summary>
</cvar>
@@ -334,6 +340,7 @@ The command line used to link programs using shared libraries.
<para>
The string displayed when programs using shared libraries are linked.
If this is not set, then &cv-link-SHLINKCOM; (the command line) is displayed.
+See also &cv-link-LINKCOMSTR; for linking static objects.
</para>
<example_commands>
@@ -363,6 +370,7 @@ and
&cv-link-_LIBDIRFLAGS;
above,
for the variable that expands to library search path options.
+See also &cv-link-LINKFLAGS; for linking static objects.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py
index 929e558..9952ccc 100644
--- a/src/engine/SCons/Tool/msvs.py
+++ b/src/engine/SCons/Tool/msvs.py
@@ -220,7 +220,7 @@ class _UserGenerator(object):
for var, src in dbg_settings.items():
# Update only expected keys
trg = {}
- for key in [k for k in list(self.usrdebg.keys()) if k in src]:
+ for key in [k for k in self.usrdebg.keys() if k in src]:
trg[key] = str(src[key])
self.configs[var].debug = trg
@@ -544,7 +544,7 @@ class _DSPGenerator(object):
if t[1] in self.env:
if SCons.Util.is_List(self.env[t[1]]):
for i in self.env[t[1]]:
- if not i in self.sources[t[0]]:
+ if i not in self.sources[t[0]]:
self.sources[t[0]].append(i)
else:
if not self.env[t[1]] in self.sources[t[0]]:
@@ -578,11 +578,10 @@ class _DSPGenerator(object):
for i in range(len(variants)):
AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i], cppdefines[i], cpppaths[i])
- self.platforms = []
- for key in list(self.configs.keys()):
- platform = self.configs[key].platform
- if platform not in self.platforms:
- self.platforms.append(platform)
+ seen = set()
+ self.platforms = [p.platform for p in self.configs.values()
+ if not (p.platform in seen or seen.add(p.platform))]
+
def Build(self):
pass
@@ -702,7 +701,7 @@ class _GenerateV6DSP(_DSPGenerator):
'Resource Files': 'r|rc|ico|cur|bmp|dlg|rc2|rct|bin|cnt|rtf|gif|jpg|jpeg|jpe',
'Other Files': ''}
- for kind in sorted(list(categories.keys()), key=lambda a: a.lower()):
+ for kind in sorted(categories.keys(), key=lambda a: a.lower()):
if not self.sources[kind]:
continue # skip empty groups
@@ -1003,7 +1002,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User):
self.file.write('\t<Files>\n')
- cats = sorted([k for k in list(categories.keys()) if self.sources[k]],
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
key=lambda a: a.lower())
for kind in cats:
if len(cats) > 1:
@@ -1348,7 +1347,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User):
'Resource Files': 'r;rc;ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe',
'Other Files': ''}
- cats = sorted([k for k in list(categories.keys()) if self.sources[k]],
+ cats = sorted([k for k in categories.keys() if self.sources[k]],
key = lambda a: a.lower())
# print vcxproj.filters file first
@@ -1505,11 +1504,9 @@ class _GenerateV7DSW(_DSWGenerator):
for variant in env['variant']:
AddConfig(self, variant)
- self.platforms = []
- for key in list(self.configs.keys()):
- platform = self.configs[key].platform
- if platform not in self.platforms:
- self.platforms.append(platform)
+ seen = set()
+ self.platforms = [p.platform for p in self.configs.values()
+ if not (p.platform in seen or seen.add(p.platform))]
def GenerateProjectFilesInfo(self):
for dspfile in self.dspfiles:
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index cc4f717..38a100f 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -405,20 +405,20 @@ class DummyEnv(object):
return self.dict
return self.dict[key]
- def __setitem__(self,key,value):
+ def __setitem__(self, key, value):
self.dict[key] = value
- def __getitem__(self,key):
+ def __getitem__(self, key):
return self.dict[key]
- def __contains__(self,key):
+ def __contains__(self, key):
return key in self.dict
- def has_key(self,name):
+ def has_key(self, name):
return name in self.dict
def get(self, name, value=None):
- if self.has_key(name):
+ if name in self.dict:
return self.dict[name]
else:
return value
@@ -771,8 +771,8 @@ class msvsTestCase(unittest.TestCase):
# Check expected result
self.assertListEqual(list(genDSP.configs.keys()), list(expected_configs.keys()))
- for key in list(genDSP.configs.keys()):
- self.assertDictEqual(genDSP.configs[key].__dict__, expected_configs[key])
+ for key, v in genDSP.configs.items():
+ self.assertDictEqual(v.__dict__, expected_configs[key])
genDSP.Build()
diff --git a/src/engine/SCons/Tool/packaging.xml b/src/engine/SCons/Tool/packaging.xml
index 8ab4912..55fecec 100644
--- a/src/engine/SCons/Tool/packaging.xml
+++ b/src/engine/SCons/Tool/packaging.xml
@@ -34,7 +34,7 @@ A framework for building binary and source packages.
<builder name="Package">
<summary>
<para>
-Builds a Binary Package of the given source files.
+Builds a Binary Package of the given source files.
</para>
<example_commands>
@@ -43,68 +43,4 @@ env.Package(source = FindInstalledFiles())
</summary>
</builder>
-<cvar name="JAR">
-<summary>
-<para>
-The Java archive tool.
-</para>
-</summary>
-</cvar>
-
-<cvar name="JARCHDIR">
-<summary>
-<para>
-The directory to which the Java archive tool should change
-(using the
-<option>-C</option>
-option).
-</para>
-</summary>
-</cvar>
-
-<cvar name="JARCOM">
-<summary>
-<para>
-The command line used to call the Java archive tool.
-</para>
-</summary>
-</cvar>
-
-<cvar name="JARCOMSTR">
-<summary>
-<para>
-The string displayed when the Java archive tool
-is called
-If this is not set, then &cv-JARCOM; (the command line) is displayed.
-</para>
-
-<example_commands>
-env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET")
-</example_commands>
-</summary>
-</cvar>
-
-<cvar name="JARFLAGS">
-<summary>
-<para>
-General options passed to the Java archive tool.
-By default this is set to
-<option>cf</option>
-to create the necessary
-<command>jar</command>
-file.
-</para>
-</summary>
-</cvar>
-
-<cvar name="JARSUFFIX">
-<summary>
-<para>
-The suffix for Java archives:
-<filename>.jar</filename>
-by default.
-</para>
-</summary>
-</cvar>
-
</sconsdoc>
diff --git a/src/engine/SCons/Tool/packaging/__init__.xml b/src/engine/SCons/Tool/packaging/__init__.xml
index 31c6eed..66a7aa0 100644
--- a/src/engine/SCons/Tool/packaging/__init__.xml
+++ b/src/engine/SCons/Tool/packaging/__init__.xml
@@ -62,24 +62,25 @@ option or with the &cv-PACKAGETYPE; construction variable. Currently
the following packagers available:
</para>
-<para>
- * msi - Microsoft Installer
- * rpm - RPM Package Manger
- * ipkg - Itsy Package Management System
- * tarbz2 - bzip2 compressed tar
- * targz - gzip compressed tar
- * tarxz - xz compressed tar
- * zip - zip file
- * src_tarbz2 - bzip2 compressed tar source
- * src_targz - gzip compressed tar source
- * src_tarxz - xz compressed tar source
- * src_zip - zip file source
-</para>
+<para><literal>msi</literal> - Microsoft Installer</para>
+<para><literal>rpm</literal> - RPM Package Manger</para>
+<para><literal>ipkg</literal> - Itsy Package Management System</para>
+<para><literal>tarbz2</literal> - bzip2 compressed tar</para>
+<para><literal>targz</literal> - gzip compressed tar</para>
+<para><literal>tarxz</literal> - xz compressed tar</para>
+<para><literal>zip</literal> - zip file</para>
+<para><literal>src_tarbz2</literal> - bzip2 compressed tar source</para>
+<para><literal>src_targz</literal> - gzip compressed tar source</para>
+<para><literal>src_tarxz</literal> - xz compressed tar source</para>
+<para><literal>src_zip</literal> - zip file source</para>
<para>
-An updated list is always available under the "package_type" option when
-running "scons --help" on a project that has packaging activated.
+An updated list is always available under the
+<replaceable>package_type</replaceable> option when
+running <command>scons --help</command>
+on a project that has packaging activated.
</para>
+
<example_commands>
env = Environment(tools=['default', 'packaging'])
env.Install('/bin/', 'my_program')
@@ -198,20 +199,21 @@ placed if applicable. The default value is "$NAME-$VERSION".
Selects the package type to build. Currently these are available:
</para>
-<para>
- * msi - Microsoft Installer
- * rpm - Redhat Package Manger
- * ipkg - Itsy Package Management System
- * tarbz2 - compressed tar
- * targz - compressed tar
- * zip - zip file
- * src_tarbz2 - compressed tar source
- * src_targz - compressed tar source
- * src_zip - zip file source
-</para>
+<para><literal>msi</literal> - Microsoft Installer</para>
+<para><literal>rpm</literal> - RPM Package Manger</para>
+<para><literal>ipkg</literal> - Itsy Package Management System</para>
+<para><literal>tarbz2</literal> - bzip2 compressed tar</para>
+<para><literal>targz</literal> - gzip compressed tar</para>
+<para><literal>tarxz</literal> - xz compressed tar</para>
+<para><literal>zip</literal> - zip file</para>
+<para><literal>src_tarbz2</literal> - bzip2 compressed tar source</para>
+<para><literal>src_targz</literal> - gzip compressed tar source</para>
+<para><literal>src_tarxz</literal> - xz compressed tar source</para>
+<para><literal>src_zip</literal> - zip file source</para>
<para>
-This may be overridden with the "package_type" command line option.
+This may be overridden with the <option>package_type</option>
+command line option.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/packaging/ipk.py b/src/engine/SCons/Tool/packaging/ipk.py
index fe3f49b..ac8b992 100644
--- a/src/engine/SCons/Tool/packaging/ipk.py
+++ b/src/engine/SCons/Tool/packaging/ipk.py
@@ -173,7 +173,7 @@ Description: $X_IPK_DESCRIPTION
#
# close all opened files
- for f in list(opened_files.values()):
+ for f in opened_files.values():
f.close()
# call a user specified function
diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py
index ebaa701..db8ae24 100644
--- a/src/engine/SCons/Tool/packaging/rpm.py
+++ b/src/engine/SCons/Tool/packaging/rpm.py
@@ -284,7 +284,7 @@ def build_specfile_filesection(spec, files):
for file in files:
# build the tagset
tags = {}
- for k in list(supported_tags.keys()):
+ for k in supported_tags.keys():
try:
v = file.GetTag(k)
if v:
diff --git a/src/engine/SCons/Tool/python.py b/src/engine/SCons/Tool/python.py
new file mode 100644
index 0000000..c61fc8d
--- /dev/null
+++ b/src/engine/SCons/Tool/python.py
@@ -0,0 +1,49 @@
+"""SCons.Tool.python
+
+Registers the Python scanner for the supported Python source file suffixes.
+
+"""
+
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+import SCons.Tool
+from SCons.Scanner.Python import PythonScanner, PythonSuffixes
+
+
+def generate(env):
+ """Hook the python builder and scanner into the environment."""
+ for suffix in PythonSuffixes:
+ SCons.Tool.SourceFileScanner.add_scanner(suffix, PythonScanner)
+
+
+def exists(env):
+ return True
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
diff --git a/src/engine/SCons/Tool/python.xml b/src/engine/SCons/Tool/python.xml
new file mode 100644
index 0000000..e3f7da3
--- /dev/null
+++ b/src/engine/SCons/Tool/python.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<!--
+__COPYRIGHT__
+
+This file is processed by the bin/SConsDoc.py module.
+See its __doc__ string for a discussion of the format.
+-->
+
+<!DOCTYPE sconsdoc [
+<!ENTITY % scons SYSTEM '../../../../doc/scons.mod'>
+%scons;
+<!ENTITY % builders-mod SYSTEM '../../../../doc/generated/builders.mod'>
+%builders-mod;
+<!ENTITY % functions-mod SYSTEM '../../../../doc/generated/functions.mod'>
+%functions-mod;
+<!ENTITY % tools-mod SYSTEM '../../../../doc/generated/tools.mod'>
+%tools-mod;
+<!ENTITY % variables-mod SYSTEM '../../../../doc/generated/variables.mod'>
+%variables-mod;
+]>
+
+<sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
+
+<tool name="python">
+<summary>
+<para>
+Loads the Python scanner scanner into the invoking environment. When loaded, the scanner will
+attempt to find implicit dependencies for any Python source files in the list of sources
+provided to an actual that uses this environment.
+</para>
+</summary>
+</tool>
+
+</sconsdoc>
diff --git a/src/engine/SCons/Tool/suncxx.py b/src/engine/SCons/Tool/suncxx.py
index c155484..1c35612 100644
--- a/src/engine/SCons/Tool/suncxx.py
+++ b/src/engine/SCons/Tool/suncxx.py
@@ -39,7 +39,6 @@ import os
import re
import subprocess
-from SCons.Util import PY3
import SCons.Tool.cxx
cplusplus = SCons.Tool.cxx
# cplusplus = __import__('c++', globals(), locals(), [])
@@ -53,10 +52,7 @@ def get_package_info(package_name, pkginfo, pkgchk):
except KeyError:
version = None
pathname = None
- try:
- from subprocess import DEVNULL # py3k
- except ImportError:
- DEVNULL = open(os.devnull, 'wb')
+ from subprocess import DEVNULL
try:
with open('/var/sadm/install/contents', 'r') as f:
@@ -72,16 +68,14 @@ def get_package_info(package_name, pkginfo, pkgchk):
try:
popen_args = {'stdout': subprocess.PIPE,
'stderr': DEVNULL}
- if PY3:
- popen_args['universal_newlines'] = True
+ popen_args['universal_newlines'] = True
p = subprocess.Popen([pkginfo, '-l', package_name],
**popen_args)
except EnvironmentError:
pass
else:
pkginfo_contents = p.communicate()[0]
- if not PY3:
- pkginfo_contents.decode()
+ pkginfo_contents.decode()
version_re = re.compile(r'^ *VERSION:\s*(.*)$', re.M)
version_match = version_re.search(pkginfo_contents)
if version_match:
@@ -91,16 +85,14 @@ def get_package_info(package_name, pkginfo, pkgchk):
try:
popen_args = {'stdout': subprocess.PIPE,
'stderr': DEVNULL}
- if PY3:
- popen_args['universal_newlines'] = True
+ popen_args['universal_newlines'] = True
p = subprocess.Popen([pkgchk, '-l', package_name],
**popen_args)
except EnvironmentError:
pass
else:
pkgchk_contents = p.communicate()[0]
- if not PY3:
- pkgchk_contents.decode()
+ pkgchk_contents.decode()
pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
pathname_match = pathname_re.search(pkgchk_contents)
if pathname_match:
diff --git a/src/engine/SCons/Tool/textfile.py b/src/engine/SCons/Tool/textfile.py
index 9e2327a..48a2904 100644
--- a/src/engine/SCons/Tool/textfile.py
+++ b/src/engine/SCons/Tool/textfile.py
@@ -53,13 +53,10 @@ import re
from SCons.Node import Node
from SCons.Node.Python import Value
-from SCons.Util import is_String, is_Sequence, is_Dict, to_bytes, PY3
+from SCons.Util import is_String, is_Sequence, is_Dict, to_bytes
-if PY3:
- TEXTFILE_FILE_WRITE_MODE = 'w'
-else:
- TEXTFILE_FILE_WRITE_MODE = 'wb'
+TEXTFILE_FILE_WRITE_MODE = 'w'
LINESEP = '\n'
@@ -126,10 +123,7 @@ def _action(target, source, env):
# write the file
try:
- if SCons.Util.PY3:
- target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')
- else:
- target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE)
+ target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')
except (OSError, IOError):
raise SCons.Errors.UserError("Can't write target file %s" % target[0])
diff --git a/src/engine/SCons/Tool/textfile.xml b/src/engine/SCons/Tool/textfile.xml
index 957e18c..878eb9f 100644
--- a/src/engine/SCons/Tool/textfile.xml
+++ b/src/engine/SCons/Tool/textfile.xml
@@ -59,7 +59,7 @@ see the &b-Substfile; description for details.
<para>
The prefix and suffix specified by the &cv-TEXTFILEPREFIX;
and &cv-TEXTFILESUFFIX; construction variables
-(the null string and <filename>.txt</filename> by default, respectively)
+(an empty string and <filename>.txt</filename> by default, respectively)
are automatically added to the target if they are not already present.
Examples:
</para>
@@ -124,7 +124,7 @@ the suffix is stripped and the remainder is used as the default target name.
<para>
The prefix and suffix specified by the &cv-SUBSTFILEPREFIX;
and &cv-SUBSTFILESUFFIX; construction variables
-(the null string by default in both cases)
+(an empty string by default in both cases)
are automatically added to the target if they are not already present.
</para>
@@ -218,7 +218,7 @@ lists of tuples are also acceptable.
<summary>
<para>
The prefix used for &b-Substfile; file names,
-the null string by default.
+an empty string by default.
</para>
</summary>
</cvar>
@@ -227,7 +227,7 @@ the null string by default.
<summary>
<para>
The suffix used for &b-Substfile; file names,
-the null string by default.
+an empty string by default.
</para>
</summary>
</cvar>
@@ -236,7 +236,7 @@ the null string by default.
<summary>
<para>
The prefix used for &b-Textfile; file names,
-the null string by default.
+an empty string by default.
</para>
</summary>
</cvar>
diff --git a/src/engine/SCons/Tool/xgettext.py b/src/engine/SCons/Tool/xgettext.py
index 11ca32f..7aba08d 100644
--- a/src/engine/SCons/Tool/xgettext.py
+++ b/src/engine/SCons/Tool/xgettext.py
@@ -70,7 +70,7 @@ class _CmdRunner(object):
self.out, self.err = proc.communicate()
self.status = proc.wait()
if self.err:
- sys.stderr.write(SCons.Util.UnicodeType(self.err))
+ sys.stderr.write(str(self.err))
return self.status
def strfunction(self, target, source, env):