From 39696fb565547639be518a9f92525904118b55c1 Mon Sep 17 00:00:00 2001 From: Peter Diener Date: Mon, 4 Mar 2019 09:52:44 -0600 Subject: Fix issue #3135. This fixes issue #3135 regarding the issue with using type bound procedures in Fortran submodules. The fix consists of changing the regex used in the scanner and the emitter to ignore lines starting with: module subroutine and module function as these are used to define type bound procedures instead of modules named 'subroutine' or 'function'. The regex is case insensitive. --- src/engine/SCons/Scanner/Fortran.py | 29 +++++++++++++++++------------ src/engine/SCons/Tool/FortranCommon.py | 3 ++- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py index 6065bbd..171a2e8 100644 --- a/src/engine/SCons/Scanner/Fortran.py +++ b/src/engine/SCons/Scanner/Fortran.py @@ -285,21 +285,26 @@ def FortranScan(path_variable="FORTRANPATH"): # but *not* the following: # # MODULE PROCEDURE procedure_name +# MODULE SUBROUTINE subroutine_name +# MODULE FUNCTION function_name # # Here is a breakdown of the regex: # -# (?i) : regex is case insensitive -# ^\s* : any amount of white space -# MODULE : match the string MODULE, case insensitive -# \s+ : match one or more white space characters -# (?!PROCEDURE) : but *don't* match if the next word matches -# PROCEDURE (negative lookahead assertion), -# case insensitive -# (\w+) : match one or more alphanumeric characters -# that make up the defined module name and -# save it in a group - - def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" +# (?i) : regex is case insensitive +# ^\s* : any amount of white space +# MODULE : match the string MODULE, case +# insensitive +# \s+ : match one or more white space +# characters +# (?!PROCEDURE|SUBROUTINE|FUNCTION) : but *don't* match if the next word +# matches PROCEDURE, SUBROUTINE or +# FUNCTION (negative lookahead +# assertion), case insensitive +# (\w+) : match one or more alphanumeric +# characters that make up the defined +# module name and save it in a group + + def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" scanner = F90Scanner("FortranScan", "$FORTRANSUFFIXES", diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py index ec409c0..b16dee5 100644 --- a/src/engine/SCons/Tool/FortranCommon.py +++ b/src/engine/SCons/Tool/FortranCommon.py @@ -64,7 +64,8 @@ def _fortranEmitter(target, source, env): if not node.exists() and not node.is_derived(): print("Could not locate " + str(node.name)) return ([], []) - mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" + # This has to match the def_regex in the Fortran scanner + mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" cre = re.compile(mod_regex,re.M) # Retrieve all USE'd module names modules = cre.findall(node.get_text_contents()) -- cgit v0.12 From 762190cd9b7f9fd2123513fd0c36408878c2c436 Mon Sep 17 00:00:00 2001 From: Peter Diener Date: Wed, 6 Mar 2019 10:27:14 -0600 Subject: Use raw strings in regexes. --- src/engine/SCons/Scanner/Fortran.py | 6 +++--- src/engine/SCons/Tool/FortranCommon.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py index 171a2e8..a932f21 100644 --- a/src/engine/SCons/Scanner/Fortran.py +++ b/src/engine/SCons/Scanner/Fortran.py @@ -187,7 +187,7 @@ def FortranScan(path_variable="FORTRANPATH"): # (\w+) : match the module name that is being USE'd # # - use_regex = "(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)" + use_regex = r"(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)" # The INCLUDE statement regex matches the following: @@ -275,7 +275,7 @@ def FortranScan(path_variable="FORTRANPATH"): # set of semicolon-separated INCLUDE statements # (as allowed by the F2003 standard) - include_regex = """(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" + include_regex = r"""(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" # The MODULE statement regex finds module definitions by matching # the following: @@ -304,7 +304,7 @@ def FortranScan(path_variable="FORTRANPATH"): # characters that make up the defined # module name and save it in a group - def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" + def_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" scanner = F90Scanner("FortranScan", "$FORTRANSUFFIXES", diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py index b16dee5..a38c6e7 100644 --- a/src/engine/SCons/Tool/FortranCommon.py +++ b/src/engine/SCons/Tool/FortranCommon.py @@ -65,7 +65,7 @@ def _fortranEmitter(target, source, env): print("Could not locate " + str(node.name)) return ([], []) # This has to match the def_regex in the Fortran scanner - mod_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" + mod_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" cre = re.compile(mod_regex,re.M) # Retrieve all USE'd module names modules = cre.findall(node.get_text_contents()) -- cgit v0.12 From 50c9c963970a5b377b2202e884f7b0d8498f0a66 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 12:49:00 -0700 Subject: Fix issue #2811 spurious rebuilds due to incorrect waiting_parents on nodes when builder has more than one target and source file generated --- src/engine/SCons/Node/__init__.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 131953b..e4c8e6c 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -784,6 +784,25 @@ class Node(object, with_metaclass(NoSlotsPyPy)): for parent in self.waiting_parents: parent.implicit = None + # Handle issue where builder emits more than one target and + # the source file for the builder is generated. + # in that case only the first target was getting it's .implicit + # cleared when the source file is built (second scan). + # leaving only partial implicits from scan before source file is generated + # typically the compiler only. Then scanned files are appended + # This is persisted to sconsign and rebuild causes false rebuilds + # because the ordering of the implicit list then changes to what it + # should have been. + # This is at least the following bugs + # https://github.com/SCons/scons/issues/2811 + # https://jira.mongodb.org/browse/SERVER-33111 + try: + for peer in parent.attributes.target_peers: + peer.implicit = None + except AttributeError as e: + pass + + self.clear() if self.pseudo: -- cgit v0.12 From b94a1792d01d7e47cd577228b97b6f32ab2bc8dc Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 13:56:54 -0700 Subject: Enhanced --debug=explain output. Breaks out sources, depends, and implicit components to dependency list. Updated test. TODO: better formatting --- src/engine/SCons/Node/__init__.py | 14 ++++++++++---- test/explain/basic.py | 12 +++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 131953b..ca6e6ee 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1666,9 +1666,16 @@ class Node(object, with_metaclass(NoSlotsPyPy)): lines.append("`%s' changed\n" % stringify(k)) if len(lines) == 0 and old_bkids != new_bkids: - lines.append("the dependency order changed:\n" + - "%sold: %s\n" % (' '*15, list(map(stringify, old_bkids))) + - "%snew: %s\n" % (' '*15, list(map(stringify, new_bkids)))) + lines.append("the dependency order changed:\n") + lines.append("->Sources\n") + for (o,n) in map(None, old.bsources, new.bsources): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Depends\n") + for (o,n) in map(None, old.bdepends, new.bdepends): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Implicit\n") + for (o,n) in map(None, old.bimplicit, new.bimplicit): + lines.append("Old:%s\tNew:%s\n"%(o,n)) if len(lines) == 0: def fmt_with_title(title, strlines): @@ -1711,7 +1718,6 @@ class Walker(object): This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and returns the next node on the descent with each get_next() call. - 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called when a cycle is detected. diff --git a/test/explain/basic.py b/test/explain/basic.py index 99942cd..bd474bb 100644 --- a/test/explain/basic.py +++ b/test/explain/basic.py @@ -324,9 +324,15 @@ env.Cat('file3', ['zzz', 'yyy', 'xxx']) python_sep = python.replace('\\', '\\\\') expect = test.wrap_stdout("""\ -scons: rebuilding `file3' because the dependency order changed: - old: ['xxx', 'yyy', 'zzz', '%(python_sep)s'] - new: ['zzz', 'yyy', 'xxx', '%(python_sep)s'] +scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python %(_python_)s %(cat_py)s file3 zzz yyy xxx """ % locals()) -- cgit v0.12 From 3ffee7b42004a6705bb890763dd132f608b4b289 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 13:58:55 -0700 Subject: Add blurb to CHANGES.txt on debug=explain formatting changes --- src/CHANGES.txt | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 15e8b5f..399d0c9 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,15 +7,26 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From William Deegan: + - Enhanced --debug=explain output. Now the separate components of the dependency list are split up + as follows: + + scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python + + From Mats Wichmann: - scons-time takes more care closing files and uses safer mkdtemp to avoid possible races on multi-job runs. - Use importlib to dynamically load tool and platform modules instead of imp module - From John Doe: - - - Whatever John Doe did. - RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 -- cgit v0.12 From d79290b03480e810acca5a61368d7b254d22fda5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 14:06:25 -0700 Subject: update changes.txt --- src/CHANGES.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 15e8b5f..c9a117e 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,14 +7,24 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From William Deegan: + - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file + is generated. This was causing the > 1th target to not have it's implicit list cleared when the source + file was actually built, leaving an implicit list similar to follows for 2nd and higher target + ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] + This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this + ['zzz', 'yyy', 'xxx', '/usr/bin/python'] + Which would trigger a rebuild because the order changed. + The fix involved added logic to mark all shared targets as peers and then ensure they're implicit + list is all cleared together. + + + From Mats Wichmann: - scons-time takes more care closing files and uses safer mkdtemp to avoid possible races on multi-job runs. - Use importlib to dynamically load tool and platform modules instead of imp module - From John Doe: - - - Whatever John Doe did. RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 -- cgit v0.12 From 0b9d8672365b01468fca5ba95594b92d307c94e9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 14:24:58 -0700 Subject: Move target_peers to slots from attributes --- src/engine/SCons/Builder.py | 7 +++++++ src/engine/SCons/Node/__init__.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 010d5ff..bc243dd 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -563,6 +563,13 @@ class BuilderBase(object): tlist, slist = self._create_nodes(env, target, source) + # If there is more than one target ensure that if we need to reset + # the implicit list to new scan of dependency all targets implicit lists + # are cleared. (SCons GH Issue #2811 and MongoDB SERVER-33111) + if len(tlist) > 1: + for t in tlist: + t.target_peers = tlist + # Check for errors with the specified target/source lists. _node_errors(self, env, tlist, slist) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index e4c8e6c..8e7699b 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -529,6 +529,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): __slots__ = ['sources', 'sources_set', + 'target_peers', '_specific_sources', 'depends', 'depends_set', @@ -797,7 +798,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): # https://github.com/SCons/scons/issues/2811 # https://jira.mongodb.org/browse/SERVER-33111 try: - for peer in parent.attributes.target_peers: + for peer in parent.target_peers: peer.implicit = None except AttributeError as e: pass -- cgit v0.12 From fd4a8f7c9383095a0e508bac937b6122dd5317d6 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 28 Mar 2019 05:17:52 -0600 Subject: [#3336] do not add not-found tool paths When tool modules initialize, they check paths to decide if the underlying tool is actually present. The current checker adds any "default paths" the caller may have supplied (locations like mingw, cygwin, chocolatey install locations, etc.); if there is match from this list, any previous default paths are also kept. To avoid keeping these non-matching paths, restore the original PATH; the caller is responsible for adding to PATH if necessary. Docstring now says so. Note lex and yacc tool modules seem to expect the path-modifying behavior that's being gotten rid of - so they preseve the path first and restore it after. The change here won't break those, but makes the extra behavior unneeded - could remove it. Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 2 ++ src/engine/SCons/Tool/__init__.py | 25 ++++++++++++++----------- src/engine/SCons/Tool/swig.py | 3 ++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 84a8056..d07b4ad 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -13,6 +13,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Use importlib to dynamically load tool and platform modules instead of imp module - sconsign: default to .sconsign.dblite if no filename is specified. Be more informative in case of unsupported pickle protocol (py2 only). + - Fix issue #3336 - on Windows, paths were being added to PATH even if + tools were not found in those paths. From John Doe: diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 8fbd587..152e186 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -1318,28 +1318,31 @@ def tool_list(platform, env): def find_program_path(env, key_program, default_paths=[]): """ - Find the location of key_program and then return the path it was located at. - Checking the default install locations. - Mainly for windows where tools aren't all installed in /usr/bin,etc - :param env: Current Environment() - :param key_program: Program we're using to locate the directory to add to PATH. + Find the location of a tool using various means. + + Mainly for windows where tools aren't all installed in /usr/bin, etc. + + :param env: Current Construction Environment. + :param key_program: Tool to locate. + :param default_paths: List of additional paths this tool might be found in. """ # First search in the SCons path path = env.WhereIs(key_program) - if (path): + if path: return path - # then the OS path: + + # Then in the OS path path = SCons.Util.WhereIs(key_program) - if (path): + if path: return path - # If that doesn't work try default location for mingw + # Finally, add the defaults and check again. Do not change + # ['ENV']['PATH'] permananetly, the caller can do that if needed. save_path = env['ENV']['PATH'] for p in default_paths: env.AppendENVPath('PATH', p) path = env.WhereIs(key_program) - if not path: - env['ENV']['PATH'] = save_path + env['ENV']['PATH'] = save_path return path # Local Variables: diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index c6abefb..6ed9d82 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -184,9 +184,10 @@ def generate(env): from SCons.Platform.mingw import MINGW_DEFAULT_PATHS from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + from SCons.Platform.win32 import CHOCO_DEFAULT_PATH if sys.platform == 'win32': - swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + [r'C:\ProgramData\chocolatey\bin'] ) + swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + CHOCO_DEFAULT_PATH) if swig: swig_bin_dir = os.path.dirname(swig) env.AppendENVPath('PATH', swig_bin_dir) -- cgit v0.12 From 77f302bcc7cff7faca0944ac6848de1c82c487d9 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 13 Apr 2019 11:38:28 -0600 Subject: [PR #3337] clean up lex and yacc tools Remove now unneeded code to save/restore the path, since the routine now does not modify the path. Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/lex.py | 19 +++++++++++-------- src/engine/SCons/Tool/yacc.py | 27 +++++++++++++++++---------- test/LEX/live_mingw.py | 2 +- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py index a63ddc9..91d50fd 100644 --- a/src/engine/SCons/Tool/lex.py +++ b/src/engine/SCons/Tool/lex.py @@ -70,11 +70,15 @@ def lexEmitter(target, source, env): def get_lex_path(env, append_paths=False): """ - Find the a path containing the lex or flex binaries. If a construction - environment is passed in then append the path to the ENV PATH. + Find the path to the lex tool, searching several possible names + + Only called in the Windows case, so the default_path + can be Windows-specific + + :param env: current construction environment + :param append_paths: if set, add the path to the tool to PATH + :return: path to lex tool, if found """ - # save existing path to reset if we don't want to append any paths - envPath = env['ENV']['PATH'] bins = ['flex', 'lex', 'win_flex'] for prog in bins: @@ -83,9 +87,7 @@ def get_lex_path(env, append_paths=False): prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: - if not append_paths: - env['ENV']['PATH'] = envPath - else: + if append_paths: env.AppendENVPath('PATH', os.path.dirname(bin_path)) return bin_path SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') @@ -113,7 +115,8 @@ def generate(env): env["LEXFLAGS"] = SCons.Util.CLVar("") if sys.platform == 'win32': - get_lex_path(env, append_paths=True) + # ignore the return - we do not need the full path here + _ = get_lex_path(env, append_paths=True) env["LEX"] = env.Detect(['flex', 'lex', 'win_flex']) if not env.get("LEXUNISTD"): env["LEXUNISTD"] = SCons.Util.CLVar("") diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py index 5db49d3..07ba8da 100644 --- a/src/engine/SCons/Tool/yacc.py +++ b/src/engine/SCons/Tool/yacc.py @@ -100,11 +100,15 @@ def yyEmitter(target, source, env): def get_yacc_path(env, append_paths=False): """ - Find the a path containing the lex or flex binaries. If a construction - environment is passed in then append the path to the ENV PATH. + Find the path to the yacc tool, searching several possible names + + Only called in the Windows case, so the default_path + can be Windows-specific + + :param env: current construction environment + :param append_paths: if set, add the path to the tool to PATH + :return: path to yacc tool, if found """ - # save existing path to reset if we don't want to append any paths - envPath = env['ENV']['PATH'] bins = ['bison', 'yacc', 'win_bison'] for prog in bins: @@ -113,12 +117,11 @@ def get_yacc_path(env, append_paths=False): prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: - if not append_paths: - env['ENV']['PATH'] = envPath - else: + if append_paths: env.AppendENVPath('PATH', os.path.dirname(bin_path)) return bin_path - SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') + SCons.Warnings.Warning('yacc tool requested, but yacc or bison binary not found in ENV PATH') + def generate(env): """Add Builders and construction variables for yacc to an Environment.""" @@ -148,7 +151,8 @@ def generate(env): SCons.Warnings.Warning('yacc tool requested, but bison binary not found in ENV PATH') if sys.platform == 'win32': - get_yacc_path(env, append_paths=True) + # ignore the return - we do not need the full path here + _ = get_yacc_path(env, append_paths=True) env["YACC"] = env.Detect(['bison', 'yacc', 'win_bison']) else: env["YACC"] = env.Detect(["bison", "yacc"]) @@ -162,7 +166,10 @@ def generate(env): env['YACCVCGFILESUFFIX'] = '.vcg' def exists(env): - return env.Detect(['bison', 'yacc']) + if sys.platform == 'win32': + return get_yacc_path(env) + else: + return env.Detect(['bison', 'yacc']) # Local Variables: # tab-width:4 diff --git a/test/LEX/live_mingw.py b/test/LEX/live_mingw.py index 13e2342..d535065 100644 --- a/test/LEX/live_mingw.py +++ b/test/LEX/live_mingw.py @@ -41,7 +41,7 @@ if sys.platform != 'win32': test.skip_test('Not windows environment; skipping test.\n') if not test.where_is('gcc'): - test.skip_test('No mingw or cygwin on windows; skipping test.\n') + test.skip_test('No mingw or cygwin build environment found; skipping test.\n') lex = test.where_is('lex') or test.where_is('flex') -- cgit v0.12 From b9859740b1253ec58e5ab43ae345432dbeadd3ae Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 15 Apr 2019 08:08:53 -0600 Subject: [PR #3337] centralize definition of candidates A list of possible executable names are provided in several places in yacc and lex tools, make it a little cleaner by defining once, at the top. Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/lex.py | 19 +++++++++++-------- src/engine/SCons/Tool/yacc.py | 33 ++++++++++++--------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py index 91d50fd..6b83aa9 100644 --- a/src/engine/SCons/Tool/lex.py +++ b/src/engine/SCons/Tool/lex.py @@ -45,6 +45,11 @@ from SCons.Platform.win32 import CHOCO_DEFAULT_PATH LexAction = SCons.Action.Action("$LEXCOM", "$LEXCOMSTR") +if sys.platform == 'win32': + BINS = ['flex', 'lex', 'win_flex'] +else: + BINS = ["flex", "lex"] + def lexEmitter(target, source, env): sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0])) @@ -79,12 +84,10 @@ def get_lex_path(env, append_paths=False): :param append_paths: if set, add the path to the tool to PATH :return: path to lex tool, if found """ - bins = ['flex', 'lex', 'win_flex'] - - for prog in bins: + for prog in BINS: bin_path = SCons.Tool.find_program_path( - env, - prog, + env, + prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: if append_paths: @@ -117,19 +120,19 @@ def generate(env): if sys.platform == 'win32': # ignore the return - we do not need the full path here _ = get_lex_path(env, append_paths=True) - env["LEX"] = env.Detect(['flex', 'lex', 'win_flex']) + env["LEX"] = env.Detect(BINS) if not env.get("LEXUNISTD"): env["LEXUNISTD"] = SCons.Util.CLVar("") env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET" else: - env["LEX"] = env.Detect(["flex", "lex"]) + env["LEX"] = env.Detect(BINS) env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET" def exists(env): if sys.platform == 'win32': return get_lex_path(env) else: - return env.Detect(["flex", "lex"]) + return env.Detect(BINS) # Local Variables: # tab-width:4 diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py index 07ba8da..2a5ffd8 100644 --- a/src/engine/SCons/Tool/yacc.py +++ b/src/engine/SCons/Tool/yacc.py @@ -45,6 +45,11 @@ from SCons.Platform.win32 import CHOCO_DEFAULT_PATH YaccAction = SCons.Action.Action("$YACCCOM", "$YACCCOMSTR") +if sys.platform == 'win32': + BINS = ['bison', 'yacc', 'win_bison'] +else: + BINS = ["bison", "yacc"] + def _yaccEmitter(target, source, env, ysuf, hsuf): yaccflags = env.subst("$YACCFLAGS", target=target, source=source) flags = SCons.Util.CLVar(yaccflags) @@ -109,12 +114,10 @@ def get_yacc_path(env, append_paths=False): :param append_paths: if set, add the path to the tool to PATH :return: path to yacc tool, if found """ - bins = ['bison', 'yacc', 'win_bison'] - - for prog in bins: + for prog in BINS: bin_path = SCons.Tool.find_program_path( - env, - prog, + env, + prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: if append_paths: @@ -143,33 +146,21 @@ def generate(env): cxx_file.add_emitter('.yy', yyEmitter) if sys.platform == 'win32': - bison = SCons.Tool.find_program_path(env, 'bison', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) - if bison: - bison_bin_dir = os.path.dirname(bison) - env.AppendENVPath('PATH', bison_bin_dir) - else: - SCons.Warnings.Warning('yacc tool requested, but bison binary not found in ENV PATH') - - if sys.platform == 'win32': - # ignore the return - we do not need the full path here + # ignore the return, all we need is for the path to be added _ = get_yacc_path(env, append_paths=True) - env["YACC"] = env.Detect(['bison', 'yacc', 'win_bison']) - else: - env["YACC"] = env.Detect(["bison", "yacc"]) - + + env["YACC"] = env.Detect(BINS) env['YACCFLAGS'] = SCons.Util.CLVar('') env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES' env['YACCHFILESUFFIX'] = '.h' - env['YACCHXXFILESUFFIX'] = '.hpp' - env['YACCVCGFILESUFFIX'] = '.vcg' def exists(env): if sys.platform == 'win32': return get_yacc_path(env) else: - return env.Detect(['bison', 'yacc']) + return env.Detect(BINS) # Local Variables: # tab-width:4 -- cgit v0.12 From 181b480c5223e6656db7768b2be5cc26d7127bc6 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 24 Apr 2019 08:15:35 -0600 Subject: [PR #3337] add testcase for tool lookup Add a unit test to show find_program_path does not alter env['ENV']['PATH']. A little cleanup in Tool/__init__.py: don't use mutable object as default value in function signature (checkers complain about this); getter/setter usage seemed unnecessary - kept one of the two but use modern syntax (checkers complain about use-before set, which is fixed by the change) Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/ToolTests.py | 25 ++++++++++++++++++++-- src/engine/SCons/Tool/__init__.py | 44 ++++++++++++++++++++------------------ 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py index f005143..f127f91 100644 --- a/src/engine/SCons/Tool/ToolTests.py +++ b/src/engine/SCons/Tool/ToolTests.py @@ -30,11 +30,14 @@ import TestUnit import SCons.Errors import SCons.Tool +from SCons.Environment import Environment + class ToolTestCase(unittest.TestCase): def test_Tool(self): """Test the Tool() function""" - class Environment(object): + + class DummyEnvironment(object): def __init__(self): self.dict = {} def Detect(self, progs): @@ -53,7 +56,8 @@ class ToolTestCase(unittest.TestCase): return key in self.dict def subst(self, string, *args, **kwargs): return string - env = Environment() + + env = DummyEnvironment() env['BUILDERS'] = {} env['ENV'] = {} env['PLATFORM'] = 'test' @@ -78,6 +82,23 @@ class ToolTestCase(unittest.TestCase): raise + def test_pathfind(self): + """Test that find_program_path() does not alter PATH""" + + PHONY_PATHS = [ + r'C:\cygwin64\bin', + r'C:\cygwin\bin', + '/usr/local/dummy/bin', + ] + + # Note this test cannot use the dummy environment, + # as function being tested calls env.WhereIs() + env = Environment() + pre_path = env['ENV']['PATH'] + tool = SCons.Tool.find_program_path(env, 'no_tool', default_paths=PHONY_PATHS) + assert env['ENV']['PATH'] == pre_path, env['ENV']['PATH'] + + if __name__ == "__main__": suite = unittest.makeSuite(ToolTestCase, 'test_') TestUnit.run(suite) diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 166c3b0..cc935d1 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -104,7 +104,9 @@ TOOL_ALIASES = { class Tool(object): - def __init__(self, name, toolpath=[], **kw): + def __init__(self, name, toolpath=None, **kw): + if toolpath is None: + toolpath = [] # Rename if there's a TOOL_ALIAS for this tool self.name = TOOL_ALIASES.get(name, name) @@ -394,7 +396,8 @@ def _call_env_subst(env, string, *args, **kw): class _ShLibInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'ShLib' def get_lib_prefix(self, env, *args, **kw): @@ -411,7 +414,8 @@ class _ShLibInfoSupport(object): class _LdModInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'LdMod' def get_lib_prefix(self, env, *args, **kw): @@ -428,7 +432,8 @@ class _LdModInfoSupport(object): class _ImpLibInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'ImpLib' def get_lib_prefix(self, env, *args, **kw): @@ -480,25 +485,21 @@ class _LibInfoGeneratorBase(object): 'ImpLib': _ImpLibInfoSupport} def __init__(self, libtype, infoname): - self.set_libtype(libtype) - self.set_infoname(infoname) + self.libtype = libtype + self.infoname = infoname + + @property + def libtype(self): + return self._support.libtype - def set_libtype(self, libtype): + @libtype.setter + def libtype(self, libtype): try: support_class = self._support_classes[libtype] except KeyError: raise ValueError('unsupported libtype %r' % libtype) self._support = support_class() - def get_libtype(self): - return self._support.get_libtype() - - def set_infoname(self, infoname): - self.infoname = infoname - - def get_infoname(self): - return self.infoname - def get_lib_prefix(self, env, *args, **kw): return self._support.get_lib_prefix(env, *args, **kw) @@ -518,9 +519,8 @@ class _LibInfoGeneratorBase(object): try: libtype = kw['generator_libtype'] except KeyError: - libtype = self.get_libtype() - infoname = self.get_infoname() - return 'Versioned%s%s' % (libtype, infoname) + libtype = self.libtype + return 'Versioned%s%s' % (libtype, self.infoname) def generate_versioned_lib_info(self, env, args, result=None, **kw): callback = self.get_versioned_lib_info_generator(**kw) @@ -730,7 +730,7 @@ class _LibSonameGenerator(_LibInfoGeneratorBase): if not soname: # fallback to library name (as returned by appropriate _LibNameGenerator) - soname = _LibNameGenerator(self.get_libtype())(env, libnode) + soname = _LibNameGenerator(self.libtype)(env, libnode) if Verbose: print("_LibSonameGenerator: FALLBACK: soname=%r" % soname) @@ -1316,7 +1316,7 @@ def tool_list(platform, env): return [x for x in tools if x] -def find_program_path(env, key_program, default_paths=[]): +def find_program_path(env, key_program, default_paths=None): """ Find the location of a tool using various means. @@ -1338,6 +1338,8 @@ def find_program_path(env, key_program, default_paths=[]): # Finally, add the defaults and check again. Do not change # ['ENV']['PATH'] permananetly, the caller can do that if needed. + if default_paths is None: + return path save_path = env['ENV']['PATH'] for p in default_paths: env.AppendENVPath('PATH', p) -- cgit v0.12 From f270a531be34c4841646e1b1b6c879f47986d5b5 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 24 Apr 2019 09:37:59 -0600 Subject: [PR #3337] test case now uses mocked env Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/ToolTests.py | 66 ++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 24 deletions(-) diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py index f127f91..6cc1724 100644 --- a/src/engine/SCons/Tool/ToolTests.py +++ b/src/engine/SCons/Tool/ToolTests.py @@ -23,6 +23,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import os import sys import unittest @@ -33,30 +34,47 @@ import SCons.Tool from SCons.Environment import Environment +class DummyEnvironment(object): + def __init__(self): + self.dict = {} + def Detect(self, progs): + if not SCons.Util.is_List(progs): + progs = [ progs ] + return progs[0] + def Append(self, **kw): + self.dict.update(kw) + def __getitem__(self, key): + return self.dict[key] + def __setitem__(self, key, val): + self.dict[key] = val + def __contains__(self, key): + return self.dict.__contains__(key) + def has_key(self, key): + return key in self.dict + def subst(self, string, *args, **kwargs): + return string + + PHONY_PATH = "/usr/phony/bin" + def WhereIs(self, key_program): + # for pathfind test for Issue #3336: + # need to fake the case where extra paths are searched, and + # if one has a "hit" after some fails, the fails are left in + # the environment's PATH. So construct a positive answer if + # we see a magic known path component in PATH; answer in + # the negative otherwise. + paths = self['ENV']['PATH'] + if self.PHONY_PATH in paths: + return os.path.join(self.PHONY_PATH, key_program) + return None + def AppendENVPath(self, pathvar, path): + # signature matches how called from find_program_path() + self['ENV'][pathvar] = self['ENV'][pathvar] + os.pathsep + path + + class ToolTestCase(unittest.TestCase): def test_Tool(self): """Test the Tool() function""" - class DummyEnvironment(object): - def __init__(self): - self.dict = {} - def Detect(self, progs): - if not SCons.Util.is_List(progs): - progs = [ progs ] - return progs[0] - def Append(self, **kw): - self.dict.update(kw) - def __getitem__(self, key): - return self.dict[key] - def __setitem__(self, key, val): - self.dict[key] = val - def __contains__(self, key): - return self.dict.__contains__(key) - def has_key(self, key): - return key in self.dict - def subst(self, string, *args, **kwargs): - return string - env = DummyEnvironment() env['BUILDERS'] = {} env['ENV'] = {} @@ -85,15 +103,15 @@ class ToolTestCase(unittest.TestCase): def test_pathfind(self): """Test that find_program_path() does not alter PATH""" + env = DummyEnvironment() PHONY_PATHS = [ r'C:\cygwin64\bin', r'C:\cygwin\bin', '/usr/local/dummy/bin', + env.PHONY_PATH, # will be recognized by dummy WhereIs ] - - # Note this test cannot use the dummy environment, - # as function being tested calls env.WhereIs() - env = Environment() + env['ENV'] = {} + env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin' pre_path = env['ENV']['PATH'] tool = SCons.Tool.find_program_path(env, 'no_tool', default_paths=PHONY_PATHS) assert env['ENV']['PATH'] == pre_path, env['ENV']['PATH'] -- cgit v0.12 From 511e9966835a3b13b1575092ae5190ef001638c9 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 24 Apr 2019 13:56:01 -0600 Subject: [PR #3337] fix two minor Sider complaints Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/ToolTests.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py index 6cc1724..74524f1 100644 --- a/src/engine/SCons/Tool/ToolTests.py +++ b/src/engine/SCons/Tool/ToolTests.py @@ -31,7 +31,6 @@ import TestUnit import SCons.Errors import SCons.Tool -from SCons.Environment import Environment class DummyEnvironment(object): @@ -113,7 +112,7 @@ class ToolTestCase(unittest.TestCase): env['ENV'] = {} env['ENV']['PATH'] = '/usr/local/bin:/opt/bin:/bin:/usr/bin' pre_path = env['ENV']['PATH'] - tool = SCons.Tool.find_program_path(env, 'no_tool', default_paths=PHONY_PATHS) + _ = SCons.Tool.find_program_path(env, 'no_tool', default_paths=PHONY_PATHS) assert env['ENV']['PATH'] == pre_path, env['ENV']['PATH'] -- cgit v0.12 From 20e0363c1bc82b27217e6a953441626d9c37f53f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 25 Apr 2019 09:37:19 -0400 Subject: PEP8 plus switch to unittest.main() when running directly --- src/engine/SCons/Scanner/FortranTests.py | 140 +++++++++++++++---------------- 1 file changed, 69 insertions(+), 71 deletions(-) diff --git a/src/engine/SCons/Scanner/FortranTests.py b/src/engine/SCons/Scanner/FortranTests.py index 5a09e3b..2e10473 100644 --- a/src/engine/SCons/Scanner/FortranTests.py +++ b/src/engine/SCons/Scanner/FortranTests.py @@ -25,7 +25,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import os.path -import sys import unittest import SCons.Scanner.Fortran @@ -33,17 +32,16 @@ import SCons.Node.FS import SCons.Warnings import TestCmd -import TestUnit original = os.getcwd() -test = TestCmd.TestCmd(workdir = '') +test = TestCmd.TestCmd(workdir='') os.chdir(test.workpath('')) # create some source files and headers: -test.write('fff1.f',""" +test.write('fff1.f', """ PROGRAM FOO INCLUDE 'f1.f' include 'f2.f' @@ -51,7 +49,7 @@ test.write('fff1.f',""" END """) -test.write('fff2.f',""" +test.write('fff2.f', """ PROGRAM FOO INCLUDE 'f2.f' include 'd1/f2.f' @@ -60,30 +58,28 @@ test.write('fff2.f',""" END """) -test.write('fff3.f',""" +test.write('fff3.f', """ PROGRAM FOO INCLUDE 'f3.f' ; INCLUDE\t'd1/f3.f' STOP END """) - # for Emacs -> " test.subdir('d1', ['d1', 'd2']) -headers = ['fi.f', 'never.f', - 'd1/f1.f', 'd1/f2.f', 'd1/f3.f', 'd1/fi.f', - 'd1/d2/f1.f', 'd1/d2/f2.f', 'd1/d2/f3.f', - 'd1/d2/f4.f', 'd1/d2/fi.f'] +test_headers = ['fi.f', 'never.f', + 'd1/f1.f', 'd1/f2.f', 'd1/f3.f', 'd1/fi.f', + 'd1/d2/f1.f', 'd1/d2/f2.f', 'd1/d2/f3.f', + 'd1/d2/f4.f', 'd1/d2/fi.f'] -for h in headers: +for h in test_headers: test.write(h, "\n") - test.subdir('include', 'subdir', ['subdir', 'include']) -test.write('fff4.f',""" +test.write('fff4.f', """ PROGRAM FOO INCLUDE 'f4.f' STOP @@ -93,7 +89,7 @@ test.write('fff4.f',""" test.write('include/f4.f', "\n") test.write('subdir/include/f4.f', "\n") -test.write('fff5.f',""" +test.write('fff5.f', """ PROGRAM FOO INCLUDE 'f5.f' INCLUDE 'not_there.f' @@ -104,7 +100,7 @@ test.write('fff5.f',""" test.write('f5.f', "\n") test.subdir('repository', ['repository', 'include'], - [ 'repository', 'src' ]) + ['repository', 'src']) test.subdir('work', ['work', 'src']) test.write(['repository', 'include', 'iii.f'], "\n") @@ -117,26 +113,25 @@ test.write(['work', 'src', 'fff.f'], """ END """) -test.write([ 'work', 'src', 'aaa.f'], """ +test.write(['work', 'src', 'aaa.f'], """ PROGRAM FOO INCLUDE 'bbb.f' STOP END """) -test.write([ 'work', 'src', 'bbb.f'], "\n") +test.write(['work', 'src', 'bbb.f'], "\n") -test.write([ 'repository', 'src', 'ccc.f'], """ +test.write(['repository', 'src', 'ccc.f'], """ PROGRAM FOO INCLUDE 'ddd.f' STOP END """) -test.write([ 'repository', 'src', 'ddd.f'], "\n") +test.write(['repository', 'src', 'ddd.f'], "\n") - -test.write('fff90a.f90',""" +test.write('fff90a.f90', """ PROGRAM FOO ! Test comments - these includes should NOT be picked up @@ -194,18 +189,19 @@ USE mod25 ! Test USE statement at the beginning of line END """) -modules = ['mod01.mod', 'mod02.mod', 'mod03.mod', 'mod04.mod', 'mod05.mod', - 'mod06.mod', 'mod07.mod', 'mod08.mod', 'mod09.mod', 'mod10.mod', - 'mod11.mod', 'mod12.mod', 'mod13.mod', 'mod14.mod', 'mod15.mod', - 'mod16.mod', 'mod17.mod', 'mod18.mod', 'mod19.mod', 'mod20.mod', - 'mod21.mod', 'mod22.mod', 'mod23.mod', 'mod24.mod', 'mod25.mod'] +test_modules = ['mod01.mod', 'mod02.mod', 'mod03.mod', 'mod04.mod', 'mod05.mod', + 'mod06.mod', 'mod07.mod', 'mod08.mod', 'mod09.mod', 'mod10.mod', + 'mod11.mod', 'mod12.mod', 'mod13.mod', 'mod14.mod', 'mod15.mod', + 'mod16.mod', 'mod17.mod', 'mod18.mod', 'mod19.mod', 'mod20.mod', + 'mod21.mod', 'mod22.mod', 'mod23.mod', 'mod24.mod', 'mod25.mod'] -for m in modules: +for m in test_modules: test.write(m, "\n") test.subdir('modules') test.write(['modules', 'use.mod'], "\n") + # define some helpers: class DummyEnvironment(object): @@ -215,7 +211,7 @@ class DummyEnvironment(object): def Dictionary(self, *args): if not args: - return { 'FORTRANPATH': self.path, 'FORTRANMODSUFFIX' : ".mod" } + return {'FORTRANPATH': self.path, 'FORTRANMODSUFFIX': ".mod"} elif len(args) == 1 and args[0] == 'FORTRANPATH': return self.path else: @@ -224,13 +220,13 @@ class DummyEnvironment(object): def has_key(self, key): return key in self.Dictionary() - def __getitem__(self,key): + def __getitem__(self, key): return self.Dictionary()[key] - def __setitem__(self,key,value): + def __setitem__(self, key, value): self.Dictionary()[key] = value - def __delitem__(self,key): + def __delitem__(self, key): del self.Dictionary()[key] def subst(self, arg, target=None, source=None, conv=None): @@ -255,11 +251,13 @@ class DummyEnvironment(object): def File(self, filename): return self.fs.File(filename) + def deps_match(self, deps, headers): scanned = list(map(os.path.normpath, list(map(str, deps)))) expect = list(map(os.path.normpath, headers)) self.assertTrue(scanned == expect, "expect %s != scanned %s" % (expect, scanned)) + # define some tests: class FortranScannerTestCase1(unittest.TestCase): @@ -275,6 +273,7 @@ class FortranScannerTestCase1(unittest.TestCase): test.unlink('f1.f') test.unlink('f2.f') + class FortranScannerTestCase2(unittest.TestCase): def runTest(self): test.write('f1.f', "\n") @@ -288,6 +287,7 @@ class FortranScannerTestCase2(unittest.TestCase): test.unlink('f1.f') test.unlink('f2.f') + class FortranScannerTestCase3(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) @@ -297,6 +297,7 @@ class FortranScannerTestCase3(unittest.TestCase): headers = ['d1/f1.f', 'd1/f2.f'] deps_match(self, deps, headers) + class FortranScannerTestCase4(unittest.TestCase): def runTest(self): test.write(['d1', 'f2.f'], " INCLUDE 'fi.f'\n") @@ -308,6 +309,7 @@ class FortranScannerTestCase4(unittest.TestCase): deps_match(self, deps, headers) test.write(['d1', 'f2.f'], "\n") + class FortranScannerTestCase5(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1")]) @@ -317,6 +319,7 @@ class FortranScannerTestCase5(unittest.TestCase): headers = ['d1/f2.f', 'd1/d2/f2.f', 'd1/f2.f'] deps_match(self, deps, headers) + class FortranScannerTestCase6(unittest.TestCase): def runTest(self): test.write('f2.f', "\n") @@ -324,19 +327,21 @@ class FortranScannerTestCase6(unittest.TestCase): s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) - headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] + headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f2.f') + class FortranScannerTestCase7(unittest.TestCase): def runTest(self): env = DummyEnvironment([test.workpath("d1/d2"), test.workpath("d1")]) s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) - headers = ['d1/f2.f', 'd1/d2/f2.f', 'd1/d2/f2.f'] + headers = ['d1/f2.f', 'd1/d2/f2.f', 'd1/d2/f2.f'] deps_match(self, deps, headers) + class FortranScannerTestCase8(unittest.TestCase): def runTest(self): test.write('f2.f', "\n") @@ -344,10 +349,11 @@ class FortranScannerTestCase8(unittest.TestCase): s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps = s(env.File('fff2.f'), env, path) - headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] + headers = ['d1/f2.f', 'd1/d2/f2.f', 'f2.f'] deps_match(self, deps, headers) test.unlink('f2.f') + class FortranScannerTestCase9(unittest.TestCase): def runTest(self): test.write('f3.f', "\n") @@ -356,9 +362,11 @@ class FortranScannerTestCase9(unittest.TestCase): path = s.path(env) n = env.File('fff3.f') - def my_rexists(s): - s.Tag('rexists_called', 1) - return SCons.Node._rexists_map[s.GetTag('old_rexists')](s) + + def my_rexists(s1): + s1.Tag('rexists_called', 1) + return SCons.Node._rexists_map[s.GetTag('old_rexists')](s1) + n.Tag('old_rexists', n._func_rexists) SCons.Node._rexists_map[3] = my_rexists n._func_rexists = 3 @@ -369,10 +377,11 @@ class FortranScannerTestCase9(unittest.TestCase): # scanned, essential for cooperation with VariantDir functionality. assert n.GetTag('rexists_called') - headers = ['d1/f3.f', 'f3.f'] + headers = ['d1/f3.f', 'f3.f'] deps_match(self, deps, headers) test.unlink('f3.f') + class FortranScannerTestCase10(unittest.TestCase): def runTest(self): env = DummyEnvironment(["include"]) @@ -380,18 +389,20 @@ class FortranScannerTestCase10(unittest.TestCase): path = s.path(env) deps1 = s(env.File('fff4.f'), env, path) env.fs.chdir(env.Dir('subdir')) - dir = env.fs.getcwd() + test_dir = env.fs.getcwd() env.fs.chdir(env.Dir('')) - path = s.path(env, dir) + path = s.path(env, test_dir) deps2 = s(env.File('#fff4.f'), env, path) - headers1 = list(map(test.workpath, ['include/f4.f'])) - headers2 = ['include/f4.f'] + headers1 = [test.workpath(f) for f in ['include/f4.f']] + headers2 = ['include/f4.f'] deps_match(self, deps1, headers1) deps_match(self, deps2, headers2) + class FortranScannerTestCase11(unittest.TestCase): def runTest(self): SCons.Warnings.enableWarningClass(SCons.Warnings.DependencyWarning) + class TestOut(object): def __call__(self, x): self.out = x @@ -407,7 +418,8 @@ class FortranScannerTestCase11(unittest.TestCase): # Did we catch the warning from not finding not_there.f? assert to.out - deps_match(self, deps, [ 'f5.f' ]) + deps_match(self, deps, ['f5.f']) + class FortranScannerTestCase12(unittest.TestCase): def runTest(self): @@ -421,6 +433,7 @@ class FortranScannerTestCase12(unittest.TestCase): deps_match(self, deps, ['f4.f']) test.unlink('include/fff4.f') + class FortranScannerTestCase13(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) @@ -429,9 +442,9 @@ class FortranScannerTestCase13(unittest.TestCase): # Create a derived file in a directory that does not exist yet. # This was a bug at one time. - f1=fs.File('include2/jjj.f') - f1.builder=1 - env = DummyEnvironment(['include','include2']) + f1 = fs.File('include2/jjj.f') + f1.builder = 1 + env = DummyEnvironment(['include', 'include2']) env.fs = fs s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) @@ -439,6 +452,7 @@ class FortranScannerTestCase13(unittest.TestCase): deps_match(self, deps, [test.workpath('repository/include/iii.f'), 'include2/jjj.f']) os.chdir(test.workpath('')) + class FortranScannerTestCase14(unittest.TestCase): def runTest(self): os.chdir(test.workpath('work')) @@ -451,15 +465,16 @@ class FortranScannerTestCase14(unittest.TestCase): s = SCons.Scanner.Fortran.FortranScan() path = s.path(env) deps1 = s(fs.File('build1/aaa.f'), env, path) - deps_match(self, deps1, [ 'build1/bbb.f' ]) + deps_match(self, deps1, ['build1/bbb.f']) deps2 = s(fs.File('build2/aaa.f'), env, path) - deps_match(self, deps2, [ 'src/bbb.f' ]) + deps_match(self, deps2, ['src/bbb.f']) deps3 = s(fs.File('build1/ccc.f'), env, path) - deps_match(self, deps3, [ 'build1/ddd.f' ]) + deps_match(self, deps3, ['build1/ddd.f']) deps4 = s(fs.File('build2/ccc.f'), env, path) - deps_match(self, deps4, [ test.workpath('repository/src/ddd.f') ]) + deps_match(self, deps4, [test.workpath('repository/src/ddd.f')]) os.chdir(test.workpath('')) + class FortranScannerTestCase15(unittest.TestCase): def runTest(self): class SubstEnvironment(DummyEnvironment): @@ -468,6 +483,7 @@ class FortranScannerTestCase15(unittest.TestCase): return test.workpath("d1") else: return arg + test.write(['d1', 'f2.f'], " INCLUDE 'fi.f'\n") env = SubstEnvironment(["$junk"]) s = SCons.Scanner.Fortran.FortranScan() @@ -477,6 +493,7 @@ class FortranScannerTestCase15(unittest.TestCase): deps_match(self, deps, headers) test.write(['d1', 'f2.f'], "\n") + class FortranScannerTestCase16(unittest.TestCase): def runTest(self): test.write('f1.f', "\n") @@ -512,28 +529,9 @@ class FortranScannerTestCase16(unittest.TestCase): test.unlink('f9.f') test.unlink('f10.f') -def suite(): - suite = unittest.TestSuite() - suite.addTest(FortranScannerTestCase1()) - suite.addTest(FortranScannerTestCase2()) - suite.addTest(FortranScannerTestCase3()) - suite.addTest(FortranScannerTestCase4()) - suite.addTest(FortranScannerTestCase5()) - suite.addTest(FortranScannerTestCase6()) - suite.addTest(FortranScannerTestCase7()) - suite.addTest(FortranScannerTestCase8()) - suite.addTest(FortranScannerTestCase9()) - suite.addTest(FortranScannerTestCase10()) - suite.addTest(FortranScannerTestCase11()) - suite.addTest(FortranScannerTestCase12()) - suite.addTest(FortranScannerTestCase13()) - suite.addTest(FortranScannerTestCase14()) - suite.addTest(FortranScannerTestCase15()) - suite.addTest(FortranScannerTestCase16()) - return suite if __name__ == "__main__": - TestUnit.run(suite()) + unittest.main() # Local Variables: # tab-width:4 -- cgit v0.12 From a77e14500c3149f0b45b560c8fb8217b7d41bcae Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 30 Mar 2019 08:53:36 -0600 Subject: [PY 3.8] modernize common test fixtures Apply changes to quiet open-file warnings. Add docstring to a few. Switch os.system usage to subprocess.call. Add if-main logic. Signed-off-by: Mats Wichmann --- test/fixture/mycompile.py | 25 ++++++++++----- test/fixture/mylink.py | 66 ++++++++++++++++++++++----------------- test/fixture/myrewrite.py | 21 +++++++++---- test/fixture/wrapper.py | 10 ++++-- test/fixture/wrapper_with_args.py | 10 +++--- 5 files changed, 83 insertions(+), 49 deletions(-) diff --git a/test/fixture/mycompile.py b/test/fixture/mycompile.py index 555c2c8..313e4b5 100644 --- a/test/fixture/mycompile.py +++ b/test/fixture/mycompile.py @@ -1,8 +1,19 @@ +r""" +Phony "compiler" for testing SCons. + +Copies its source files to the target file, dropping lines +that match a pattern, so we can recognize the tool +has made a modification. +""" + import sys -line = ('/*' + sys.argv[1] + '*/\n').encode() -outfile = open(sys.argv[2], 'wb') -for f in sys.argv[3:]: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != line]: - outfile.write(l) -sys.exit(0) + +if __name__ == '__main__': + line = '/*' + sys.argv[1] + '*/\n' + with open(sys.argv[2], 'w') as ofp: + for f in sys.argv[3:]: + with open(f, 'r') as ifp: + lines = [l for l in ifp.readlines() if l != line] + for l in lines: + ofp.write(l) + sys.exit(0) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 7c03f00..5006f22 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -1,31 +1,39 @@ +r""" +Phony "linker" for testing SCons. + +Recognizes the option to specify an output file, ignoring +all others; copies input lines to the output file except +ones that contain a pattern, so we can recognize the tool +has made a modification. +""" + import sys -if sys.platform == 'win32': - args = sys.argv[1:] - while args: - a = args[0] - if a == '-o': - out = args[1] - args = args[2:] - continue - if not a[0] in '/-': - break - args = args[1:] - if a[:5].lower() == '/out:': out = a[5:] - infile = open(args[0], 'rb') - outfile = open(out, 'wb') - for l in infile.readlines(): - if l[:5] != b'#link': - outfile.write(l) - sys.exit(0) -else: - import getopt - opts, args = getopt.getopt(sys.argv[1:], 'o:') - for opt, arg in opts: - if opt == '-o': out = arg - infile = open(args[0], 'rb') - outfile = open(out, 'wb') - for l in infile.readlines(): - if l[:5] != b'#link': - outfile.write(l) - sys.exit(0) +if __name__ == '__main__': + if sys.platform == 'win32': + args = sys.argv[1:] + while args: + a = args[0] + if a == '-o': + out = args[1] + args = args[2:] + continue + if not a[0] in '/-': + break + args = args[1:] + if a[:5].lower() == '/out:': out = a[5:] + with open(args[0], 'r') as ifp, open(out, 'w') as ofp: + for l in ifp.readlines(): + if not l.startswith('#link'): + ofp.write(l) + sys.exit(0) + else: + import getopt + opts, args = getopt.getopt(sys.argv[1:], 'o:') + for opt, arg in opts: + if opt == '-o': out = arg + with open(args[0], 'r') as ifp, open(out, 'w') as ofp: + for l in ifp.readlines(): + if not l.startswith('#link'): + ofp.write(l) + sys.exit(0) diff --git a/test/fixture/myrewrite.py b/test/fixture/myrewrite.py index 40bf830..bd90a68 100644 --- a/test/fixture/myrewrite.py +++ b/test/fixture/myrewrite.py @@ -1,7 +1,16 @@ +r""" +Phony tool to modify a file in place for testing SCons. + +Drops lines that match a pattern. Currently used to test +ranlib-related behavior without invoking ranlib. +""" + import sys -line = ('/*' + sys.argv[1] + '*/\n').encode() -lines = open(sys.argv[2], 'rb').readlines() -outfile = open(sys.argv[2], 'wb') -for l in [l for l in lines if l != line]: - outfile.write(l) -sys.exit(0) + +if __name__ == '__main__': + line = ('/*' + sys.argv[1] + '*/\n') + with open(sys.argv[2], 'w') as ofp, open(sys.argv[2], 'r') as ifp: + lines = [l for l in ifp.readlines() if l != line] + for l in lines: + ofp.write(l) + sys.exit(0) diff --git a/test/fixture/wrapper.py b/test/fixture/wrapper.py index f02ea03..8791390 100644 --- a/test/fixture/wrapper.py +++ b/test/fixture/wrapper.py @@ -1,6 +1,10 @@ import os import sys -if '--version' not in sys.argv and '-dumpversion' not in sys.argv: +import subprocess + +if __name__ == '__main__': path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out') - open(path, 'wb').write(b"wrapper.py\n") -os.system(" ".join(sys.argv[1:])) + if '--version' not in sys.argv and '-dumpversion' not in sys.argv: + with open(path, 'w') as f: + f.write("wrapper.py\n") + subprocess.call(sys.argv[1:]) diff --git a/test/fixture/wrapper_with_args.py b/test/fixture/wrapper_with_args.py index fccab72..f9e4d22 100644 --- a/test/fixture/wrapper_with_args.py +++ b/test/fixture/wrapper_with_args.py @@ -1,7 +1,9 @@ import os import sys +import subprocess -path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out') - -open(path, 'a').write("wrapper_with_args.py %s\n" % " ".join(sys.argv[1:])) -os.system(" ".join(sys.argv[1:])) +if __name__ == '__main__': + path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out') + with open(path, 'a') as f: + f.write("wrapper_with_args.py %s\n" % " ".join(sys.argv[1:])) + subprocess.call(sys.argv[1:]) -- cgit v0.12 From b0c3385604ebc1d7d552472f1cc6d0910aafa32a Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 30 Mar 2019 16:10:38 -0600 Subject: [PY 3.8] file closes in tools and others Signed-off-by: Mats Wichmann --- src/engine/SCons/Action.py | 2 +- src/engine/SCons/ActionTests.py | 9 ++++++ src/engine/SCons/Node/FS.py | 4 +-- src/engine/SCons/Platform/darwin.py | 11 ++++---- src/engine/SCons/Tool/__init__.py | 9 ++++-- src/engine/SCons/Tool/clang.py | 3 +- src/engine/SCons/Tool/clangxx.py | 3 +- src/engine/SCons/Tool/docbook/__init__.py | 46 ++++++++++++++----------------- src/engine/SCons/Tool/hpcxx.py | 3 +- src/engine/SCons/Tool/ipkg.py | 6 ++-- src/engine/SCons/Tool/mingw.py | 2 +- src/engine/SCons/Tool/msvs.py | 14 +++++----- src/engine/SCons/Tool/packaging/msi.py | 21 +++++++------- src/engine/SCons/Tool/packaging/rpm.py | 8 +++--- src/engine/SCons/Tool/rpmutils.py | 39 +++++++++++++------------- src/engine/SCons/Util.py | 20 +++++++------- 16 files changed, 108 insertions(+), 92 deletions(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index bff6003..893c749 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -211,7 +211,7 @@ def _object_contents(obj): def _code_contents(code, docstring=None): - """Return the signature contents of a code object. + r"""Return the signature contents of a code object. By providing direct access to the code object of the function, Python makes this extremely easy. Hooray! diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 042d3dd..34fea45 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -1529,6 +1529,7 @@ class CommandGeneratorActionTestCase(unittest.TestCase): (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), + (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } meth_matches = [ @@ -1707,6 +1708,7 @@ class FunctionActionTestCase(unittest.TestCase): (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), + (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } @@ -1715,6 +1717,7 @@ class FunctionActionTestCase(unittest.TestCase): (3, 5): bytearray(b'1, 1, 0, 0,(),(),(d\x00\x00S),(),()'), (3, 6): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), + (3, 8): bytearray(b'1, 1, 0, 0,(),(),(d\x00S\x00),(),()'), } def factory(act, **kw): @@ -1959,6 +1962,7 @@ class LazyActionTestCase(unittest.TestCase): (3, 5): bytearray(b'0, 0, 0, 0,(),(),(d\x00\x00S),(),()'), (3, 6): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), (3, 7): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), + (3, 8): bytearray(b'0, 0, 0, 0,(),(),(d\x00S\x00),(),()'), } meth_matches = [ @@ -2017,6 +2021,7 @@ class ActionCallerTestCase(unittest.TestCase): (3, 5): b'd\x00\x00S', (3, 6): b'd\x00S\x00', (3, 7): b'd\x00S\x00', + (3, 8): b'd\x00S\x00', } @@ -2217,6 +2222,7 @@ class ObjectContentsTestCase(unittest.TestCase): (3, 5): bytearray(b'3, 3, 0, 0,(),(),(|\x00\x00S),(),()'), (3, 6): bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'), (3, 7): bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'), + (3, 8): bytearray(b'3, 3, 0, 0,(),(),(|\x00S\x00),(),()'), } c = SCons.Action._function_contents(func1) @@ -2242,6 +2248,8 @@ class ObjectContentsTestCase(unittest.TestCase): b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"), (3, 7): bytearray( b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"), + (3, 8): bytearray( + b"{TestClass:__main__}[[[(, ()), [(, (,))]]]]{{1, 1, 0, 0,(a,b),(a,b),(d\x01|\x00_\x00d\x02|\x00_\x01d\x00S\x00),(),(),2, 2, 0, 0,(),(),(d\x00S\x00),(),()}}{{{a=a,b=b}}}"), } assert c == expected[sys.version_info[:2]], "Got\n" + repr(c) + "\nExpected \n" + "\n" + repr( @@ -2259,6 +2267,7 @@ class ObjectContentsTestCase(unittest.TestCase): (3, 5): bytearray(b'0, 0, 0, 0,(Hello, World!),(print),(e\x00\x00d\x00\x00\x83\x01\x00\x01d\x01\x00S)'), (3, 6): bytearray(b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'), (3, 7): bytearray(b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'), + (3, 8): bytearray(b'0, 0, 0, 0,(Hello, World!),(print),(e\x00d\x00\x83\x01\x01\x00d\x01S\x00)'), } assert c == expected[sys.version_info[:2]], "Got\n" + repr(c) + "\nExpected \n" + "\n" + repr(expected[ diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 61054f3..d861b2b 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -480,7 +480,7 @@ class EntryProxy(SCons.Util.Proxy): return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_posix") def __get_windows_path(self): - """Return the path with \ as the path separator, + r"""Return the path with \ as the path separator, regardless of platform.""" if OS_SEP == '\\': return self @@ -1418,7 +1418,7 @@ class FS(LocalFS): self.Top.addRepository(d) def PyPackageDir(self, modulename): - """Locate the directory of a given python module name + r"""Locate the directory of a given python module name For example scons might resolve to Windows: C:\Python27\Lib\site-packages\scons-2.5.1 diff --git a/src/engine/SCons/Platform/darwin.py b/src/engine/SCons/Platform/darwin.py index c85b75b..fd697f6 100644 --- a/src/engine/SCons/Platform/darwin.py +++ b/src/engine/SCons/Platform/darwin.py @@ -56,12 +56,11 @@ def generate(env): for file in filelist: if os.path.isfile(file): - f = open(file, 'r') - lines = f.readlines() - for line in lines: - if line: - env.AppendENVPath('PATHOSX', line.strip('\n')) - f.close() + with open(file, 'r') as f: + lines = f.readlines() + for line in lines: + if line: + env.AppendENVPath('PATHOSX', line.strip('\n')) # Not sure why this wasn't the case all along? if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False): diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index cc935d1..c8fb389 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -51,7 +51,12 @@ import SCons.Scanner.D import SCons.Scanner.LaTeX import SCons.Scanner.Prog import SCons.Scanner.SWIG -import collections +try: + # Python 3 + from collections.abc import Callable +except ImportError: + # Python 2.7 + from collections import Callable DefaultToolpath = [] @@ -378,7 +383,7 @@ def _call_linker_cb(env, callback, args, result=None): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback) print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)) - if isinstance(cbfun, collections.Callable): + if isinstance(cbfun, Callable): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback) result = cbfun(env, *args) diff --git a/src/engine/SCons/Tool/clang.py b/src/engine/SCons/Tool/clang.py index cbb48cb..081ab67 100644 --- a/src/engine/SCons/Tool/clang.py +++ b/src/engine/SCons/Tool/clang.py @@ -77,7 +77,8 @@ def generate(env): stdout=subprocess.PIPE) if pipe.wait() != 0: return # clang -dumpversion is of no use - line = pipe.stdout.readline() + with pipe.stdout: + line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) diff --git a/src/engine/SCons/Tool/clangxx.py b/src/engine/SCons/Tool/clangxx.py index 7194d9e..a29cf79 100644 --- a/src/engine/SCons/Tool/clangxx.py +++ b/src/engine/SCons/Tool/clangxx.py @@ -85,7 +85,8 @@ def generate(env): return # clang -dumpversion is of no use - line = pipe.stdout.readline() + with pipe.stdout: + line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py index 5b98db2..ddbb8f1 100644 --- a/src/engine/SCons/Tool/docbook/__init__.py +++ b/src/engine/SCons/Tool/docbook/__init__.py @@ -352,9 +352,8 @@ def __build_lxml(target, source, env): result = transform(doc) try: - of = open(str(target[0]), "wb") - of.write(of.write(etree.tostring(result, pretty_print=True))) - of.close() + with open(str(target[0]), "wb") as of: + of.write(of.write(etree.tostring(result, pretty_print=True))) except: pass @@ -440,25 +439,23 @@ def DocbookEpub(env, target, source=None, *args, **kw): function could be replaced by a call to the SCons Zip builder if support was added for different compression formats for separate source nodes. """ - zf = zipfile.ZipFile(str(target[0]), 'w') - mime_file = open('mimetype', 'w') - mime_file.write('application/epub+zip') - mime_file.close() - zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED) - for s in source: - if os.path.isfile(str(s)): - head, tail = os.path.split(str(s)) - if not head: - continue - s = head - for dirpath, dirnames, filenames in os.walk(str(s)): - for fname in filenames: - path = os.path.join(dirpath, fname) - if os.path.isfile(path): - zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))), - zipfile.ZIP_DEFLATED) - zf.close() - + with zipfile.ZipFile(str(target[0]), 'w') as zf: + with open('mimetype', 'w') as mime_file: + mime_file.write('application/epub+zip') + zf.write(mime_file.name, compress_type = zipfile.ZIP_STORED) + for s in source: + if os.path.isfile(str(s)): + head, tail = os.path.split(str(s)) + if not head: + continue + s = head + for dirpath, dirnames, filenames in os.walk(str(s)): + for fname in filenames: + path = os.path.join(dirpath, fname) + if os.path.isfile(path): + zf.write(path, os.path.relpath(path, str(env.get('ZIPROOT', ''))), + zipfile.ZIP_DEFLATED) + def add_resources(target, source, env): """Add missing resources to the OEBPS directory @@ -701,9 +698,8 @@ def DocbookMan(env, target, source=None, *args, **kw): except: # Use simple regex parsing - f = open(__ensure_suffix(str(s),'.xml'), 'r') - content = f.read() - f.close() + with open(__ensure_suffix(str(s),'.xml'), 'r') as f: + content = f.read() for m in re_manvolnum.finditer(content): volnum = m.group(1) diff --git a/src/engine/SCons/Tool/hpcxx.py b/src/engine/SCons/Tool/hpcxx.py index 1ba9198..7113fa2 100644 --- a/src/engine/SCons/Tool/hpcxx.py +++ b/src/engine/SCons/Tool/hpcxx.py @@ -68,7 +68,8 @@ def generate(env): env['CXX'] = acc or 'aCC' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z') # determine version of aCC - line = os.popen(acc + ' -V 2>&1').readline().rstrip() + with os.popen(acc + ' -V 2>&1') as p: + line = p.readline().rstrip() if line.find('aCC: HP ANSI C++') == 0: env['CXXVERSION'] = line.split()[-1] diff --git a/src/engine/SCons/Tool/ipkg.py b/src/engine/SCons/Tool/ipkg.py index df77eea..8e01dd2 100644 --- a/src/engine/SCons/Tool/ipkg.py +++ b/src/engine/SCons/Tool/ipkg.py @@ -55,8 +55,10 @@ def generate(env): env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' if env.WhereIs('id'): - env['IPKGUSER'] = os.popen('id -un').read().strip() - env['IPKGGROUP'] = os.popen('id -gn').read().strip() + with os.popen('id -un') as p: + env['IPKGUSER'] = p.read().strip() + with os.popen('id -gn') as p: + env['IPKGGROUP'] = p.read().strip() env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') env['IPKGSUFFIX'] = '.ipk' diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index df88d79..603d6da 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -123,7 +123,7 @@ key_program = 'mingw32-make' def find_version_specific_mingw_paths(): - """ + r""" One example of default mingw install paths is: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index ff81732..8ec33e6 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -645,10 +645,10 @@ class _GenerateV6DSP(_DSPGenerator): if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata + '\n') pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata + '\n') def PrintSourceFiles(self): @@ -917,10 +917,10 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write('\n') def printSources(self, hierarchy, commonprefix): @@ -1241,10 +1241,10 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write('\n') def printFilters(self, hierarchy, name): @@ -1617,7 +1617,7 @@ class _GenerateV7DSW(_DSWGenerator): self.file.write('EndGlobal\n') if self.nokeep == 0: pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata) self.file.write('\n') diff --git a/src/engine/SCons/Tool/packaging/msi.py b/src/engine/SCons/Tool/packaging/msi.py index 052d7d8..3a394a0 100644 --- a/src/engine/SCons/Tool/packaging/msi.py +++ b/src/engine/SCons/Tool/packaging/msi.py @@ -188,7 +188,7 @@ def build_wxsfile(target, source, env): """ Compiles a .wxs file from the keywords given in env['msi_spec'] and by analyzing the tree of source nodes and their tags. """ - file = open(target[0].get_abspath(), 'w') + f = open(target[0].get_abspath(), 'w') try: # Create a document with the Wix root tag @@ -209,7 +209,7 @@ def build_wxsfile(target, source, env): build_license_file(target[0].get_dir(), env) # write the xml to a file - file.write( doc.toprettyxml() ) + f.write( doc.toprettyxml() ) # call a user specified function if 'CHANGE_SPECFILE' in env: @@ -217,6 +217,8 @@ def build_wxsfile(target, source, env): except KeyError as e: raise SCons.Errors.UserError( '"%s" package field for MSI is missing.' % e.args[0] ) + finally: + f.close() # # setup function @@ -440,14 +442,13 @@ def build_license_file(directory, spec): pass # ignore this as X_MSI_LICENSE_TEXT is optional if name!='' or text!='': - file = open( os.path.join(directory.get_path(), 'License.rtf'), 'w' ) - file.write('{\\rtf') - if text!='': - file.write(text.replace('\n', '\\par ')) - else: - file.write(name+'\\par\\par') - file.write('}') - file.close() + with open(os.path.join(directory.get_path(), 'License.rtf'), 'w') as f: + f.write('{\\rtf') + if text!='': + f.write(text.replace('\n', '\\par ')) + else: + file.write(name+'\\par\\par') + f.write('}') # # mandatory and optional package tags diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py index 0a4db6c..ebaa701 100644 --- a/src/engine/SCons/Tool/packaging/rpm.py +++ b/src/engine/SCons/Tool/packaging/rpm.py @@ -125,11 +125,11 @@ def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ - with open(target[0].get_abspath(), 'w') as file: + with open(target[0].get_abspath(), 'w') as ofp: try: - file.write(build_specfile_header(env)) - file.write(build_specfile_sections(env)) - file.write(build_specfile_filesection(env, source)) + ofp.write(build_specfile_header(env)) + ofp.write(build_specfile_sections(env)) + ofp.write(build_specfile_filesection(env, source)) # call a user specified function if 'CHANGE_SPECFILE' in env: diff --git a/src/engine/SCons/Tool/rpmutils.py b/src/engine/SCons/Tool/rpmutils.py index e2d6997..566f8e1 100644 --- a/src/engine/SCons/Tool/rpmutils.py +++ b/src/engine/SCons/Tool/rpmutils.py @@ -482,9 +482,11 @@ def updateRpmDicts(rpmrc, pyfile): """ try: # Read old rpmutils.py file - oldpy = open(pyfile,"r").readlines() + with open(pyfile,"r") as f: + oldpy = f.readlines() # Read current rpmrc.in file - rpm = open(rpmrc,"r").readlines() + with open(rpmrc,"r") as f: + rpm = f.readlines() # Parse for data data = {} # Allowed section names that get parsed @@ -511,24 +513,23 @@ def updateRpmDicts(rpmrc, pyfile): # Insert data data[key][tokens[1]] = tokens[2:] # Write new rpmutils.py file - out = open(pyfile,"w") - pm = 0 - for l in oldpy: - if pm: - if l.startswith('# End of rpmrc dictionaries'): - pm = 0 + with open(pyfile,"w") as out: + pm = 0 + for l in oldpy: + if pm: + if l.startswith('# End of rpmrc dictionaries'): + pm = 0 + out.write(l) + else: out.write(l) - else: - out.write(l) - if l.startswith('# Start of rpmrc dictionaries'): - pm = 1 - # Write data sections to single dictionaries - for key, entries in data.items(): - out.write("%s = {\n" % key) - for arch in sorted(entries.keys()): - out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch]))) - out.write("}\n\n") - out.close() + if l.startswith('# Start of rpmrc dictionaries'): + pm = 1 + # Write data sections to single dictionaries + for key, entries in data.items(): + out.write("%s = {\n" % key) + for arch in sorted(entries.keys()): + out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch]))) + out.write("}\n\n") except: pass diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index baf972f..8eb0823 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -679,7 +679,7 @@ if can_read_reg: HKEY_USERS = hkey_mod.HKEY_USERS def RegGetValue(root, key): - """This utility function returns a value in the registry + r"""This utility function returns a value in the registry without having to open the key first. Only available on Windows platforms with a version of Python that can read the registry. Returns the same thing as @@ -1002,7 +1002,9 @@ if sys.platform == 'cygwin': def get_native_path(path): """Transforms an absolute path into a native path for the system. In Cygwin, this converts from a Cygwin path to a Windows one.""" - return os.popen('cygpath -w ' + path).read().replace('\n', '') + with os.popen('cygpath -w ' + path) as p: + npath = p.read().replace('\n', '') + return npath else: def get_native_path(path): """Transforms an absolute path into a native path for the system. @@ -1478,13 +1480,12 @@ if hasattr(hashlib, 'md5'): :return: String of Hex digits representing the signature """ m = hashlib.md5() - f = open(fname, "rb") - while True: - blck = f.read(chunksize) - if not blck: - break - m.update(to_bytes(blck)) - f.close() + with open(fname, "rb") as f: + while True: + blck = f.read(chunksize) + if not blck: + break + m.update(to_bytes(blck)) return m.hexdigest() else: # if md5 algorithm not available, just return data unmodified @@ -1513,7 +1514,6 @@ def MD5collect(signatures): return MD5signature(', '.join(signatures)) - def silent_intern(x): """ Perform sys.intern() on the passed argument and return the result. -- cgit v0.12 From f61d3bcd112285644c1a6ce253b267ef690a7e06 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 31 Mar 2019 07:01:00 -0600 Subject: [PY 3.8] test fixes for file closings, rawstrings On a linux host (missing some things that may be on the Travis CI setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages. Signed-off-by: Mats Wichmann --- SConstruct | 21 +-- bin/SConsDoc.py | 172 ++++++++++----------- site_scons/soe_utils.py | 18 +-- src/engine/SCons/Action.py | 31 ++-- src/engine/SCons/Node/FS.py | 22 +-- src/engine/SCons/Platform/win32.py | 12 +- src/engine/SCons/SConsign.py | 5 + src/engine/SCons/Scanner/RC.py | 6 +- src/engine/SCons/Tool/PharLapCommon.py | 3 +- src/engine/SCons/Tool/docbook/__init__.py | 136 ++++++++-------- src/engine/SCons/Tool/suncxx.py | 12 +- src/test_interrupts.py | 3 +- src/test_pychecker.py | 3 +- src/test_setup.py | 33 ++-- src/test_strings.py | 3 +- test/AS/as-live.py | 3 +- test/AS/fixture/myas.py | 18 +-- test/AS/fixture/myas_args.py | 23 ++- test/Actions/actions.py | 7 +- test/Actions/append.py | 17 +- test/Actions/exitstatfunc.py | 4 +- test/Actions/function.py | 2 +- test/Actions/pre-post-fixture/work2/SConstruct | 3 +- test/Actions/pre-post-fixture/work3/SConstruct | 3 +- test/Actions/pre-post-fixture/work4/build.py | 8 +- test/Actions/timestamp.py | 3 +- test/Actions/unicode-signature-fixture/SConstruct | 3 +- test/Alias/Alias.py | 3 +- test/Alias/Depends.py | 3 +- test/Alias/action.py | 14 +- test/Alias/scanner.py | 8 +- test/Alias/srcdir.py | 26 ++-- test/AlwaysBuild.py | 3 +- test/Batch/Boolean.py | 3 +- test/Batch/CHANGED_SOURCES.py | 3 +- test/Batch/SOURCES.py | 3 +- test/Batch/action-changed.py | 7 +- test/Batch/callable.py | 3 +- test/Batch/removed.py | 3 +- test/Batch/up_to_date.py | 3 +- test/Builder-factories.py | 15 +- test/Builder/errors.py | 13 +- test/Builder/multi/different-actions.py | 7 +- test/Builder/multi/different-environments.py | 9 +- test/Builder/multi/different-multi.py | 7 +- test/Builder/multi/different-order.py | 7 +- test/Builder/multi/different-overrides.py | 7 +- test/Builder/multi/different-target-lists.py | 7 +- test/Builder/multi/error.py | 7 +- test/Builder/multi/lone-target-list.py | 7 +- test/Builder/multi/multi.py | 7 +- test/Builder/multi/same-actions.py | 7 +- test/Builder/multi/same-overrides.py | 11 +- test/Builder/multi/same-targets.py | 7 +- test/Builder/non-multi.py | 7 +- test/Builder/same-actions-diff-envs.py | 4 +- test/Builder/same-actions-diff-overrides.py | 4 +- test/Builder/srcdir.py | 8 +- test/Builder/wrapper.py | 7 +- test/CFILESUFFIX.py | 3 +- test/CPPFLAGS.py | 34 ++-- test/CPPSUFFIXES.py | 17 +- test/CXX/CXXFILESUFFIX.py | 3 +- test/Chmod.py | 8 +- test/Clean/Option.py | 6 +- test/Clean/basic.py | 6 +- test/Clean/function.py | 6 +- test/Climb/U-Default-no-target.py | 4 +- test/Climb/explicit-parent--D.py | 8 +- test/Climb/explicit-parent--U.py | 8 +- test/Climb/explicit-parent-u.py | 8 +- test/Climb/option--D.py | 6 +- test/Climb/option--U.py | 6 +- test/Climb/option-u.py | 8 +- test/Command.py | 26 ++-- test/CommandGenerator.py | 6 +- test/Configure/Builder-call.py | 3 +- test/Configure/VariantDir.py | 19 +-- test/Configure/custom-tests.py | 2 +- test/Copy-Action.py | 8 +- test/D/AllAtOnce/Common/common.py | 4 +- test/D/CoreScanner/Common/common.py | 4 +- test/D/HSTeoh/Common/arLibIssue.py | 4 +- test/D/HSTeoh/Common/libCompileOptions.py | 4 +- test/D/HSTeoh/Common/linkingProblem.py | 4 +- .../Common/singleStringCannotBeMultipleOptions.py | 4 +- .../CompileAndLinkOneStep/Common/common.py | 4 +- .../CompileThenLinkTwoSteps/Common/common.py | 4 +- .../2939_Ariovistus/Common/correctLinkOptions.py | 4 +- .../2940_Ariovistus/Common/correctLinkOptions.py | 4 +- .../2994/Common/D_changed_DFLAGS_not_rebuilding.py | 4 +- test/D/SharedObjects/Common/common.py | 4 +- test/DSUFFIXES.py | 17 +- test/Decider/switch-rebuild.py | 3 +- test/Default.py | 6 +- test/Delete.py | 16 +- test/Depends/Depends.py | 8 +- test/Depends/spurious-rebuilds.py | 3 +- test/Deprecated/BuildDir.py | 7 +- test/Deprecated/SConscript-build_dir.py | 8 +- test/Deprecated/SourceCode/SourceCode.py | 8 +- test/Deprecated/SourceSignatures/basic.py | 3 +- test/Deprecated/SourceSignatures/env.py | 3 +- test/Deprecated/SourceSignatures/implicit-cache.py | 3 +- test/Deprecated/SourceSignatures/no-csigs.py | 3 +- test/Deprecated/SourceSignatures/switch-rebuild.py | 3 +- test/Deprecated/TargetSignatures/content.py | 8 +- test/Deprecated/debug-nomemoizer.py | 3 +- test/ENV.py | 6 +- test/ESCAPE.py | 8 +- test/Errors/AttributeError.py | 4 +- test/Errors/Exception.py | 5 +- test/Errors/SyntaxError.py | 2 +- test/Errors/TypeError.py | 2 +- test/Errors/UserError.py | 2 +- test/Execute.py | 3 +- test/Exit.py | 16 +- test/FindFile.py | 12 +- test/Flatten.py | 8 +- test/Fortran/FORTRANMODDIR.py | 6 +- test/Fortran/FORTRANSUFFIXES.py | 17 +- test/Fortran/USE-MODULE.py | 6 +- test/Fortran/link-with-cxx.py | 23 +-- test/Fortran/module-subdir.py | 24 +-- test/GetBuildFailures/option-k.py | 3 +- test/GetBuildFailures/parallel.py | 3 +- test/GetBuildFailures/serial.py | 6 +- test/Glob/Repository.py | 8 +- test/Glob/VariantDir.py | 16 +- test/Glob/basic.py | 8 +- test/Glob/exclude.py | 8 +- test/Glob/source.py | 8 +- test/Glob/strings.py | 8 +- test/Glob/subdir.py | 8 +- test/Glob/subst.py | 8 +- test/HeaderGen.py | 12 +- test/IDL/MIDLCOM.py | 16 +- test/Ignore.py | 11 +- test/Install/Install.py | 34 ++-- test/Install/wrap-by-attribute.py | 8 +- test/Interactive/configure.py | 11 +- test/LEX/LEX.py | 3 +- test/LEX/LEXFLAGS.py | 3 +- test/LINK/LINKFLAGS.py | 3 +- test/LINK/SHLINKFLAGS.py | 3 +- test/M4/M4COM.py | 10 +- test/M4/M4COMSTR.py | 10 +- test/MSVC/batch.py | 14 +- test/MSVS/vs-10.0-scc-files.py | 2 +- test/MSVS/vs-10.0-scc-legacy-files.py | 4 +- test/MSVS/vs-11.0-scc-files.py | 2 +- test/MSVS/vs-11.0-scc-legacy-files.py | 4 +- test/MSVS/vs-14.0-scc-files.py | 2 +- test/MSVS/vs-14.0-scc-legacy-files.py | 4 +- test/MSVS/vs-14.1-scc-files.py | 2 +- test/MSVS/vs-14.1-scc-legacy-files.py | 4 +- test/MSVS/vs-7.0-scc-files.py | 4 +- test/MSVS/vs-7.0-scc-legacy-files.py | 2 +- test/MSVS/vs-7.1-scc-legacy-files.py | 2 +- test/MSVS/vs-8.0-scc-legacy-files.py | 2 +- test/MSVS/vs-9.0-scc-legacy-files.py | 2 +- test/Mkdir.py | 24 +-- test/Move.py | 8 +- test/NoClean.py | 15 +- test/ParseDepends.py | 6 +- test/QT/qt_warnings.py | 4 +- test/Repository/Default.py | 3 +- test/Repository/LIBPATH.py | 15 +- test/Repository/Local.py | 4 +- test/Repository/SConscript.py | 18 ++- test/Repository/VariantDir.py | 8 +- test/Repository/option-c.py | 4 +- test/Repository/option-f.py | 8 +- test/Repository/option-n.py | 3 +- test/Repository/targets.py | 8 +- test/Requires/basic.py | 11 +- test/Requires/eval-order.py | 7 +- test/Rpcgen/RPCGEN.py | 13 +- test/Rpcgen/RPCGENCLIENTFLAGS.py | 13 +- test/Rpcgen/RPCGENFLAGS.py | 13 +- test/Rpcgen/RPCGENHEADERFLAGS.py | 13 +- test/Rpcgen/RPCGENSERVICEFLAGS.py | 13 +- test/Rpcgen/RPCGENXDRFLAGS.py | 13 +- test/SConscript/SConscript.py | 2 +- test/SConscript/SConscriptChdir.py | 24 ++- test/SConsignFile/default.py | 6 +- test/SConsignFile/explicit-file.py | 6 +- test/SConsignFile/use-dbhash.py | 6 +- test/SConsignFile/use-dbm.py | 6 +- test/SConsignFile/use-dumbdbm.py | 6 +- test/SConsignFile/use-gdbm.py | 6 +- test/SHELL.py | 8 +- test/SPAWN.py | 8 +- test/Scanner/FindPathDirs.py | 8 +- test/Scanner/Scanner.py | 11 +- test/Scanner/dictionary.py | 8 +- test/Scanner/empty-implicit.py | 3 +- test/Scanner/exception.py | 11 +- test/Scanner/generated.py | 18 +-- test/Scanner/multi-env.py | 7 +- test/Scanner/no-Dir-node.py | 10 +- test/Scanner/source_scanner-dict.py | 30 ++-- test/Scanner/unicode.py | 7 +- test/SideEffect/directory.py | 3 +- test/SideEffect/parallel.py | 3 +- test/Subst/null-sources-attr.py | 8 +- test/TAR/TAR.py | 12 +- test/TAR/TARFLAGS.py | 14 +- test/TARGET-dir.py | 7 +- test/TEX/LATEX.py | 21 +-- test/TEX/LATEX2.py | 2 +- test/TEX/LATEXCOM.py | 2 +- test/TEX/LATEXCOMSTR.py | 2 +- test/TEX/LATEXFLAGS.py | 11 +- test/TEX/PDFLATEX.py | 21 +-- test/TEX/PDFLATEXCOM.py | 2 +- test/TEX/PDFLATEXCOMSTR.py | 3 +- test/TEX/PDFLATEXFLAGS.py | 11 +- test/TEX/PDFTEX.py | 21 +-- test/TEX/PDFTEXCOM.py | 2 +- test/TEX/PDFTEXCOMSTR.py | 3 +- test/TEX/PDFTEXFLAGS.py | 11 +- test/TEX/PDF_single_source.py | 4 +- test/TEX/TEX.py | 21 +-- test/TEX/TEXCOM.py | 2 +- test/TEX/TEXCOMSTR.py | 2 +- test/TEX/TEXFLAGS.py | 11 +- test/TEX/auxiliaries.py | 2 +- test/TEX/biber_biblatex.py | 2 +- test/TEX/biber_biblatex2.py | 2 +- test/TEX/biblatex.py | 2 +- test/TEX/biblatex_plain.py | 2 +- test/TEX/bibliography.py | 4 +- test/TEX/bibtex-latex-rerun.py | 2 +- test/TEX/clean.py | 2 +- test/TEX/configure.py | 2 +- test/TEX/dryrun.py | 2 +- test/TEX/eps_graphics.py | 16 +- test/TEX/eps_graphics2.py | 20 +-- test/TEX/generated_files.py | 2 +- test/TEX/glossaries.py | 2 +- test/TEX/glossary.py | 2 +- test/TEX/input_docClass.py | 14 +- test/TEX/lstinputlisting.py | 2 +- test/TEX/makeindex.py | 2 +- test/TEX/multi-line_include_options.py | 2 +- test/TEX/multi-run.py | 2 +- test/TEX/multibib.py | 2 +- test/TEX/multiple_include.py | 14 +- test/TEX/multiple_include_subdir.py | 16 +- test/TEX/newglossary.py | 6 +- test/TEX/nomencl.py | 4 +- test/TEX/recursive_scanner_dependencies_import.py | 4 +- test/TEX/recursive_scanner_dependencies_input.py | 3 +- test/TEX/rename_result.py | 2 +- test/TEX/subdir-as-include.py | 2 +- test/TEX/subdir-input.py | 2 +- test/TEX/subdir_variantdir_include.py | 2 +- test/TEX/subdir_variantdir_include2.py | 10 +- test/TEX/subdir_variantdir_input.py | 2 +- test/TEX/synctex.py | 2 +- test/TEX/usepackage.py | 2 +- test/TEX/variant_dir.py | 18 +-- test/TEX/variant_dir_bibunit.py | 2 +- test/TEX/variant_dir_dup0.py | 26 ++-- test/TEX/variant_dir_newglossary.py | 6 +- test/TEX/variant_dir_style_dup0.py | 12 +- test/ToolSurrogate.py | 8 +- test/Touch.py | 8 +- test/Value.py | 1 - test/Variables/Variables.py | 4 +- test/Variables/chdir.py | 4 +- test/VariantDir/Clean.py | 6 +- test/VariantDir/SConscript-variant_dir.py | 18 +-- test/WhereIs.py | 2 +- test/Win32/bad-drive.py | 8 +- test/Win32/default-drive.py | 8 +- test/YACC/YACC-fixture/myyacc.py | 12 +- test/YACC/YACCFLAGS-fixture/myyacc.py | 16 +- test/YACC/YACCHFILESUFFIX.py | 9 +- test/YACC/YACCHXXFILESUFFIX.py | 9 +- test/YACC/YACCVCGFILESUFFIX.py | 9 +- test/builderrors.py | 10 +- test/chdir.py | 9 +- test/duplicate-sources.py | 8 +- test/emitter.py | 3 +- test/explain/basic.py | 10 +- test/explain/save-info.py | 10 +- test/fixture/mycompile.py | 6 +- test/fixture/mylink.py | 8 +- test/fixture/myrewrite.py | 5 +- test/fixture/wrapper.py | 4 +- test/gnutools.py | 28 ++-- test/ignore-command.py | 8 +- test/implicit/IMPLICIT_COMMAND_DEPENDENCIES.py | 15 +- test/implicit/asynchronous-modification.py | 6 +- test/implicit/changed-node.py | 38 +++-- test/long-lines/signature.py | 12 +- test/multiline.py | 6 +- test/no-arguments.py | 8 +- test/no-target.py | 8 +- test/option--max-drift.py | 6 +- test/option--random.py | 8 +- test/option-n.py | 5 +- test/option/debug-count.py | 5 +- test/option/debug-findlibs.py | 9 +- test/option/debug-memoizer.py | 3 +- test/option/debug-memory.py | 3 +- test/option/debug-multiple.py | 5 +- test/option/debug-objects.py | 3 +- test/option/debug-presub.py | 11 +- test/option/debug-time.py | 8 +- test/option/md5-chunksize.py | 11 +- test/option/stack-size.py | 6 +- test/option/warn-duplicate-environment.py | 7 +- test/option/warn-misleading-keywords.py | 7 +- test/overrides.py | 12 +- .../convenience-functions/convenience-functions.py | 2 +- test/packaging/ipkg.py | 7 +- test/packaging/place-files-in-subdirectory.py | 5 +- test/packaging/rpm/internationalization.py | 22 +-- test/packaging/rpm/multipackage.py | 6 +- test/packaging/rpm/package.py | 8 +- test/packaging/rpm/tagging.py | 6 +- test/preserve-source.py | 8 +- test/python-version.py | 2 +- test/question/basic.py | 6 +- test/redirection.py | 9 +- test/runtest/python.py | 2 +- test/sconsign/corrupt.py | 11 +- test/sconsign/ghost-entries.py | 8 +- test/sconsign/script/SConsignFile.py | 24 ++- test/sconsign/script/Signatures.py | 22 ++- test/sconsign/script/bad.py | 8 +- test/sconsign/script/dblite.py | 4 +- test/sconsign/script/no-SConsignFile.py | 24 ++- test/silent-command.py | 8 +- test/site_scons/site_init.py | 2 +- test/special-filenames.py | 3 +- test/srcchange.py | 10 +- test/strfunction.py | 6 +- test/subclassing.py | 2 +- test/subdir.py | 6 +- test/subdivide.py | 18 ++- test/suffixes.py | 8 +- test/timestamp-fallback.py | 9 +- test/toolpath/VariantDir.py | 4 +- test/up-to-date.py | 6 +- testing/framework/SConscript | 13 +- testing/framework/TestSCons.py | 52 +++---- testing/framework/TestSConsMSVS.py | 8 +- 351 files changed, 1644 insertions(+), 1516 deletions(-) diff --git a/SConstruct b/SConstruct index 590aedf..dc9ee5d 100644 --- a/SConstruct +++ b/SConstruct @@ -96,14 +96,16 @@ git_status_lines = [] if git: cmd = "%s ls-files 2> /dev/null" % git - git_status_lines = os.popen(cmd, "r").readlines() + with os.popen(cmd, "r") as p: + git_status_lines = p.readlines() revision = ARGUMENTS.get('REVISION', '') def generate_build_id(revision): return revision if not revision and git: - git_hash = os.popen("%s rev-parse HEAD 2> /dev/null" % git, "r").read().strip() + with os.popen("%s rev-parse HEAD 2> /dev/null" % git, "r") as p: + git_hash = p.read().strip() def generate_build_id(revision): result = git_hash if [l for l in git_status_lines if 'modified' in l]: @@ -570,10 +572,9 @@ for p in [ scons ]: def write_src_files(target, source, **kw): global src_files src_files.sort() - f = open(str(target[0]), 'w') - for file in src_files: - f.write(file + "\n") - f.close() + with open(str(target[0]), 'w') as f: + for file in src_files: + f.write(file + "\n") return 0 env.Command(os.path.join(build, 'MANIFEST'), MANIFEST_in_list, @@ -662,14 +663,14 @@ for p in [ scons ]: def Digestify(target, source, env): import hashlib src = source[0].rfile() - contents = open(str(src),'rb').read() + with open(str(src),'rb') as f: + contents = f.read() m = hashlib.md5() m.update(contents) sig = m.hexdigest() bytes = os.stat(str(src))[6] - open(str(target[0]), 'w').write("MD5 %s %s %d\n" % (sig, - src.name, - bytes)) + with open(str(target[0]), 'w') as f: + f.write("MD5 %s %s %d\n" % (sig, src.name, bytes)) env.Command(digest, tar_gz, Digestify) if not zipit: diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py index bd9c90d..962073e 100644 --- a/bin/SConsDoc.py +++ b/bin/SConsDoc.py @@ -178,22 +178,21 @@ def isSConsXml(fpath): contains the default target namespace definition. """ try: - f = open(fpath,'r') - content = f.read() - f.close() + with open(fpath,'r') as f: + content = f.read() if content.find('xmlns="%s"' % dbxsd) >= 0: return True except: pass - - return False + + return False def remove_entities(content): # Cut out entity inclusions content = re_entity_header.sub("", content, re.M) # Cut out entities themselves content = re_entity.sub(lambda match: match.group(1), content) - + return content default_xsd = os.path.join('doc','xsd','scons.xsd') @@ -201,11 +200,11 @@ default_xsd = os.path.join('doc','xsd','scons.xsd') ARG = "dbscons" class Libxml2ValidityHandler: - + def __init__(self): self.errors = [] self.warnings = [] - + def error(self, msg, data): if data != ARG: raise Exception("Error handler did not receive correct argument") @@ -221,14 +220,14 @@ class DoctypeEntity: def __init__(self, name_, uri_): self.name = name_ self.uri = uri_ - + def getEntityString(self): txt = """ %(perc)s%(name)s; """ % {'perc' : perc, 'name' : self.name, 'uri' : self.uri} return txt - + class DoctypeDeclaration: def __init__(self, name_=None): self.name = name_ @@ -241,23 +240,23 @@ class DoctypeDeclaration: self.addEntity("functions-mod", "functions.mod") self.addEntity("tools-mod", "tools.mod") self.addEntity("variables-mod", "variables.mod") - + def addEntity(self, name, uri): self.entries.append(DoctypeEntity(name, uri)) - + def createDoctype(self): content = '\n' - + return content if not has_libxml2: class TreeFactory: def __init__(self): pass - + def newNode(self, tag): return etree.Element(tag) @@ -268,22 +267,22 @@ if not has_libxml2: return etree.Element(tag, nsmap=NSMAP) return etree.Element(tag) - + def copyNode(self, node): return copy.deepcopy(node) - + def appendNode(self, parent, child): parent.append(child) def hasAttribute(self, node, att): return att in node.attrib - + def getAttribute(self, node, att): return node.attrib[att] - + def setAttribute(self, node, att, value): node.attrib[att] = value - + def getText(self, root): return root.text @@ -292,30 +291,27 @@ if not has_libxml2: def writeGenTree(self, root, fp): dt = DoctypeDeclaration() - fp.write(etree.tostring(root, xml_declaration=True, - encoding="UTF-8", pretty_print=True, + fp.write(etree.tostring(root, xml_declaration=True, + encoding="UTF-8", pretty_print=True, doctype=dt.createDoctype())) def writeTree(self, root, fpath): - fp = open(fpath, 'w') - fp.write(etree.tostring(root, xml_declaration=True, - encoding="UTF-8", pretty_print=True)) - fp.close() + with open(fpath, 'w') as fp: + fp.write(etree.tostring(root, xml_declaration=True, + encoding="UTF-8", pretty_print=True)) def prettyPrintFile(self, fpath): - fin = open(fpath,'r') - tree = etree.parse(fin) - pretty_content = etree.tostring(tree, pretty_print=True) - fin.close() - - fout = open(fpath,'w') - fout.write(pretty_content) - fout.close() + with open(fpath,'r') as fin: + tree = etree.parse(fin) + pretty_content = etree.tostring(tree, pretty_print=True) + + with open(fpath,'w') as fout: + fout.write(pretty_content) def decorateWithHeader(self, root): root.attrib["{"+xsi+"}schemaLocation"] = "%s %s/scons.xsd" % (dbxsd, dbxsd) return root - + def newXmlTree(self, root): """ Return a XML file tree with the correct namespaces set, the element root as top entry and the given header comment. @@ -324,7 +320,7 @@ if not has_libxml2: 'xsi' : xsi} t = etree.Element(root, nsmap=NSMAP) return self.decorateWithHeader(t) - + def validateXml(self, fpath, xmlschema_context): # Use lxml xmlschema = etree.XMLSchema(xmlschema_context) @@ -361,21 +357,21 @@ if not has_libxml2: current XML toolkit. """ return [root] - -else: + +else: class TreeFactory: def __init__(self): pass - + def newNode(self, tag): return libxml2.newNode(tag) def newEtreeNode(self, tag, init_ns=False): return etree.Element(tag) - + def copyNode(self, node): return node.copyNode(1) - + def appendNode(self, parent, child): if hasattr(parent, 'addChild'): parent.addChild(child) @@ -386,7 +382,7 @@ else: if hasattr(node, 'hasProp'): return node.hasProp(att) return att in node.attrib - + def getAttribute(self, node, att): if hasattr(node, 'prop'): return node.prop(att) @@ -397,7 +393,7 @@ else: node.setProp(att, value) else: node.attrib[att] = value - + def getText(self, root): if hasattr(root, 'getContent'): return root.getContent() @@ -425,20 +421,18 @@ else: doc.freeDoc() def writeTree(self, root, fpath): - fp = open(fpath, 'w') - doc = libxml2.newDoc('1.0') - doc.setRootElement(root) - fp.write(doc.serialize("UTF-8", 1)) - doc.freeDoc() - fp.close() + with open(fpath, 'w') as fp: + doc = libxml2.newDoc('1.0') + doc.setRootElement(root) + fp.write(doc.serialize("UTF-8", 1)) + doc.freeDoc() def prettyPrintFile(self, fpath): # Read file and resolve entities doc = libxml2.readFile(fpath, None, libxml2d.XML_PARSE_NOENT) - fp = open(fpath, 'w') - # Prettyprint - fp.write(doc.serialize("UTF-8", 1)) - fp.close() + with open(fpath, 'w') as fp: + # Prettyprint + fp.write(doc.serialize("UTF-8", 1)) # Cleanup doc.freeDoc() @@ -447,9 +441,9 @@ else: ns = root.newNs(dbxsd, None) xi = root.newNs(xsi, 'xsi') root.setNs(ns) #put this node in the target namespace - + root.setNsProp(xi, 'schemaLocation', "%s %s/scons.xsd" % (dbxsd, dbxsd)) - + return root def newXmlTree(self, root): @@ -461,7 +455,7 @@ else: def validateXml(self, fpath, xmlschema_context): retval = True - + # Create validation context validation_context = xmlschema_context.schemaNewValidCtxt() # Set error/warning handlers @@ -471,18 +465,18 @@ else: doc = libxml2.readFile(fpath, None, libxml2.XML_PARSE_NOENT) doc.xincludeProcessFlags(libxml2.XML_PARSE_NOENT) err = validation_context.schemaValidateDoc(doc) - + if err or eh.errors: for e in eh.errors: print(e.rstrip("\n")) # import pdb; pdb.set_trace() print("%s fails to validate" % fpath) retval = False - + # Cleanup doc.freeDoc() del validation_context - + return retval def findAll(self, root, tag, ns=None, xpath_context=None, nsmap=None): @@ -506,7 +500,7 @@ else: expression = "./%s/node()" % tag if ns: expression = "./%s:%s/node()" % (ns, tag) - + return xpath_context.xpathEval(expression) else: expression = "./{%s}%s/node()" % (nsmap[ns], tag) @@ -536,7 +530,7 @@ else: if child.tail: tail = libxml2.newText(child.tail) elements.append(tail) - + return elements def convertElementTree(self, root): @@ -562,7 +556,7 @@ else: if root.tail: tail = libxml2.newText(root.tail) elements.append(tail) - + return elements tf = TreeFactory() @@ -603,7 +597,7 @@ class SConsDocTree: # Register namespaces for key, val in self.nsmap.items(): self.xpath_context.xpathRegisterNs(key, val) - + def __del__(self): if self.doc is not None: self.doc.freeDoc() @@ -622,7 +616,7 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): ctxt = libxml2.schemaNewParserCtxt(xsdfile) xmlschema_context = ctxt.schemaParse() del ctxt - + fpaths = [] for dp in dpaths: if dp.endswith('.xml') and isSConsXml(dp): @@ -635,13 +629,13 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): fp = os.path.join(path, f) if isSConsXml(fp): fpaths.append(fp) - + fails = [] for idx, fp in enumerate(fpaths): fpath = os.path.join(path, fp) print("%.2f%s (%d/%d) %s" % (float(idx+1)*100.0/float(len(fpaths)), perc, idx+1, len(fpaths),fp)) - + if not tf.validateXml(fp, xmlschema_context): fails.append(fp) continue @@ -652,7 +646,7 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): if fails: return False - + return True class Item(object): @@ -733,10 +727,10 @@ class SConsDocHandler(object): uses.extend(self.parseItems(u, xpath_context, nsmap)) for s in tf.findAll(domelem, "sets", dbxid, xpath_context, nsmap): sets.extend(self.parseItems(s, xpath_context, nsmap)) - + return sorted(uses), sorted(sets) - def parseInstance(self, domelem, map, Class, + def parseInstance(self, domelem, map, Class, xpath_context, nsmap, include_entities=True): name = 'unknown' if tf.hasAttribute(domelem, 'name'): @@ -760,24 +754,24 @@ class SConsDocHandler(object): instance.arguments = [] instance.arguments.append(tf.copyNode(a)) - def parseDomtree(self, root, xpath_context=None, nsmap=None, include_entities=True): + def parseDomtree(self, root, xpath_context=None, nsmap=None, include_entities=True): # Process Builders for b in tf.findAll(root, "builder", dbxid, xpath_context, nsmap): - self.parseInstance(b, self.builders, Builder, + self.parseInstance(b, self.builders, Builder, xpath_context, nsmap, include_entities) # Process Functions for f in tf.findAll(root, "scons_function", dbxid, xpath_context, nsmap): - self.parseInstance(f, self.functions, Function, + self.parseInstance(f, self.functions, Function, xpath_context, nsmap, include_entities) # Process Tools for t in tf.findAll(root, "tool", dbxid, xpath_context, nsmap): - self.parseInstance(t, self.tools, Tool, + self.parseInstance(t, self.tools, Tool, xpath_context, nsmap, include_entities) # Process CVars for c in tf.findAll(root, "cvar", dbxid, xpath_context, nsmap): - self.parseInstance(c, self.cvars, ConstructionVariable, + self.parseInstance(c, self.cvars, ConstructionVariable, xpath_context, nsmap, include_entities) - + def parseContent(self, content, include_entities=True): """ Parses the given content as XML file. This method is used when we generate the basic lists of entities @@ -798,28 +792,26 @@ class SConsDocHandler(object): t.parseXmlFile(fpath) # Parse it self.parseDomtree(t.root, t.xpath_context, t.nsmap) - + # lifted from Ka-Ping Yee's way cool pydoc module. if sys.version_info[0] == 2: def importfile(path): """Import a Python source file or compiled file given its path.""" import imp magic = imp.get_magic() - file = open(path, 'r') - if file.read(len(magic)) == magic: - kind = imp.PY_COMPILED - else: - kind = imp.PY_SOURCE - file.close() + with open(path, 'r') as ifp: + if ifp.read(len(magic)) == magic: + kind = imp.PY_COMPILED + else: + kind = imp.PY_SOURCE filename = os.path.basename(path) name, ext = os.path.splitext(filename) - file = open(path, 'r') - try: - module = imp.load_module(name, file, path, (ext, 'r', kind)) - except ImportError as e: - sys.stderr.write("Could not import %s: %s\n" % (path, e)) - return None - file.close() + with open(path, 'r') as ifp: + try: + module = imp.load_module(name, ifp, path, (ext, 'r', kind)) + except ImportError as e: + sys.stderr.write("Could not import %s: %s\n" % (path, e)) + return None return module else: # PY3 version, from newer pydoc @@ -828,8 +820,8 @@ else: # PY3 version, from newer pydoc import importlib from pydoc import ErrorDuringImport magic = importlib.util.MAGIC_NUMBER - with open(path, 'rb') as file: - is_bytecode = magic == file.read(len(magic)) + with open(path, 'rb') as ifp: + is_bytecode = magic == ifp.read(len(magic)) filename = os.path.basename(path) name, ext = os.path.splitext(filename) if is_bytecode: diff --git a/site_scons/soe_utils.py b/site_scons/soe_utils.py index 451c7de..3b87dee 100644 --- a/site_scons/soe_utils.py +++ b/site_scons/soe_utils.py @@ -17,16 +17,14 @@ def soelim(target, source, env): t = str(target[0]) s = str(source[0]) dir, f = os.path.split(s) - tfp = open(t, 'w') - sfp = open(s, 'r') - for line in sfp.readlines(): - if line[:4] in ['.so ', "'so "]: - sofile = os.path.join(dir, line[4:-1]) - tfp.write(open(sofile, 'r').read()) - else: - tfp.write(line) - sfp.close() - tfp.close() + with open(t, 'w') as tfp, open(s, 'r') as sfp: + for line in sfp.readlines(): + if line[:4] in ['.so ', "'so "]: + sofile = os.path.join(dir, line[4:-1]) + with open(sofile, 'r') as f: + tfp.write(f.read()) + else: + tfp.write(line) def soscan(node, env, path): c = node.get_text_contents() diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 893c749..f97d564 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -108,6 +108,8 @@ import subprocess import itertools import inspect from collections import OrderedDict +if sys.platform == 'win32': + import msvcrt import SCons.Debug from SCons.Debug import logInstanceCreation @@ -767,16 +769,25 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): it'll have to be tweaked to get the full desired functionality. one special arg (so far?), 'error', to tell what to do with exceptions. """ - # allow std{in,out,err} to be "'devnull'" - io = kw.get('stdin') - if is_String(io) and io == 'devnull': - kw['stdin'] = open(os.devnull) - io = kw.get('stdout') - if is_String(io) and io == 'devnull': - kw['stdout'] = open(os.devnull, 'w') - io = kw.get('stderr') - if is_String(io) and io == 'devnull': - kw['stderr'] = open(os.devnull, 'w') + # allow std{in,out,err} to be "'devnull'". This is like + # subprocess.DEVNULL, which does not exist for Py2. Use the + # subprocess one if possible. + # Clean this up when Py2 support is dropped + try: + from subprocess import DEVNULL + except ImportError: + DEVNULL = None + + for stream in 'stdin', 'stdout', 'stderr': + io = kw.get(stream) + if is_String(io) and io == 'devnull': + if DEVNULL: + kw[stream] = DEVNULL + else: + if sys.platform == 'win32': + kw[stream] = msvcrt.get_osfhandle(open(os.devnull, "r+")) + else: + kw[stream] = open(os.devnull, "r+") # Figure out what shell environment to use ENV = kw.get('env', None) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index d861b2b..af0fe8c 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -699,13 +699,13 @@ class Base(SCons.Node.Node): @SCons.Memoize.CountMethodCall def stat(self): - try: + try: return self._memo['stat'] - except KeyError: + except KeyError: pass - try: + try: result = self.fs.stat(self.get_abspath()) - except os.error: + except os.error: result = None self._memo['stat'] = result @@ -719,16 +719,16 @@ class Base(SCons.Node.Node): def getmtime(self): st = self.stat() - if st: + if st: return st[stat.ST_MTIME] - else: + else: return None def getsize(self): st = self.stat() - if st: + if st: return st[stat.ST_SIZE] - else: + else: return None def isdir(self): @@ -3350,7 +3350,7 @@ class File(Base): df = dmap.get(c_str, None) if df: return df - + if os.altsep: c_str = c_str.replace(os.sep, os.altsep) df = dmap.get(c_str, None) @@ -3387,7 +3387,7 @@ class File(Base): file and just copy the prev_ni provided. If the prev_ni is wrong. It will propagate it. See: https://github.com/SCons/scons/issues/2980 - + Args: self - dependency target - target @@ -3396,7 +3396,7 @@ class File(Base): node to function. So if we detect that it's not passed. we throw DeciderNeedsNode, and caller should handle this and pass node. - Returns: + Returns: Boolean - Indicates if node(File) has changed. """ if node is None: diff --git a/src/engine/SCons/Platform/win32.py b/src/engine/SCons/Platform/win32.py index be30546..0a3b199 100644 --- a/src/engine/SCons/Platform/win32.py +++ b/src/engine/SCons/Platform/win32.py @@ -193,7 +193,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # actually do the spawn try: - args = [sh, '/C', escape(' '.join(args)) ] + args = [sh, '/C', escape(' '.join(args))] ret = spawnve(os.P_WAIT, sh, args, env) except OSError as e: # catch any error @@ -207,15 +207,17 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # and do clean up stuff if stdout is not None and stdoutRedirected == 0: try: - stdout.write(open( tmpFileStdout, "r" ).read()) - os.remove( tmpFileStdout ) + with open(tmpFileStdout, "r" ) as tmp: + stdout.write(tmp.read()) + os.remove(tmpFileStdout) except (IOError, OSError): pass if stderr is not None and stderrRedirected == 0: try: - stderr.write(open( tmpFileStderr, "r" ).read()) - os.remove( tmpFileStderr ) + with open(tmpFileStderr, "r" ) as tmp: + stderr.write(tmp.read()) + os.remove(tmpFileStderr) except (IOError, OSError): pass return ret diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py index dfafdc9..70247a4 100644 --- a/src/engine/SCons/SConsign.py +++ b/src/engine/SCons/SConsign.py @@ -338,6 +338,11 @@ class DirFile(Dir): SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%self.sconsign) + try: + fp.close() + except AttributeError: + pass + global sig_files sig_files.append(self) diff --git a/src/engine/SCons/Scanner/RC.py b/src/engine/SCons/Scanner/RC.py index 82f8ddc..abaaef7 100644 --- a/src/engine/SCons/Scanner/RC.py +++ b/src/engine/SCons/Scanner/RC.py @@ -48,9 +48,9 @@ def RCScan(): """Return a prototype Scanner instance for scanning RC source files""" res_re= r'^(?:\s*#\s*(?:include)|' \ - '.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \ - '\s*.*?)' \ - '\s*(<|"| )([^>"\s]+)(?:[>"\s])*$' + r'.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \ + r'\s*.*?)' \ + r'\s*(<|"| )([^>"\s]+)(?:[>"\s])*$' resScanner = SCons.Scanner.ClassicCPP("ResourceScanner", "$RCSUFFIXES", "CPPPATH", diff --git a/src/engine/SCons/Tool/PharLapCommon.py b/src/engine/SCons/Tool/PharLapCommon.py index 864a185..9ffafa9 100644 --- a/src/engine/SCons/Tool/PharLapCommon.py +++ b/src/engine/SCons/Tool/PharLapCommon.py @@ -79,7 +79,8 @@ def getPharLapVersion(): include_path = os.path.join(getPharLapPath(), os.path.normpath("include/embkern.h")) if not os.path.exists(include_path): raise SCons.Errors.UserError("Cannot find embkern.h in ETS include directory.\nIs Phar Lap ETS installed properly?") - mo = REGEX_ETS_VER.search(open(include_path, 'r').read()) + with open(include_path, 'r') as f: + mo = REGEX_ETS_VER.search(f.read()) if mo: return int(mo.group(1)) # Default return for Phar Lap 9.1 diff --git a/src/engine/SCons/Tool/docbook/__init__.py b/src/engine/SCons/Tool/docbook/__init__.py index ddbb8f1..ee8e4d6 100644 --- a/src/engine/SCons/Tool/docbook/__init__.py +++ b/src/engine/SCons/Tool/docbook/__init__.py @@ -84,7 +84,7 @@ def __extend_targets_sources(target, source): source = [source] if len(target) < len(source): target.extend(source[len(target):]) - + return target, source def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path): @@ -94,12 +94,12 @@ def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path): path_args = [scriptpath, db_xsl_folder] + default_path xsl_style = os.path.join(*path_args) kw['DOCBOOK_XSL'] = xsl_style - + def __select_builder(lxml_builder, libxml2_builder, cmdline_builder): """ Selects a builder, based on which Python modules are present. """ if prefer_xsltproc: return cmdline_builder - + if not has_libxml2: # At the moment we prefer libxml2 over lxml, the latter can lead # to conflicts when installed together with libxml2. @@ -115,7 +115,7 @@ def __ensure_suffix(t, suffix): tpath = str(t) if not tpath.endswith(suffix): return tpath+suffix - + return t def __ensure_suffix_stem(t, suffix): @@ -124,11 +124,11 @@ def __ensure_suffix_stem(t, suffix): if not tpath.endswith(suffix): stem = tpath tpath += suffix - + return tpath, stem else: stem, ext = os.path.splitext(tpath) - + return t, stem def __get_xml_text(root): @@ -151,7 +151,7 @@ def __create_output_dir(base_dir): else: if base_dir.endswith('/'): dir = base_dir - + if dir and not os.path.isdir(dir): os.makedirs(dir) @@ -203,10 +203,10 @@ def _detect(env): the requested output formats. """ global prefer_xsltproc - + if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True - + if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)): # Try to find the XSLT processors __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority) @@ -219,15 +219,15 @@ def _detect(env): # include_re = re.compile('fileref\\s*=\\s*["|\']([^\\n]*)["|\']') sentity_re = re.compile('') - + def __xml_scan(node, env, path, arg): """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """ # Does the node exist yet? if not os.path.isfile(str(node)): return [] - + if env.get('DOCBOOK_SCANENT',''): - # Use simple pattern matching for system entities..., no support + # Use simple pattern matching for system entities..., no support # for recursion yet. contents = node.get_text_contents() return sentity_re.findall(contents) @@ -235,9 +235,9 @@ def __xml_scan(node, env, path, arg): xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl') if not has_libxml2 or prefer_xsltproc: if has_lxml and not prefer_xsltproc: - + from lxml import etree - + xsl_tree = etree.parse(xsl_file) doc = etree.parse(str(node)) result = doc.xslt(xsl_tree) @@ -266,7 +266,7 @@ def __xml_scan(node, env, path, arg): for x in str(result).splitlines(): if x.strip() != "" and not x.startswith(" 1: env.Clean(outfiles[0], outfiles[1:]) - + return result def DocbookSlidesPdf(env, target, source=None, *args, **kw): @@ -746,7 +746,7 @@ def DocbookSlidesPdf(env, target, source=None, *args, **kw): for t,s in zip(target,source): t, stem = __ensure_suffix_stem(t, '.pdf') xsl = __builder.__call__(env, stem+'.fo', s, **kw) - env.Depends(xsl, kw['DOCBOOK_XSL']) + env.Depends(xsl, kw['DOCBOOK_XSL']) result.extend(xsl) result.extend(__fop_builder.__call__(env, t, xsl, **kw)) @@ -763,7 +763,7 @@ def DocbookSlidesHtml(env, target, source=None, *args, **kw): source = target target = ['index.html'] elif not SCons.Util.is_List(source): - source = [source] + source = [source] # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl']) @@ -796,12 +796,12 @@ def DocbookXInclude(env, target, source, *args, **kw): # Setup builder __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder) - + # Create targets result = [] for t,s in zip(target,source): result.extend(__builder.__call__(env, t, s, **kw)) - + return result def DocbookXslt(env, target, source=None, *args, **kw): @@ -810,13 +810,13 @@ def DocbookXslt(env, target, source=None, *args, **kw): """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) - + # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl') # Setup builder __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder) - + # Create targets result = [] for t,s in zip(target,source): @@ -840,18 +840,18 @@ def generate(env): DOCBOOK_DEFAULT_XSL_MAN = '', DOCBOOK_DEFAULT_XSL_SLIDESPDF = '', DOCBOOK_DEFAULT_XSL_SLIDESHTML = '', - + # Paths to the detected executables DOCBOOK_XSLTPROC = '', DOCBOOK_XMLLINT = '', DOCBOOK_FOP = '', - + # Additional flags for the text processors DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''), DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''), DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''), DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''), - + # Default command lines for the detected executables DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'], DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'], @@ -861,7 +861,7 @@ def generate(env): DOCBOOK_XSLTPROCCOMSTR = None, DOCBOOK_XMLLINTCOMSTR = None, DOCBOOK_FOPCOMSTR = None, - + ) _detect(env) diff --git a/src/engine/SCons/Tool/suncxx.py b/src/engine/SCons/Tool/suncxx.py index d526d86..9ac8d32 100644 --- a/src/engine/SCons/Tool/suncxx.py +++ b/src/engine/SCons/Tool/suncxx.py @@ -52,7 +52,13 @@ def get_package_info(package_name, pkginfo, pkgchk): version = None pathname = None try: - sadm_contents = open('/var/sadm/install/contents', 'r').read() + from subprocess import DEVNULL # py3k + except ImportError: + DEVNULL = open(os.devnull, 'wb') + + try: + with open('/var/sadm/install/contents', 'r') as f: + sadm_contents = f.read() except EnvironmentError: pass else: @@ -64,7 +70,7 @@ def get_package_info(package_name, pkginfo, pkgchk): try: p = subprocess.Popen([pkginfo, '-l', package_name], stdout=subprocess.PIPE, - stderr=open('/dev/null', 'w')) + stderr=DEVNULL) except EnvironmentError: pass else: @@ -78,7 +84,7 @@ def get_package_info(package_name, pkginfo, pkgchk): try: p = subprocess.Popen([pkgchk, '-l', package_name], stdout=subprocess.PIPE, - stderr=open('/dev/null', 'w')) + stderr=DEVNULL) except EnvironmentError: pass else: diff --git a/src/test_interrupts.py b/src/test_interrupts.py index 0fd8ba7..de18a54 100644 --- a/src/test_interrupts.py +++ b/src/test_interrupts.py @@ -87,7 +87,8 @@ exceptall_pat = re.compile(r' *except(?: *| +Exception *, *[^: ]+):[^\n]*') uncaughtKeyboardInterrupt = 0 for f in files: - contents = open(os.path.join(scons_lib_dir, f)).read() + with open(os.path.join(scons_lib_dir, f)) as ifp: + contents = ifp.read() try_except_lines = {} lastend = 0 while True: diff --git a/src/test_pychecker.py b/src/test_pychecker.py index 54d78fb..56233c2 100644 --- a/src/test_pychecker.py +++ b/src/test_pychecker.py @@ -63,7 +63,8 @@ else: src_engine_ = os.path.join(src_engine, '') MANIFEST = os.path.join(src_engine, 'MANIFEST.in') -files = open(MANIFEST).read().split() +with open(MANIFEST) as f: + files = f.read().split() files = [f for f in files if f[-3:] == '.py'] diff --git a/src/test_setup.py b/src/test_setup.py index edf0de5..75e0533 100644 --- a/src/test_setup.py +++ b/src/test_setup.py @@ -176,21 +176,26 @@ tar_gz = os.path.join(cwd, 'build', 'dist', '%s.tar.gz' % scons_version) zip = os.path.join(cwd, 'build', 'dist', '%s.zip' % scons_version) if os.path.isfile(zip): - try: import zipfile - except ImportError: pass + try: + import zipfile + except + ImportError: pass else: - zf = zipfile.ZipFile(zip, 'r') - - for name in zf.namelist(): - dir = os.path.dirname(name) - try: os.makedirs(dir) - except: pass - # if the file exists, then delete it before writing - # to it so that we don't end up trying to write to a symlink: - if os.path.isfile(name) or os.path.islink(name): - os.unlink(name) - if not os.path.isdir(name): - open(name, 'w').write(zf.read(name)) + with zipfile.ZipFile(zip, 'r') as zf: + + for name in zf.namelist(): + dname = os.path.dirname(name) + try: + os.makedirs(dname) + except FileExistsError: + pass + # if the file exists, then delete it before writing + # to it so that we don't end up trying to write to a symlink: + if os.path.isfile(name) or os.path.islink(name): + os.unlink(name) + if not os.path.isdir(name): + with open(name, 'w') as ofp: + ofp.write(zf.read(name)) if not os.path.isdir(scons_version) and os.path.isfile(tar_gz): # Unpack the .tar.gz file. This should create the scons_version/ diff --git a/src/test_strings.py b/src/test_strings.py index e9f0abf..a8a5000 100644 --- a/src/test_strings.py +++ b/src/test_strings.py @@ -98,7 +98,8 @@ class Checker(object): for fname in filenames: fpath = os.path.join(dirpath, fname) if self.search_this(fpath) and not self.remove_this(fname, fpath): - body = open(fpath, 'r').read() + with open(fpath, 'r') as f: + body = f.read() for expr in self.expressions: if not expr.search(body): msg = '%s: missing %s' % (fpath, repr(expr.pattern)) diff --git a/test/AS/as-live.py b/test/AS/as-live.py index 879e7b2..b781caf 100644 --- a/test/AS/as-live.py +++ b/test/AS/as-live.py @@ -58,7 +58,8 @@ if sys.platform == "win32": test.write("wrapper.py", """\ import os import sys -open('%s', 'wb').write(("wrapper.py: %%s\\n" %% sys.argv[-1]).encode()) +with open('%s', 'wb') as f: + f.write(("wrapper.py: %%s\\n" %% sys.argv[-1]).encode()) cmd = " ".join(sys.argv[1:]) os.system(cmd) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) diff --git a/test/AS/fixture/myas.py b/test/AS/fixture/myas.py index bffae78..4f5d9ac 100644 --- a/test/AS/fixture/myas.py +++ b/test/AS/fixture/myas.py @@ -15,11 +15,10 @@ if sys.platform == 'win32': inf = a continue if a[:3] == '/Fo': out = a[3:] - infile = open(inf, 'rb') - outfile = open(out, 'wb') - for l in infile.readlines(): - if l[:3] != b'#as': - outfile.write(l) + with open(inf, 'rb') as ifp, open(out, 'wb') as ofp: + for l in ifp.readlines(): + if l[:3] != b'#as': + ofp.write(l) sys.exit(0) else: @@ -27,9 +26,8 @@ else: opts, args = getopt.getopt(sys.argv[1:], 'co:') for opt, arg in opts: if opt == '-o': out = arg - infile = open(args[0], 'rb') - outfile = open(out, 'wb') - for l in infile.readlines(): - if l[:3] != b'#as': - outfile.write(l) + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: + for l in ifp.readlines(): + if l[:3] != b'#as': + ofp.write(l) sys.exit(0) diff --git a/test/AS/fixture/myas_args.py b/test/AS/fixture/myas_args.py index c7ca315..24d68dc 100644 --- a/test/AS/fixture/myas_args.py +++ b/test/AS/fixture/myas_args.py @@ -21,12 +21,11 @@ if sys.platform == 'win32': out = a[3:] continue optstring = optstring + ' ' + a - infile = open(inf, 'rb') - outfile = open(out, 'wb') - outfile.write(bytearray(optstring + "\n",'utf-8')) - for l in infile.readlines(): - if l[:3] != b'#as': - outfile.write(l) + with open(inf, 'rb') as ifp, open(out, 'wb') as ofp: + ofp.write(bytearray(optstring + "\n",'utf-8')) + for l in ifp.readlines(): + if l[:3] != b'#as': + ofp.write(l) sys.exit(0) else: import getopt @@ -37,12 +36,10 @@ else: if opt == '-o': out = arg else: optstring = optstring + ' ' + opt - infile = open(args[0], 'rb') - outfile = open(out, 'wb') - outfile.write(bytearray(optstring + "\n",'utf-8')) - - for l in infile.readlines(): - if l[:3] != b'#as': - outfile.write(l) + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: + ofp.write(bytearray(optstring + "\n",'utf-8')) + for l in ifp.readlines(): + if l[:3] != b'#as': + ofp.write(l) sys.exit(0) diff --git a/test/Actions/actions.py b/test/Actions/actions.py index e69cdd7..f1bb6fe 100644 --- a/test/Actions/actions.py +++ b/test/Actions/actions.py @@ -32,10 +32,9 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -file = open(sys.argv[1], 'wb') -file.write((sys.argv[2] + "\n").encode()) -file.write(open(sys.argv[3], 'rb').read()) -file.close +with open(sys.argv[1], 'wb') as f, open(sys.argv[3], 'rb') as infp: + f.write((sys.argv[2] + "\n").encode()) + f.write(infp.read()) sys.exit(0) """) diff --git a/test/Actions/append.py b/test/Actions/append.py index 68646b3..0a59c42 100644 --- a/test/Actions/append.py +++ b/test/Actions/append.py @@ -44,19 +44,14 @@ test.write('SConstruct', """ env=Environment() def before(env, target, source): - f=open(str(target[0]), "wb") - f.write(b"Foo\\n") - f.close() - f=open("before.txt", "wb") - f.write(b"Bar\\n") - f.close() + with open(str(target[0]), "wb") as f: + f.write(b"Foo\\n") + with open("before.txt", "wb") as f: + f.write(b"Bar\\n") def after(env, target, source): - fin = open(str(target[0]), "rb") - fout = open("after%s", "wb") - fout.write(fin.read()) - fout.close() - fin.close() + with open(str(target[0]), "rb") as fin, open("after%s", "wb") as fout: + fout.write(fin.read()) env.Prepend(LINKCOM=Action(before)) env.Append(LINKCOM=Action(after)) diff --git a/test/Actions/exitstatfunc.py b/test/Actions/exitstatfunc.py index c2feef8..2e2a540 100644 --- a/test/Actions/exitstatfunc.py +++ b/test/Actions/exitstatfunc.py @@ -38,8 +38,8 @@ def always_succeed(s): return 0 def copy_fail(target, source, env): - content = open(str(source[0]), 'rb').read() - open(str(target[0]), 'wb').write(content) + with open(str(source[0]), 'rb') as infp, open(str(target[0]), 'wb') as f: + f.write(infp.read()) return 2 a = Action(copy_fail, exitstatfunc=always_succeed) diff --git a/test/Actions/function.py b/test/Actions/function.py index 61311af..7f292cf 100644 --- a/test/Actions/function.py +++ b/test/Actions/function.py @@ -90,7 +90,7 @@ def toto(header='%(header)s', trailer='%(trailer)s'): return writeDeps ''' -exec( withClosure % optEnv ) +exec(withClosure % optEnv) genHeaderBld = SCons.Builder.Builder( action = SCons.Action.Action( diff --git a/test/Actions/pre-post-fixture/work2/SConstruct b/test/Actions/pre-post-fixture/work2/SConstruct index 61f739f..6f03a53 100644 --- a/test/Actions/pre-post-fixture/work2/SConstruct +++ b/test/Actions/pre-post-fixture/work2/SConstruct @@ -1,5 +1,6 @@ def b(target, source, env): - open(str(target[0]), 'wb').write((env['X'] + '\n').encode()) + with open(str(target[0]), 'wb') as f: + f.write((env['X'] + '\n').encode()) env1 = Environment(X='111') env2 = Environment(X='222') B = Builder(action = b, env = env1, multi=1) diff --git a/test/Actions/pre-post-fixture/work3/SConstruct b/test/Actions/pre-post-fixture/work3/SConstruct index 0e13fa2..d523295 100644 --- a/test/Actions/pre-post-fixture/work3/SConstruct +++ b/test/Actions/pre-post-fixture/work3/SConstruct @@ -3,7 +3,8 @@ def pre(target, source, env): def post(target, source, env): pass def build(target, source, env): - open(str(target[0]), 'wb').write(b'build()\n') + with open(str(target[0]), 'wb') as f: + f.write(b'build()\n') env = Environment() AddPreAction('dir', pre) AddPostAction('dir', post) diff --git a/test/Actions/pre-post-fixture/work4/build.py b/test/Actions/pre-post-fixture/work4/build.py index db0572a..390c8b9 100644 --- a/test/Actions/pre-post-fixture/work4/build.py +++ b/test/Actions/pre-post-fixture/work4/build.py @@ -1,5 +1,5 @@ import sys -outfp = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - outfp.write(open(f, 'rb').read()) -outfp.close() +with open(sys.argv[1], 'wb') as outfp: + for f in sys.argv[2:]: + with open(f, 'rb') as infp: + outfp.write(infp.read()) diff --git a/test/Actions/timestamp.py b/test/Actions/timestamp.py index 835ac7f..d94a287 100644 --- a/test/Actions/timestamp.py +++ b/test/Actions/timestamp.py @@ -45,7 +45,8 @@ test.not_up_to_date(arguments = 'file.out') test.write('SConstruct', """\ def my_copy(target, source, env): - open(str(target[0]), 'w').write(open(str(source[0]), 'r').read()) + with open(str(target[0]), 'w') as f, open(str(source[0]), 'r') as infp: + f.write(infp.read()) env = Environment() env.Decider('timestamp-match') env.Command('file.out', 'file.in', my_copy) diff --git a/test/Actions/unicode-signature-fixture/SConstruct b/test/Actions/unicode-signature-fixture/SConstruct index 9c0f03d..4d466e1 100644 --- a/test/Actions/unicode-signature-fixture/SConstruct +++ b/test/Actions/unicode-signature-fixture/SConstruct @@ -1,7 +1,8 @@ fnode = File(u'foo.txt') def funcact(target, source, env): - open(str(target[0]), 'wb').write(b"funcact\n") + with open(str(target[0]), 'wb') as f: + f.write(b"funcact\n") for i in range(300): pass return 0 diff --git a/test/Alias/Alias.py b/test/Alias/Alias.py index a5dd903..c371625 100644 --- a/test/Alias/Alias.py +++ b/test/Alias/Alias.py @@ -37,7 +37,8 @@ test.subdir('sub1', 'sub2') test.write('build.py', r""" import sys -open(sys.argv[1], 'wb').write(open(sys.argv[2], 'rb').read()) +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) sys.exit(0) """) diff --git a/test/Alias/Depends.py b/test/Alias/Depends.py index a1129e4..715374c 100644 --- a/test/Alias/Depends.py +++ b/test/Alias/Depends.py @@ -37,7 +37,8 @@ test.subdir('sub1', 'sub2') test.write('build.py', r""" import sys -open(sys.argv[1], 'wb').write(open(sys.argv[2], 'rb').read()) +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) sys.exit(0) """) diff --git a/test/Alias/action.py b/test/Alias/action.py index 2a10dbc..def27a7 100644 --- a/test/Alias/action.py +++ b/test/Alias/action.py @@ -35,20 +35,22 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def cat(target, source, env): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) def foo(target, source, env): target = list(map(str, target)) source = list(map(str, source)) - open('foo', 'wb').write(bytearray("foo(%s, %s)\\n" % (target, source),'utf-8')) + with open('foo', 'wb') as f: + f.write(bytearray("foo(%s, %s)\\n" % (target, source),'utf-8')) def bar(target, source, env): target = list(map(str, target)) source = list(map(str, source)) - open('bar', 'wb').write(bytearray("bar(%s, %s)\\n" % (target, source),'utf-8')) + with open('bar', 'wb') as f: + f.write(bytearray("bar(%s, %s)\\n" % (target, source),'utf-8')) env = Environment(BUILDERS = {'Cat':Builder(action=cat)}) env.Alias(target = ['build-f1'], source = 'f1.out', action = foo) diff --git a/test/Alias/scanner.py b/test/Alias/scanner.py index d20a729..a6ded81 100644 --- a/test/Alias/scanner.py +++ b/test/Alias/scanner.py @@ -35,10 +35,10 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) XBuilder = Builder(action = cat, src_suffix = '.x', suffix = '.c') env = Environment() diff --git a/test/Alias/srcdir.py b/test/Alias/srcdir.py index 4a0de43..977d114 100644 --- a/test/Alias/srcdir.py +++ b/test/Alias/srcdir.py @@ -63,21 +63,23 @@ test.subdir('python') test.write('SConstruct', """\ import os.path -env = Environment () +env = Environment() -def at_copy_ext (target, source, env): - n = str (source[0]) - s = open (n, 'rb').read () - e = os.path.splitext (n)[1] - t = str (target[0]) + e - open (t, 'wb').write (s) +def at_copy_ext(target, source, env): + n = str(source[0]) + with open(n, 'rb') as f: + s = f.read() + e = os.path.splitext(n)[1] + t = str(target[0]) + e + with open(t, 'wb') as f: + f.write(s) -AT_COPY_EXT = Builder (action = at_copy_ext, src_suffix=['.py', '.sh',]) -env.Append (BUILDERS = {'AT_COPY_EXT': AT_COPY_EXT}) +AT_COPY_EXT = Builder(action=at_copy_ext, src_suffix=['.py', '.sh',]) +env.Append(BUILDERS={'AT_COPY_EXT': AT_COPY_EXT}) -env.Alias ('minimal', ['python']) +env.Alias('minimal', ['python']) -Export ('env') +Export('env') b = 'python/out-scons' @@ -87,7 +89,7 @@ SConscript(b + '/SConscript') """) test.write(['python', 'SConscript'], """\ -Import ('env') +Import('env') env.AT_COPY_EXT('foo.py') """) diff --git a/test/AlwaysBuild.py b/test/AlwaysBuild.py index dfd9fd4..55e6f27 100644 --- a/test/AlwaysBuild.py +++ b/test/AlwaysBuild.py @@ -55,7 +55,8 @@ c2 = env.Alias('clean2', [], [Delete('clean2-t1'), Delete('clean2-t2')]) env.AlwaysBuild(c2) def dir_build(target, source, env): - open('dir_build.txt', 'ab').write(b'dir_build()\\n') + with open('dir_build.txt', 'ab') as f: + f.write(b'dir_build()\\n') env.Command(Dir('dir'), None, dir_build) env.AlwaysBuild('dir') """ % locals()) diff --git a/test/Batch/Boolean.py b/test/Batch/Boolean.py index 53cceb6..c118745 100644 --- a/test/Batch/Boolean.py +++ b/test/Batch/Boolean.py @@ -36,7 +36,8 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def batch_build(target, source, env): for t, s in zip(target, source): - open(str(t), 'wb').write(open(str(s), 'rb').read()) + with open(str(t), 'wb') as f, open(str(s), 'rb') as infp: + f.write(infp.read()) env = Environment() bb = Action(batch_build, batch_key=True) env['BUILDERS']['Batch'] = Builder(action=bb) diff --git a/test/Batch/CHANGED_SOURCES.py b/test/Batch/CHANGED_SOURCES.py index 0b9f3ba..477869f 100644 --- a/test/Batch/CHANGED_SOURCES.py +++ b/test/Batch/CHANGED_SOURCES.py @@ -43,7 +43,8 @@ dir = sys.argv[1] for infile in sys.argv[2:]: inbase = os.path.splitext(os.path.split(infile)[1])[0] outfile = os.path.join(dir, inbase+'.out') - open(outfile, 'wb').write(open(infile, 'rb').read()) + with open(outfile, 'wb') as f, open(infile, 'rb') as infp: + f.write(infp.read()) sys.exit(0) """) diff --git a/test/Batch/SOURCES.py b/test/Batch/SOURCES.py index ddb3b10..8198f92 100644 --- a/test/Batch/SOURCES.py +++ b/test/Batch/SOURCES.py @@ -43,7 +43,8 @@ dir = sys.argv[1] for infile in sys.argv[2:]: inbase = os.path.splitext(os.path.split(infile)[1])[0] outfile = os.path.join(dir, inbase+'.out') - open(outfile, 'wb').write(open(infile, 'rb').read()) + with open(outfile, 'wb') as f, open(infile, 'rb') as infp: + f.write(infp.read()) sys.exit(0) """) diff --git a/test/Batch/action-changed.py b/test/Batch/action-changed.py index 1dc0f08..777c7fb 100644 --- a/test/Batch/action-changed.py +++ b/test/Batch/action-changed.py @@ -46,10 +46,9 @@ sources = sys.argv[sep+1:] for i in range(len(targets)): t = targets[i] s = sources[i] - fp = open(t, 'wb') - fp.write(bytearray('%s\\n','utf-8')) - fp.write(open(s, 'rb').read()) - fp.close() + with open(t, 'wb') as fp, open(s, 'rb') as infp: + fp.write(bytearray('%s\\n','utf-8')) + fp.write(infp.read()) sys.exit(0) """ diff --git a/test/Batch/callable.py b/test/Batch/callable.py index 6fbd11c..9fe14ee 100644 --- a/test/Batch/callable.py +++ b/test/Batch/callable.py @@ -40,7 +40,8 @@ test.subdir('sub1', 'sub2') test.write('SConstruct', """ def batch_build(target, source, env): for t, s in zip(target, source): - open(str(t), 'wb').write(open(str(s), 'rb').read()) + with open(str(t), 'wb') as f, open(str(s), 'rb') as infp: + f.write(infp.read()) if ARGUMENTS.get('BATCH_CALLABLE'): def batch_key(action, env, target, source): return (id(action), id(env), target[0].dir) diff --git a/test/Batch/removed.py b/test/Batch/removed.py index f4455c2..b244cb3 100644 --- a/test/Batch/removed.py +++ b/test/Batch/removed.py @@ -42,7 +42,8 @@ dir = sys.argv[1] for infile in sys.argv[2:]: inbase = os.path.splitext(os.path.split(infile)[1])[0] outfile = os.path.join(dir, inbase+'.out') - open(outfile, 'wb').write(open(infile, 'rb').read()) + with open(outfile, 'wb') as f, open(infile, 'rb') as infp: + f.write(infp.read()) sys.exit(0) """) diff --git a/test/Batch/up_to_date.py b/test/Batch/up_to_date.py index 58152e0..229c88f 100644 --- a/test/Batch/up_to_date.py +++ b/test/Batch/up_to_date.py @@ -42,7 +42,8 @@ dir = sys.argv[1] for infile in sys.argv[2:]: inbase = os.path.splitext(os.path.split(infile)[1])[0] outfile = os.path.join(dir, inbase+'.out') - open(outfile, 'wb').write(open(infile, 'rb').read()) + with open(outfile, 'wb') as f, open(infile, 'rb') as infp: + f.write(infp.read()) sys.exit(0) """) diff --git a/test/Builder-factories.py b/test/Builder-factories.py index 45bf08f..e1fb65c 100644 --- a/test/Builder-factories.py +++ b/test/Builder-factories.py @@ -43,15 +43,16 @@ import os.path def mkdir(env, source, target): t = str(target[0]) os.makedirs(t) - open(os.path.join(t, 'marker'), 'wb').write(b"MakeDirectory\\n") + with open(os.path.join(t, 'marker'), 'wb') as f: + f.write(b"MakeDirectory\\n") MakeDirectory = Builder(action=mkdir, target_factory=Dir) def collect(env, source, target): - out = open(str(target[0]), 'wb') - dir = str(source[0]) - for f in sorted(os.listdir(dir)): - f = os.path.join(dir, f) - out.write(open(f, 'rb').read()) - out.close() + with open(str(target[0]), 'wb') as out: + dir = str(source[0]) + for f in sorted(os.listdir(dir)): + f = os.path.join(dir, f) + with open(f, 'rb') as infp: + out.write(infp.read()) Collect = Builder(action=collect, source_factory=Dir) env = Environment(BUILDERS = {'MakeDirectory':MakeDirectory, 'Collect':Collect}) diff --git a/test/Builder/errors.py b/test/Builder/errors.py index 1e4e16c..bd7e100 100644 --- a/test/Builder/errors.py +++ b/test/Builder/errors.py @@ -38,13 +38,10 @@ SConstruct_path = test.workpath('SConstruct') sconstruct = """ def buildop(env, source, target): - outf = open(str(target[0]), 'wb') - inpf = open(str(source[0]), 'r') - for line in inpf.readlines(): - if line.find(str(target[0])) == -1: - outf.write(line) - inpf.close() - outf.close() + with open(str(target[0]), 'wb') as outf, open(str(source[0]), 'r') as infp: + for line in inpf.readlines(): + if line.find(str(target[0])) == -1: + outf.write(line) b1 = Builder(action=buildop, src_suffix='.a', suffix='.b') %s env=Environment(tools=[], BUILDERS={'b1':b1, 'b2':b2}) @@ -58,7 +55,7 @@ foo.b built """) -python_file_line = test.python_file_line(SConstruct_path, 14) +python_file_line = test.python_file_line(SConstruct_path, 11) ### Gross mistake in Builder spec diff --git a/test/Builder/multi/different-actions.py b/test/Builder/multi/different-actions.py index 30e98f8..ec07b62 100644 --- a/test/Builder/multi/different-actions.py +++ b/test/Builder/multi/different-actions.py @@ -36,9 +36,10 @@ test = TestSCons.TestSCons(match=TestSCons.match_re) test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=Action(build, varlist=['XXX']), multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }, XXX = 'foo') diff --git a/test/Builder/multi/different-environments.py b/test/Builder/multi/different-environments.py index 9ce09b9..82b10ec 100644 --- a/test/Builder/multi/different-environments.py +++ b/test/Builder/multi/different-environments.py @@ -39,10 +39,11 @@ _python_ = TestSCons._python_ test.write('build.py', r"""\ import sys def build(num, target, source): - file = open(str(target), 'wb') - file.write('%s\n' % num) - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target), 'wb') as f: + f.write('%s\n' % num) + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) build(sys.argv[1],sys.argv[2],sys.argv[3:]) """) diff --git a/test/Builder/multi/different-multi.py b/test/Builder/multi/different-multi.py index 28002bd..3084bf5 100644 --- a/test/Builder/multi/different-multi.py +++ b/test/Builder/multi/different-multi.py @@ -37,9 +37,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) def build2(env, target, source): build(env, target, source) diff --git a/test/Builder/multi/different-order.py b/test/Builder/multi/different-order.py index c423969..4018159 100644 --- a/test/Builder/multi/different-order.py +++ b/test/Builder/multi/different-order.py @@ -39,9 +39,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): for t in target: - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/different-overrides.py b/test/Builder/multi/different-overrides.py index 6a38a93..c4267f3 100644 --- a/test/Builder/multi/different-overrides.py +++ b/test/Builder/multi/different-overrides.py @@ -36,9 +36,10 @@ test = TestSCons.TestSCons(match=TestSCons.match_re) test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/different-target-lists.py b/test/Builder/multi/different-target-lists.py index 437311f..4b6c49e 100644 --- a/test/Builder/multi/different-target-lists.py +++ b/test/Builder/multi/different-target-lists.py @@ -43,9 +43,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): for t in target: - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/error.py b/test/Builder/multi/error.py index 2de23d3..3b2a8d4 100644 --- a/test/Builder/multi/error.py +++ b/test/Builder/multi/error.py @@ -37,9 +37,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=0) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/lone-target-list.py b/test/Builder/multi/lone-target-list.py index 7c02c4a..885d34a 100644 --- a/test/Builder/multi/lone-target-list.py +++ b/test/Builder/multi/lone-target-list.py @@ -37,9 +37,10 @@ DefaultEnvironment(tools=[]) def build(env, target, source): for t in target: - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/multi.py b/test/Builder/multi/multi.py index 0f83d71..aec0951 100644 --- a/test/Builder/multi/multi.py +++ b/test/Builder/multi/multi.py @@ -37,9 +37,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/same-actions.py b/test/Builder/multi/same-actions.py index 0b75566..f2a8fe3 100644 --- a/test/Builder/multi/same-actions.py +++ b/test/Builder/multi/same-actions.py @@ -37,9 +37,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/multi/same-overrides.py b/test/Builder/multi/same-overrides.py index c4c1893..c545329 100644 --- a/test/Builder/multi/same-overrides.py +++ b/test/Builder/multi/same-overrides.py @@ -37,11 +37,12 @@ _python_ = TestSCons._python_ test.write('build.py', r"""\ import sys def build(num, target, source): - file = open(str(target), 'wb') - file.write(bytearray('%s\n'% num,'utf-8')) - for s in source: - file.write(open(str(s), 'rb').read()) -build(sys.argv[1],sys.argv[2],sys.argv[3:]) + with open(str(target), 'wb') as f: + f.write(bytearray('%s\n'% num,'utf-8')) + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) +build(sys.argv[1], sys.argv[2], sys.argv[3:]) """) test.write('SConstruct', """\ diff --git a/test/Builder/multi/same-targets.py b/test/Builder/multi/same-targets.py index c800a1c..17f6f99 100644 --- a/test/Builder/multi/same-targets.py +++ b/test/Builder/multi/same-targets.py @@ -38,9 +38,10 @@ DefaultEnvironment(tools=[]) def build(env, target, source): for t in target: - file = open(str(t), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(t), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=1) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/non-multi.py b/test/Builder/non-multi.py index 0ddb038..3c09db1 100644 --- a/test/Builder/non-multi.py +++ b/test/Builder/non-multi.py @@ -37,9 +37,10 @@ test.write('SConstruct', """ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) B = Builder(action=build, multi=0) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/same-actions-diff-envs.py b/test/Builder/same-actions-diff-envs.py index 289ee09..b80c988 100644 --- a/test/Builder/same-actions-diff-envs.py +++ b/test/Builder/same-actions-diff-envs.py @@ -37,8 +37,8 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'w') - file.write('1') + with open(str(target[0]), 'w') as f: + f.write('1') B = Builder(action=build) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/same-actions-diff-overrides.py b/test/Builder/same-actions-diff-overrides.py index 2b7cefe..8f6bdca 100644 --- a/test/Builder/same-actions-diff-overrides.py +++ b/test/Builder/same-actions-diff-overrides.py @@ -37,8 +37,8 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'w') - file.write('1') + with open(str(target[0]), 'w') as f: + f.write('1') B = Builder(action=build) env = Environment(tools=[], BUILDERS = { 'B' : B }) diff --git a/test/Builder/srcdir.py b/test/Builder/srcdir.py index d7a9e18..6ce27fe 100644 --- a/test/Builder/srcdir.py +++ b/test/Builder/srcdir.py @@ -41,10 +41,10 @@ file3 = test.workpath('file3') test.write(['src', 'cat.py'], """\ import sys -o = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - o.write(open(f, 'rb').read()) -o.close() +with open(sys.argv[1], 'wb') as o: + for f in sys.argv[2:]: + with open(f, 'rb') as i: + o.write(i.read()) """) test.write(['src', 'SConstruct'], """\ diff --git a/test/Builder/wrapper.py b/test/Builder/wrapper.py index 3ee9f79..acb1d44 100644 --- a/test/Builder/wrapper.py +++ b/test/Builder/wrapper.py @@ -39,9 +39,10 @@ DefaultEnvironment(tools=[]) import os.path import string def cat(target, source, env): - fp = open(str(target[0]), 'wb') - for s in map(str, source): - fp.write(open(s, 'rb').read()) + with open(str(target[0]), 'wb') as fp: + for s in map(str, source): + with open(s, 'rb') as infp: + fp.write(infp.read()) Cat = Builder(action=cat) def Wrapper(env, target, source): if not target: diff --git a/test/CFILESUFFIX.py b/test/CFILESUFFIX.py index 410ece5..7af4fa4 100644 --- a/test/CFILESUFFIX.py +++ b/test/CFILESUFFIX.py @@ -45,7 +45,8 @@ else: longopts = [] cmd_opts, args = getopt.getopt(sys.argv[1:], 't', longopts) for a in args: - contents = open(a, 'rb').read() + with open(a, 'rb') as f: + contents = f.read() sys.stdout.write((contents.replace(b'LEX', b'mylex.py')).decode()) sys.exit(0) """) diff --git a/test/CPPFLAGS.py b/test/CPPFLAGS.py index e132876..4c656a1 100644 --- a/test/CPPFLAGS.py +++ b/test/CPPFLAGS.py @@ -51,11 +51,10 @@ while args: break args.pop(0) if a[:5] == '/OUT:': out = a[5:] -infile = open(args[0], 'r') -outfile = open(out, 'w') -for l in infile.readlines(): - if l[:5] != '#link': - outfile.write(l) +with open(out, 'w') as ofp, open(args[0], 'r') as ifp: + for l in ifp.readlines(): + if l[:5] != '#link': + ofp.write(l) sys.exit(0) """) @@ -67,12 +66,12 @@ import sys opts, args = getopt.getopt(sys.argv[1:], 'o:s:') for opt, arg in opts: if opt == '-o': out = arg -outfile = open(out, 'w') -for f in args: - infile = open(f, 'r') - for l in infile.readlines(): - if l[:5] != '#link': - outfile.write(l) +with open(out, 'w') as ofp: + for f in args: + with open(f, 'r') as ifp: + for l in ifp.readlines(): + if l[:5] != '#link': + ofp.write(l) sys.exit(0) """) @@ -85,12 +84,13 @@ clen = len(compiler) + 1 opts, args = getopt.getopt(sys.argv[2:], 'co:xf:K:') for opt, arg in opts: if opt == '-o': out = arg - elif opt == '-x': open('mygcc.out', 'a').write(compiler + "\n") -infile = open(args[0], 'r') -outfile = open(out, 'w') -for l in infile.readlines(): - if l[:clen] != '#' + compiler: - outfile.write(l) + elif opt == '-x': + with open('mygcc.out', 'a') as f: + f.write(compiler + "\n") +with open(out, 'w') as ofp, open(args[0], 'r') as ifp: + for l in ifp.readlines(): + if l[:clen] != '#' + compiler: + ofp.write(l) sys.exit(0) """) diff --git a/test/CPPSUFFIXES.py b/test/CPPSUFFIXES.py index 141df29..9b8dd90 100644 --- a/test/CPPSUFFIXES.py +++ b/test/CPPSUFFIXES.py @@ -37,14 +37,15 @@ test = TestSCons.TestSCons() test.write('mycc.py', r""" import sys def do_file(outf, inf): - for line in open(inf, 'r').readlines(): - if line[:10] == '#include <': - do_file(outf, line[10:-2]) - else: - outf.write(line) -outf = open(sys.argv[1], 'w') -for f in sys.argv[2:]: - do_file(outf, f) + with open(inf, 'r') as ifp: + for line in ifp.readlines(): + if line[:10] == '#include <': + do_file(outf, line[10:-2]) + else: + outf.write(line) +with open(sys.argv[1], 'w') as outf: + for f in sys.argv[2:]: + do_file(outf, f) sys.exit(0) """) diff --git a/test/CXX/CXXFILESUFFIX.py b/test/CXX/CXXFILESUFFIX.py index c8dbf0a..48d727e 100644 --- a/test/CXX/CXXFILESUFFIX.py +++ b/test/CXX/CXXFILESUFFIX.py @@ -41,7 +41,8 @@ else: longopts = [] cmd_opts, args = getopt.getopt(sys.argv[1:], 't', longopts) for a in args: - contents = open(a, 'r').read() + with open(a, 'r') as f: + contents = f.read() sys.stdout.write(contents.replace('LEX', 'mylex.py')) sys.exit(0) """) diff --git a/test/Chmod.py b/test/Chmod.py index 316800b..64f4ed9 100644 --- a/test/Chmod.py +++ b/test/Chmod.py @@ -45,10 +45,10 @@ Execute(Chmod('d2', 0o777)) Execute(Chmod(Dir('d2-Dir'), 0o777)) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as infp: + f.write(infp.read()) Cat = Action(cat) env = Environment() env.Command('bar.out', 'bar.in', [Cat, diff --git a/test/Clean/Option.py b/test/Clean/Option.py index f49c226..5795ff2 100644 --- a/test/Clean/Option.py +++ b/test/Clean/Option.py @@ -39,10 +39,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/Clean/basic.py b/test/Clean/basic.py index e9f0540..fbff9b1 100644 --- a/test/Clean/basic.py +++ b/test/Clean/basic.py @@ -38,10 +38,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/Clean/function.py b/test/Clean/function.py index 7ddf727..45c9753 100644 --- a/test/Clean/function.py +++ b/test/Clean/function.py @@ -38,10 +38,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) test.subdir('subd') diff --git a/test/Climb/U-Default-no-target.py b/test/Climb/U-Default-no-target.py index ca03416..62f1067 100644 --- a/test/Climb/U-Default-no-target.py +++ b/test/Climb/U-Default-no-target.py @@ -37,8 +37,8 @@ test.write('SConstruct', """ Default('not_a_target.in') """) -test.run(arguments = '-U', status=2, match=TestSCons.match_re, stderr="""\ -scons: \*\*\* Do not know how to make File target `not_a_target.in' \(.*not_a_target.in\). Stop. +test.run(arguments = '-U', status=2, match=TestSCons.match_re, stderr=\ +r"""scons: \*\*\* Do not know how to make File target `not_a_target.in' \(.*not_a_target.in\). Stop. """) test.pass_test() diff --git a/test/Climb/explicit-parent--D.py b/test/Climb/explicit-parent--D.py index 6f669c3..a1c3aee 100644 --- a/test/Climb/explicit-parent--D.py +++ b/test/Climb/explicit-parent--D.py @@ -39,10 +39,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(tools=[], BUILDERS={'Cat':Builder(action=cat)}) env.Cat('f1.out', 'f1.in') f2 = env.Cat('f2.out', 'f2.in') diff --git a/test/Climb/explicit-parent--U.py b/test/Climb/explicit-parent--U.py index ab2d33e..5308632 100644 --- a/test/Climb/explicit-parent--U.py +++ b/test/Climb/explicit-parent--U.py @@ -38,10 +38,10 @@ test.subdir('subdir') test.write('SConstruct', """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Cat('foo.out', 'foo.in') SConscript('subdir/SConscript', "env") diff --git a/test/Climb/explicit-parent-u.py b/test/Climb/explicit-parent-u.py index e3e774e..7210444 100644 --- a/test/Climb/explicit-parent-u.py +++ b/test/Climb/explicit-parent-u.py @@ -39,10 +39,10 @@ test.subdir('subdir') test.write('SConstruct', """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Cat('f1.out', 'f1.in') env.Cat('f2.out', 'f2.in') diff --git a/test/Climb/option--D.py b/test/Climb/option--D.py index 42b92d8..06c5fa8 100644 --- a/test/Climb/option--D.py +++ b/test/Climb/option--D.py @@ -34,10 +34,8 @@ test.subdir('sub1', 'sub2') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/Climb/option--U.py b/test/Climb/option--U.py index c0e6e1e..137bb26 100644 --- a/test/Climb/option--U.py +++ b/test/Climb/option--U.py @@ -36,10 +36,8 @@ test.subdir('sub1', 'sub2', 'sub3') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', r""" diff --git a/test/Climb/option-u.py b/test/Climb/option-u.py index 21e83cf..49874f9 100644 --- a/test/Climb/option-u.py +++ b/test/Climb/option-u.py @@ -44,10 +44,10 @@ test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(tools=[]) env.Append(BUILDERS = {'Cat' : Builder(action=cat)}) env.Cat(target = 'sub1/f1a.out', source = 'sub1/f1a.in') diff --git a/test/Command.py b/test/Command.py index c36fb33..09a8daa 100644 --- a/test/Command.py +++ b/test/Command.py @@ -36,10 +36,8 @@ test.subdir('sub') build_py = r""" import sys -contents = open(sys.argv[2], 'r').read() -file = open(sys.argv[1], 'w') -file.write(contents) -file.close() +with open(sys.argv[1], 'w') as f, open(sys.argv[2], 'r') as infp: + f.write(infp.read()) """ test.write('build.py', build_py) test.write(['expand_chdir_sub', 'subbuild.py'], build_py) @@ -48,22 +46,20 @@ test.write('SConstruct', """ import os def buildIt(env, target, source): - contents = open(str(source[0]), 'r').read() - file = open(str(target[0]), 'w') - xyzzy = env.get('XYZZY', '') - if xyzzy: - file.write(xyzzy + '\\n') - file.write(contents) - file.close() + with open(str(target[0]), 'w') as f, open(str(source[0]), 'r') as infp: + xyzzy = env.get('XYZZY', '') + if xyzzy: + f.write(xyzzy + '\\n') + f.write(infp.read()) return 0 def sub(env, target, source): target = str(target[0]) source = str(source[0]) - t = open(target, 'w') - for f in sorted(os.listdir(source)): - t.write(open(os.path.join(source, f), 'r').read()) - t.close() + with open(target, 'w') as t: + for f in sorted(os.listdir(source)): + with open(os.path.join(source, f), 'r') as s: + t.write(s.read()) return 0 env = Environment(COPY_THROUGH_TEMP = r'%(_python_)s build.py .tmp $SOURCE' + '\\n' + r'%(_python_)s build.py $TARGET .tmp', diff --git a/test/CommandGenerator.py b/test/CommandGenerator.py index a3a995b..b8155e7 100644 --- a/test/CommandGenerator.py +++ b/test/CommandGenerator.py @@ -34,10 +34,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'r').read() -file = open(sys.argv[1], 'w') -file.write(contents) -file.close() +with open(sys.argv[1], 'w') as f, open(sys.argv[2], 'r') as ifp: + f.write(ifp.read()) sys.exit(0) """) diff --git a/test/Configure/Builder-call.py b/test/Configure/Builder-call.py index b85b039..b4c9d33 100644 --- a/test/Configure/Builder-call.py +++ b/test/Configure/Builder-call.py @@ -39,7 +39,8 @@ test.write('mycommand.py', r""" import sys sys.stderr.write( 'Hello World on stderr\n' ) sys.stdout.write( 'Hello World on stdout\n' ) -open(sys.argv[1], 'w').write( 'Hello World\n' ) +with open(sys.argv[1], 'w') as f: + f.write( 'Hello World\n' ) """) test.write('SConstruct', """\ diff --git a/test/Configure/VariantDir.py b/test/Configure/VariantDir.py index 23a4b14..2c54b84 100644 --- a/test/Configure/VariantDir.py +++ b/test/Configure/VariantDir.py @@ -45,26 +45,27 @@ test.write('SConstruct', """\ env = Environment(LOGFILE='build/config.log') import os env.AppendENVPath('PATH', os.environ['PATH']) -VariantDir( 'build', '.' ) +VariantDir('build', '.') conf = env.Configure(conf_dir='build/config.tests', log_file='$LOGFILE') -r1 = conf.CheckCHeader( 'math.h' ) -r2 = conf.CheckCHeader( 'no_std_c_header.h' ) # leads to compile error +r1 = conf.CheckCHeader('math.h') +r2 = conf.CheckCHeader('no_std_c_header.h') # leads to compile error env = conf.Finish() -Export( 'env' ) -# print open( 'build/config.log' ).readlines() -SConscript( 'build/SConscript' ) +Export('env') +# with open('build/config.log') as f: +# print f.readlines() +SConscript('build/SConscript') """) test.write('SConscript', """\ -Import( 'env' ) -env.Program( 'TestProgram', 'TestProgram.c' ) +Import('env') +env.Program('TestProgram', 'TestProgram.c') """) test.write('TestProgram.c', """\ #include int main(void) { - printf( "Hello\\n" ); + printf("Hello\\n"); } """) diff --git a/test/Configure/custom-tests.py b/test/Configure/custom-tests.py index 6362e25..1c6eac8 100644 --- a/test/Configure/custom-tests.py +++ b/test/Configure/custom-tests.py @@ -170,7 +170,7 @@ env = conf.Finish() test.run() test.must_match('config.log', -""".* +r""".* .* scons: Configure: Display of list ... scons: Configure: \(cached\) yes diff --git a/test/Copy-Action.py b/test/Copy-Action.py index 6003aa9..4bfa0da 100644 --- a/test/Copy-Action.py +++ b/test/Copy-Action.py @@ -43,10 +43,10 @@ Execute(Copy(File('d2.out'), 'd2.in')) Execute(Copy('d3.out', File('f3.in'))) def cat(env, source, target): target = str(target[0]) - f = open(target, "w") - for src in source: - f.write(open(str(src), "r").read()) - f.close() + with open(target, "w") as f: + for src in source: + with open(str(src), "r") as ifp: + f.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('bar.out', 'bar.in', [Cat, diff --git a/test/D/AllAtOnce/Common/common.py b/test/D/AllAtOnce/Common/common.py index 1713028..0d87213 100644 --- a/test/D/AllAtOnce/Common/common.py +++ b/test/D/AllAtOnce/Common/common.py @@ -44,7 +44,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Image') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) test.run() diff --git a/test/D/CoreScanner/Common/common.py b/test/D/CoreScanner/Common/common.py index 1d2fde0..d6a6280 100644 --- a/test/D/CoreScanner/Common/common.py +++ b/test/D/CoreScanner/Common/common.py @@ -47,7 +47,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Image') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) arguments = 'test1%(_obj)s test2%(_obj)s' % locals() diff --git a/test/D/HSTeoh/Common/arLibIssue.py b/test/D/HSTeoh/Common/arLibIssue.py index 9bca3d8..6ea8caf 100644 --- a/test/D/HSTeoh/Common/arLibIssue.py +++ b/test/D/HSTeoh/Common/arLibIssue.py @@ -46,7 +46,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('ArLibIssue') - test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "ar"]'.format(tool))) + with open('SConstruct_template', 'r') as f: + config = f.read().format('tools=["{0}", "ar"]'.format(tool)) + test.write('SConstruct', config) test.run() diff --git a/test/D/HSTeoh/Common/libCompileOptions.py b/test/D/HSTeoh/Common/libCompileOptions.py index 4a21c45..94616ae 100644 --- a/test/D/HSTeoh/Common/libCompileOptions.py +++ b/test/D/HSTeoh/Common/libCompileOptions.py @@ -46,7 +46,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('LibCompileOptions') - test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link", "ar"]'.format(tool))) + with open('SConstruct_template', 'r') as f: + config = f.read().format('tools=["{0}", "link", "ar"]'.format(tool)) + test.write('SConstruct', config) test.run() diff --git a/test/D/HSTeoh/Common/linkingProblem.py b/test/D/HSTeoh/Common/linkingProblem.py index b526ad7..0669695 100644 --- a/test/D/HSTeoh/Common/linkingProblem.py +++ b/test/D/HSTeoh/Common/linkingProblem.py @@ -47,7 +47,9 @@ def testForTool(tool): test.skip_test("ncurses not apparently installed, skip this test.") test.dir_fixture('LinkingProblem') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) test.run() diff --git a/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py b/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py index 4716f1c..2632f87 100644 --- a/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py +++ b/test/D/HSTeoh/Common/singleStringCannotBeMultipleOptions.py @@ -45,7 +45,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('SingleStringCannotBeMultipleOptions') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) test.run(status=2, stdout=None, stderr=None) diff --git a/test/D/HelloWorld/CompileAndLinkOneStep/Common/common.py b/test/D/HelloWorld/CompileAndLinkOneStep/Common/common.py index e757d47..675091c 100644 --- a/test/D/HelloWorld/CompileAndLinkOneStep/Common/common.py +++ b/test/D/HelloWorld/CompileAndLinkOneStep/Common/common.py @@ -44,7 +44,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Image') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) if tool == 'dmd': # The gdmd executable in Debian Unstable as at 2012-05-12, version 4.6.3 puts out messages on stderr diff --git a/test/D/HelloWorld/CompileThenLinkTwoSteps/Common/common.py b/test/D/HelloWorld/CompileThenLinkTwoSteps/Common/common.py index e757d47..675091c 100644 --- a/test/D/HelloWorld/CompileThenLinkTwoSteps/Common/common.py +++ b/test/D/HelloWorld/CompileThenLinkTwoSteps/Common/common.py @@ -44,7 +44,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Image') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) if tool == 'dmd': # The gdmd executable in Debian Unstable as at 2012-05-12, version 4.6.3 puts out messages on stderr diff --git a/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py index 1b42580..b2acb43 100644 --- a/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py +++ b/test/D/Issues/2939_Ariovistus/Common/correctLinkOptions.py @@ -46,7 +46,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Project') - test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link"]'.format(tool))) + with open('SConstruct_template', 'r') as f: + config = f.read().format('tools=["{0}", "link"]'.format(tool)) + test.write('SConstruct', config) test.run() diff --git a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py index 5acd26a..19b96b9 100644 --- a/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py +++ b/test/D/Issues/2940_Ariovistus/Common/correctLinkOptions.py @@ -61,7 +61,9 @@ def testForTool(tool): test.fail_test('No information about platform: ' + platform) test.dir_fixture('Project') - test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link"]'.format(tool))) + with open('SConstruct_template', 'r') as f: + config = f.read().format('tools=["{0}", "link"]'.format(tool)) + test.write('SConstruct', config) test.run() diff --git a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py index 07b1366..b58227d 100644 --- a/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py +++ b/test/D/Issues/2994/Common/D_changed_DFLAGS_not_rebuilding.py @@ -46,7 +46,9 @@ def testForTool(tool): test.skip_test("Required executable for tool '{0}' not found, skipping test.\n".format(tool)) test.dir_fixture('Project') - test.write('SConstruct', open('SConstruct_template', 'r').read().format('tools=["{0}", "link"]'.format(tool))) + with open('SConstruct_template', 'r') as f: + config = f.read().format('tools=["{0}", "link"]'.format(tool)) + test.write('SConstruct', config) test.run() test.fail_test('main.o' not in test.stdout()) diff --git a/test/D/SharedObjects/Common/common.py b/test/D/SharedObjects/Common/common.py index bae376d..5113cc4 100644 --- a/test/D/SharedObjects/Common/common.py +++ b/test/D/SharedObjects/Common/common.py @@ -76,7 +76,9 @@ def testForTool(tool): test.fail_test() test.dir_fixture('Image') - test.write('SConstruct', open('SConstruct_template', 'r').read().format(tool)) + with open('SConstruct_template', 'r') as f: + config = f.read().format(tool) + test.write('SConstruct', config) if Base()['DC'] == 'gdmd': # The gdmd executable in Debian Unstable as at 2012-05-12, version 4.6.3 puts out messages on stderr diff --git a/test/DSUFFIXES.py b/test/DSUFFIXES.py index 46bdf83..54a506c 100644 --- a/test/DSUFFIXES.py +++ b/test/DSUFFIXES.py @@ -37,14 +37,15 @@ test = TestSCons.TestSCons() test.write('mydc.py', r""" import sys def do_file(outf, inf): - for line in open(inf, 'rb').readlines(): - if line[:7] == b'import ': - do_file(outf, line[7:-2] + b'.d') - else: - outf.write(line) -outf = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - do_file(outf, f) + with open(inf, 'rb') as ifp: + for line in ifp.readlines(): + if line[:7] == b'import ': + do_file(outf, line[7:-2] + b'.d') + else: + outf.write(line) +with open(sys.argv[1], 'wb') as outf: + for f in sys.argv[2:]: + do_file(outf, f) sys.exit(0) """) diff --git a/test/Decider/switch-rebuild.py b/test/Decider/switch-rebuild.py index d2b288d..2926455 100644 --- a/test/Decider/switch-rebuild.py +++ b/test/Decider/switch-rebuild.py @@ -38,7 +38,8 @@ DefaultEnvironment(tools=[]) Decider('%s') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as f, open(str(source[0]), 'rt') as ifp: + f.write(ifp.read()) B = Builder(action=build) env = Environment(tools=[], BUILDERS = { 'B' : B }) env.B(target='switch.out', source='switch.in') diff --git a/test/Default.py b/test/Default.py index 05944a6..b9896f8 100644 --- a/test/Default.py +++ b/test/Default.py @@ -43,10 +43,8 @@ for dirname in ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight']: test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'r').read() -file = open(sys.argv[1], 'w') -file.write(contents) -file.close() +with open(sys.argv[1], 'w') as f, open(sys.argv[2], 'r') as ifp: + f.write(ifp.read()) """) # diff --git a/test/Delete.py b/test/Delete.py index 94ba24a..fc4ab4f 100644 --- a/test/Delete.py +++ b/test/Delete.py @@ -44,10 +44,10 @@ Execute(Delete('symlinks/dirlink')) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('f3.out', 'f3.in', [Cat, Delete("f4"), Delete("d5")]) @@ -194,10 +194,10 @@ if sys.platform != 'win32': test.write("SConstruct", """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ifp: + for src in source: + with open(str(src), "rb") as ofp: + ofp.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('f14-nonexistent.out', 'f14.in', [Delete("$TARGET", must_exist=1), diff --git a/test/Depends/Depends.py b/test/Depends/Depends.py index 054b9a1..3ed9e12 100644 --- a/test/Depends/Depends.py +++ b/test/Depends/Depends.py @@ -40,10 +40,10 @@ test.subdir('subdir', 'sub2') test.write('build.py', r""" import sys -fp = open(sys.argv[1], 'wb') -for fname in sys.argv[2:]: - fp.write(open(fname, 'rb').read()) -fp.close() +with open(sys.argv[1], 'wb') as ofp: + for fname in sys.argv[2:]: + with open(fname, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/Depends/spurious-rebuilds.py b/test/Depends/spurious-rebuilds.py index 6afc829..f4ad040 100644 --- a/test/Depends/spurious-rebuilds.py +++ b/test/Depends/spurious-rebuilds.py @@ -47,7 +47,8 @@ import os.path if not os.path.exists('mkl'): os.mkdir('mkl') if not os.path.exists('test.c'): - open('test.c', 'w').write('int i;') + with open('test.c', 'w') as f: + f.write('int i;') env=Environment() env.SharedObject('all-defuns.obj', 'all-defuns.c') diff --git a/test/Deprecated/BuildDir.py b/test/Deprecated/BuildDir.py index b0d6610..1a1ba02 100644 --- a/test/Deprecated/BuildDir.py +++ b/test/Deprecated/BuildDir.py @@ -97,11 +97,8 @@ import os.path def buildIt(target, source, env): if not os.path.exists('build'): os.mkdir('build') - f1=open(str(source[0]), 'r') - f2=open(str(target[0]), 'w') - f2.write(f1.read()) - f2.close() - f1.close() + with open(str(source[0]), 'r') as ifp, open(str(target[0]), 'w') as ofp: + ofp.write(ifp.read()) return 0 Import("env") env.Command(target='f2.c', source='f2.in', action=buildIt) diff --git a/test/Deprecated/SConscript-build_dir.py b/test/Deprecated/SConscript-build_dir.py index c9ec07e..0d1ba6a 100644 --- a/test/Deprecated/SConscript-build_dir.py +++ b/test/Deprecated/SConscript-build_dir.py @@ -73,10 +73,10 @@ var9 = Dir('../build/var9') def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}, BUILD='build') diff --git a/test/Deprecated/SourceCode/SourceCode.py b/test/Deprecated/SourceCode/SourceCode.py index b5c0ba9..b7f1305 100644 --- a/test/Deprecated/SourceCode/SourceCode.py +++ b/test/Deprecated/SourceCode/SourceCode.py @@ -49,10 +49,10 @@ import os def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) def sc_cat(env, source, target): source = [] diff --git a/test/Deprecated/SourceSignatures/basic.py b/test/Deprecated/SourceSignatures/basic.py index 52a2c5c..7951dbd 100644 --- a/test/Deprecated/SourceSignatures/basic.py +++ b/test/Deprecated/SourceSignatures/basic.py @@ -35,7 +35,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) base_sconstruct_contents = """\ SetOption('warn', 'deprecated-source-signatures') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + ofp.write(ifp.read()) B = Builder(action = build) env = Environment(BUILDERS = { 'B' : B }) env.B(target = 'f1.out', source = 'f1.in') diff --git a/test/Deprecated/SourceSignatures/env.py b/test/Deprecated/SourceSignatures/env.py index bb76ff4..c63b176 100644 --- a/test/Deprecated/SourceSignatures/env.py +++ b/test/Deprecated/SourceSignatures/env.py @@ -39,7 +39,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) base_sconstruct_contents = """\ SetOption('warn', 'deprecated-source-signatures') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + ofp.write(ifp.read()) B = Builder(action = build) env = Environment(BUILDERS = { 'B' : B }) env2 = env.Clone() diff --git a/test/Deprecated/SourceSignatures/implicit-cache.py b/test/Deprecated/SourceSignatures/implicit-cache.py index af6aa49..a4bdc78 100644 --- a/test/Deprecated/SourceSignatures/implicit-cache.py +++ b/test/Deprecated/SourceSignatures/implicit-cache.py @@ -41,7 +41,8 @@ SetOption('implicit_cache', 1) SourceSignatures('timestamp') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + ofp.write(ifp.read()) B = Builder(action = build) env = Environment(BUILDERS = { 'B' : B }) env.B(target = 'both.out', source = 'both.in') diff --git a/test/Deprecated/SourceSignatures/no-csigs.py b/test/Deprecated/SourceSignatures/no-csigs.py index f815538..c4f2a78 100644 --- a/test/Deprecated/SourceSignatures/no-csigs.py +++ b/test/Deprecated/SourceSignatures/no-csigs.py @@ -36,7 +36,8 @@ test = TestSConsign.TestSConsign(match = TestSConsign.match_re) test.write('SConstruct', """\ SetOption('warn', 'deprecated-source-signatures') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + ofp.write(ifp.read()) B = Builder(action = build) env = Environment(BUILDERS = { 'B' : B }) env.B(target = 'f1.out', source = 'f1.in') diff --git a/test/Deprecated/SourceSignatures/switch-rebuild.py b/test/Deprecated/SourceSignatures/switch-rebuild.py index e8af27a..b9cc3d5 100644 --- a/test/Deprecated/SourceSignatures/switch-rebuild.py +++ b/test/Deprecated/SourceSignatures/switch-rebuild.py @@ -45,7 +45,8 @@ SetOption('warn', 'deprecated-source-signatures') SourceSignatures('%s') def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + ofp.write(ifp.read()) B = Builder(action = build) env = Environment(BUILDERS = { 'B' : B }) env.B(target = 'switch.out', source = 'switch.in') diff --git a/test/Deprecated/TargetSignatures/content.py b/test/Deprecated/TargetSignatures/content.py index 2cd90ec..aca63f3 100644 --- a/test/Deprecated/TargetSignatures/content.py +++ b/test/Deprecated/TargetSignatures/content.py @@ -48,10 +48,10 @@ SetOption('warn', 'deprecated-target-signatures') env = Environment() def copy(env, source, target): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) copyAction = Action(copy, "Copying $TARGET") diff --git a/test/Deprecated/debug-nomemoizer.py b/test/Deprecated/debug-nomemoizer.py index c533efa..6d05cb2 100644 --- a/test/Deprecated/debug-nomemoizer.py +++ b/test/Deprecated/debug-nomemoizer.py @@ -34,7 +34,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re) test.write('SConstruct', """ def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as ofp, open(str(source[0]), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) diff --git a/test/ENV.py b/test/ENV.py index 36ad844..0866cf5 100644 --- a/test/ENV.py +++ b/test/ENV.py @@ -49,8 +49,10 @@ test.write('build.py', r"""\ import os import sys -contents = open(sys.argv[2], 'r').read() -open(sys.argv[1], 'w').write("build.py %s\n%s" % (os.environ['X'], contents)) +with open(sys.argv[2], 'r') as f: + contents = f.read() +with open(sys.argv[1], 'w') as f: + f.write("build.py %s\n%s" % (os.environ['X'], contents)) """) test.write('input', "input file\n") diff --git a/test/ESCAPE.py b/test/ESCAPE.py index 819d60b..853ab57 100644 --- a/test/ESCAPE.py +++ b/test/ESCAPE.py @@ -36,10 +36,10 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -ofp = open(sys.argv[1], 'wb') -for s in sys.argv[2:]: - ofp.write(open(s, 'rb').read()) -ofp.close() +with open(sys.argv[1], 'wb') as ofp: + for s in sys.argv[2:]: + with open(s, 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """\ diff --git a/test/Errors/AttributeError.py b/test/Errors/AttributeError.py index c666a2d..09e0d4b 100644 --- a/test/Errors/AttributeError.py +++ b/test/Errors/AttributeError.py @@ -39,9 +39,9 @@ a.append(2) """) test.run(status = 2, stderr = """\ -(AttributeError|): 'int' object has no attribute 'append': +(AttributeError|): 'int' object has no attribute 'append': File ".+SConstruct", line 2: - a.append\(2\) + a.append\\(2\\) """) test.pass_test() diff --git a/test/Errors/Exception.py b/test/Errors/Exception.py index 30404fc..c08a09e 100644 --- a/test/Errors/Exception.py +++ b/test/Errors/Exception.py @@ -31,7 +31,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', """\ def foo(env, target, source): print(str(target[0])) - open(str(target[0]), 'wt').write('foo') + with open(str(target[0]), 'wt') as f: + f.write('foo') def exit(env, target, source): raise Exception('exit') @@ -51,7 +52,7 @@ test.write('exit.in', 'exit\n') # no longer exists or that line in the source file no longer exists, # so make sure the proper variations are supported in the following # regexp. -expect = """scons: \*\*\* \[exit.out\] Exception : exit +expect = r"""scons: \*\*\* \[exit.out\] Exception : exit Traceback \((most recent call|innermost) last\): ( File ".+", line \d+, in \S+ [^\n]+ diff --git a/test/Errors/SyntaxError.py b/test/Errors/SyntaxError.py index e6b8e4d..2cdebea 100644 --- a/test/Errors/SyntaxError.py +++ b/test/Errors/SyntaxError.py @@ -42,7 +42,7 @@ test.run(stdout = "scons: Reading SConscript files ...\n", a ! x - \^ + \\^ SyntaxError: (invalid syntax|Unknown character) diff --git a/test/Errors/TypeError.py b/test/Errors/TypeError.py index 286fa26..802d3df 100644 --- a/test/Errors/TypeError.py +++ b/test/Errors/TypeError.py @@ -41,7 +41,7 @@ a[2] = 3 test.run(status = 2, stderr = """\ TypeError:( 'int')? object does not support item assignment: File ".+SConstruct", line 2: - a\[2\] = 3 + a\\[2\\] = 3 """) test.pass_test() diff --git a/test/Errors/UserError.py b/test/Errors/UserError.py index 669260d..0906a45 100644 --- a/test/Errors/UserError.py +++ b/test/Errors/UserError.py @@ -39,7 +39,7 @@ import SCons.Errors raise SCons.Errors.UserError('Depends() requires both sources and targets.') """) -expect = """ +expect = r""" scons: \*\*\* Depends\(\) requires both sources and targets. """ + TestSCons.file_expr diff --git a/test/Execute.py b/test/Execute.py index c40d0d0..9dcafac 100644 --- a/test/Execute.py +++ b/test/Execute.py @@ -36,7 +36,8 @@ test = TestSCons.TestSCons() test.write('my_copy.py', """\ import sys -open(sys.argv[2], 'wb').write(open(sys.argv[1], 'rb').read()) +with open(sys.argv[2], 'wb') as ofp, open(sys.argv[1], 'rb') as ifp: + ofp.write(ifp.read()) try: exitval = int(sys.argv[3]) except IndexError: diff --git a/test/Exit.py b/test/Exit.py index 394ee2f..f00986d 100644 --- a/test/Exit.py +++ b/test/Exit.py @@ -104,10 +104,10 @@ SConscript('subdir/SConscript') test.write(['subdir', 'SConscript'], """\ def exit_builder(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) Exit(27) env = Environment(BUILDERS = {'my_exit' : Builder(action=exit_builder)}) env.my_exit('foo.out', 'foo.in') @@ -133,10 +133,10 @@ exitscan = Scanner(function = exit_scanner, skeys = ['.k']) def cat(env, source, target): target = str(target[0]) - outf = open(target, 'wb') - for src in source: - outf.write(open(str(src), "rb").read()) - outf.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), "rb") as ifp: + outf.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Append(SCANNERS = [exitscan]) diff --git a/test/FindFile.py b/test/FindFile.py index e878172..fa195c4 100644 --- a/test/FindFile.py +++ b/test/FindFile.py @@ -40,13 +40,17 @@ test.write(['bar', 'baz', 'testfile2'], 'test 4\n') test.write('SConstruct', """ env = Environment(FILE = 'file', BAR = 'bar') file1 = FindFile('testfile1', [ 'foo', '.', 'bar', 'bar/baz' ]) -print(open(str(file1), 'r').read()) +with open(str(file1), 'r') as f: + print(f.read()) file2 = env.FindFile('test${FILE}1', [ 'bar', 'foo', '.', 'bar/baz' ]) -print(open(str(file2), 'r').read()) +with open(str(file2), 'r') as f: + print(f.read()) file3 = FindFile('testfile2', [ 'foo', '.', 'bar', 'bar/baz' ]) -print(open(str(file3), 'r').read()) +with open(str(file3), 'r') as f: + print(f.read()) file4 = env.FindFile('testfile2', [ '$BAR/baz', 'foo', '.', 'bar' ]) -print(open(str(file4), 'r').read()) +with open(str(file4), 'r') as f: + print(f.read()) """) expect = test.wrap_stdout(read_str = """test 1 diff --git a/test/Flatten.py b/test/Flatten.py index fd9943d..40bbb3e 100644 --- a/test/Flatten.py +++ b/test/Flatten.py @@ -37,10 +37,10 @@ test.subdir('work') test.write(['work', 'SConstruct'], """ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) f1 = env.Cat('../file1.out', 'file1.in') f2 = env.Cat('../file2.out', ['file2a.in', 'file2b.in']) diff --git a/test/Fortran/FORTRANMODDIR.py b/test/Fortran/FORTRANMODDIR.py index 61dcc45..a0e03af 100644 --- a/test/Fortran/FORTRANMODDIR.py +++ b/test/Fortran/FORTRANMODDIR.py @@ -47,14 +47,16 @@ import re import sys # case insensitive matching, because Fortran is case insensitive mod_regex = "(?im)^\\s*MODULE\\s+(?!PROCEDURE)(\\w+)" -contents = open(sys.argv[2]).read() +with open(sys.argv[2]) as f: + contents = f.read() modules = re.findall(mod_regex, contents) (prefix, moddir) = sys.argv[1].split('=') if prefix != 'moduledir': sys.exit(1) modules = [os.path.join(moddir, m.lower()+'.mod') for m in modules] for t in sys.argv[3:] + modules: - open(t, 'wb').write(('myfortran.py wrote %s\n' % os.path.split(t)[1]).encode()) + with open(t, 'wb') as f: + f.write(('myfortran.py wrote %s\n' % os.path.split(t)[1]).encode()) """) test.write('SConstruct', """ diff --git a/test/Fortran/FORTRANSUFFIXES.py b/test/Fortran/FORTRANSUFFIXES.py index c1b3455..b703c60 100644 --- a/test/Fortran/FORTRANSUFFIXES.py +++ b/test/Fortran/FORTRANSUFFIXES.py @@ -37,14 +37,15 @@ test = TestSCons.TestSCons() test.write('myfc.py', r""" import sys def do_file(outf, inf): - for line in open(inf, 'rb').readlines(): - if line[:15] == b" INCLUDE '": - do_file(outf, line[15:-2]) - else: - outf.write(line) -outf = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - do_file(outf, f) + with open(inf, 'rb') as inf: + for line in inf.readlines(): + if line[:15] == b" INCLUDE '": + do_file(outf, line[15:-2]) + else: + outf.write(line) +with open(sys.argv[1], 'wb') as outf: + for f in sys.argv[2:]: + do_file(outf, f) sys.exit(0) """) diff --git a/test/Fortran/USE-MODULE.py b/test/Fortran/USE-MODULE.py index 0d78e7a..ab76f3d 100644 --- a/test/Fortran/USE-MODULE.py +++ b/test/Fortran/USE-MODULE.py @@ -38,11 +38,13 @@ import os.path import re import sys mod_regex = "(?im)^\\s*MODULE\\s+(?!PROCEDURE)(\\w+)" -contents = open(sys.argv[1]).read() +with open(sys.argv[1]) as f: + contents = f.read() modules = re.findall(mod_regex, contents) modules = [m.lower()+'.mod' for m in modules] for t in sys.argv[2:] + modules: - open(t, 'wb').write(('myfortran.py wrote %s\n' % os.path.split(t)[1]).encode()) + with open(t, 'wb') as f: + f.write(('myfortran.py wrote %s\n' % os.path.split(t)[1]).encode()) sys.exit(0) """) diff --git a/test/Fortran/link-with-cxx.py b/test/Fortran/link-with-cxx.py index bf10fc8..f559b0a 100644 --- a/test/Fortran/link-with-cxx.py +++ b/test/Fortran/link-with-cxx.py @@ -42,25 +42,25 @@ test = TestSCons.TestSCons(match = TestSCons.match_re) test.write('test_linker.py', r""" import sys if sys.argv[1] == '-o': - outfile = open(sys.argv[2], 'wb') + ofp = open(sys.argv[2], 'wb') infiles = sys.argv[3:] elif sys.argv[1][:5] == '/OUT:': - outfile = open(sys.argv[1][5:], 'wb') + ofp = open(sys.argv[1][5:], 'wb') infiles = sys.argv[2:] for infile in infiles: - with open(infile, 'rb') as f: - outfile.write(f.read()) -outfile.close() + with open(infile, 'rb') as ifp: + ofp.write(ifp.read()) +ofp.close() sys.exit(0) """) test.write('test_fortran.py', r""" import sys -outfile = open(sys.argv[2], 'wb') -for infile in sys.argv[4:]: - outfile.write(open(infile, 'rb').read()) -outfile.close() +with open(sys.argv[2], 'wb') as ofp: + for infile in sys.argv[4:]: + with open(infile, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) @@ -70,8 +70,9 @@ import SCons.Tool.link def copier(target, source, env): s = str(source[0]) t = str(target[0]) - with open(t, 'wb') as fo, open(s, 'rb') as fi: - fo.write(fi.read()) + with open(t, 'wb') as ofp, open(s, 'rb') as ifp: + ofp.write(ifp.read()) + env = Environment(CXX = r'%(_python_)s test_linker.py', CXXCOM = Action(copier), SMARTLINK = SCons.Tool.link.smart_link, diff --git a/test/Fortran/module-subdir.py b/test/Fortran/module-subdir.py index 6224d44..0b87aa2 100644 --- a/test/Fortran/module-subdir.py +++ b/test/Fortran/module-subdir.py @@ -52,23 +52,23 @@ for opt, arg in opts: if opt == '-o': out = arg elif opt == '-M': modsubdir = arg import os -infile = open(args[0], 'rb') -outfile = open(out, 'wb') -for l in infile.readlines(): - if l[:7] == b'module ': - module = modsubdir + os.sep + l[7:-1].decode() + '.mod' - open(module, 'wb').write(('myfortran.py wrote %s\n' % module).encode()) - if l[:length] != comment: - outfile.write(l) +with open(out, 'wb') as ofp, open(args[0], 'rb') as ifp: + for l in ifp.readlines(): + if l[:7] == b'module ': + module = modsubdir + os.sep + l[7:-1].decode() + '.mod' + with open(module, 'wb') as f: + f.write(('myfortran.py wrote %s\n' % module).encode()) + if l[:length] != comment: + ofp.write(l) sys.exit(0) """) test.write('myar.py', """\ import sys -t = open(sys.argv[1], 'wb') -for s in sys.argv[2:]: - t.write(open(s, 'rb').read()) -t.close +with open(sys.argv[1], 'wb') as ofp: + for s in sys.argv[2:]: + with open(s, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/GetBuildFailures/option-k.py b/test/GetBuildFailures/option-k.py index 28e80c8..92a9db8 100644 --- a/test/GetBuildFailures/option-k.py +++ b/test/GetBuildFailures/option-k.py @@ -46,7 +46,8 @@ test = TestSCons.TestSCons() contents = r"""\ import sys if sys.argv[0] == 'mypass.py': - open(sys.argv[3], 'wb').write(open(sys.argv[4], 'rb').read()) + with open(sys.argv[3], 'wb') as ofp, open(sys.argv[4], 'rb') as ifp: + ofp.write(ifp.read()) exit_value = 0 elif sys.argv[0] == 'myfail.py': exit_value = 1 diff --git a/test/GetBuildFailures/parallel.py b/test/GetBuildFailures/parallel.py index ee8847f..5387e4a 100644 --- a/test/GetBuildFailures/parallel.py +++ b/test/GetBuildFailures/parallel.py @@ -60,7 +60,8 @@ if wait_marker != '-.marker': while not os.path.exists(wait_marker): time.sleep(1) if sys.argv[0] == 'mypass.py': - open(sys.argv[3], 'wb').write(open(sys.argv[4], 'rb').read()) + with open(sys.argv[3], 'wb') as ofp, open(sys.argv[4], 'rb') as ifp: + ofp.write(ifp.read()) exit_value = 0 elif sys.argv[0] == 'myfail.py': exit_value = 1 diff --git a/test/GetBuildFailures/serial.py b/test/GetBuildFailures/serial.py index 4d1b7cd..7557dd5 100644 --- a/test/GetBuildFailures/serial.py +++ b/test/GetBuildFailures/serial.py @@ -49,7 +49,8 @@ test = TestSCons.TestSCons() contents = r"""\ import sys if sys.argv[0] == 'mypass.py': - open(sys.argv[3], 'wb').write(open(sys.argv[4], 'rb').read()) + with open(sys.argv[3], 'wb') as ofp, open(sys.argv[4], 'rb') as ifp: + ofp.write(ifp.read()) exit_value = 0 elif sys.argv[0] == 'myfail.py': exit_value = 1 @@ -195,8 +196,7 @@ scons: *** [f12] f12: My SConsEnvironmentError scons: *** [f13] f13: My SConsEnvironmentError scons: *** [f14] InternalError : My InternalError """) + \ -"""\ -Traceback \((most recent call|innermost) last\): +r"""Traceback \((most recent call|innermost) last\): ( File ".+", line \d+, in \S+ [^\n]+ )*( File ".+", line \d+, in \S+ diff --git a/test/Glob/Repository.py b/test/Glob/Repository.py index 3308e62..714bafa 100644 --- a/test/Glob/Repository.py +++ b/test/Glob/Repository.py @@ -50,10 +50,10 @@ test.write(['repository', 'SConstruct'], """\ DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) # Verify that we can glob a repository-only Node that exists # only in memory, not on disk. diff --git a/test/Glob/VariantDir.py b/test/Glob/VariantDir.py index 3beb9ab..6340bb8 100644 --- a/test/Glob/VariantDir.py +++ b/test/Glob/VariantDir.py @@ -52,10 +52,10 @@ test.write(['src', 'SConscript'], """\ env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) @@ -67,10 +67,10 @@ test.write(['src', 'sub1', 'SConscript'], """\ env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/basic.py b/test/Glob/basic.py index ad998c3..5e5cdb5 100644 --- a/test/Glob/basic.py +++ b/test/Glob/basic.py @@ -37,10 +37,10 @@ DefaultEnvironment(tools=[]) env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/exclude.py b/test/Glob/exclude.py index bc3e774..658d99a 100644 --- a/test/Glob/exclude.py +++ b/test/Glob/exclude.py @@ -40,10 +40,10 @@ DefaultEnvironment(tools=[]) env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/source.py b/test/Glob/source.py index 3d40d05..33aff85 100644 --- a/test/Glob/source.py +++ b/test/Glob/source.py @@ -41,10 +41,10 @@ DefaultEnvironment(tools=[]) env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/strings.py b/test/Glob/strings.py index 0780ace..2a4a624 100644 --- a/test/Glob/strings.py +++ b/test/Glob/strings.py @@ -49,10 +49,10 @@ test.write(['src', 'SConscript'], """\ env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/subdir.py b/test/Glob/subdir.py index 1227788..22439f7 100644 --- a/test/Glob/subdir.py +++ b/test/Glob/subdir.py @@ -40,10 +40,10 @@ DefaultEnvironment(tools=[]) env = Environment(tools=[]) def concatenate(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Concatenate'] = Builder(action=concatenate) diff --git a/test/Glob/subst.py b/test/Glob/subst.py index 6a145f1..efbc916 100644 --- a/test/Glob/subst.py +++ b/test/Glob/subst.py @@ -38,10 +38,10 @@ DefaultEnvironment(tools=[]) env = Environment(tools=[], PATTERN = 'f*.in') def copy(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) env['BUILDERS']['Copy'] = Builder(action=copy) diff --git a/test/HeaderGen.py b/test/HeaderGen.py index 2763b34..f66ef57 100644 --- a/test/HeaderGen.py +++ b/test/HeaderGen.py @@ -35,9 +35,8 @@ test = TestSCons.TestSCons() test.write('SConstruct', """\ def writeFile(target, contents): - file = open(str(target[0]), 'w') - file.write(contents) - file.close() + with open(str(target[0]), 'w') as f: + f.write(contents) return 0 env = Environment() @@ -60,10 +59,9 @@ test.write('SConstruct', """\ env = Environment() def gen_a_h(target, source, env): - t = open(str(target[0]), 'w') - s = open(str(source[0]), 'r') - s.readline() - t.write(s.readline()[:-1] + ';\\n') + with open(str(target[0]), 'w') as t, open(str(source[0]), 'r') as s: + s.readline() + t.write(s.readline()[:-1] + ';\\n') MakeHeader = Builder(action = gen_a_h) env_no_scan = env.Clone(SCANNERS=[], BUILDERS={'MakeHeader' : MakeHeader}) diff --git a/test/IDL/MIDLCOM.py b/test/IDL/MIDLCOM.py index a478da0..af5ce01 100644 --- a/test/IDL/MIDLCOM.py +++ b/test/IDL/MIDLCOM.py @@ -39,16 +39,14 @@ test = TestSCons.TestSCons() test.write('mymidl.py', """ import os.path import sys -out_tlb = open(sys.argv[1], 'w') base = os.path.splitext(sys.argv[1])[0] -out_h = open(base + '.h', 'w') -out_c = open(base + '_i.c', 'w') -for f in sys.argv[2:]: - infile = open(f, 'r') - for l in [l for l in infile.readlines() if l != '/*midl*/\\n']: - out_tlb.write(l) - out_h.write(l) - out_c.write(l) +with open(sys.argv[1], 'w') as out_tlb, open(base + '.h', 'w') as out_h, open(base + '_i.c', 'w') as out_c: + for f in sys.argv[2:]: + with open(f, 'r') as ifp: + for l in [l for l in ifp.readlines() if l != '/*midl*/\\n']: + out_tlb.write(l) + out_h.write(l) + out_c.write(l) sys.exit(0) """) diff --git a/test/Ignore.py b/test/Ignore.py index 0716e11..053f785 100644 --- a/test/Ignore.py +++ b/test/Ignore.py @@ -36,11 +36,12 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() + open(sys.argv[3], 'rb').read() -file = open(sys.argv[1], 'wb') -for arg in sys.argv[2:]: - file.write(open(arg, 'rb').read()) -file.close() +with open(sys.argv[2], 'rb') as afp2, open(sys.argv[3], 'rb') as afp3: + contents = afp2.read() + afp3.read() +with open(sys.argv[1], 'wb') as f: + for arg in sys.argv[2:]: + with open(arg, 'rb') as ifp: + f.write(ifp.read()) """) SUBDIR_f3_out = os.path.join('$SUBDIR', 'f3.out') diff --git a/test/Install/Install.py b/test/Install/Install.py index da97d2a..0647002 100644 --- a/test/Install/Install.py +++ b/test/Install/Install.py @@ -51,15 +51,16 @@ test.write(['work', 'SConstruct'], """\ DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) - f = open(target, "w") - for src in source: - f.write(open(str(src), "r").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) def my_install(dest, source, env): import shutil shutil.copy2(source, dest) - open('my_install.out', 'a').write(dest) + with open('my_install.out', 'a') as f: + f.write(dest) env1 = Environment(tools=[]) env1.Append(BUILDERS={'Cat':Builder(action=cat)}) @@ -123,7 +124,8 @@ test.fail_test(oldtime1 == os.path.getmtime(f1_out)) test.fail_test(oldtime2 != os.path.getmtime(f2_out)) # Verify that we didn't link to the Installed file. -open(f2_out, 'w').write("xyzzy\n") +with open(f2_out, 'w') as f: + f.write("xyzzy\n") test.must_match(['work', 'f2.out'], "f2.in\n", mode='r') # Verify that scons prints an error message @@ -131,20 +133,16 @@ test.must_match(['work', 'f2.out'], "f2.in\n", mode='r') test.write(['work', 'f1.in'], "f1.in again again\n") os.chmod(test.workpath('work', 'export'), 0o555) -f = open(f1_out, 'rb') +with open(f1_out, 'rb'): + expect = [ + "Permission denied", + "The process cannot access the file because it is being used by another process", + "Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird", + ] + test.run(chdir='work', arguments=f1_out, stderr=None, status=2) -expect = [ - "Permission denied", - "The process cannot access the file because it is being used by another process", - "Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird", -] - -test.run(chdir = 'work', arguments = f1_out, stderr=None, status=2) - -test.must_contain_any_line(test.stderr(), expect) - -f.close() + test.must_contain_any_line(test.stderr(), expect) test.pass_test() diff --git a/test/Install/wrap-by-attribute.py b/test/Install/wrap-by-attribute.py index 6989fa8..014b7a5 100644 --- a/test/Install/wrap-by-attribute.py +++ b/test/Install/wrap-by-attribute.py @@ -47,10 +47,10 @@ import os.path def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, 'wb') as ofp: + for src in source: + with open(str(src), 'rb') as ifp: + ofp.write(ifp.read()) env = Environment(tools=[], DESTDIR='dest') env.Append(BUILDERS={'Cat':Builder(action=cat)}) diff --git a/test/Interactive/configure.py b/test/Interactive/configure.py index a7f0735..9c7ef49 100644 --- a/test/Interactive/configure.py +++ b/test/Interactive/configure.py @@ -51,15 +51,14 @@ env = Environment(CXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE', # Ensure that our 'compiler' works... def CheckMyCC(context): context.Message('Checking for MyCC compiler...') - result = context.TryBuild(context.env.Object, - 'int main(void) {return 0;}', + result = context.TryBuild(context.env.Object, + 'int main(void) {return 0;}', '.cpp') context.Result(result) return result - -conf = Configure(env, - custom_tests = {'CheckMyCC' : CheckMyCC}) - + +conf = Configure(env, custom_tests = {'CheckMyCC' : CheckMyCC}) + if conf.CheckMyCC(): pass # build succeeded else: diff --git a/test/LEX/LEX.py b/test/LEX/LEX.py index 65e4497..a739bfe 100644 --- a/test/LEX/LEX.py +++ b/test/LEX/LEX.py @@ -44,7 +44,8 @@ else: longopts = [] cmd_opts, args = getopt.getopt(sys.argv[1:], 't', longopts) for a in args: - contents = open(a, 'rb').read() + with open(a, 'rb') as f: + contents = f.read() sys.stdout.write(contents.replace(b'LEX', b'mylex.py').decode()) sys.exit(0) """) diff --git a/test/LEX/LEXFLAGS.py b/test/LEX/LEXFLAGS.py index 51b6614..994834e 100644 --- a/test/LEX/LEXFLAGS.py +++ b/test/LEX/LEXFLAGS.py @@ -51,7 +51,8 @@ for opt, arg in cmd_opts: if opt == '-I': i_arguments = i_arguments + ' ' + arg else: opt_string = opt_string + ' ' + opt for a in args: - contents = open(a, 'r').read() + with open(a, 'r') as f: + contents = f.read() contents = contents.replace('LEXFLAGS', opt_string) contents = contents.replace('I_ARGS', i_arguments) sys.stdout.write(contents) diff --git a/test/LINK/LINKFLAGS.py b/test/LINK/LINKFLAGS.py index f0c7518..1642459 100644 --- a/test/LINK/LINKFLAGS.py +++ b/test/LINK/LINKFLAGS.py @@ -36,7 +36,8 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write(("wrapper.py\\n").encode()) +with open('%s', 'wb') as f: + f.write(("wrapper.py\\n").encode()) args = [s for s in sys.argv[1:] if s != 'fake_link_flag'] os.system(" ".join(args)) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) diff --git a/test/LINK/SHLINKFLAGS.py b/test/LINK/SHLINKFLAGS.py index 51b6e22..ab90ece 100644 --- a/test/LINK/SHLINKFLAGS.py +++ b/test/LINK/SHLINKFLAGS.py @@ -37,7 +37,8 @@ test = TestSCons.TestSCons() test.write("wrapper.py", """import os import sys -open('%s', 'wb').write(("wrapper.py\\n").encode()) +with open('%s', 'wb') as f: + f.write(("wrapper.py\\n").encode()) args = [s for s in sys.argv[1:] if s != 'fake_shlink_flag'] os.system(" ".join(args)) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) diff --git a/test/M4/M4COM.py b/test/M4/M4COM.py index 4e95419..756cd55 100644 --- a/test/M4/M4COM.py +++ b/test/M4/M4COM.py @@ -38,11 +38,11 @@ test = TestSCons.TestSCons() test.write('mym4.py', """ import sys -outfile = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*m4*/\\n']: - outfile.write(l) +with open(sys.argv[1], 'wb') as ofp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + for l in [l for l in ifp.readlines() if l != b'/*m4*/\\n']: + ofp.write(l) sys.exit(0) """) diff --git a/test/M4/M4COMSTR.py b/test/M4/M4COMSTR.py index 0e6725b..106cd1d 100644 --- a/test/M4/M4COMSTR.py +++ b/test/M4/M4COMSTR.py @@ -39,11 +39,11 @@ test = TestSCons.TestSCons() test.write('mym4.py', """ import sys -outfile = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*m4*/\\n']: - outfile.write(l) +with open(sys.argv[1], 'wb') as ofp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + for l in [l for l in ifp.readlines() if l != b'/*m4*/\\n']: + ofp.write(l) sys.exit(0) """) diff --git a/test/MSVC/batch.py b/test/MSVC/batch.py index 0d3063f..d9033ec 100644 --- a/test/MSVC/batch.py +++ b/test/MSVC/batch.py @@ -56,20 +56,24 @@ else: # Delay writing the .log output until here so any trailing slash or # backslash has been stripped, and the output comparisons later in this # script don't have to account for the difference. -open('fake_cl.log', 'a').write(" ".join(sys.argv[1:]) + '\\n') +with open('fake_cl.log', 'a') as ofp: + ofp.write(" ".join(sys.argv[1:]) + '\\n') for infile in input_files: if dir: outfile = os.path.join(dir, infile.replace('.c', '.obj')) else: outfile = output - open(outfile, 'w').write(open(infile, 'r').read()) + with open(outfile, 'w') as ofp: + with open(infile, 'r') as ifp: + ofp.write(ifp.read()) """) test.write('fake_link.py', """\ import sys -ofp = open(sys.argv[1], 'w') -for infile in sys.argv[2:]: - ofp.write(open(infile, 'r').read()) +with open(sys.argv[1], 'w') as ofp: + for infile in sys.argv[2:]: + with open(infile, 'r') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/MSVS/vs-10.0-scc-files.py b/test/MSVS/vs-10.0-scc-files.py index 0b8bd76..8a08ece 100644 --- a/test/MSVS/vs-10.0-scc-files.py +++ b/test/MSVS/vs-10.0-scc-files.py @@ -51,7 +51,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-10.0-scc-legacy-files.py b/test/MSVS/vs-10.0-scc-legacy-files.py index 14276a7..9cb65d8 100644 --- a/test/MSVS/vs-10.0-scc-legacy-files.py +++ b/test/MSVS/vs-10.0-scc-legacy-files.py @@ -46,11 +46,11 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-11.0-scc-files.py b/test/MSVS/vs-11.0-scc-files.py index a25b954..2b13e46 100644 --- a/test/MSVS/vs-11.0-scc-files.py +++ b/test/MSVS/vs-11.0-scc-files.py @@ -51,7 +51,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-11.0-scc-legacy-files.py b/test/MSVS/vs-11.0-scc-legacy-files.py index 726f994..9e46f6a 100644 --- a/test/MSVS/vs-11.0-scc-legacy-files.py +++ b/test/MSVS/vs-11.0-scc-legacy-files.py @@ -46,11 +46,11 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-14.0-scc-files.py b/test/MSVS/vs-14.0-scc-files.py index b6db6d5..d706b32 100644 --- a/test/MSVS/vs-14.0-scc-files.py +++ b/test/MSVS/vs-14.0-scc-files.py @@ -51,7 +51,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-14.0-scc-legacy-files.py b/test/MSVS/vs-14.0-scc-legacy-files.py index ba6ebad..904a103 100644 --- a/test/MSVS/vs-14.0-scc-legacy-files.py +++ b/test/MSVS/vs-14.0-scc-legacy-files.py @@ -46,11 +46,11 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-14.1-scc-files.py b/test/MSVS/vs-14.1-scc-files.py index 74e055e..465c904 100644 --- a/test/MSVS/vs-14.1-scc-files.py +++ b/test/MSVS/vs-14.1-scc-files.py @@ -49,7 +49,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-14.1-scc-legacy-files.py b/test/MSVS/vs-14.1-scc-legacy-files.py index 0444b16..45d94a6 100644 --- a/test/MSVS/vs-14.1-scc-legacy-files.py +++ b/test/MSVS/vs-14.1-scc-legacy-files.py @@ -44,11 +44,11 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] diff --git a/test/MSVS/vs-7.0-scc-files.py b/test/MSVS/vs-7.0-scc-files.py index 8586060..4d90a92 100644 --- a/test/MSVS/vs-7.0-scc-files.py +++ b/test/MSVS/vs-7.0-scc-files.py @@ -42,8 +42,8 @@ test._msvs_versions = ['7.0'] expected_slnfile = TestSConsMSVS.expected_slnfile_7_0 expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_7_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.0', +SConscript_contents = \ +r"""env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], MSVS_SCC_CONNECTION_ROOT='.', diff --git a/test/MSVS/vs-7.0-scc-legacy-files.py b/test/MSVS/vs-7.0-scc-legacy-files.py index d458cf3..e87441b 100644 --- a/test/MSVS/vs-7.0-scc-legacy-files.py +++ b/test/MSVS/vs-7.0-scc-legacy-files.py @@ -46,7 +46,7 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] diff --git a/test/MSVS/vs-7.1-scc-legacy-files.py b/test/MSVS/vs-7.1-scc-legacy-files.py index 9f0f809..f80c965 100644 --- a/test/MSVS/vs-7.1-scc-legacy-files.py +++ b/test/MSVS/vs-7.1-scc-legacy-files.py @@ -46,7 +46,7 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='7.1', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] diff --git a/test/MSVS/vs-8.0-scc-legacy-files.py b/test/MSVS/vs-8.0-scc-legacy-files.py index 865e1aa..bfb8416 100644 --- a/test/MSVS/vs-8.0-scc-legacy-files.py +++ b/test/MSVS/vs-8.0-scc-legacy-files.py @@ -46,7 +46,7 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='8.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] diff --git a/test/MSVS/vs-9.0-scc-legacy-files.py b/test/MSVS/vs-9.0-scc-legacy-files.py index 1e609f8..0085f64 100644 --- a/test/MSVS/vs-9.0-scc-legacy-files.py +++ b/test/MSVS/vs-9.0-scc-legacy-files.py @@ -46,7 +46,7 @@ SConscript_contents = """\ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='9.0', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH='C:\\MyMsVsProjects', + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', MSVS_SCC_PROJECT_NAME='Perforce Project') testsrc = ['test1.cpp', 'test2.cpp'] diff --git a/test/Mkdir.py b/test/Mkdir.py index 8ace476..367c834 100644 --- a/test/Mkdir.py +++ b/test/Mkdir.py @@ -41,10 +41,10 @@ Execute(Mkdir('d1')) Execute(Mkdir(Dir('#d1-Dir'))) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('f2.out', 'f2.in', [Cat, Mkdir("d3")]) @@ -126,14 +126,14 @@ test.write(['work2', 'SConstruct'], """\ import os def catdir(env, source, target): target = str(target[0]) - outfp = open(target, "wb") - for src in source: - s = str(src) - for f in sorted(os.listdir(s)): - f = os.path.join(s, f) - if os.path.isfile(f): - outfp.write(open(f, "rb").read()) - outfp.close() + with open(target, "wb") as outfp: + for src in source: + s = str(src) + for f in sorted(os.listdir(s)): + f = os.path.join(s, f) + if os.path.isfile(f): + with open(f, "rb") as infp: + outfp.write(infp.read()) CatDir = Builder(action = catdir) env = Environment(BUILDERS = {'CatDir' : CatDir}) env.Command(Dir('hello'), None, [Mkdir('$TARGET')]) diff --git a/test/Move.py b/test/Move.py index b58fa34..1da3aa7 100644 --- a/test/Move.py +++ b/test/Move.py @@ -37,10 +37,10 @@ Execute(Move('f1.out', 'f1.in')) Execute(Move('File-f1.out', File('f1.in-File'))) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('f2.out', 'f2.in', [Cat, Move("f3.out", "f3.in")]) diff --git a/test/NoClean.py b/test/NoClean.py index 63e3e28..fe6a2bc 100644 --- a/test/NoClean.py +++ b/test/NoClean.py @@ -34,15 +34,20 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def action(target, source, env): - for t in target: open(t.get_internal_path(), 'w') + for t in target: + with open(t.get_internal_path(), 'w'): + pass Command('1.out', 'SConstruct', action) NoClean('1.out') """) test.write('SConstruct.force', """ def action(target, source, env): - for t in target: open(t.get_internal_path(), 'w') - open('4.out', 'w') + for t in target: + with open(t.get_internal_path(), 'w'): + pass + with open('4.out', 'w'): + pass res = Command('3.out', 'SConstruct.force', action) Clean('4.out', res) NoClean('4.out') @@ -50,7 +55,9 @@ NoClean('4.out') test.write('SConstruct.multi', """ def action(target, source, env): - for t in target: open(t.get_internal_path(), 'w') + for t in target: + with open(t.get_internal_path(), 'w'): + pass Command(['5.out', '6.out'], 'SConstruct.multi', action) NoClean('6.out') """) diff --git a/test/ParseDepends.py b/test/ParseDepends.py index 12b02e2..2de2105 100644 --- a/test/ParseDepends.py +++ b/test/ParseDepends.py @@ -36,10 +36,8 @@ test.subdir('subdir', 'sub2') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() + open(sys.argv[3], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as afp2, open(sys.argv[3], 'rb') as afp3: + f.write(afp2.read() + afp3.read()) """) test.write('SConstruct', """ diff --git a/test/QT/qt_warnings.py b/test/QT/qt_warnings.py index a1cf221..23612de 100644 --- a/test/QT/qt_warnings.py +++ b/test/QT/qt_warnings.py @@ -84,8 +84,8 @@ if moc: qtdir = os.path.dirname(os.path.dirname(moc)) qtdir = qtdir.replace('\\', '\\\\' ) - expect = """ -scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) + expect = \ +r"""scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) File "%s", line \d+, in (\?|) """ % (qtdir, re.escape(SConstruct_path)) else: diff --git a/test/Repository/Default.py b/test/Repository/Default.py index bd9d5f8..e33a26e 100644 --- a/test/Repository/Default.py +++ b/test/Repository/Default.py @@ -47,7 +47,8 @@ def copy(env, source, target): source = str(source[0]) target = str(target[0]) print('copy() < %s > %s' % (source, target)) - open(target, "w").write(open(source, "r").read()) + with open(target, "w") as ofp, open(source, "r") as ifp: + ofp.write(ifp.read()) Build = Builder(action=copy) env = Environment(BUILDERS={'Build':Build}) diff --git a/test/Repository/LIBPATH.py b/test/Repository/LIBPATH.py index 8b396fa..646b5d7 100644 --- a/test/Repository/LIBPATH.py +++ b/test/Repository/LIBPATH.py @@ -46,14 +46,13 @@ bbb_exe = env_yyy.Program('bbb', 'bbb.c') def write_LIBDIRFLAGS(env, target, source): pre = env.subst('$LIBDIRPREFIX') suf = env.subst('$LIBDIRSUFFIX') - f = open(str(target[0]), 'w') - for arg in env.subst('$_LIBDIRFLAGS', target=target).split(): - if arg[:len(pre)] == pre: - arg = arg[len(pre):] - if arg[-len(suf):] == suf: - arg = arg[:-len(pre)] - f.write(arg + '\n') - f.close() + with open(str(target[0]), 'w') as f: + for arg in env.subst('$_LIBDIRFLAGS', target=target).split(): + if arg[:len(pre)] == pre: + arg = arg[len(pre):] + if arg[-len(suf):] == suf: + arg = arg[:-len(pre)] + f.write(arg + '\n') return 0 env_zzz.Command('zzz.out', aaa_exe, write_LIBDIRFLAGS) env_yyy.Command('yyy.out', bbb_exe, write_LIBDIRFLAGS) diff --git a/test/Repository/Local.py b/test/Repository/Local.py index 7062075..a906245 100644 --- a/test/Repository/Local.py +++ b/test/Repository/Local.py @@ -49,8 +49,8 @@ def copy(env, source, target): source = str(source[0]) target = str(target[0]) print('copy() < %s > %s' % (source, target)) - with open(target, 'w') as fo, open(source, 'r') as fi: - fo.write(fi.read()) + with open(target, 'w') as ofp, open(source, 'r') as ifp: + ofp.write(ifp.read()) Build = Builder(action=copy) env = Environment(BUILDERS={'Build':Build}, BBB='bbb') diff --git a/test/Repository/SConscript.py b/test/Repository/SConscript.py index 1b67c07..1482800 100644 --- a/test/Repository/SConscript.py +++ b/test/Repository/SConscript.py @@ -61,10 +61,11 @@ SConscript('src/SConscript') test.write(['rep1', 'src', 'SConscript'], """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "w") - for src in source: - f.write(open(str(src), "r").read()) - f.close() + with open(target, "w") as ofp: + for src in source: + with open(str(src), "r") as ifp: + ofp.write(ifp.read()) + env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Cat(target = 'foo', source = ['aaa.in', 'bbb.in', 'ccc.in']) """) @@ -97,10 +98,11 @@ SConscript('src/SConscript') test.write(['rep2', 'src', 'SConscript'], """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "w") as ofp: + for src in source: + with open(str(src), "r") as ifp: + ofp.write(ifp.read()) + env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Cat(target = 'foo', source = ['aaa.in', 'bbb.in', 'ccc.in']) SConscript('sub/SConscript') diff --git a/test/Repository/VariantDir.py b/test/Repository/VariantDir.py index 8887f86..327e550 100644 --- a/test/Repository/VariantDir.py +++ b/test/Repository/VariantDir.py @@ -49,10 +49,10 @@ def cat(env, source, target): target = str(target[0]) source = list(map(str, source)) print('cat(%s) > %s' % (source, target)) - f = open(target, "w") - for src in source: - f.write(open(src, "r").read()) - f.close() + with open(target, "w") as ofp: + for src in source: + with open(src, "r") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('aaa.mid', 'aaa.in') diff --git a/test/Repository/option-c.py b/test/Repository/option-c.py index 58c4876..a73bcf7 100644 --- a/test/Repository/option-c.py +++ b/test/Repository/option-c.py @@ -66,8 +66,8 @@ def copy(env, source, target): source = str(source[0]) target = str(target[0]) print('copy() < %s > %s' % (source, target)) - with open(target, 'w') as fo, open(source, 'r') as fi: - fo.write(fi.read()) + with open(target, 'w') as ofp, open(source, 'r') as ifp: + ofp.write(ifp.read()) Build = Builder(action=copy) env = Environment(BUILDERS={'Build':Build}) diff --git a/test/Repository/option-f.py b/test/Repository/option-f.py index c990f2f..f1b2cc6 100644 --- a/test/Repository/option-f.py +++ b/test/Repository/option-f.py @@ -43,10 +43,10 @@ test.write(['repository', 'SConstruct'], """\ Repository(r'%s') def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('aaa.out', 'aaa.in') diff --git a/test/Repository/option-n.py b/test/Repository/option-n.py index d23a200..d99e92a 100644 --- a/test/Repository/option-n.py +++ b/test/Repository/option-n.py @@ -49,7 +49,8 @@ def copy(env, source, target): source = str(source[0]) target = str(target[0]) print('copy() < %s > %s' % (source, target)) - open(target, "w").write(open(source, "r").read()) + with open(target, "w") as ofp, open(source, "r") as ifp: + ofp.write(ifp.read()) Build = Builder(action=copy) env = Environment(BUILDERS={'Build':Build}) diff --git a/test/Repository/targets.py b/test/Repository/targets.py index 0bc625a..5899c57 100644 --- a/test/Repository/targets.py +++ b/test/Repository/targets.py @@ -44,10 +44,10 @@ def cat(env, source, target): target = str(target[0]) source = list(map(str, source)) print('cat(%s) > %s' % (source, target)) - f = open(target, "w") - for src in source: - f.write(open(src, "r").read()) - f.close() + with open(target, "w") as ofp: + for src in source: + with open(src, "r") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('aaa.out', 'aaa.in') diff --git a/test/Requires/basic.py b/test/Requires/basic.py index edce13b..4851ac8 100644 --- a/test/Requires/basic.py +++ b/test/Requires/basic.py @@ -35,11 +35,12 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def append_prereq_func(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.write(open('prereq.out', 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as ofp: + for s in source: + with open(str(s), 'rb') as ifp: + ofp.write(ifp.read()) + with open('prereq.out', 'rb') as ifp: + ofp.write(ifp.read()) return None append_prereq = Action(append_prereq_func) env = Environment() diff --git a/test/Requires/eval-order.py b/test/Requires/eval-order.py index 77fbc98..fddf232 100644 --- a/test/Requires/eval-order.py +++ b/test/Requires/eval-order.py @@ -34,11 +34,10 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def copy_and_create_func(target, source, env): - with open(str(target[0]), 'w') as fp: + with open(str(target[0]), 'w') as ofp: for s in source: - with open(str(s), 'r') as f: - fp.write(f.read()) - open('file.in', 'w').write("file.in 1\\n") + with open(str(s), 'r') as ifp: + ofp.write(ifp.read()) with open('file.in', 'w') as f: f.write("file.in 1\\n") return None diff --git a/test/Rpcgen/RPCGEN.py b/test/Rpcgen/RPCGEN.py index 2f793e2..eaa4e16 100644 --- a/test/Rpcgen/RPCGEN.py +++ b/test/Rpcgen/RPCGEN.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/Rpcgen/RPCGENCLIENTFLAGS.py b/test/Rpcgen/RPCGENCLIENTFLAGS.py index 9612952..a298ebd 100644 --- a/test/Rpcgen/RPCGENCLIENTFLAGS.py +++ b/test/Rpcgen/RPCGENCLIENTFLAGS.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/Rpcgen/RPCGENFLAGS.py b/test/Rpcgen/RPCGENFLAGS.py index d4be92c..c254ed0 100644 --- a/test/Rpcgen/RPCGENFLAGS.py +++ b/test/Rpcgen/RPCGENFLAGS.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/Rpcgen/RPCGENHEADERFLAGS.py b/test/Rpcgen/RPCGENHEADERFLAGS.py index 4beca64..8e40ad7 100644 --- a/test/Rpcgen/RPCGENHEADERFLAGS.py +++ b/test/Rpcgen/RPCGENHEADERFLAGS.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/Rpcgen/RPCGENSERVICEFLAGS.py b/test/Rpcgen/RPCGENSERVICEFLAGS.py index 7644485..2edc77c 100644 --- a/test/Rpcgen/RPCGENSERVICEFLAGS.py +++ b/test/Rpcgen/RPCGENSERVICEFLAGS.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/Rpcgen/RPCGENXDRFLAGS.py b/test/Rpcgen/RPCGENXDRFLAGS.py index 41da70c..2d1ca96 100644 --- a/test/Rpcgen/RPCGENXDRFLAGS.py +++ b/test/Rpcgen/RPCGENXDRFLAGS.py @@ -38,12 +38,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') -output.write(" ".join(sys.argv) + "\\n") -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('RPCGEN', 'myrpcgen.py')) -output.close() + if opt == '-o': out = arg +with open(out, 'w') as ofp: + ofp.write(" ".join(sys.argv) + "\\n") + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('RPCGEN', 'myrpcgen.py')) sys.exit(0) """) diff --git a/test/SConscript/SConscript.py b/test/SConscript/SConscript.py index 36288be..fd8511d 100644 --- a/test/SConscript/SConscript.py +++ b/test/SConscript/SConscript.py @@ -74,7 +74,7 @@ SConscript('SConscript5') try: from collections import UserList except ImportError: - exec('from UserList import UserList') + from UserList import UserList x7 = "SConstruct x7" x8 = "SConstruct x8" x9 = SConscript('SConscript6', UserList(["x7", "x8"])) diff --git a/test/SConscript/SConscriptChdir.py b/test/SConscript/SConscriptChdir.py index 6cd4566..5468a54 100644 --- a/test/SConscript/SConscriptChdir.py +++ b/test/SConscript/SConscriptChdir.py @@ -44,33 +44,43 @@ SConscript('dir5/SConscript') """) test.write(['dir1', 'SConscript'], """ -exec(open("create_test.py", 'r').read()) +with open("create_test.py", 'r') as f: + contents = f.read() +exec(contents) """) test.write(['dir2', 'SConscript'], """ -exec(open("create_test.py", 'r').read()) +with open("create_test.py", 'r') as f: + contents = f.read() +exec(contents) """) test.write(['dir3', 'SConscript'], """ import os.path name = os.path.join('dir3', 'create_test.py') -exec(open(name, 'r').read()) +with open(name, 'r') as f: + contents = f.read() +exec(contents) """) test.write(['dir4', 'SConscript'], """ -exec(open("create_test.py", 'r').read()) +with open("create_test.py", 'r') as f: + contents = f.read() +exec(contents) """) test.write(['dir5', 'SConscript'], """ import os.path name = os.path.join('dir5', 'create_test.py') -exec(open(name, 'r').read()) +with open(name, 'r') as f: + contents = f.read() +exec(contents) """) for dir in ['dir1', 'dir2', 'dir3','dir4', 'dir5']: test.write([dir, 'create_test.py'], r""" -f = open("test.txt", "a") -f.write("This is the %s test.\n") +with open("test.txt", "a") as f: + f.write("This is the %s test.\n") f.close() """ % dir) diff --git a/test/SConsignFile/default.py b/test/SConsignFile/default.py index 4d56a5e..62ac006 100644 --- a/test/SConsignFile/default.py +++ b/test/SConsignFile/default.py @@ -39,10 +39,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/SConsignFile/explicit-file.py b/test/SConsignFile/explicit-file.py index 90c2241..7583bdc 100644 --- a/test/SConsignFile/explicit-file.py +++ b/test/SConsignFile/explicit-file.py @@ -39,10 +39,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) """) # diff --git a/test/SConsignFile/use-dbhash.py b/test/SConsignFile/use-dbhash.py index f70c8b0..e57e244 100644 --- a/test/SConsignFile/use-dbhash.py +++ b/test/SConsignFile/use-dbhash.py @@ -43,10 +43,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/SConsignFile/use-dbm.py b/test/SConsignFile/use-dbm.py index b5021c4..fcf4420 100644 --- a/test/SConsignFile/use-dbm.py +++ b/test/SConsignFile/use-dbm.py @@ -49,10 +49,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/SConsignFile/use-dumbdbm.py b/test/SConsignFile/use-dumbdbm.py index 2dcfa61..36ba18b 100644 --- a/test/SConsignFile/use-dumbdbm.py +++ b/test/SConsignFile/use-dumbdbm.py @@ -48,10 +48,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/SConsignFile/use-gdbm.py b/test/SConsignFile/use-gdbm.py index 1eb3645..8f863fb 100644 --- a/test/SConsignFile/use-gdbm.py +++ b/test/SConsignFile/use-gdbm.py @@ -43,10 +43,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/SHELL.py b/test/SHELL.py index faee27f..5d97b97 100644 --- a/test/SHELL.py +++ b/test/SHELL.py @@ -57,10 +57,10 @@ def stripquote(s): return s args = stripquote(sys.argv[2]).split() args = list(map(stripquote, args)) -ofp = open(args[2], 'wb') -for f in args[3:] + ['extra.txt']: - ofp.write(open(f, 'rb').read()) -ofp.close() +with open(args[2], 'wb') as ofp: + for f in args[3:] + ['extra.txt']: + with open(f, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """ % locals()) diff --git a/test/SPAWN.py b/test/SPAWN.py index 6802524..fba21d5 100644 --- a/test/SPAWN.py +++ b/test/SPAWN.py @@ -36,10 +36,10 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -ofp = open(sys.argv[1], 'wb') -for s in sys.argv[2:]: - ofp.write(open(s, 'rb').read()) -ofp.close() +with open(sys.argv[1], 'wb') as ofp: + for s in sys.argv[2:]: + with open(s, 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/Scanner/FindPathDirs.py b/test/Scanner/FindPathDirs.py index c56f448..34eb779 100644 --- a/test/Scanner/FindPathDirs.py +++ b/test/Scanner/FindPathDirs.py @@ -41,8 +41,6 @@ test.write('build.py', r""" import os.path import sys path = sys.argv[1].split() -input = open(sys.argv[2], 'r') -output = open(sys.argv[3], 'w') def find_file(f): for dir in path: @@ -55,11 +53,13 @@ def process(infp, outfp): for line in infp.readlines(): if line[:8] == 'include ': file = line[8:-1] - process(find_file(file), outfp) + with find_file(file) as f: + process(f, outfp) else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'r') as ifp, open(sys.argv[3], 'w') as ofp: + process(ifp, ofp) sys.exit(0) """) diff --git a/test/Scanner/Scanner.py b/test/Scanner/Scanner.py index e5516bd..272f26a 100644 --- a/test/Scanner/Scanner.py +++ b/test/Scanner/Scanner.py @@ -33,14 +33,13 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -input = open(sys.argv[1], 'r') -output = open(sys.argv[2], 'w') def process(infp, outfp): for line in infp.readlines(): if line[:8] == 'include ': file = line[8:-1] - process(open(file, 'r'), outfp) + with open(file, 'r') as f: + process(f, outfp) elif line[:8] == 'getfile ': outfp.write('include ') outfp.write(line[8:]) @@ -48,7 +47,8 @@ def process(infp, outfp): else: outfp.write(line) -process(input, output) +with open(sys.argv[1], 'r') as ifp, open(sys.argv[2], 'w') as ofp: + process(ifp, ofp) sys.exit(0) """, mode='w') @@ -118,7 +118,8 @@ def third(env, target, source): contents = source[0].get_contents() # print("TYPE:"+str(type(contents))) contents = contents.replace(b'getfile', b'MISSEDME') - open(str(target[0]), 'wb').write(contents) + with open(str(target[0]), 'wb') as f: + f.write(contents) kbld = Builder(action=r'%(_python_)s build.py $SOURCES $TARGET', src_suffix='.first', diff --git a/test/Scanner/dictionary.py b/test/Scanner/dictionary.py index c587098..efe3cd2 100644 --- a/test/Scanner/dictionary.py +++ b/test/Scanner/dictionary.py @@ -36,8 +36,6 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -input = open(sys.argv[1], 'r') -output = open(sys.argv[2], 'w') include_prefix = 'include%s ' % sys.argv[1][-1] @@ -45,11 +43,13 @@ def process(infp, outfp): for line in infp.readlines(): if line[:len(include_prefix)] == include_prefix: file = line[len(include_prefix):-1] - process(open(file, 'r'), outfp) + with open(file, 'r') as f: + process(f, outfp) else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'w') as ofp, open(sys.argv[1], 'r') as ifp: + process(ifp, ofp) sys.exit(0) """) diff --git a/test/Scanner/empty-implicit.py b/test/Scanner/empty-implicit.py index 8d9a47d..a1e7b03 100644 --- a/test/Scanner/empty-implicit.py +++ b/test/Scanner/empty-implicit.py @@ -53,7 +53,8 @@ def echo(env, target, source): t = os.path.split(str(target[0]))[1] s = os.path.split(str(source[0]))[1] print('create %s from %s' % (t, s)) - open(t, 'wb').write(open(s, 'rb').read()) + with open(t, 'wb') as ofb, open(s, 'rb') as ifb: + ofb.write(ifb.read()) Echo = Builder(action = Action(echo, None), src_suffix = '.x', diff --git a/test/Scanner/exception.py b/test/Scanner/exception.py index 1a14152..ec19842 100644 --- a/test/Scanner/exception.py +++ b/test/Scanner/exception.py @@ -61,16 +61,17 @@ def process(outf, inf): for line in inf.readlines(): if line[:8] == 'include ': file = line[8:-1] - process(outf, open(file, 'rb')) + with open(file, 'rb') as ifp: + process(outf, ifp) else: outf.write(line) def cat(env, source, target): target = str(target[0]) - outf = open(target, 'wb') - for src in source: - process(outf, open(str(src), 'rb')) - outf.close() + with open(target, 'wb') as outf: + for src in source: + with open(str(src), 'rb') as inf: + process(outf, inf) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Append(SCANNERS = [kscan]) diff --git a/test/Scanner/generated.py b/test/Scanner/generated.py index 3e08549..5e808e1 100644 --- a/test/Scanner/generated.py +++ b/test/Scanner/generated.py @@ -245,7 +245,7 @@ lib_name = "g" lib_fullname = env.subst("${LIBPREFIX}g${LIBSUFFIX}") lib_srcs = "libg_1.c libg_2.c libg_3.c".split() import re -lib_objs = [re.sub("\.c$", ".o", x) for x in lib_srcs] +lib_objs = [re.sub(r"\.c$", ".o", x) for x in lib_srcs] Mylib.ExportHeader(env, exported_hdrs) Mylib.ExportLib(env, lib_fullname) @@ -259,7 +259,7 @@ Mylib.ExportLib(env, lib_fullname) #cmd_generated = "cd %s ; sh MAKE-HEADER.sh" % Dir(".") #cmd_justlib = "cd %s ; make" % Dir(".") -_ws = re.compile('\s') +_ws = re.compile(r'\s') def escape(s): if _ws.search(s): @@ -294,7 +294,8 @@ import sys os.chdir(os.path.split(sys.argv[0])[0]) for h in ['libg_gx.h', 'libg_gy.h', 'libg_gz.h']: - open(h, 'w').write('') + with open(h, 'w') as f: + f.write('') """ % locals()) test.write(['src', 'lib_geng', 'SConstruct'], """\ @@ -302,12 +303,11 @@ import os Scanned = {} -def write_out(file, dict): - f = open(file, 'w') - for k in sorted(dict.keys()): - file = os.path.split(k)[1] - f.write(file + ": " + str(dict[k]) + "\\n") - f.close() +def write_out(fname, dict): + with open(fname, 'w') as f: + for k in sorted(dict.keys()): + name = os.path.split(k)[1] + f.write(name + ": " + str(dict[k]) + "\\n") # A hand-coded new-style class proxy to wrap the underlying C Scanner # with a method that counts the calls. diff --git a/test/Scanner/multi-env.py b/test/Scanner/multi-env.py index 9cf86dc..1cc85d0 100644 --- a/test/Scanner/multi-env.py +++ b/test/Scanner/multi-env.py @@ -72,12 +72,13 @@ def process(infp, outfp): l = len(prefix) for line in infp.readlines(): if line[:l] == prefix: - process(open(line[l:-1], 'r'), outfp) + with open(line[l:-1], 'r') as f: + process(f, outfp) else: outfp.write(line) -process(open(sys.argv[2], 'r'), - open(sys.argv[1], 'w')) +with open(sys.argv[2], 'r') as ifp, open(sys.argv[1], 'w') as ofp: + process(ifp, ofp) sys.exit(0) """ diff --git a/test/Scanner/no-Dir-node.py b/test/Scanner/no-Dir-node.py index 69b665a..a230ea6 100644 --- a/test/Scanner/no-Dir-node.py +++ b/test/Scanner/no-Dir-node.py @@ -54,8 +54,6 @@ test.write('build.py', r""" import os.path import sys path = sys.argv[1].split() -input = open(sys.argv[2], 'r') -output = open(sys.argv[3], 'w') def find_file(f): if os.path.isabs(f): @@ -69,12 +67,14 @@ def find_file(f): def process(infp, outfp): for line in infp.readlines(): if line[:8] == 'include ': - file = line[8:-1] - process(find_file(file), outfp) + fname = line[8:-1] + with find_file(fname) as f: + process(f, outfp) else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'r') as ifp, open(sys.argv[3], 'w') as ofp: + process(ifp, ofp) sys.exit(0) """) diff --git a/test/Scanner/source_scanner-dict.py b/test/Scanner/source_scanner-dict.py index 47773b8..f719f00 100644 --- a/test/Scanner/source_scanner-dict.py +++ b/test/Scanner/source_scanner-dict.py @@ -39,21 +39,21 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -output = open(sys.argv[1], 'w') -for infile in sys.argv[2:]: - input = open(infile, 'r') - - include_prefix = 'include%s ' % infile[-1] - - def process(infp, outfp, include_prefix=include_prefix): - for line in infp.readlines(): - if line[:len(include_prefix)] == include_prefix: - file = line[len(include_prefix):-1] - process(open(file, 'r'), outfp) - else: - outfp.write(line) - - process(input, output) +with open(sys.argv[1], 'w') as ofp: + for infile in sys.argv[2:]: + with open(infile, 'r') as ifp: + include_prefix = 'include%s ' % infile[-1] + + def process(infp, outfp, include_prefix=include_prefix): + for line in infp.readlines(): + if line[:len(include_prefix)] == include_prefix: + file = line[len(include_prefix):-1] + with open(file, 'r') as f: + process(f, outfp) + else: + outfp.write(line) + + process(ifp, ofp) sys.exit(0) """) diff --git a/test/Scanner/unicode.py b/test/Scanner/unicode.py index 96010de..227c72e 100644 --- a/test/Scanner/unicode.py +++ b/test/Scanner/unicode.py @@ -49,7 +49,8 @@ import codecs import sys def process(outfp, infile): - contents = open(infile, 'rb').read() + with open(infile, 'rb') as f: + contents = f.read() if contents[:len(codecs.BOM_UTF8)] == codecs.BOM_UTF8: contents = contents[len(codecs.BOM_UTF8):].decode('utf-8') elif contents[:len(codecs.BOM_UTF16_LE)] == codecs.BOM_UTF16_LE: @@ -70,8 +71,8 @@ def process(outfp, infile): else: outfp.write(line + '\n') -output = open(sys.argv[2], 'w') -process(output, sys.argv[1]) +with open(sys.argv[2], 'w') as ofp: + process(ofp, sys.argv[1]) sys.exit(0) """) diff --git a/test/SideEffect/directory.py b/test/SideEffect/directory.py index 23f50af..9fcbea2 100644 --- a/test/SideEffect/directory.py +++ b/test/SideEffect/directory.py @@ -37,7 +37,8 @@ import os.path import os def copy(source, target): - open(target, "wb").write(open(source, "rb").read()) + with open(target, "wb") as ofp, open(source, "rb") as ifp: + ofp.write(ifp.read()) def build(env, source, target): copy(str(source[0]), str(target[0])) diff --git a/test/SideEffect/parallel.py b/test/SideEffect/parallel.py index 63538f3..7ec53b3 100644 --- a/test/SideEffect/parallel.py +++ b/test/SideEffect/parallel.py @@ -52,7 +52,8 @@ except OSError as e: src, target = sys.argv[1:] -open(logfile, 'ab').write(('%s -> %s\\n' % (src, target)).encode()) +with open(logfile, 'ab') as f: + f.write(('%s -> %s\\n' % (src, target)).encode()) # Give the other threads a chance to start. time.sleep(1) diff --git a/test/Subst/null-sources-attr.py b/test/Subst/null-sources-attr.py index 64a0b5b..729aa99 100644 --- a/test/Subst/null-sources-attr.py +++ b/test/Subst/null-sources-attr.py @@ -37,10 +37,10 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -fp = open(sys.argv[1], 'wb') -for infile in sys.argv[2:]: - fp.write(open(infile, 'rb').read()) -fp.close() +with open(sys.argv[1], 'wb') as ofp: + for infile in sys.argv[2:]: + with open(infile, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/TAR/TAR.py b/test/TAR/TAR.py index 65e6182..159f047 100644 --- a/test/TAR/TAR.py +++ b/test/TAR/TAR.py @@ -42,16 +42,18 @@ import sys opts, args = getopt.getopt(sys.argv[1:], 'cf:') for opt, arg in opts: if opt == '-f': out = arg + def process(outfile, name): if os.path.isdir(name): for entry in sorted(os.listdir(name)): process(outfile, os.path.join(name, entry)) else: - outfile.write(open(name, 'r').read()) -outfile = open(out, 'w') -for infile in args: - process(outfile, infile) -outfile.close() + with open(name, 'r') as ifp: + outfile.write(ifp.read()) + +with open(out, 'w') as ofp: + for infile in args: + process(ofp, infile) sys.exit(0) """) diff --git a/test/TAR/TARFLAGS.py b/test/TAR/TARFLAGS.py index e1eae0f..29a1866 100644 --- a/test/TAR/TARFLAGS.py +++ b/test/TAR/TARFLAGS.py @@ -44,17 +44,19 @@ opt_string = '' for opt, arg in cmd_opts: if opt == '-f': out = arg else: opt_string = opt_string + ' ' + opt + def process(outfile, name): if os.path.isdir(name): for entry in sorted(os.listdir(name)): process(outfile, os.path.join(name, entry)) else: - outfile.write(open(name, 'r').read()) -outfile = open(out, 'w') -outfile.write('options: %s\\n' % opt_string) -for infile in args: - process(outfile, infile) -outfile.close() + with open(name, 'r') as ifp: + outfile.write(ifp.read()) + +with open(out, 'w') as ofp: + ofp.write('options: %s\\n' % opt_string) + for infile in args: + process(ofp, infile) sys.exit(0) """) diff --git a/test/TARGET-dir.py b/test/TARGET-dir.py index 9e99087..652cf77 100644 --- a/test/TARGET-dir.py +++ b/test/TARGET-dir.py @@ -43,9 +43,10 @@ test.subdir('src', 'build1', 'build2') test.write('SConstruct', """ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) f.close() env = Environment(CPPPATH='${TARGET.dir}') env.Append(BUILDERS = {'Cat' : Builder(action=cat)}) diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py index dc5e535..553313e 100644 --- a/test/TEX/LATEX.py +++ b/test/TEX/LATEX.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the LATEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. @@ -44,15 +44,16 @@ import os import getopt cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', []) base_name = os.path.splitext(arg[0])[0] -infile = open(arg[0], 'r') -dvi_file = open(base_name+'.dvi', 'w') -aux_file = open(base_name+'.aux', 'w') -log_file = open(base_name+'.log', 'w') -for l in infile.readlines(): - if l[0] != '\\': - dvi_file.write(l) - aux_file.write(l) - log_file.write(l) +with open(arg[0], 'r') as ifp: + with open(base_name+'.dvi', 'w') as dvi_file, \ + open(base_name+'.aux', 'w') as aux_file, \ + open(base_name+'.log', 'w') as log_file: + + for l in ifp.readlines(): + if l[0] != '\\': + dvi_file.write(l) + aux_file.write(l) + log_file.write(l) sys.exit(0) """) diff --git a/test/TEX/LATEX2.py b/test/TEX/LATEX2.py index 566f164..a3ac125 100644 --- a/test/TEX/LATEX2.py +++ b/test/TEX/LATEX2.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can produce several .pdf at once from several sources. """ diff --git a/test/TEX/LATEXCOM.py b/test/TEX/LATEXCOM.py index 878d4cf..8ea87c8 100644 --- a/test/TEX/LATEXCOM.py +++ b/test/TEX/LATEXCOM.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test the ability to configure the $LATEXCOM construction variable. """ diff --git a/test/TEX/LATEXCOMSTR.py b/test/TEX/LATEXCOMSTR.py index f8a377d..41c5dc7 100644 --- a/test/TEX/LATEXCOMSTR.py +++ b/test/TEX/LATEXCOMSTR.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test that the $LATEXCOMSTR construction variable allows you to configure the C compilation output. """ diff --git a/test/TEX/LATEXFLAGS.py b/test/TEX/LATEXFLAGS.py index 48cfa9c..5e8b4af 100644 --- a/test/TEX/LATEXFLAGS.py +++ b/test/TEX/LATEXFLAGS.py @@ -43,12 +43,11 @@ opt_string = '' for opt, arg in cmd_opts: opt_string = opt_string + ' ' + opt base_name = os.path.splitext(args[0])[0] -infile = open(args[0], 'r') -out_file = open(base_name+'.dvi', 'w') -out_file.write(opt_string + "\n") -for l in infile.readlines(): - if l[0] != '\\': - out_file.write(l) +with open(base_name+'.dvi', 'w') as ofp, open(args[0], 'r') as ifp: + ofp.write(opt_string + "\n") + for l in ifp.readlines(): + if l[0] != '\\': + ofp.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFLATEX.py b/test/TEX/PDFLATEX.py index dece385..a350b28 100644 --- a/test/TEX/PDFLATEX.py +++ b/test/TEX/PDFLATEX.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the PDFLATEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. @@ -44,15 +44,16 @@ import os import getopt cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', []) base_name = os.path.splitext(arg[0])[0] -infile = open(arg[0], 'rb') -pdf_file = open(base_name+'.pdf', 'wb') -aux_file = open(base_name+'.aux', 'wb') -log_file = open(base_name+'.log', 'wb') -for l in infile.readlines(): - if l[0] != '\\': - pdf_file.write(l) - aux_file.write(l) - log_file.write(l) +with open(arg[0], 'r') as ifp: + with open(base_name+'.pdf', 'w') as pdf_file, \ + open(base_name+'.aux', 'w') as aux_file, \ + open(base_name+'.log', 'w') as log_file: + + for l in ifp.readlines(): + if l[0] != '\\': + pdf_file.write(l) + aux_file.write(l) + log_file.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFLATEXCOM.py b/test/TEX/PDFLATEXCOM.py index c2b54ce..5e9d68d 100644 --- a/test/TEX/PDFLATEXCOM.py +++ b/test/TEX/PDFLATEXCOM.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test the ability to configure the $PDFLATEXCOM construction variable. """ diff --git a/test/TEX/PDFLATEXCOMSTR.py b/test/TEX/PDFLATEXCOMSTR.py index 1d911bd..d695bde 100644 --- a/test/TEX/PDFLATEXCOMSTR.py +++ b/test/TEX/PDFLATEXCOMSTR.py @@ -1,4 +1,3 @@ - #!/usr/bin/env python # # __COPYRIGHT__ @@ -25,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test that the $PDFLATEXCOMSTR construction variable allows you to configure the C compilation output. """ diff --git a/test/TEX/PDFLATEXFLAGS.py b/test/TEX/PDFLATEXFLAGS.py index 47643e4..9bea1f0 100644 --- a/test/TEX/PDFLATEXFLAGS.py +++ b/test/TEX/PDFLATEXFLAGS.py @@ -43,12 +43,11 @@ opt_string = '' for opt, arg in cmd_opts: opt_string = opt_string + ' ' + opt base_name = os.path.splitext(args[0])[0] -infile = open(args[0], 'r') -out_file = open(base_name+'.pdf', 'w') -out_file.write(opt_string + "\n") -for l in infile.readlines(): - if l[0] != '\\': - out_file.write(l) +with open(base_name+'.pdf', 'w') as ofp, open(args[0], 'r') as ifp: + ofp.write(opt_string + "\n") + for l in ifp.readlines(): + if l[0] != '\\': + ofp.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFTEX.py b/test/TEX/PDFTEX.py index 5a958d5..0309fce 100644 --- a/test/TEX/PDFTEX.py +++ b/test/TEX/PDFTEX.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the PDFTEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. @@ -44,15 +44,16 @@ import os import getopt cmd_opts, arg = getopt.getopt(sys.argv[2:], 'i:r:', []) base_name = os.path.splitext(arg[0])[0] -infile = open(arg[0], 'rb') -pdf_file = open(base_name+'.pdf', 'wb') -aux_file = open(base_name+'.aux', 'wb') -log_file = open(base_name+'.log', 'wb') -for l in infile.readlines(): - if l[0] != '\\': - pdf_file.write(l) - aux_file.write(l) - log_file.write(l) +with open(arg[0], 'r') as ifp: + with open(base_name+'.pdf', 'w') as pdf_file, \ + open(base_name+'.aux', 'w') as aux_file, \ + open(base_name+'.log', 'w') as log_file: + + for l in ifp.readlines(): + if l[0] != '\\': + pdf_file.write(l) + aux_file.write(l) + log_file.write(l) sys.exit(0) """) diff --git a/test/TEX/PDFTEXCOM.py b/test/TEX/PDFTEXCOM.py index 6e915a4..fd0ba69 100644 --- a/test/TEX/PDFTEXCOM.py +++ b/test/TEX/PDFTEXCOM.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test the ability to configure the $PDFTEXCOM construction variable. """ diff --git a/test/TEX/PDFTEXCOMSTR.py b/test/TEX/PDFTEXCOMSTR.py index 7ee5b41..50edd28 100644 --- a/test/TEX/PDFTEXCOMSTR.py +++ b/test/TEX/PDFTEXCOMSTR.py @@ -1,4 +1,3 @@ - #!/usr/bin/env python # # __COPYRIGHT__ @@ -25,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test that the $PDFTEXCOMSTR construction variable allows you to configure the C compilation output. """ diff --git a/test/TEX/PDFTEXFLAGS.py b/test/TEX/PDFTEXFLAGS.py index 97b352e..c9fcdca 100644 --- a/test/TEX/PDFTEXFLAGS.py +++ b/test/TEX/PDFTEXFLAGS.py @@ -43,12 +43,11 @@ opt_string = '' for opt, arg in cmd_opts: opt_string = opt_string + ' ' + opt base_name = os.path.splitext(args[0])[0] -infile = open(args[0], 'r') -out_file = open(base_name+'.pdf', 'w') -out_file.write(opt_string + "\n") -for l in infile.readlines(): - if l[0] != '\\': - out_file.write(l) +with open(base_name+'.pdf', 'w') as ofp, open(args[0], 'r') as ifp: + ofp.write(opt_string + "\n") + for l in ifp.readlines(): + if l[0] != '\\': + ofp.write(l) sys.exit(0) """) diff --git a/test/TEX/PDF_single_source.py b/test/TEX/PDF_single_source.py index aefdd3e..cd11234 100644 --- a/test/TEX/PDF_single_source.py +++ b/test/TEX/PDF_single_source.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a mulitple pdf's from a list of PostScript files. Test courtesy Rob Managan. @@ -108,7 +108,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr diff --git a/test/TEX/TEX.py b/test/TEX/TEX.py index 7b20106..3964eb8 100644 --- a/test/TEX/TEX.py +++ b/test/TEX/TEX.py @@ -24,7 +24,7 @@ from __future__ import print_function __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the TEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. @@ -47,15 +47,16 @@ import os import getopt cmd_opts, arg = getopt.getopt(sys.argv[1:], 'i:r:', []) base_name = os.path.splitext(arg[0])[0] -infile = open(arg[0], 'r') -dvi_file = open(base_name+'.dvi', 'w') -aux_file = open(base_name+'.aux', 'w') -log_file = open(base_name+'.log', 'w') -for l in infile.readlines(): - if l[0] != '\\': - dvi_file.write(l) - aux_file.write(l) - log_file.write(l) +with open(arg[0], 'r') as ifp: + with open(base_name+'.dvi', 'w') as dvi_file, \ + open(base_name+'.aux', 'w') as aux_file, \ + open(base_name+'.log', 'w') as log_file: + + for l in ifp.readlines(): + if l[0] != '\\': + dvi_file.write(l) + aux_file.write(l) + log_file.write(l) sys.exit(0) """) diff --git a/test/TEX/TEXCOM.py b/test/TEX/TEXCOM.py index 9d820bc..10da59e 100644 --- a/test/TEX/TEXCOM.py +++ b/test/TEX/TEXCOM.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test the ability to configure the $TEXCOM construction variable. """ diff --git a/test/TEX/TEXCOMSTR.py b/test/TEX/TEXCOMSTR.py index 0facc6f..9dbba13 100644 --- a/test/TEX/TEXCOMSTR.py +++ b/test/TEX/TEXCOMSTR.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test that the $TEXCOMSTR construction variable allows you to configure the C compilation output. """ diff --git a/test/TEX/TEXFLAGS.py b/test/TEX/TEXFLAGS.py index 7b4fd15..287b537 100644 --- a/test/TEX/TEXFLAGS.py +++ b/test/TEX/TEXFLAGS.py @@ -43,12 +43,11 @@ opt_string = '' for opt, arg in cmd_opts: opt_string = opt_string + ' ' + opt base_name = os.path.splitext(args[0])[0] -infile = open(args[0], 'r') -out_file = open(base_name+'.dvi', 'w') -out_file.write(opt_string + "\n") -for l in infile.readlines(): - if l[0] != '\\': - out_file.write(l) +with open(base_name+'.dvi', 'w') as ofp, open(args[0], 'r') as ifp: + ofp.write(opt_string + "\n") + for l in ifp.readlines(): + if l[0] != '\\': + ofp.write(l) sys.exit(0) """) diff --git a/test/TEX/auxiliaries.py b/test/TEX/auxiliaries.py index 8d220c5..e28c212 100644 --- a/test/TEX/auxiliaries.py +++ b/test/TEX/auxiliaries.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that sections of LaTeX output that use auxiliary files (a bibliography in our configuration below) are consistent when re-run after modifying the input file. diff --git a/test/TEX/biber_biblatex.py b/test/TEX/biber_biblatex.py index b4a4969..6ee8121 100755 --- a/test/TEX/biber_biblatex.py +++ b/test/TEX/biber_biblatex.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document that uses the multibib oackage Test courtesy Rob Managan. diff --git a/test/TEX/biber_biblatex2.py b/test/TEX/biber_biblatex2.py index e9893ee..61fafcf 100644 --- a/test/TEX/biber_biblatex2.py +++ b/test/TEX/biber_biblatex2.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document that uses the biblatex package It uses the default backend, could be bibtex or biber. Require both be installed diff --git a/test/TEX/biblatex.py b/test/TEX/biblatex.py index 21e1a93..bb88aaa 100755 --- a/test/TEX/biblatex.py +++ b/test/TEX/biblatex.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document that uses the biblatex package Test courtesy Rob Managan. diff --git a/test/TEX/biblatex_plain.py b/test/TEX/biblatex_plain.py index 06b3cc6..5cad924 100644 --- a/test/TEX/biblatex_plain.py +++ b/test/TEX/biblatex_plain.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document that uses the biblatex package Test courtesy Rob Managan. diff --git a/test/TEX/bibliography.py b/test/TEX/bibliography.py index 9e79320..a8032db 100644 --- a/test/TEX/bibliography.py +++ b/test/TEX/bibliography.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \bibliography in TeX source files causes SCons to be aware of the necessary created bibliography files. @@ -48,7 +48,7 @@ have_latex = test.where_is('latex') if not have_latex: test.skip_test('Could not find latex; skipping test(s).\n') - + test.write('SConstruct', """\ import os env = Environment(tools = ['tex', 'latex', 'dvips']) diff --git a/test/TEX/bibtex-latex-rerun.py b/test/TEX/bibtex-latex-rerun.py index a2538f1..300f03b 100644 --- a/test/TEX/bibtex-latex-rerun.py +++ b/test/TEX/bibtex-latex-rerun.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we re-run LaTeX after running BibTeX in response to changes in a .bib file. diff --git a/test/TEX/clean.py b/test/TEX/clean.py index b0e5ee4..ad828d2 100644 --- a/test/TEX/clean.py +++ b/test/TEX/clean.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Check that all auxilary files created by LaTeX are properly cleaned by scons -c. """ diff --git a/test/TEX/configure.py b/test/TEX/configure.py index 60ebb9c..763f86f 100644 --- a/test/TEX/configure.py +++ b/test/TEX/configure.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify execution of custom test case. The old code base would not be able to fail the test """ diff --git a/test/TEX/dryrun.py b/test/TEX/dryrun.py index 308e167..4265791 100644 --- a/test/TEX/dryrun.py +++ b/test/TEX/dryrun.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the LATEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. diff --git a/test/TEX/eps_graphics.py b/test/TEX/eps_graphics.py index e0a8731..9e36148 100644 --- a/test/TEX/eps_graphics.py +++ b/test/TEX/eps_graphics.py @@ -24,8 +24,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" -Test creation of a Tex document with nested includes in a +r""" +Test creation of a Tex document with nested includes in a subdir that needs to create a fig.pdf. Test courtesy Rob Managan. @@ -115,7 +115,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -133,13 +133,13 @@ r"""\documentclass{report} \usepackage{epsfig,color} % for .tex version of figures if we go that way \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -150,7 +150,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are shown as well. +The Acknowledgements are shown as well. To get a hard copy of this report call me. diff --git a/test/TEX/eps_graphics2.py b/test/TEX/eps_graphics2.py index e523df7..19ea98b 100644 --- a/test/TEX/eps_graphics2.py +++ b/test/TEX/eps_graphics2.py @@ -24,8 +24,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" -Test creation of a Tex document with nested includes in a +r""" +Test creation of a Tex document with nested includes in a subdir that needs to create a fig.pdf. Test creation with pdflatex @@ -117,7 +117,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -135,13 +135,13 @@ r"""\documentclass{report} \usepackage{epsfig,color} % for .tex version of figures if we go that way \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -152,14 +152,14 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are shown as well. +The Acknowledgements are shown as well. To get a hard copy of this report call me. \begin{figure}[htbp] \begin{center} -\includegraphics - [width=.5\textwidth] +\includegraphics + [width=.5\textwidth] {Fig1} \caption{Zone and Node indexing} \label{fig1} diff --git a/test/TEX/generated_files.py b/test/TEX/generated_files.py index 0325154..9bafc9b 100644 --- a/test/TEX/generated_files.py +++ b/test/TEX/generated_files.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document with generated tex files This checks whether the .bbl file is kept as a side effect Test creation with pdflatex diff --git a/test/TEX/glossaries.py b/test/TEX/glossaries.py index 05ddf12..21180a0 100644 --- a/test/TEX/glossaries.py +++ b/test/TEX/glossaries.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \glossaries in TeX source files causes SCons to be aware of the necessary created glossary files. diff --git a/test/TEX/glossary.py b/test/TEX/glossary.py index be0a870..0becb40 100644 --- a/test/TEX/glossary.py +++ b/test/TEX/glossary.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \glossary in TeX source files causes SCons to be aware of the necessary created glossary files. diff --git a/test/TEX/input_docClass.py b/test/TEX/input_docClass.py index 3fa2b08..413cba5 100644 --- a/test/TEX/input_docClass.py +++ b/test/TEX/input_docClass.py @@ -24,9 +24,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a LaTeX document that uses \input{filename} -to set the documentclass. When the file has .tex we have to search +to set the documentclass. When the file has .tex we have to search to find the documentclass command. Test courtesy Rob Managan. @@ -53,13 +53,13 @@ r""" \input{theClass} \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -73,7 +73,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are shown as well. +The Acknowledgements are shown as well. \end{document} """) diff --git a/test/TEX/lstinputlisting.py b/test/TEX/lstinputlisting.py index fcfe5a8..1d60df7 100644 --- a/test/TEX/lstinputlisting.py +++ b/test/TEX/lstinputlisting.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we re-run LaTeX when a source file in \lstinputlisting changes. diff --git a/test/TEX/makeindex.py b/test/TEX/makeindex.py index 638224a..960ed68 100644 --- a/test/TEX/makeindex.py +++ b/test/TEX/makeindex.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \makeindex in TeX source files causes SCons to be aware of the necessary created index files. diff --git a/test/TEX/multi-line_include_options.py b/test/TEX/multi-line_include_options.py index 5266455..bb8a5f2 100644 --- a/test/TEX/multi-line_include_options.py +++ b/test/TEX/multi-line_include_options.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" When an inclusion's optional argument (enclosed in square brackets: []) spans multiple lines (via comment wrapping), ensure that the LaTeX Scanner doesn't throw an IndexError. diff --git a/test/TEX/multi-run.py b/test/TEX/multi-run.py index ff4e82a..9de0da4 100644 --- a/test/TEX/multi-run.py +++ b/test/TEX/multi-run.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that both .tex and .ltx files can handle a LaTeX-style bibliography (by calling $BIBTEX to generate a .bbl file) and correctly re-run to resolve undefined references. diff --git a/test/TEX/multibib.py b/test/TEX/multibib.py index cdb9b87..114ade6 100644 --- a/test/TEX/multibib.py +++ b/test/TEX/multibib.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a Tex document that uses the multibib oackage Test courtesy Rob Managan. diff --git a/test/TEX/multiple_include.py b/test/TEX/multiple_include.py index 0480d45..76a95e2 100644 --- a/test/TEX/multiple_include.py +++ b/test/TEX/multiple_include.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -116,7 +116,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -155,13 +155,13 @@ r"""\documentclass{report} \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -177,7 +177,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are shown as well. +The Acknowledgements are shown as well. \index{Getting the Report} diff --git a/test/TEX/multiple_include_subdir.py b/test/TEX/multiple_include_subdir.py index ade4713..589aa06 100644 --- a/test/TEX/multiple_include_subdir.py +++ b/test/TEX/multiple_include_subdir.py @@ -24,8 +24,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" -Test creation of a Tex document with nested includes in a +r""" +Test creation of a Tex document with nested includes in a subdir that needs to create a fig.pdf. Test courtesy Rob Managan. @@ -116,7 +116,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -155,13 +155,13 @@ r"""\documentclass{report} \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -177,7 +177,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are shown as well. +The Acknowledgements are shown as well. \index{Getting the Report} diff --git a/test/TEX/newglossary.py b/test/TEX/newglossary.py index 12c68a7..faae7d3 100644 --- a/test/TEX/newglossary.py +++ b/test/TEX/newglossary.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \newglossary in TeX source files causes SCons to be aware of the necessary created glossary files. @@ -72,7 +72,7 @@ test.write('newglossary.tex', r""" \newacronym{gnu}{GNU}{GNU's Not UNIX} \makeglossaries -\glstoctrue +\glstoctrue %\loadglsentries[\acronymtype]{chapters/acronyms} \loadglsentries[symbol]{symbols} %\loadglsentries[definition]{defns} @@ -97,7 +97,7 @@ a definition \gls{defPower} test.write('symbols.tex', r""" -\newglossaryentry{mel}{name={Microelectronic Fundamentals},description={\nopostdesc},sort=d} +\newglossaryentry{mel}{name={Microelectronic Fundamentals},description={\nopostdesc},sort=d} \newsym{dynPower}{P_{dyn}}{P}{Dynamic power consumption}{mel} %\newcommand{\newsym}[5]{\newglossaryentry{#1}{name=\ensuremath{#2},description={\symtab{#2}{#4}},parent={#5},sort={#3}}} diff --git a/test/TEX/nomencl.py b/test/TEX/nomencl.py index 1c121c0..7afb84b 100644 --- a/test/TEX/nomencl.py +++ b/test/TEX/nomencl.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of \nomencl in TeX source files causes SCons to be aware of the necessary created glossary files. @@ -65,7 +65,7 @@ test.write('nomencl.tex', r""" \begin{document} -A nomenclature entry \nomenclature{gnu}{an animal or software group} +A nomenclature entry \nomenclature{gnu}{an animal or software group} and another\nomenclature{nix}{not sure}. %handle old version of nomencl.sty diff --git a/test/TEX/recursive_scanner_dependencies_import.py b/test/TEX/recursive_scanner_dependencies_import.py index b31dfbe..c8c6569 100644 --- a/test/TEX/recursive_scanner_dependencies_import.py +++ b/test/TEX/recursive_scanner_dependencies_import.py @@ -24,14 +24,14 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -"""Verify that we re-run LaTeX after changing a nested \import. This +r""" +Verify that we re-run LaTeX after changing a nested \import. This checks that recursive implicit dependencies are found correctly. This is a separate test from the recursive_scanner_dependencies_input.py test because \input and \include are handled specially by the PDF builder, whereas \import dependencies are found only by the scanner. - """ import os diff --git a/test/TEX/recursive_scanner_dependencies_input.py b/test/TEX/recursive_scanner_dependencies_input.py index 257051e..5f37bf1 100644 --- a/test/TEX/recursive_scanner_dependencies_input.py +++ b/test/TEX/recursive_scanner_dependencies_input.py @@ -24,7 +24,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -"""Verify that we re-run LaTeX after changing a nested \input. This +r""" +Verify that we re-run LaTeX after changing a nested \input. This checks that recursive implicit dependencies are found correctly. """ diff --git a/test/TEX/rename_result.py b/test/TEX/rename_result.py index f061e26..b06d388 100644 --- a/test/TEX/rename_result.py +++ b/test/TEX/rename_result.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can rename the output from latex to the target name provided by the user. """ diff --git a/test/TEX/subdir-as-include.py b/test/TEX/subdir-as-include.py index 8b897ca..bb3f2e5 100755 --- a/test/TEX/subdir-as-include.py +++ b/test/TEX/subdir-as-include.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" This is an obscure test case. When 1) a file without a suffix is included in a TeX build and 2) there is a directory with the same name as that file, diff --git a/test/TEX/subdir-input.py b/test/TEX/subdir-input.py index 8c7febe..0d9311e 100644 --- a/test/TEX/subdir-input.py +++ b/test/TEX/subdir-input.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. diff --git a/test/TEX/subdir_variantdir_include.py b/test/TEX/subdir_variantdir_include.py index 7af3733..a7004b5 100644 --- a/test/TEX/subdir_variantdir_include.py +++ b/test/TEX/subdir_variantdir_include.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used diff --git a/test/TEX/subdir_variantdir_include2.py b/test/TEX/subdir_variantdir_include2.py index 4dbc4d2..5a0b49f 100644 --- a/test/TEX/subdir_variantdir_include2.py +++ b/test/TEX/subdir_variantdir_include2.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used @@ -73,8 +73,8 @@ Hi there. \end{document} """) -test.write(['docs','content','chapter.tex'], """\ -Sub-document 1 +test.write(['docs','content','chapter.tex'], +r"""Sub-document 1 \input{content/subchap} """) @@ -87,8 +87,8 @@ Sub-chapter 2 #test.run(arguments = '.') #test.run(arguments = '.', stderr=None, stdout=None) -# next line tests that side effect nodes get disambiguated -# and their directories created in a variantDir before +# next line tests that side effect nodes get disambiguated +# and their directories created in a variantDir before # the builder tries to populate them and fails test.run(arguments = 'build/main.pdf', stderr=None, stdout=None) diff --git a/test/TEX/subdir_variantdir_input.py b/test/TEX/subdir_variantdir_input.py index efc0692..c817c83 100644 --- a/test/TEX/subdir_variantdir_input.py +++ b/test/TEX/subdir_variantdir_input.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used diff --git a/test/TEX/synctex.py b/test/TEX/synctex.py index 867063a..f07db78 100644 --- a/test/TEX/synctex.py +++ b/test/TEX/synctex.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that use of -synctex command option causes SCons to be aware of the created synctex.gz file. diff --git a/test/TEX/usepackage.py b/test/TEX/usepackage.py index 637956a..0bb8c22 100644 --- a/test/TEX/usepackage.py +++ b/test/TEX/usepackage.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate that we can set the LATEX string to our own utility, that the produced .dvi, .aux and .log files get removed by the -c option, and that we can use this to wrap calls to the real latex utility. diff --git a/test/TEX/variant_dir.py b/test/TEX/variant_dir.py index 99c3523..d81f542 100644 --- a/test/TEX/variant_dir.py +++ b/test/TEX/variant_dir.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -122,7 +122,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -156,10 +156,10 @@ test.write(['docs', 'test.bib'], """\ %% http://bibdesk.sourceforge.net/ -%% Created for Rob Managan at 2006-11-15 12:53:16 -0800 +%% Created for Rob Managan at 2006-11-15 12:53:16 -0800 -%% Saved with string encoding Western (ASCII) +%% Saved with string encoding Western (ASCII) @@ -184,13 +184,13 @@ r"""\documentclass{report} \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -206,7 +206,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are show as well \cite{Managan:2006fk}. +The Acknowledgements are show as well \cite{Managan:2006fk}. \index{Getting the Report} diff --git a/test/TEX/variant_dir_bibunit.py b/test/TEX/variant_dir_bibunit.py index ce2c24e..cd3409e 100644 --- a/test/TEX/variant_dir_bibunit.py +++ b/test/TEX/variant_dir_bibunit.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a fully-featured TeX document (with bibunit driven bibliographies) in a variant_dir. diff --git a/test/TEX/variant_dir_dup0.py b/test/TEX/variant_dir_dup0.py index 25205f8..8f4334f 100644 --- a/test/TEX/variant_dir_dup0.py +++ b/test/TEX/variant_dir_dup0.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -129,7 +129,7 @@ $F2psBegin 0.06299 0.06299 sc % % Fig objects follow -% +% 7.500 slw % Ellipse n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr @@ -162,7 +162,7 @@ test.write(['docs', 'test.bib'], """\ %% This BibTeX bibliography file was created using BibDesk. %% http://bibdesk.sourceforge.net/ -%% Saved with string encoding Western (ASCII) +%% Saved with string encoding Western (ASCII) @techreport{AnAuthor:2006fk, Author = {A. N. Author}, @@ -185,13 +185,13 @@ r"""\documentclass{report} \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -207,7 +207,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are show as well \cite{AnAuthor:2006fk}. +The Acknowledgements are show as well \cite{AnAuthor:2006fk}. \index{Getting the Report} @@ -242,13 +242,13 @@ r"""\documentclass{report} \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -264,7 +264,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are show as well \cite{AnAuthor:2006fk}. +The Acknowledgements are show as well \cite{AnAuthor:2006fk}. \index{Getting the Report} diff --git a/test/TEX/variant_dir_newglossary.py b/test/TEX/variant_dir_newglossary.py index 5a28ed4..1e6ab43 100644 --- a/test/TEX/variant_dir_newglossary.py +++ b/test/TEX/variant_dir_newglossary.py @@ -24,9 +24,9 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Validate the use of \newglossary in TeX source files in conjunction -with variant_dir. +with variant_dir. Test configuration contributed by Kendrick Boyd. """ @@ -104,6 +104,6 @@ files = [ for f in files: test.must_exist(['build',f]) test.must_not_exist(['src',f]) - + test.pass_test() diff --git a/test/TEX/variant_dir_style_dup0.py b/test/TEX/variant_dir_style_dup0.py index 711086f..a9649b0 100644 --- a/test/TEX/variant_dir_style_dup0.py +++ b/test/TEX/variant_dir_style_dup0.py @@ -24,7 +24,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" -""" +r""" Test creation of a fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -117,13 +117,13 @@ r""" \makeindex \begin{document} - + \title{Report Title} \author{A. N. Author} - -\maketitle - + +\maketitle + \begin{abstract} there is no abstract \end{abstract} @@ -139,7 +139,7 @@ The introduction is short. \section{Acknowledgements} -The Acknowledgements are show as well \cite{AnAuthor:2006fk}. +The Acknowledgements are show as well \cite{AnAuthor:2006fk}. \index{Getting the Report} diff --git a/test/ToolSurrogate.py b/test/ToolSurrogate.py index 0d3c6e7..0674db1 100644 --- a/test/ToolSurrogate.py +++ b/test/ToolSurrogate.py @@ -68,10 +68,10 @@ class ToolSurrogate(object): def Cat(target, source, env): target = str(target[0]) - f = open(target, "wb") - for src in map(str, source): - f.write(open(src, "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in map(str, source): + with open(src, "rb") as ifp: + ofp.write(ifp.read()) ToolList = { 'posix' : [('cc', 'CCCOM', Cat), diff --git a/test/Touch.py b/test/Touch.py index 7c1817a..431cd6c 100644 --- a/test/Touch.py +++ b/test/Touch.py @@ -39,10 +39,10 @@ Execute(Touch('f1')) Execute(Touch(File('f1-File'))) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) Cat = Action(cat) env = Environment() env.Command('f2.out', 'f2.in', [Cat, Touch("f3")]) diff --git a/test/Value.py b/test/Value.py index 5a6a48e..c1f764a 100644 --- a/test/Value.py +++ b/test/Value.py @@ -63,7 +63,6 @@ def create_value (target, source, env): target[0].write(source[0].get_contents()) def create_value_file (target, source, env): - #open(str(target[0]), 'wb').write(source[0].read()) with open(str(target[0]), 'wb') as f: f.write(source[0].read()) diff --git a/test/Variables/Variables.py b/test/Variables/Variables.py index 0fe3745..09a17d5 100644 --- a/test/Variables/Variables.py +++ b/test/Variables/Variables.py @@ -231,7 +231,9 @@ opts.Save('variables.saved', env) def checkSave(file, expected): gdict = {} ldict = {} - exec(open(file, 'r').read(), gdict, ldict) + with open(file, 'r') as f: + contents = f.read() + exec(contents, gdict, ldict) assert expected == ldict, "%s\n...not equal to...\n%s" % (expected, ldict) # First test with no command line variables diff --git a/test/Variables/chdir.py b/test/Variables/chdir.py index b5fce2a..bdf390d 100644 --- a/test/Variables/chdir.py +++ b/test/Variables/chdir.py @@ -52,7 +52,9 @@ print("VARIABLE = "+repr(env['VARIABLE'])) test.write(['bin', 'opts.cfg'], """\ import os os.chdir(os.path.split(__name__)[0]) -exec(open('opts2.cfg', 'r').read()) +with open('opts2.cfg', 'r') as f: + contents = f.read() +exec(contents) """) test.write(['bin', 'opts2.cfg'], """\ diff --git a/test/VariantDir/Clean.py b/test/VariantDir/Clean.py index 1287034..2e0d4c6 100644 --- a/test/VariantDir/Clean.py +++ b/test/VariantDir/Clean.py @@ -43,8 +43,10 @@ VariantDir('build1', '.', duplicate=1) def build_sample(target, source, env): targetdir = str(target[0].dir) target = str(target[0]) - open(target, 'w').write(open(str(source[0]), 'r').read()) - open(targetdir+'/sample.junk', 'w').write('Side effect!\\n') + with open(target, 'w') as ofd, open(str(source[0]), 'r') as ifd: + ofd.write(ifd.read()) + with open(targetdir+'/sample.junk', 'w') as f: + f.write('Side effect!\\n') t0 = Command("build0/sample.out", "sample.in", build_sample) t1 = Command("build1/sample.out", "sample.in", build_sample) diff --git a/test/VariantDir/SConscript-variant_dir.py b/test/VariantDir/SConscript-variant_dir.py index 068c312..1e28c47 100644 --- a/test/VariantDir/SConscript-variant_dir.py +++ b/test/VariantDir/SConscript-variant_dir.py @@ -59,10 +59,10 @@ var9 = Dir('../build/var9') def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}, BUILD='build') @@ -94,7 +94,7 @@ env.SConscript('src/SConscript', variant_dir='../$BUILD/var8', duplicate=0) # VariantDir('build/var9', '.') # SConscript('build/var9/src/SConscript') SConscript('src/SConscript', variant_dir='build/var9', src_dir='.') -""") +""") test.subdir(['test', 'src'], ['test', 'alt']) @@ -154,12 +154,12 @@ for file in ['aaa.in', 'bbb.in', 'ccc.in']: test.must_exist(test.workpath('test', 'build', 'var2', file)) test.fail_test(not equal_stats(test.workpath('test', 'build', 'var2', file), test.workpath('test', 'src', file))) - + # Make sure we didn't duplicate the source files in build/var3. test.must_not_exist(test.workpath('test', 'build', 'var3', 'aaa.in')) test.must_not_exist(test.workpath('test', 'build', 'var3', 'bbb.in')) test.must_not_exist(test.workpath('test', 'build', 'var3', 'ccc.in')) - + #XXX We can't support var4 and var5 yet, because our VariantDir linkage #XXX is to an entire source directory. We haven't yet generalized our #XXX infrastructure to be able to take the SConscript file from one source @@ -186,12 +186,12 @@ for file in ['aaa.in', 'bbb.in', 'ccc.in']: test.must_exist(test.workpath('build', 'var6', file)) test.fail_test(not equal_stats(test.workpath('build', 'var6', file), test.workpath('test', 'src', file))) - + # Make sure we didn't duplicate the source files in build/var7. test.must_not_exist(test.workpath('build', 'var7', 'aaa.in')) test.must_not_exist(test.workpath('build', 'var7', 'bbb.in')) test.must_not_exist(test.workpath('build', 'var7', 'ccc.in')) - + # Make sure we didn't duplicate the source files in build/var8. test.must_not_exist(test.workpath('build', 'var8', 'aaa.in')) test.must_not_exist(test.workpath('build', 'var8', 'bbb.in')) diff --git a/test/WhereIs.py b/test/WhereIs.py index c765848..bb7ac40 100644 --- a/test/WhereIs.py +++ b/test/WhereIs.py @@ -31,7 +31,7 @@ import TestSCons test = TestSCons.TestSCons() -subdir_SConscript = os.path.join('subdir', 'SConscript') +subdir_SConscript = os.path.join('subdir/SConscript') sub1_xxx_exe = test.workpath('sub1', 'xxx.exe') sub2_xxx_exe = test.workpath('sub2', 'xxx.exe') sub3_xxx_exe = test.workpath('sub3', 'xxx.exe') diff --git a/test/Win32/bad-drive.py b/test/Win32/bad-drive.py index 80a36c8..424732d 100644 --- a/test/Win32/bad-drive.py +++ b/test/Win32/bad-drive.py @@ -60,10 +60,10 @@ def cat(env, source, target): target = str(target[0]) source = list(map(str, source)) print('cat(%%s) > %%s' %% (source, target)) - f = open(target, "wb") - for src in source: - f.write(open(src, "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(src, "rb") as ifp: + ofp.write(ifp.read()) bad_drive = '%s' env = Environment(BUILDERS={'Build':Builder(action=cat)}) diff --git a/test/Win32/default-drive.py b/test/Win32/default-drive.py index 31253e4..78db4be 100644 --- a/test/Win32/default-drive.py +++ b/test/Win32/default-drive.py @@ -47,10 +47,10 @@ test.subdir('src') test.write(['src', 'SConstruct'], """ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as ofp: + for src in source: + with open(str(src), "rb") as ifp: + ofp.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('../build/file.out', 'file.in') diff --git a/test/YACC/YACC-fixture/myyacc.py b/test/YACC/YACC-fixture/myyacc.py index 756c98f..d0ab95e 100644 --- a/test/YACC/YACC-fixture/myyacc.py +++ b/test/YACC/YACC-fixture/myyacc.py @@ -1,13 +1,13 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'o:', []) -output = None opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') + if opt == '-o': out = arg else: opt_string = opt_string + ' ' + opt -for a in args: - contents = open(a, 'r').read() - output.write(contents.replace('YACC', 'myyacc.py')) -output.close() +with open(out, 'w') as ofp: + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + ofp.write(contents.replace('YACC', 'myyacc.py')) sys.exit(0) diff --git a/test/YACC/YACCFLAGS-fixture/myyacc.py b/test/YACC/YACCFLAGS-fixture/myyacc.py index ffd9031..43024f1 100644 --- a/test/YACC/YACCFLAGS-fixture/myyacc.py +++ b/test/YACC/YACCFLAGS-fixture/myyacc.py @@ -1,17 +1,17 @@ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'o:I:x', []) -output = None opt_string = '' i_arguments = '' for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'wb') + if opt == '-o': out = arg elif opt == '-I': i_arguments = i_arguments + ' ' + arg else: opt_string = opt_string + ' ' + opt -for a in args: - contents = open(a, 'rb').read() - contents = contents.replace(b'YACCFLAGS', opt_string.encode()) - contents = contents.replace(b'I_ARGS', i_arguments.encode()) - output.write(contents) -output.close() +with open(out, 'wb') as ofp: + for a in args: + with open(a, 'rb') as ifp: + contents = ifp.read() + contents = contents.replace(b'YACCFLAGS', opt_string.encode()) + contents = contents.replace(b'I_ARGS', i_arguments.encode()) + ofp.write(contents) sys.exit(0) diff --git a/test/YACC/YACCHFILESUFFIX.py b/test/YACC/YACCHFILESUFFIX.py index f205473..6c34db1 100644 --- a/test/YACC/YACCHFILESUFFIX.py +++ b/test/YACC/YACCHFILESUFFIX.py @@ -46,12 +46,13 @@ for o, a in opts: if o == '-o': outfile = open(a, 'wb') for f in args: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: - outfile.write(l) + with open(f, 'rb') as infile: + for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: + outfile.write(l) outfile.close() base, ext = os.path.splitext(args[0]) -open(base+'.hsuffix', 'wb').write((" ".join(sys.argv)+'\\n').encode()) +with open(base+'.hsuffix', 'wb') as outfile: + outfile.write((" ".join(sys.argv) + '\\n').encode()) sys.exit(0) """) diff --git a/test/YACC/YACCHXXFILESUFFIX.py b/test/YACC/YACCHXXFILESUFFIX.py index 6418189..63a5358 100644 --- a/test/YACC/YACCHXXFILESUFFIX.py +++ b/test/YACC/YACCHXXFILESUFFIX.py @@ -46,12 +46,13 @@ for o, a in opts: if o == '-o': outfile = open(a, 'wb') for f in args: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: - outfile.write(l) + with open(f, 'rb') as infile: + for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: + outfile.write(l) outfile.close() base, ext = os.path.splitext(args[0]) -open(base+'.hxxsuffix', 'wb').write((" ".join(sys.argv)+'\\n').encode()) +with open(base+'.hxxsuffix', 'wb') as outfile: + outfile.write((" ".join(sys.argv)+'\\n').encode()) sys.exit(0) """) diff --git a/test/YACC/YACCVCGFILESUFFIX.py b/test/YACC/YACCVCGFILESUFFIX.py index 5306076..aee3265 100644 --- a/test/YACC/YACCVCGFILESUFFIX.py +++ b/test/YACC/YACCVCGFILESUFFIX.py @@ -48,13 +48,14 @@ for o, a in opts: elif o == '-o': outfile = open(a, 'wb') for f in args: - infile = open(f, 'rb') - for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: - outfile.write(l) + with open(f, 'rb') as infile: + for l in [l for l in infile.readlines() if l != b'/*yacc*/\\n']: + outfile.write(l) outfile.close() if vcg: base, ext = os.path.splitext(args[0]) - open(base+'.vcgsuffix', 'wb').write((" ".join(sys.argv)+'\\n').encode()) + with open(base+'.vcgsuffix', 'wb') as outfile: + outfile.write((" ".join(sys.argv)+'\\n').encode()) sys.exit(0) """) diff --git a/test/builderrors.py b/test/builderrors.py index a3e2f4d..f5cbccf 100644 --- a/test/builderrors.py +++ b/test/builderrors.py @@ -38,10 +38,8 @@ test.write('build.py', r""" import sys exitval = int(sys.argv[1]) if exitval == 0: - contents = open(sys.argv[3], 'r').read() - file = open(sys.argv[2], 'w') - file.write(contents) - file.close() + with open(sys.argv[2], 'w') as f, open(sys.argv[3], 'r') as infp: + f.write(infp.read()) sys.exit(exitval) """) @@ -198,8 +196,8 @@ env = Environment() env.Default("all") env.Alias("all", env.Install("dir", "file.txt")) """) -test.run(status=2, match=TestSCons.match_re, stderr="""\ -scons: \*\*\* Do not know how to make File target `all' \(.*all\). Stop. +test.run(status=2, match=TestSCons.match_re, stderr=\ +r"""scons: \*\*\* Do not know how to make File target `all' \(.*all\). Stop. """) # No tests failed; OK. diff --git a/test/chdir.py b/test/chdir.py index c4d392e..696488b 100644 --- a/test/chdir.py +++ b/test/chdir.py @@ -91,11 +91,10 @@ other9_f19_in = test.workpath('other9', 'f19.in') test.write(cat_py, """\ import sys -ofp = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - ifp = open(f, 'rb') - ofp.write(ifp.read()) -ofp.close +with open(sys.argv[1], 'wb') as ofp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + ofp.write(ifp.read()) """) test.write(['work1', 'SConstruct'], """ diff --git a/test/duplicate-sources.py b/test/duplicate-sources.py index 03b5686..3ad2928 100644 --- a/test/duplicate-sources.py +++ b/test/duplicate-sources.py @@ -35,10 +35,10 @@ test = TestSCons.TestSCons() test.write('SConstruct', """\ def cat(target, source, env): - t = open(str(target[0]), 'wb') - for s in source: - t.write(open(str(s), 'rb').read()) - t.close() + with open(str(target[0]), 'wb') as t: + for s in source: + with open(str(s), 'rb') as s: + t.write(s.read()) env = Environment(BUILDERS = {'Cat' : Builder(action = cat)}) env.Cat('out.txt', ['f1.in', 'f2.in', 'f1.in']) """) diff --git a/test/emitter.py b/test/emitter.py index 78de13e..7712d3a 100644 --- a/test/emitter.py +++ b/test/emitter.py @@ -42,7 +42,8 @@ SConscript('var2/SConscript') test.write('src/SConscript',""" def build(target, source, env): for t in target: - open(str(t), "wt").write(str(t)) + with open(str(t), "wt") as f: + f.write(str(t)) def emitter(target, source, env): target.append(str(target[0])+".foo") diff --git a/test/explain/basic.py b/test/explain/basic.py index 99942cd..160d632 100644 --- a/test/explain/basic.py +++ b/test/explain/basic.py @@ -67,13 +67,15 @@ def process(outfp, infp): print("os.getcwd() =", os.getcwd()) raise process(outfp, fp) + fp.close() else: outfp.write(line) -outfp = open(sys.argv[1], 'w') -for f in sys.argv[2:]: - if f != '-': - process(outfp, open(f, 'r')) +with open(sys.argv[1], 'w') as ofp: + for f in sys.argv[2:]: + if f != '-': + with open(f, 'r') as ifp: + process(ofp, ifp) sys.exit(0) """) diff --git a/test/explain/save-info.py b/test/explain/save-info.py index 08255e0..383822c 100644 --- a/test/explain/save-info.py +++ b/test/explain/save-info.py @@ -57,13 +57,15 @@ def process(outfp, infp): print("os.getcwd() =", os.getcwd()) raise process(outfp, fp) + fp.close() else: outfp.write(line) -outfp = open(sys.argv[1], 'w') -for f in sys.argv[2:]: - if f != '-': - process(outfp, open(f, 'r')) +with open(sys.argv[1], 'w') as ofp: + for f in sys.argv[2:]: + if f != '-': + with open(f, 'r') as ifp: + process(ofp, ifp) sys.exit(0) """) diff --git a/test/fixture/mycompile.py b/test/fixture/mycompile.py index 313e4b5..275f7be 100644 --- a/test/fixture/mycompile.py +++ b/test/fixture/mycompile.py @@ -9,10 +9,10 @@ has made a modification. import sys if __name__ == '__main__': - line = '/*' + sys.argv[1] + '*/\n' - with open(sys.argv[2], 'w') as ofp: + line = ('/*' + sys.argv[1] + '*/\n').encode() + with open(sys.argv[2], 'wb') as ofp: for f in sys.argv[3:]: - with open(f, 'r') as ifp: + with open(f, 'rb') as ifp: lines = [l for l in ifp.readlines() if l != line] for l in lines: ofp.write(l) diff --git a/test/fixture/mylink.py b/test/fixture/mylink.py index 5006f22..b567118 100644 --- a/test/fixture/mylink.py +++ b/test/fixture/mylink.py @@ -22,9 +22,9 @@ if __name__ == '__main__': break args = args[1:] if a[:5].lower() == '/out:': out = a[5:] - with open(args[0], 'r') as ifp, open(out, 'w') as ofp: + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: for l in ifp.readlines(): - if not l.startswith('#link'): + if not l.startswith(b'#link'): ofp.write(l) sys.exit(0) else: @@ -32,8 +32,8 @@ if __name__ == '__main__': opts, args = getopt.getopt(sys.argv[1:], 'o:') for opt, arg in opts: if opt == '-o': out = arg - with open(args[0], 'r') as ifp, open(out, 'w') as ofp: + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: for l in ifp.readlines(): - if not l.startswith('#link'): + if not l.startswith(b'#link'): ofp.write(l) sys.exit(0) diff --git a/test/fixture/myrewrite.py b/test/fixture/myrewrite.py index bd90a68..95272b6 100644 --- a/test/fixture/myrewrite.py +++ b/test/fixture/myrewrite.py @@ -8,9 +8,10 @@ ranlib-related behavior without invoking ranlib. import sys if __name__ == '__main__': - line = ('/*' + sys.argv[1] + '*/\n') - with open(sys.argv[2], 'w') as ofp, open(sys.argv[2], 'r') as ifp: + line = ('/*' + sys.argv[1] + '*/\n').encode() + with open(sys.argv[2], 'rb') as ifp: lines = [l for l in ifp.readlines() if l != line] + with open(sys.argv[2], 'wb') as ofp: for l in lines: ofp.write(l) sys.exit(0) diff --git a/test/fixture/wrapper.py b/test/fixture/wrapper.py index 8791390..a023689 100644 --- a/test/fixture/wrapper.py +++ b/test/fixture/wrapper.py @@ -5,6 +5,6 @@ import subprocess if __name__ == '__main__': path = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'wrapper.out') if '--version' not in sys.argv and '-dumpversion' not in sys.argv: - with open(path, 'w') as f: - f.write("wrapper.py\n") + with open(path, 'wb') as f: + f.write(b"wrapper.py\n") subprocess.call(sys.argv[1:]) diff --git a/test/gnutools.py b/test/gnutools.py index 65d699b..bd8e366 100644 --- a/test/gnutools.py +++ b/test/gnutools.py @@ -46,16 +46,16 @@ test.write(['gnutools','mygcc.py'], """ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) -output = None +out = None opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') + if opt == '-o': out = arg else: opt_string = opt_string + ' ' + opt + arg -output.write('gcc ' + opt_string + '\\n') -for a in args: - contents = open(a, 'r').read() - output.write(contents) -output.close() +with open(out, 'w') as ofp: + ofp.write('gcc ' + opt_string + '\\n') + for a in args: + with open(a, 'r') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) @@ -63,16 +63,16 @@ test.write(['gnutools','myg++.py'], """ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) -output = None +out = None opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') + if opt == '-o': out = arg else: opt_string = opt_string + ' ' + opt + arg -output.write('g++ ' + opt_string + '\\n') -for a in args: - contents = open(a, 'r').read() - output.write(contents) -output.close() +with open(out, 'w') as ofp: + ofp.write('g++ ' + opt_string + '\\n') + for a in args: + with open(a, 'r') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) diff --git a/test/ignore-command.py b/test/ignore-command.py index 9fd24ab..d5c18a5 100644 --- a/test/ignore-command.py +++ b/test/ignore-command.py @@ -40,10 +40,10 @@ test.subdir('build', 'src') test.write('build.py', r""" import sys -fp = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - fp.write(open(f, 'rb').read()) -fp.close() +with open(sys.argv[1], 'wb') as fp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + fp.write(ifp.read()) sys.exit(1) """) diff --git a/test/implicit/IMPLICIT_COMMAND_DEPENDENCIES.py b/test/implicit/IMPLICIT_COMMAND_DEPENDENCIES.py index 3d05fe3..2431a61 100644 --- a/test/implicit/IMPLICIT_COMMAND_DEPENDENCIES.py +++ b/test/implicit/IMPLICIT_COMMAND_DEPENDENCIES.py @@ -45,16 +45,17 @@ generate_build_py_py_contents = """\ import os import sys -open(sys.argv[1], 'w').write('''\ +with open(sys.argv[1], 'w') as f: + f.write('''\ #!/usr/bin/env %(python)s import os import sys -fp = open(sys.argv[1], 'w') -args = [os.path.split(sys.argv[0])[1]] + sys.argv[1:] -fp.write(" ".join(args) + '\\\\n' + '%(extra)s') -for infile in sys.argv[2:]: - fp.write(open(infile, 'r').read()) -fp.close() +with open(sys.argv[1], 'w') as fp: + args = [os.path.split(sys.argv[0])[1]] + sys.argv[1:] + fp.write(" ".join(args) + '\\\\n' + '%(extra)s') + for infile in sys.argv[2:]: + with open(infile, 'r') as ifp: + fp.write(ifp.read()) ''') os.chmod(sys.argv[1], 0o755) diff --git a/test/implicit/asynchronous-modification.py b/test/implicit/asynchronous-modification.py index 90a6392..1a409ae 100644 --- a/test/implicit/asynchronous-modification.py +++ b/test/implicit/asynchronous-modification.py @@ -55,8 +55,10 @@ test.write(['hdr.h'], """\ """) test.write(['mod.py'], """\ -open('mod', 'w').write(open('mod.py', 'r').read()) -open('hdr.h', 'w').write("/* modified */\\n") +with open('mod', 'w') as f, open('mod.py', 'r') as ifp: + f.write(ifp.read()) +with open('hdr.h', 'w') as f: + f.write("/* modified */\\n") """) test.write(['one.c'], """\ diff --git a/test/implicit/changed-node.py b/test/implicit/changed-node.py index 8b818ba..c8c5a01 100644 --- a/test/implicit/changed-node.py +++ b/test/implicit/changed-node.py @@ -46,14 +46,13 @@ SetOption('max_drift', 1) def lister(target, source, env): import os - fp = open(str(target[0]), 'w') - s = str(source[0]) - if os.path.isdir(s): - for l in os.listdir(str(source[0])): - fp.write(l + '\\n') - else: - fp.write(s + '\\n') - fp.close() + with open(str(target[0]), 'w') as ofp: + s = str(source[0]) + if os.path.isdir(s): + for l in os.listdir(str(source[0])): + ofp.write(l + '\\n') + else: + ofp.write(s + '\\n') builder = Builder(action=lister, source_factory=Dir, @@ -83,14 +82,13 @@ SetOption('max_drift', 1) def lister(target, source, env): import os.path - fp = open(str(target[0]), 'w') - s = str(source[0]) - if os.path.isdir(s): - for l in os.listdir(str(source[0])): - fp.write(l + '\\n') - else: - fp.write(s + '\\n') - fp.close() + with open(str(target[0]), 'w') as ofp: + s = str(source[0]) + if os.path.isdir(s): + for l in os.listdir(str(source[0])): + ofp.write(l + '\\n') + else: + ofp.write(s + '\\n') builder = Builder(action=lister, source_factory=File) @@ -111,12 +109,12 @@ test.pass_test() # # #def setfile(f, content): -# f = open(f, 'w') -# try: f.write(content) -# finally: f.close() +# with open(f, 'w') as ofp: +# ofp.write(content) # #def checkfile(f, content): -# assert open(f).read().strip() == content +# with open(f) as fp: +# assert fp.read().strip() == content # #def rm(f): # if exists(f): diff --git a/test/long-lines/signature.py b/test/long-lines/signature.py index 64214b4..082a13b 100644 --- a/test/long-lines/signature.py +++ b/test/long-lines/signature.py @@ -42,14 +42,14 @@ test.write(build_py, """\ #!%(_python_)s import sys if sys.argv[1][0] == '@': - args = open(sys.argv[1][1:], 'r').read() - args = args.split() + with open(sys.argv[1][1:], 'r') as f: + args = f.read().split() else: args = sys.argv[1:] -fp = open(args[0], 'w') -fp.write(open(args[1], 'r').read()) -fp.write('FILEFLAG=%%s\\n' %% args[2]) -fp.write('TIMESTAMP=%%s\\n' %% args[3]) +with open(args[0], 'w') as fp, open(args[1], 'r') as ifp: + fp.write(ifp.read()) + fp.write('FILEFLAG=%%s\\n' %% args[2]) + fp.write('TIMESTAMP=%%s\\n' %% args[3]) """ % locals()) os.chmod(build_py, 0o755) diff --git a/test/multiline.py b/test/multiline.py index 4537eae..c2fabf8 100644 --- a/test/multiline.py +++ b/test/multiline.py @@ -35,10 +35,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) sys.exit(0) """) diff --git a/test/no-arguments.py b/test/no-arguments.py index 953d827..8925c48 100644 --- a/test/no-arguments.py +++ b/test/no-arguments.py @@ -41,10 +41,10 @@ def cat(env, source, target): target = str(target[0]) source = list(map(str, source)) print('cat(%s) > %s' % (source, target)) - f = open(target, "wb") - for src in source: - f.write(open(src, "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(src, "rb") as ifp: + f.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('aaa.out', 'aaa.in') diff --git a/test/no-target.py b/test/no-target.py index bce5632..bf5b94a 100644 --- a/test/no-target.py +++ b/test/no-target.py @@ -42,10 +42,10 @@ SConscript(r'%s') test.write(subdir_SConscript, r""" def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) b = Builder(action=cat, suffix='.out', src_suffix='.in') env = Environment(BUILDERS={'Build':b}) diff --git a/test/option--max-drift.py b/test/option--max-drift.py index 4e063c9..b90ecdf 100644 --- a/test/option--max-drift.py +++ b/test/option--max-drift.py @@ -34,10 +34,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/option--random.py b/test/option--random.py index 357cf2e..2944ad8 100644 --- a/test/option--random.py +++ b/test/option--random.py @@ -38,10 +38,10 @@ test = TestSCons.TestSCons() test.write('SConscript', """\ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) env = Environment(BUILDERS={'Cat':Builder(action=cat)}) env.Cat('aaa.out', 'aaa.in') env.Cat('bbb.out', 'bbb.in') diff --git a/test/option-n.py b/test/option-n.py index 0fd7bfe..f952428 100644 --- a/test/option-n.py +++ b/test/option-n.py @@ -52,9 +52,8 @@ test.subdir('build', 'src') test.write('build.py', r""" import sys -file = open(sys.argv[1], 'w') -file.write("build.py: %s\n" % sys.argv[1]) -file.close() +with open(sys.argv[1], 'w') as ofp: + ofp.write("build.py: %s\n" % sys.argv[1]) """) test.write('SConstruct', """ diff --git a/test/option/debug-count.py b/test/option/debug-count.py index 2b5b745..0234bfa 100644 --- a/test/option/debug-count.py +++ b/test/option/debug-count.py @@ -46,7 +46,8 @@ except ImportError: test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as infp: + f.write(infp.read()) env = Environment(BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) @@ -57,7 +58,7 @@ test.write('file.in', "file.in\n") # show up in the output. def find_object_count(s, stdout): - re_string = '\d+ +\d+ %s' % re.escape(s) + re_string = r'\d+ +\d+ %s' % re.escape(s) return re.search(re_string, stdout) objects = [ diff --git a/test/option/debug-findlibs.py b/test/option/debug-findlibs.py index 78ecee9..8d9974c 100644 --- a/test/option/debug-findlibs.py +++ b/test/option/debug-findlibs.py @@ -34,11 +34,10 @@ test.subdir('sub1', 'sub2') test.write('cat.py', """\ import sys -ofp = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - ifp = open(f, 'rb') - ofp.write(ifp.read()) -ofp.close() +with open(sys.argv[1], 'wb') as ofp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + ofp.write(ifp.read()) """) test.write('SConstruct', """\ diff --git a/test/option/debug-memoizer.py b/test/option/debug-memoizer.py index f65bcb8..01af561 100644 --- a/test/option/debug-memoizer.py +++ b/test/option/debug-memoizer.py @@ -38,7 +38,8 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as infp: + f.write(infp.read()) env = Environment(tools=[], BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) diff --git a/test/option/debug-memory.py b/test/option/debug-memory.py index 6d395d6..bf720cc 100644 --- a/test/option/debug-memory.py +++ b/test/option/debug-memory.py @@ -49,7 +49,8 @@ except ImportError: test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as ifp: + f.write(ifp.read()) env = Environment(tools=[], BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) diff --git a/test/option/debug-multiple.py b/test/option/debug-multiple.py index 23af13b..020aa85 100644 --- a/test/option/debug-multiple.py +++ b/test/option/debug-multiple.py @@ -38,7 +38,8 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as infp: + f.write(infp.read()) env = Environment(BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) @@ -49,7 +50,7 @@ test.write('file.in', "file.in\n") # show up in the output. def find_object_count(s, stdout): - re_string = '\d+ +\d+ %s' % re.escape(s) + re_string = r'\d+ +\d+ %s' % re.escape(s) return re.search(re_string, stdout) objects = [ diff --git a/test/option/debug-objects.py b/test/option/debug-objects.py index e86684a..beec4b7 100644 --- a/test/option/debug-objects.py +++ b/test/option/debug-objects.py @@ -43,7 +43,8 @@ except ImportError: test.write('SConstruct', """ DefaultEnvironment(tools=[]) def cat(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as infp: + f.write(infp.read()) env = Environment(tools=[], BUILDERS={'Cat':Builder(action=Action(cat))}) env.Cat('file.out', 'file.in') """) diff --git a/test/option/debug-presub.py b/test/option/debug-presub.py index 0b0555a..cbd5242 100644 --- a/test/option/debug-presub.py +++ b/test/option/debug-presub.py @@ -32,7 +32,8 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -open(sys.argv[2], "wb").write(open(sys.argv[1], "rb").read()) +with open(sys.argv[2], "wb") as f, open(sys.argv[1], "rb") as infp: + f.write(infp.read()) sys.exit(0) """) @@ -40,10 +41,10 @@ test.write('SConstruct', """\ DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as infp: + f.write(infp.read()) FILE = Builder(action="$FILECOM") TEMP = Builder(action="$TEMPCOM") LIST = Builder(action="$LISTCOM") diff --git a/test/option/debug-time.py b/test/option/debug-time.py index 987e49f..3ed7555 100644 --- a/test/option/debug-time.py +++ b/test/option/debug-time.py @@ -36,10 +36,10 @@ test.write('sleep_cat.py', """\ import sys import time time.sleep(int(sys.argv[1])) -fp = open(sys.argv[2], 'wb') -for arg in sys.argv[3:]: - fp.write(open(arg, 'rb').read()) -fp.close() +with open(sys.argv[2], 'wb') as fp: + for arg in sys.argv[3:]: + with open(arg, 'rb') as infp: + fp.write(infp.read()) sys.exit(0) """) diff --git a/test/option/md5-chunksize.py b/test/option/md5-chunksize.py index 708143f..4f1d495 100644 --- a/test/option/md5-chunksize.py +++ b/test/option/md5-chunksize.py @@ -32,10 +32,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as infp: + f.write(infp.read()) """) test.write('SConstruct', """ @@ -107,9 +105,8 @@ DefaultEnvironment(tools=[]) import os def get_stat(target, source, env): stat = os.stat(source[0].get_abspath()) - dest = open(target[0].get_abspath(),'w') - dest.write(str(stat)) - dest.close() + with open(target[0].get_abspath(),'w') as dest: + dest.write(str(stat)) env = Environment(tools=[]) env.Command('test.big', 'SConstruct', 'dd if=/dev/zero of=test.big seek=100 bs=1M count=0 2>/dev/null') env.AlwaysBuild('test.big') diff --git a/test/option/stack-size.py b/test/option/stack-size.py index febec5a..53faa9e 100644 --- a/test/option/stack-size.py +++ b/test/option/stack-size.py @@ -41,10 +41,8 @@ test.subdir('work1', 'work2') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as infp: + f.write(infp.read()) """) diff --git a/test/option/warn-duplicate-environment.py b/test/option/warn-duplicate-environment.py index 1509e41..1000647 100644 --- a/test/option/warn-duplicate-environment.py +++ b/test/option/warn-duplicate-environment.py @@ -36,9 +36,10 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', """ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) WARN = ARGUMENTS.get('WARN') if WARN: diff --git a/test/option/warn-misleading-keywords.py b/test/option/warn-misleading-keywords.py index ca934e5..45236bb 100644 --- a/test/option/warn-misleading-keywords.py +++ b/test/option/warn-misleading-keywords.py @@ -36,9 +36,10 @@ test = TestSCons.TestSCons(match = TestSCons.match_re_dotall) test.write('SConstruct', """ DefaultEnvironment(tools=[]) def build(env, target, source): - file = open(str(target[0]), 'wb') - for s in source: - file.write(open(str(s), 'rb').read()) + with open(str(target[0]), 'wb') as f: + for s in source: + with open(str(s), 'rb') as infp: + f.write(infp.read()) WARN = ARGUMENTS.get('WARN') if WARN: diff --git a/test/overrides.py b/test/overrides.py index cca8dc7..54a174b 100644 --- a/test/overrides.py +++ b/test/overrides.py @@ -77,11 +77,13 @@ env.Program('hello', 'hello.c', test.write('hello.c',"this ain't no c file!\n") test.write('mycc.py',""" -open('hello.not_obj', 'w').write('this is no object file!') +with open('hello.not_obj', 'w') as f: + f.write('this is no object file!') """) test.write('mylink.py',""" -open('hello.not_exe', 'w').write('this is not a program!') +with open('hello.not_exe', 'w') as f: + f.write('this is not a program!') """) test.run(arguments='hello.not_exe') @@ -107,11 +109,13 @@ env.Program('goodbye', 'goodbye.c', test.write('goodbye.c',"this ain't no c file!\n") test.write('mycc.py',""" -open('goodbye.not_obj', 'wt').write('this is no object file!') +with open('goodbye.not_obj', 'wt') as f: + f.write('this is no object file!') """) test.write('mylink.py',""" -open('goodbye.not_exe', 'wt').write('this is not a program!') +with open('goodbye.not_exe', 'wt') as f: + f.write('this is not a program!') """) test.run(arguments='goodbye.not_exe', stderr=None) diff --git a/test/packaging/convenience-functions/convenience-functions.py b/test/packaging/convenience-functions/convenience-functions.py index a1be041..fb9acb3 100644 --- a/test/packaging/convenience-functions/convenience-functions.py +++ b/test/packaging/convenience-functions/convenience-functions.py @@ -33,7 +33,7 @@ import TestSCons test = TestSCons.TestSCons() -test.dir_fixture( "image" ) +test.dir_fixture("image") bin_f1 = os.path.join('bin', 'f1') bin_f2 = os.path.join('bin', 'f2') diff --git a/test/packaging/ipkg.py b/test/packaging/ipkg.py index 08889a9..99c31e5 100644 --- a/test/packaging/ipkg.py +++ b/test/packaging/ipkg.py @@ -73,6 +73,11 @@ Maintainer, Depends, and Description fields.''', X_IPK_DEPENDS = 'libc6, grep', ) """) +with os.popen('id -un') as p: + IPKGUSER = p.read().strip() +with os.popen('id -gn') as p: + IPKGGROUP = p.read().strip() + expected="""scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... @@ -84,7 +89,7 @@ build_specfiles(["foo-0.0/CONTROL/control", "foo-0.0/CONTROL/conffiles", "foo-0. ipkg-build -o %s -g %s foo-0.0 Packaged contents of foo-0.0 into %s/foo_0.0_arm.ipk scons: done building targets. -"""%(os.popen('id -un').read().strip(), os.popen('id -gn').read().strip(), test.workpath()) +"""%(IPKGUSER, IPKGGROUP, test.workpath()) test.run(arguments="--debug=stacktrace foo_0.0_arm.ipk", stdout=expected) test.must_exist( 'foo-0.0/CONTROL/control' ) diff --git a/test/packaging/place-files-in-subdirectory.py b/test/packaging/place-files-in-subdirectory.py index 0eb791f..23ff543 100644 --- a/test/packaging/place-files-in-subdirectory.py +++ b/test/packaging/place-files-in-subdirectory.py @@ -102,8 +102,9 @@ env.Package( NAME = 'libfoo', test.run(stderr = None) -str = os.popen( 'tar -tzf %s'%test.workpath('libfoo-1.2.3.tar.gz') ).read() -test.fail_test( str != "libfoo-1.2.3/src/main.c\nlibfoo-1.2.3/SConstruct\n" ) +with os.popen('tar -tzf %s'%test.workpath('libfoo-1.2.3.tar.gz')) as p: + str = p.read() +test.fail_test(str != "libfoo-1.2.3/src/main.c\nlibfoo-1.2.3/SConstruct\n") test.pass_test() diff --git a/test/packaging/rpm/internationalization.py b/test/packaging/rpm/internationalization.py index ad77f40..eea30ca 100644 --- a/test/packaging/rpm/internationalization.py +++ b/test/packaging/rpm/internationalization.py @@ -94,25 +94,29 @@ machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( src_rpm ) test.must_exist( machine_rpm ) -test.must_not_exist( 'bin/main' ) +test.must_not_exist('bin/main') cmd = 'rpm -qp --queryformat \'%%{GROUP}-%%{SUMMARY}-%%{DESCRIPTION}\' %s' os.environ['LANGUAGE'] = 'de' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Applikation/büro-hallo-das sollte wirklich lang sein' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Applikation/büro-hallo-das sollte wirklich lang sein') os.environ['LANGUAGE'] = 'fr' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/bureau-bonjour-ceci devrait être vraiment long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/bureau-bonjour-ceci devrait être vraiment long') os.environ['LANGUAGE'] = 'en' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/office-hello-this should be really long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/office-hello-this should be really long') os.environ['LC_ALL'] = 'ae' -out = os.popen( cmd % test.workpath(machine_rpm) ).read() -test.fail_test( out != 'Application/office-hello-this should be really long' ) +with os.popen(cmd % test.workpath(machine_rpm)) as p: + out = p.read() +test.fail_test(out != 'Application/office-hello-this should be really long') # # test INTERNATIONAL PACKAGE TAGS diff --git a/test/packaging/rpm/multipackage.py b/test/packaging/rpm/multipackage.py index fd67a09..2f106f4 100644 --- a/test/packaging/rpm/multipackage.py +++ b/test/packaging/rpm/multipackage.py @@ -104,9 +104,11 @@ test.must_exist( machine_rpm2 ) test.must_exist( src_rpm2 ) test.must_not_exist( 'bin/main' ) -out = os.popen( 'rpm -qpl %s' % machine_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.must_contain_all_lines( out, '/bin/main') -out = os.popen( 'rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % src_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') test.pass_test() diff --git a/test/packaging/rpm/package.py b/test/packaging/rpm/package.py index 2ba66b9..ddd3c89 100644 --- a/test/packaging/rpm/package.py +++ b/test/packaging/rpm/package.py @@ -83,9 +83,11 @@ machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( machine_rpm ) test.must_exist( src_rpm ) test.must_not_exist( 'bin/main' ) -out = os.popen( 'rpm -qpl %s' % machine_rpm).read() -test.must_contain_all_lines( out, '/bin/main') -out = os.popen( 'rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() +test.must_contain_all_lines(out, '/bin/main') +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') test.pass_test() diff --git a/test/packaging/rpm/tagging.py b/test/packaging/rpm/tagging.py index b685c91..c730e14 100644 --- a/test/packaging/rpm/tagging.py +++ b/test/packaging/rpm/tagging.py @@ -85,11 +85,13 @@ src_rpm = 'foo-1.2.3-0.src.rpm' machine_rpm = 'foo-1.2.3-0.%s.rpm' % SCons.Tool.rpmutils.defaultMachine() test.must_exist( machine_rpm ) -out = os.popen('rpm -qpl %s' % machine_rpm).read() +with os.popen('rpm -qpl %s' % machine_rpm) as p: + out = p.read() test.must_contain_all_lines( out, '/bin/main') test.must_exist( src_rpm ) -out = os.popen('rpm -qpl %s' % src_rpm).read() +with os.popen('rpm -qpl %s' % src_rpm) as p: + out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') expect = '(0755, root, users) /bin/main' diff --git a/test/preserve-source.py b/test/preserve-source.py index 74fbed5..b7444da 100644 --- a/test/preserve-source.py +++ b/test/preserve-source.py @@ -36,10 +36,10 @@ def cat(env, source, target): target = str(target[0]) source = list(map(str, source)) print('cat(%s) > %s' % (source, target)) - f = open(target, "wb") - for src in source: - f.write(open(src, "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(src, "rb") as ifp: + f.write(ifp.read()) env = Environment(BUILDERS={'Build':Builder(action=cat)}) env.Build('aaa.out', 'aaa.in') diff --git a/test/python-version.py b/test/python-version.py index 3cc3395..9cfd2bd 100644 --- a/test/python-version.py +++ b/test/python-version.py @@ -45,7 +45,7 @@ test.write('SetOption-python', "SetOption('warn', ['no-python-version'])\n") if TestSCons.unsupported_python_version(): - error = "scons: \*\*\* SCons version \S+ does not run under Python version %s." + error = r"scons: \*\*\* SCons version \S+ does not run under Python version %s." error = error % re.escape(TestSCons.python_version_string()) + "\n" test.run(arguments = '-Q', status = 1, stderr = error) diff --git a/test/question/basic.py b/test/question/basic.py index 21e6206..968c4f7 100644 --- a/test/question/basic.py +++ b/test/question/basic.py @@ -36,10 +36,8 @@ _python_ = TestSCons._python_ test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/redirection.py b/test/redirection.py index 3394523..0960dfd 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -42,18 +42,19 @@ if sys.platform == "win32": try: - input = open(sys.argv[1], 'rb').read() + with open(sys.argv[1], 'rb') as f: + indata = f.read() except IndexError: if PY3K: source = sys.stdin.buffer else: source = sys.stdin - input = source.read() + indata = source.read() if PY3K: - sys.stdout.buffer.write(input) + sys.stdout.buffer.write(indata) else: - sys.stdout.write(input) + sys.stdout.write(indata) sys.exit(0) """) diff --git a/test/runtest/python.py b/test/runtest/python.py index 14156e0..da62378 100644 --- a/test/runtest/python.py +++ b/test/runtest/python.py @@ -55,7 +55,7 @@ mypython = os.path.normpath(os.path.join(head, dir, os.path.pardir, dir, python) def escape(s): return s.replace('\\', '\\\\') -if re.search('\s', mypython): +if re.search(r'\s', mypython): mypythonstring = '"%s"' % escape(mypython) else: mypythonstring = escape(mypython) diff --git a/test/sconsign/corrupt.py b/test/sconsign/corrupt.py index cab4d75..25b48e2 100644 --- a/test/sconsign/corrupt.py +++ b/test/sconsign/corrupt.py @@ -41,7 +41,8 @@ work2_sub__sconsign = test.workpath('work2', 'sub', '.sconsign') SConstruct_contents = """\ def build1(target, source, env): - open(str(target[0]), 'wb').write(open(str(source[0]), 'rb').read()) + with open(str(target[0]), 'wb') as ofp, open(str(source[0]), 'rb') as ifp: + ofp.write(ifp.read()) return None B1 = Builder(action = build1) @@ -55,12 +56,12 @@ test.write(['work1', 'SConstruct'], SConstruct_contents) test.write(['work1', 'foo.in'], "work1/foo.in\n") -stderr = ''' +stderr = r''' scons: warning: Ignoring corrupt .sconsign file: \.sconsign\.dblite .* ''' -stdout = test.wrap_stdout('build1\(\["sub.foo\.out"\], \["foo\.in"\]\)\n') +stdout = test.wrap_stdout(r'build1\(\["sub.foo\.out"\], \["foo\.in"\]\)' + '\n') test.write(work1__sconsign_dblite, 'not:a:sconsign:file') test.run(chdir='work1', arguments='.', stderr=stderr, stdout=stdout) @@ -80,12 +81,12 @@ test.write(['work2', 'SConstruct'], SConstruct_contents) test.write(['work2', 'foo.in'], "work2/foo.in\n") -stderr = ''' +stderr = r''' scons: warning: Ignoring corrupt .sconsign file: sub.\.sconsign .* ''' -stdout = test.wrap_stdout('build1\(\["sub.foo\.out"\], \["foo\.in"\]\)\n') +stdout = test.wrap_stdout(r'build1\(\["sub.foo\.out"\], \["foo\.in"\]\)' + '\n') test.write(work2_sub__sconsign, 'not:a:sconsign:file') test.run(chdir='work2', arguments='.', stderr=stderr, stdout=stdout) diff --git a/test/sconsign/ghost-entries.py b/test/sconsign/ghost-entries.py index 46916ca..59a1ec2 100644 --- a/test/sconsign/ghost-entries.py +++ b/test/sconsign/ghost-entries.py @@ -51,10 +51,10 @@ test = TestSCons.TestSCons() test.write('SConstruct', """\ def cat(target, source, env): - fp = open(str(target[0]), 'wb') - for s in source: - fp.write(open(str(s), 'rb').read()) - fp.close() + with open(str(target[0]), 'wb') as fp: + for s in source: + with open(str(s), 'rb') as infp: + fp.write(infp.read()) env=Environment() Export('env') env['BUILDERS']['Cat']=Builder(action=cat, multi=1) diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py index 5e56624..8055b68 100644 --- a/test/sconsign/script/SConsignFile.py +++ b/test/sconsign/script/SConsignFile.py @@ -48,10 +48,6 @@ import re import sys path = sys.argv[1].split() -output = open(sys.argv[2], 'w') -input = open(sys.argv[3], 'r') - -output.write('fake_cc.py: %%s\n' %% sys.argv) def find_file(f): for dir in path: @@ -62,14 +58,19 @@ def find_file(f): def process(infp, outfp): for line in infp.readlines(): - m = re.match('#include <(.*)>', line) + m = re.match(r'#include <(.*)>', line) if m: file = m.group(1) - process(find_file(file), outfp) + found = find_file(file) + process(found, outfp) + if found: + found.close() else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'w') as outf, open(sys.argv[3], 'r') as ifp: + outf.write('fake_cc.py: %%s\n' %% sys.argv) + process(ifp, outf) sys.exit(0) """ % locals()) @@ -77,12 +78,9 @@ sys.exit(0) test.write(fake_link_py, r"""#!%(_python_)s import sys -output = open(sys.argv[1], 'w') -input = open(sys.argv[2], 'r') - -output.write('fake_link.py: %%s\n' %% sys.argv) - -output.write(input.read()) +with open(sys.argv[1], 'w') as outf, open(sys.argv[2], 'r') as ifp: + outf.write('fake_link.py: %%s\n' %% sys.argv) + outf.write(ifp.read()) sys.exit(0) """ % locals()) diff --git a/test/sconsign/script/Signatures.py b/test/sconsign/script/Signatures.py index 7797bce..24ffaf7 100644 --- a/test/sconsign/script/Signatures.py +++ b/test/sconsign/script/Signatures.py @@ -68,10 +68,6 @@ import re import sys path = sys.argv[1].split() -output = open(sys.argv[2], 'w') -input = open(sys.argv[3], 'r') - -output.write('fake_cc.py: %%s\n' %% sys.argv) def find_file(f): for dir in path: @@ -85,11 +81,16 @@ def process(infp, outfp): m = re.match('#include <(.*)>', line) if m: file = m.group(1) - process(find_file(file), outfp) + found = find_file(file) + process(found, outfp) + if found: + found.close() else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'w') as outf, open(sys.argv[3], 'r') as ifp: + outf.write('fake_cc.py: %%s\n' %% sys.argv) + process(ifp, outf) sys.exit(0) """ % locals()) @@ -97,12 +98,9 @@ sys.exit(0) test.write(fake_link_py, r"""#!%(_python_)s import sys -output = open(sys.argv[1], 'w') -input = open(sys.argv[2], 'r') - -output.write('fake_link.py: %%s\n' %% sys.argv) - -output.write(input.read()) +with open(sys.argv[1], 'w') as outf, open(sys.argv[2], 'r') as ifp: + outf.write('fake_link.py: %%s\n' %% sys.argv) + outf.write(ifp.read()) sys.exit(0) """ % locals()) diff --git a/test/sconsign/script/bad.py b/test/sconsign/script/bad.py index a384748..5be42b9 100644 --- a/test/sconsign/script/bad.py +++ b/test/sconsign/script/bad.py @@ -38,13 +38,13 @@ test.write('bad2.dblite', "bad2.dblite\n") test.write('bad3', "bad3\n") test.run_sconsign(arguments = "-f dblite no_sconsign", - stderr = "sconsign: \[Errno 2\] No such file or directory: 'no_sconsign'\n") + stderr = "sconsign: \\[Errno 2\\] No such file or directory: 'no_sconsign'\n") test.run_sconsign(arguments = "-f dblite bad1", - stderr = "sconsign: \[Errno 2\] No such file or directory: 'bad1.dblite'\n") + stderr = "sconsign: \\[Errno 2\\] No such file or directory: 'bad1.dblite'\n") test.run_sconsign(arguments = "-f dblite bad1.dblite", - stderr = "sconsign: \[Errno 2\] No such file or directory: 'bad1.dblite'\n") + stderr = "sconsign: \\[Errno 2\\] No such file or directory: 'bad1.dblite'\n") test.run_sconsign(arguments = "-f dblite bad2", stderr = "sconsign: ignoring invalid `dblite' file `bad2'.*\n") @@ -53,7 +53,7 @@ test.run_sconsign(arguments = "-f dblite bad2.dblite", stderr = "sconsign: ignoring invalid `dblite' file `bad2.dblite'.*\n") test.run_sconsign(arguments = "-f sconsign no_sconsign", - stderr = "sconsign: \[Errno 2\] No such file or directory: 'no_sconsign'\n") + stderr = "sconsign: \\[Errno 2\\] No such file or directory: 'no_sconsign'\n") test.run_sconsign(arguments = "-f sconsign bad3", stderr = "sconsign: ignoring invalid .sconsign file `bad3'.*\n") diff --git a/test/sconsign/script/dblite.py b/test/sconsign/script/dblite.py index 0daf8bf..41cf7e2 100644 --- a/test/sconsign/script/dblite.py +++ b/test/sconsign/script/dblite.py @@ -43,7 +43,7 @@ LINK = test.detect('LINK', norm=1) if LINK is None: LINK = CC def escape_drive_case(s): - """Turn c\: into [cC]\:""" + r"""Turn c\: into [cC]\:""" if re.match(r'^(.)[\\]?:', s): drive=s[0] return '['+drive.lower()+drive.upper()+']'+s[1:] @@ -133,7 +133,7 @@ hello%(_obj)s: %(sig_re)s \d+ \d+ %(sig_re)s \[.*\] """ % locals() -expect_r = """=== sub1: +expect_r = r"""=== sub1: hello%(_exe)s: %(sig_re)s '%(date_re)s' \d+ %(sub1_hello_obj)s: %(sig_re)s '%(date_re)s' \d+ %(LINK)s: None '%(date_re)s' \d+ diff --git a/test/sconsign/script/no-SConsignFile.py b/test/sconsign/script/no-SConsignFile.py index d9ab51f..cf5bcb2 100644 --- a/test/sconsign/script/no-SConsignFile.py +++ b/test/sconsign/script/no-SConsignFile.py @@ -57,10 +57,6 @@ import re import sys path = sys.argv[1].split() -output = open(sys.argv[2], 'w') -input = open(sys.argv[3], 'r') - -output.write('fake_cc.py: %%s\n' %% sys.argv) def find_file(f): for dir in path: @@ -71,14 +67,19 @@ def find_file(f): def process(infp, outfp): for line in infp.readlines(): - m = re.match('#include <(.*)>', line) + m = re.match(r'#include <(.*)>', line) if m: file = m.group(1) - process(find_file(file), outfp) + found = find_file(file) + process(found, outfp) + if found: + found.close() else: outfp.write(line) -process(input, output) +with open(sys.argv[2], 'w') as outf, open(sys.argv[3], 'r') as ifp: + outf.write('fake_cc.py: %%s\n' %% sys.argv) + process(ifp, outf) sys.exit(0) """ % locals()) @@ -86,12 +87,9 @@ sys.exit(0) test.write(fake_link_py, r"""#!%(_python_)s import sys -output = open(sys.argv[1], 'w') -input = open(sys.argv[2], 'r') - -output.write('fake_link.py: %%s\n' %% sys.argv) - -output.write(input.read()) +with open(sys.argv[1], 'w') as outf, open(sys.argv[2], 'r') as ifp: + outf.write('fake_link.py: %%s\n' %% sys.argv) + outf.write(ifp.read()) sys.exit(0) """ % locals()) diff --git a/test/silent-command.py b/test/silent-command.py index b0e4a2e..7f3b010 100644 --- a/test/silent-command.py +++ b/test/silent-command.py @@ -40,10 +40,10 @@ test.subdir('build', 'src') test.write('build.py', r""" import sys -fp = open(sys.argv[1], 'wb') -for f in sys.argv[2:]: - fp.write(open(f, 'rb').read()) -fp.close() +with open(sys.argv[1], 'wb') as fp: + for f in sys.argv[2:]: + with open(f, 'rb') as ifp: + fp.write(ifp.read()) """) test.write('SConstruct', """\ diff --git a/test/site_scons/site_init.py b/test/site_scons/site_init.py index 27768a9..e21b5f2 100644 --- a/test/site_scons/site_init.py +++ b/test/site_scons/site_init.py @@ -124,7 +124,7 @@ e.Foo(target='foo.out', source='SConstruct') test.run(arguments = '-Q .', stdout = "", - stderr = """.*Error loading site_init file.*Huh\?.*""", + stderr = r".*Error loading site_init file.*Huh\?.*", status=2, match=TestSCons.match_re_dotall) diff --git a/test/special-filenames.py b/test/special-filenames.py index 798bf09..1ba764e 100644 --- a/test/special-filenames.py +++ b/test/special-filenames.py @@ -49,7 +49,8 @@ attempt_file_names = [ test.write("cat.py", """\ import sys -open(sys.argv[1], 'wb').write(open(sys.argv[2], 'rb').read()) +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) """) file_names = [] diff --git a/test/srcchange.py b/test/srcchange.py index 6916d50..e396fb8 100644 --- a/test/srcchange.py +++ b/test/srcchange.py @@ -44,7 +44,8 @@ test = TestSCons.TestSCons() test.write('getrevision', """ from __future__ import print_function -print(open('revnum.in','r').read().strip(), end='') +with open('revnum.in','r') as f: + print(f.read().strip(), end='') """) test.write('SConstruct', """ @@ -52,12 +53,11 @@ import re def subrevision(target, source ,env): orig = target[0].get_text_contents() - new = re.sub('\$REV.*?\$', + new = re.sub(r'\$REV.*?\$', '$REV: %%s$'%%source[0].get_text_contents().strip(), target[0].get_text_contents()) - outf = open(str(target[0]),'w') - outf.write(new) - outf.close() + with open(str(target[0]),'w') as outf: + outf.write(new) SubRevision = Action(subrevision) diff --git a/test/strfunction.py b/test/strfunction.py index 8587dcb..04e23aa 100644 --- a/test/strfunction.py +++ b/test/strfunction.py @@ -36,7 +36,8 @@ test = TestSCons.TestSCons() test.write('cat.py', """\ import sys -open(sys.argv[2], "wb").write(open(sys.argv[1], "rb").read()) +with open(sys.argv[2], "wb") as f, open(sys.argv[1], "rb") as ifp: + f.write(ifp.read()) sys.exit(0) """) @@ -49,7 +50,8 @@ def strfunction(target, source, env): def func(target, source, env): t = str(target[0]) s = str(source[0]) - open(t, 'w').write(open(s, 'r').read()) + with open(t, 'w') as f, open(s, 'r') as ifp: + f.write(ifp.read()) func1action = Action(func, strfunction) func2action = Action(func, strfunction=strfunction) diff --git a/test/subclassing.py b/test/subclassing.py index b621bf5..ab4c7d5 100644 --- a/test/subclassing.py +++ b/test/subclassing.py @@ -54,7 +54,7 @@ env.Command('f0.out', 'f0.in', copy_action) try: from collections import UserString except ImportError: - exec('from UserString import UserString') + from UserString import UserString try: class mystr(str): pass diff --git a/test/subdir.py b/test/subdir.py index 9a8b762..363d44c 100644 --- a/test/subdir.py +++ b/test/subdir.py @@ -35,10 +35,8 @@ test.subdir('subdir') test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'r').read() -file = open(sys.argv[1], 'w') -file.write(contents) -file.close() +with open(sys.argv[1], 'w') as f, open(sys.argv[2], 'r') as ifp: + f.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/test/subdivide.py b/test/subdivide.py index 7ddc2e9..a4a128e 100644 --- a/test/subdivide.py +++ b/test/subdivide.py @@ -59,18 +59,20 @@ fake_link_py = test.workpath('fake_link.py') test.write(fake_cc_py, """\ import sys -ofp = open(sys.argv[1], 'w') -ofp.write('fake_cc.py: %s\\n' % sys.argv) -for s in sys.argv[2:]: - ofp.write(open(s, 'r').read()) +with open(sys.argv[1], 'w') as ofp: + ofp.write('fake_cc.py: %s\\n' % sys.argv) + for s in sys.argv[2:]: + with open(s, 'r') as ifp: + ofp.write(ifp.read()) """) test.write(fake_link_py, """\ import sys -ofp = open(sys.argv[1], 'w') -ofp.write('fake_link.py: %s\\n' % sys.argv) -for s in sys.argv[2:]: - ofp.write(open(s, 'r').read()) +with open(sys.argv[1], 'w') as ofp: + ofp.write('fake_link.py: %s\\n' % sys.argv) + for s in sys.argv[2:]: + with open(s, 'r') as ifp: + ofp.write(ifp.read()) """) test.chmod(fake_cc_py, 0o755) diff --git a/test/suffixes.py b/test/suffixes.py index 74655ec..7684ee8 100644 --- a/test/suffixes.py +++ b/test/suffixes.py @@ -35,10 +35,10 @@ test = TestSCons.TestSCons() test.write('SConstruct', """ def cat(env, source, target): target = str(target[0]) - f = open(target, "wb") - for src in source: - f.write(open(str(src), "rb").read()) - f.close() + with open(target, "wb") as f: + for src in source: + with open(str(src), "rb") as ifp: + f.write(ifp.read()) Cat = Builder(action=cat, suffix='.out') env = Environment(BUILDERS = {'Cat':Cat}) env.Cat('file1', 'file1.in') diff --git a/test/timestamp-fallback.py b/test/timestamp-fallback.py index 6b10033..f4e2e4d 100644 --- a/test/timestamp-fallback.py +++ b/test/timestamp-fallback.py @@ -63,8 +63,11 @@ os.environ['PYTHONPATH'] = test.workpath('.') test.write('SConstruct', """ DefaultEnvironment(tools=[]) + def build(env, target, source): - open(str(target[0]), 'wt').write(open(str(source[0]), 'rt').read()) + with open(str(target[0]), 'wt') as ofp, open(str(source[0]), 'rt') as ifp: + opf.write(ifp.read()) + B = Builder(action = build) env = Environment(tools = [], BUILDERS = { 'B' : B }) env.B(target = 'f1.out', source = 'f1.in') @@ -90,10 +93,10 @@ build(["f4.out"], ["f4.in"]) """), stderr = None) -os.utime(test.workpath('f1.in'), +os.utime(test.workpath('f1.in'), (os.path.getatime(test.workpath('f1.in')), os.path.getmtime(test.workpath('f1.in'))+10)) -os.utime(test.workpath('f3.in'), +os.utime(test.workpath('f3.in'), (os.path.getatime(test.workpath('f3.in')), os.path.getmtime(test.workpath('f3.in'))+10)) diff --git a/test/toolpath/VariantDir.py b/test/toolpath/VariantDir.py index 4177550..652dde5 100644 --- a/test/toolpath/VariantDir.py +++ b/test/toolpath/VariantDir.py @@ -50,8 +50,8 @@ test.write(['subdir', 'src', 'tools', 'MyBuilder.py'], """\ from SCons.Script import Builder def generate(env): def my_copy(target, source, env): - content = open(str(source[0]), 'rb').read() - open(str(target[0]), 'wb').write(content) + with open(str(target[0]), 'wb') as f, open(str(source[0]), 'rb') as ifp: + f.write(ifp.read()) env['BUILDERS']['MyCopy'] = Builder(action = my_copy) def exists(env): diff --git a/test/up-to-date.py b/test/up-to-date.py index d7381bd..12ea604 100644 --- a/test/up-to-date.py +++ b/test/up-to-date.py @@ -36,10 +36,8 @@ test = TestSCons.TestSCons() test.write('build.py', r""" import sys -contents = open(sys.argv[2], 'rb').read() -file = open(sys.argv[1], 'wb') -file.write(contents) -file.close() +with open(sys.argv[1], 'wb') as f, open(sys.argv[2], 'rb') as ifp: + f.write(ifp.read()) """) test.write('SConstruct', """ diff --git a/testing/framework/SConscript b/testing/framework/SConscript index 0d3832e..bb81d8e 100644 --- a/testing/framework/SConscript +++ b/testing/framework/SConscript @@ -41,12 +41,13 @@ files = [ def copy(target, source, env): t = str(target[0]) s = str(source[0]) - c = open(s, 'r').read() - # Note: We construct the __ VERSION __ substitution string at - # run-time so it doesn't get replaced when this file gets copied - # into the tree for packaging. - c = c.replace('__' + 'VERSION' + '__', env['VERSION']) - open(t, 'w').write(c) + with open(s, 'r') as i, open(t, 'w') as o: + c = i.read() + # Note: We construct the __ VERSION __ substitution string at + # run-time so it doesn't get replaced when this file gets copied + # into the tree for packaging. + c = c.replace('__' + 'VERSION' + '__', env['VERSION']) + o.write(c) for file in files: # Guarantee that real copies of these files always exist in diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 23e8753..23b3416 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -957,23 +957,23 @@ import sys import re # -w and -z are fake options used in test/QT/QTFLAGS.py cmd_opts, args = getopt.getopt(sys.argv[1:], 'io:wz', []) -output = None impl = 0 opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': output = open(arg, 'w') + if opt == '-o': out = arg elif opt == '-i': impl = 1 else: opt_string = opt_string + ' ' + opt -output.write("/* mymoc.py%s */\\n" % opt_string) -for a in args: - with open(a, 'r') as f: - contents = f.read() - a = a.replace('\\\\', '\\\\\\\\') - subst = r'{ my_qt_symbol( "' + a + '\\\\n" ); }' - if impl: - contents = re.sub( r'#include.*', '', contents ) - output.write(contents.replace('Q_OBJECT', subst)) -output.close() + +with open(out, 'w') as ofp: + ofp.write("/* mymoc.py%s */\\n" % opt_string) + for a in args: + with open(a, 'r') as ifp: + contents = ifp.read() + a = a.replace('\\\\', '\\\\\\\\') + subst = r'{ my_qt_symbol( "' + a + '\\\\n" ); }' + if impl: + contents = re.sub( r'#include.*', '', contents ) + ofp.write(contents.replace('Q_OBJECT', subst)) sys.exit(0) """) @@ -988,7 +988,7 @@ source = None opt_string = '' for arg in sys.argv[1:]: if output_arg: - output = open(arg, 'w') + out = arg output_arg = 0 elif impl_arg: impl = arg @@ -1002,19 +1002,19 @@ for arg in sys.argv[1:]: else: if source: sys.exit(1) - source = open(arg, 'r') - sourceFile = arg -output.write("/* myuic.py%s */\\n" % opt_string) -if impl: - output.write( '#include "' + impl + '"\\n' ) - includes = re.findall('(.*?)', source.read()) - for incFile in includes: - # this is valid for ui.h files, at least - if os.path.exists(incFile): - output.write('#include "' + incFile + '"\\n') -else: - output.write( '#include "my_qobject.h"\\n' + source.read() + " Q_OBJECT \\n" ) -output.close() + source = sourceFile = arg + +with open(out, 'w') as ofp, open(source, 'r') as ifp: + ofp.write("/* myuic.py%s */\\n" % opt_string) + if impl: + ofp.write( '#include "' + impl + '"\\n' ) + includes = re.findall('(.*?)', ifp.read()) + for incFile in includes: + # this is valid for ui.h files, at least + if os.path.exists(incFile): + ofp.write('#include "' + incFile + '"\\n') + else: + ofp.write( '#include "my_qobject.h"\\n' + ifp.read() + " Q_OBJECT \\n" ) sys.exit(0) """ ) diff --git a/testing/framework/TestSConsMSVS.py b/testing/framework/TestSConsMSVS.py index 4c99bd4..e7200b6 100644 --- a/testing/framework/TestSConsMSVS.py +++ b/testing/framework/TestSConsMSVS.py @@ -1045,7 +1045,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', HOST_ARCH='%(HOST_ARCH)s') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] @@ -1068,7 +1068,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', HOST_ARCH='%(HOST_ARCH)s') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] @@ -1091,7 +1091,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', HOST_ARCH='%(HOST_ARCH)s') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] @@ -1114,7 +1114,7 @@ env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', HOST_ARCH='%(HOST_ARCH)s') testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk_dir\\sdk.h'] +testincs = [r'sdk_dir\\sdk.h'] testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] -- cgit v0.12 From f3c5ac37a96adc91d688d17a9ad462a95d32587c Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 8 Apr 2019 16:38:24 -0600 Subject: [PR #3345] fix flake8 compliants on the PR Signed-off-by: Mats Wichmann --- src/engine/SCons/Action.py | 2 +- src/engine/SCons/Tool/packaging/msi.py | 2 +- src/test_setup.py | 4 ++-- test/fixture/mycompile.py | 6 +++--- test/fixture/myrewrite.py | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index f97d564..fd859ad 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -785,7 +785,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): kw[stream] = DEVNULL else: if sys.platform == 'win32': - kw[stream] = msvcrt.get_osfhandle(open(os.devnull, "r+")) + kw[stream] = msvcrt.get_osfhandle(os.open(os.devnull, os.O_RDWR)) else: kw[stream] = open(os.devnull, "r+") diff --git a/src/engine/SCons/Tool/packaging/msi.py b/src/engine/SCons/Tool/packaging/msi.py index 3a394a0..0ef18ec 100644 --- a/src/engine/SCons/Tool/packaging/msi.py +++ b/src/engine/SCons/Tool/packaging/msi.py @@ -447,7 +447,7 @@ def build_license_file(directory, spec): if text!='': f.write(text.replace('\n', '\\par ')) else: - file.write(name+'\\par\\par') + f.write(name+'\\par\\par') f.write('}') # diff --git a/src/test_setup.py b/src/test_setup.py index 75e0533..09865f5 100644 --- a/src/test_setup.py +++ b/src/test_setup.py @@ -178,8 +178,8 @@ zip = os.path.join(cwd, 'build', 'dist', '%s.zip' % scons_version) if os.path.isfile(zip): try: import zipfile - except - ImportError: pass + except ImportError: + pass else: with zipfile.ZipFile(zip, 'r') as zf: diff --git a/test/fixture/mycompile.py b/test/fixture/mycompile.py index 275f7be..27bf840 100644 --- a/test/fixture/mycompile.py +++ b/test/fixture/mycompile.py @@ -13,7 +13,7 @@ if __name__ == '__main__': with open(sys.argv[2], 'wb') as ofp: for f in sys.argv[3:]: with open(f, 'rb') as ifp: - lines = [l for l in ifp.readlines() if l != line] - for l in lines: - ofp.write(l) + lines = [ln for ln in ifp.readlines() if ln != line] + for ln in lines: + ofp.write(ln) sys.exit(0) diff --git a/test/fixture/myrewrite.py b/test/fixture/myrewrite.py index 95272b6..ad46091 100644 --- a/test/fixture/myrewrite.py +++ b/test/fixture/myrewrite.py @@ -10,8 +10,8 @@ import sys if __name__ == '__main__': line = ('/*' + sys.argv[1] + '*/\n').encode() with open(sys.argv[2], 'rb') as ifp: - lines = [l for l in ifp.readlines() if l != line] + lines = [ln for ln in ifp.readlines() if ln != line] with open(sys.argv[2], 'wb') as ofp: - for l in lines: - ofp.write(l) + for ln in lines: + ofp.write(ln) sys.exit(0) -- cgit v0.12 From 9ddd2ab49faddd45ae5d1d0253d5f5135f348099 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 25 Apr 2019 12:22:53 -0400 Subject: Add initializing fixture_dirs from shell variable FIXTURE_DIRS --- testing/framework/TestCmd.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index a6a8045..bf010e1 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -974,6 +974,12 @@ class TestCmd(object): self.subdir(subdir) self.fixture_dirs = [] + try: + self.fixture_dirs = (os.environ['FIXTURE_DIRS']).split(os.pathsep) + except KeyError: + pass + + def __del__(self): self.cleanup() @@ -1630,6 +1636,7 @@ class TestCmd(object): os.mkdir(new) except OSError as e: print("Got error :%s"%e) + import pdb; pdb.set_trace() pass else: count = count + 1 -- cgit v0.12 From e820fbfd1c89ef3ef5a0e59fcdbc055b9e80e687 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 25 Apr 2019 12:25:57 -0400 Subject: Fix Issue #3135 - Also add tests to check that emitter is properly processing interface module declarations --- src/CHANGES.txt | 3 + src/engine/SCons/Scanner/FortranTests.py | 7 +- src/engine/SCons/Tool/FortranCommonTests.py | 125 +++++++++++++++++++++ test/fixture/fortran_unittests/test_1.f90 | 46 ++++++++ test/fixture/fortran_unittests/test_2.f90 | 46 ++++++++ test/fixture/fortran_unittests/test_submodules.f90 | 15 +++ 6 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 src/engine/SCons/Tool/FortranCommonTests.py create mode 100644 test/fixture/fortran_unittests/test_1.f90 create mode 100644 test/fixture/fortran_unittests/test_2.f90 create mode 100644 test/fixture/fortran_unittests/test_submodules.f90 diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4d24611..98a414e 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -18,6 +18,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Decider and not clearing it when the configure context is completed. - Add default paths for yacc tool on windows to include cygwin, mingw, and chocolatey + From Github User pdiener: + - Fix issue #3135 - Handle Fortran submodules and type bound procedures + From Daniel Moody: - Change the default for AppendENVPath to delete_existing=0, so path order will not be changed, unless explicitly set (Issue #3276) diff --git a/src/engine/SCons/Scanner/FortranTests.py b/src/engine/SCons/Scanner/FortranTests.py index 2e10473..c958474 100644 --- a/src/engine/SCons/Scanner/FortranTests.py +++ b/src/engine/SCons/Scanner/FortranTests.py @@ -363,9 +363,9 @@ class FortranScannerTestCase9(unittest.TestCase): n = env.File('fff3.f') - def my_rexists(s1): - s1.Tag('rexists_called', 1) - return SCons.Node._rexists_map[s.GetTag('old_rexists')](s1) + def my_rexists(s): + s.Tag('rexists_called', 1) + return SCons.Node._rexists_map[s.GetTag('old_rexists')](s) n.Tag('old_rexists', n._func_rexists) SCons.Node._rexists_map[3] = my_rexists @@ -530,6 +530,7 @@ class FortranScannerTestCase16(unittest.TestCase): test.unlink('f10.f') + if __name__ == "__main__": unittest.main() diff --git a/src/engine/SCons/Tool/FortranCommonTests.py b/src/engine/SCons/Tool/FortranCommonTests.py new file mode 100644 index 0000000..6ccd206 --- /dev/null +++ b/src/engine/SCons/Tool/FortranCommonTests.py @@ -0,0 +1,125 @@ +# +# __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. +# +# from typing import Dict, Any + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import os +import os.path +import unittest + +import SCons.Node.FS +import SCons.Warnings +import SCons.Tool.FortranCommon + +import TestCmd + +original = os.getcwd() + +test = TestCmd.TestCmd(workdir='') + +os.chdir(test.workpath('')) + + +class DummyEnvironment(object): + dictionary = None # type: Dict[Any, Any] + + def __init__(self, list_cpp_path): + self.path = list_cpp_path + self.fs = SCons.Node.FS.FS(test.workpath('')) + self.dictionary = {} + + def has_key(self, key): + return key in self.dictionary + + def __getitem__(self, key): + return self.dictionary[key] + + def __setitem__(self, key, value): + self.dictionary[key] = value + + def __delitem__(self, key): + del self.dictionary[key] + + def subst(self, arg, target=None, source=None, conv=None): + if arg[0] == '$': + return self[arg[1:]] + return arg + + def subst_path(self, path, target=None, source=None, conv=None): + if not isinstance(path, list): + path = [path] + return list(map(self.subst, path)) + + def get_calculator(self): + return None + + def get_factory(self, factory): + return factory or self.fs.File + + def Dir(self, filename): + return self.fs.Dir(filename) + + def File(self, filename): + return self.fs.File(filename) + + +class FortranScannerSubmodulesTestCase(unittest.TestCase): + def runTest(self): + """ + Check that test_1.f90 and test_2.f90 which have interface specifications + Don't generate targets for those modules listed in the interface section + """ + + test.dir_fixture('fortran_unittests') + env = DummyEnvironment([test.workpath('modules')]) + env['FORTRANMODDIR'] = 'modules' + env['FORTRANMODSUFFIX'] = '.mod' + emitter = SCons.Tool.FortranCommon._fortranEmitter + # path = s.path(env) + + for fort in ['test_1.f90', 'test_2.f90']: + file_base, _ = os.path.splitext(fort) + file_mod = '%s.mod' % file_base + f = env.File(fort) + (target, source) = emitter([], [f, ], env) + + # print("Targets:%s\nSources:%s"%([str(a) for a in target], [str(a) for a in source])) + + # should only be 1 target and 1 source + self.assertEqual(len(target), 1, + msg="More than 1 target: %d [%s]" % (len(target), [str(t) for t in target])) + self.assertEqual(len(source), 1, + msg="More than 1 source: %d [%s]" % (len(source), [str(t) for t in source])) + + # target should be file_base.mod + self.assertEqual(str(target[0]).endswith(file_mod), True, + msg="Target[0]=%s doesn't end with '%s'" % (str(target[0]), file_mod)) + + # source should be file_base .f90 + self.assertEqual(str(source[0]).endswith(fort), True, + msg="Source[0]=%s doesn't end with '%s'" % (str(source[0]), fort)) + + +if __name__ == "__main__": + unittest.main() diff --git a/test/fixture/fortran_unittests/test_1.f90 b/test/fixture/fortran_unittests/test_1.f90 new file mode 100644 index 0000000..25ba9d6 --- /dev/null +++ b/test/fixture/fortran_unittests/test_1.f90 @@ -0,0 +1,46 @@ +module test_1 + + type test_type_1 + integer :: n + contains + procedure :: set_n + procedure :: get_n + end type test_type_1 + + +interface + + module subroutine set_n ( this, n ) + class(test_type_1), intent(inout) :: this + integer, intent(in) :: n + end subroutine + + module function get_n ( this ) + class(test_type_1), intent(in) :: this + integer :: get_n + end function get_n + +end interface + +end module test_1 + + +submodule(test_1) test_1_impl + +contains + + module procedure set_n + + implicit none + + this%n = n + end procedure set_n + + module procedure get_n + + implicit none + + get_n = this%n + end procedure get_n + +end submodule test_1_impl diff --git a/test/fixture/fortran_unittests/test_2.f90 b/test/fixture/fortran_unittests/test_2.f90 new file mode 100644 index 0000000..7a39b0d --- /dev/null +++ b/test/fixture/fortran_unittests/test_2.f90 @@ -0,0 +1,46 @@ +module test_2 + + type test_type_2 + integer :: m + contains + procedure :: set_m + procedure :: get_m + end type test_type_2 + + +interface + + module subroutine set_m ( this, m ) + class(test_type_2), intent(inout) :: this + integer, intent(in) :: m + end subroutine + + module function get_m ( this ) + class(test_type_2), intent(in) :: this + integer :: get_m + end function get_m + +end interface + +end module test_2 + + +submodule(test_2) test_2_impl + +contains + + module procedure set_m + + implicit none + + this%m = m + end procedure set_m + + module procedure get_m + + implicit none + + get_m = this%m + end procedure get_m + +end submodule test_2_impl diff --git a/test/fixture/fortran_unittests/test_submodules.f90 b/test/fixture/fortran_unittests/test_submodules.f90 new file mode 100644 index 0000000..5deec37 --- /dev/null +++ b/test/fixture/fortran_unittests/test_submodules.f90 @@ -0,0 +1,15 @@ +program test_submodules + + use test_1 + use test_2 + + type(test_type_1) :: var1 + type(test_type_2) :: var2 + + call var1%set_n(42) + call var2%set_m(21) + + print*,'var1%n = ', var1%get_n() + print*,'var2%m = ', var2%get_m() + +end program test_submodules -- cgit v0.12 From 0e84c296d686e4384c8e6f5137a7c15e51dcb167 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 25 Apr 2019 13:44:24 -0600 Subject: [PR #3345] fix a few more Py3.8 problems Signed-off-by: Mats Wichmann --- src/engine/SCons/Conftest.py | 4 ++-- src/engine/SCons/Tool/qt.py | 13 ++++++++++--- test/QT/qt_warnings.py | 4 ++-- test/packaging/rpm/package.py | 2 +- testing/framework/TestSCons.py | 24 ++++++++++++------------ 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index 84aa992..67a5a67 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -704,7 +704,7 @@ def CheckProg(context, prog_name): # def _YesNoResult(context, ret, key, text, comment = None): - """ + r""" Handle the result of a test with a "yes" or "no" result. :Parameters: @@ -723,7 +723,7 @@ def _YesNoResult(context, ret, key, text, comment = None): def _Have(context, key, have, comment = None): - """ + r""" Store result of a test in context.havedict and context.headerfilename. :Parameters: diff --git a/src/engine/SCons/Tool/qt.py b/src/engine/SCons/Tool/qt.py index b8cf77a..685a9a0 100644 --- a/src/engine/SCons/Tool/qt.py +++ b/src/engine/SCons/Tool/qt.py @@ -66,11 +66,17 @@ if SCons.Util.case_sensitive_suffixes('.h', '.H'): cxx_suffixes = cplusplus.CXXSuffixes -# def find_platform_specific_qt_paths(): """ - If the platform has non-standard paths which it installs QT in,return the likely default path - :return: + find non-standard QT paths + + If the platform does not put QT tools in standard search paths, + the path is expected to be set using QTDIR. SCons violates + the normal rule of not pulling from the user's environment + in this case. However, some test cases try to validate what + happens when QTDIR is unset, so we need to try to make a guess. + + :return: a guess at a path """ # qt_bin_dirs = [] @@ -83,6 +89,7 @@ def find_platform_specific_qt_paths(): # Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin # so we need to handle this differently # qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin') + # TODO: all current Fedoras do the same, need to look deeper here. qt_bin_dir = '/usr/lib64/qt-3.3/bin' return qt_bin_dir diff --git a/test/QT/qt_warnings.py b/test/QT/qt_warnings.py index 23612de..020333e 100644 --- a/test/QT/qt_warnings.py +++ b/test/QT/qt_warnings.py @@ -84,8 +84,8 @@ if moc: qtdir = os.path.dirname(os.path.dirname(moc)) qtdir = qtdir.replace('\\', '\\\\' ) - expect = \ -r"""scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) + expect = r""" +scons: warning: Could not detect qt, using moc executable as a hint \(QTDIR=%s\) File "%s", line \d+, in (\?|) """ % (qtdir, re.escape(SConstruct_path)) else: diff --git a/test/packaging/rpm/package.py b/test/packaging/rpm/package.py index ddd3c89..23ebe05 100644 --- a/test/packaging/rpm/package.py +++ b/test/packaging/rpm/package.py @@ -86,7 +86,7 @@ test.must_not_exist( 'bin/main' ) with os.popen('rpm -qpl %s' % machine_rpm) as p: out = p.read() test.must_contain_all_lines(out, '/bin/main') -with os.popen('rpm -qpl %s' % machine_rpm) as p: +with os.popen('rpm -qpl %s' % src_rpm) as p: out = p.read() test.fail_test( not out == 'foo-1.2.3.spec\nfoo-1.2.3.tar.gz\n') diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 23b3416..907eac7 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -949,7 +949,7 @@ class TestSCons(TestCommon): def Qt_dummy_installation(self, dir='qt'): # create a dummy qt installation - self.subdir( dir, [dir, 'bin'], [dir, 'include'], [dir, 'lib'] ) + self.subdir(dir, [dir, 'bin'], [dir, 'include'], [dir, 'lib']) self.write([dir, 'bin', 'mymoc.py'], """\ import getopt @@ -960,11 +960,11 @@ cmd_opts, args = getopt.getopt(sys.argv[1:], 'io:wz', []) impl = 0 opt_string = '' for opt, arg in cmd_opts: - if opt == '-o': out = arg + if opt == '-o': outfile = arg elif opt == '-i': impl = 1 else: opt_string = opt_string + ' ' + opt -with open(out, 'w') as ofp: +with open(outfile, 'w') as ofp: ofp.write("/* mymoc.py%s */\\n" % opt_string) for a in args: with open(a, 'r') as ifp: @@ -972,7 +972,7 @@ with open(out, 'w') as ofp: a = a.replace('\\\\', '\\\\\\\\') subst = r'{ my_qt_symbol( "' + a + '\\\\n" ); }' if impl: - contents = re.sub( r'#include.*', '', contents ) + contents = re.sub(r'#include.*', '', contents) ofp.write(contents.replace('Q_OBJECT', subst)) sys.exit(0) """) @@ -988,7 +988,7 @@ source = None opt_string = '' for arg in sys.argv[1:]: if output_arg: - out = arg + outfile = arg output_arg = 0 elif impl_arg: impl = arg @@ -1004,17 +1004,17 @@ for arg in sys.argv[1:]: sys.exit(1) source = sourceFile = arg -with open(out, 'w') as ofp, open(source, 'r') as ifp: +with open(outfile, 'w') as ofp, open(source, 'r') as ifp: ofp.write("/* myuic.py%s */\\n" % opt_string) if impl: - ofp.write( '#include "' + impl + '"\\n' ) + ofp.write('#include "' + impl + '"\\n') includes = re.findall('(.*?)', ifp.read()) for incFile in includes: # this is valid for ui.h files, at least if os.path.exists(incFile): ofp.write('#include "' + incFile + '"\\n') else: - ofp.write( '#include "my_qobject.h"\\n' + ifp.read() + " Q_OBJECT \\n" ) + ofp.write('#include "my_qobject.h"\\n' + ifp.read() + " Q_OBJECT \\n") sys.exit(0) """ ) @@ -1027,7 +1027,7 @@ void my_qt_symbol(const char *arg); #include "../include/my_qobject.h" #include void my_qt_symbol(const char *arg) { - fputs( arg, stdout ); + fputs(arg, stdout); } """) @@ -1035,9 +1035,9 @@ void my_qt_symbol(const char *arg) { env = Environment() import sys if sys.platform == 'win32': - env.StaticLibrary( 'myqt', 'my_qobject.cpp' ) + env.StaticLibrary('myqt', 'my_qobject.cpp') else: - env.SharedLibrary( 'myqt', 'my_qobject.cpp' ) + env.SharedLibrary('myqt', 'my_qobject.cpp') """) self.run(chdir = self.workpath(dir, 'lib'), @@ -1080,7 +1080,7 @@ if ARGUMENTS.get('variant_dir', 0): else: sconscript = File('SConscript') Export("env dup") -SConscript( sconscript ) +SConscript(sconscript) """ % (self.QT, self.QT_LIB, self.QT_MOC, self.QT_UIC)) -- cgit v0.12 From 4007416e4125db5d3598c3113bb1a3052c4460a7 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 25 Apr 2019 16:41:34 -0400 Subject: Remove debug logic --- testing/framework/TestCmd.py | 1 - 1 file changed, 1 deletion(-) diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index bf010e1..d4557e7 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -1636,7 +1636,6 @@ class TestCmd(object): os.mkdir(new) except OSError as e: print("Got error :%s"%e) - import pdb; pdb.set_trace() pass else: count = count + 1 -- cgit v0.12 From 095970b093e2eb1c9d86ae55379d3bb0412cfd85 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 10:34:34 -0400 Subject: Initial testcase logic to fix Issue #2811 --- test/TaskMaster/bug_2811/fixture_dir/SConstruct | 62 +++++++++++++++++++++++++ test/TaskMaster/bug_2811/fixture_dir/a | 8 ++++ test/TaskMaster/bug_2811/fixture_dir/b.in | 2 + test/TaskMaster/bug_2811/fixture_dir/c | 0 test/TaskMaster/bug_2811/fixture_dir/f | 0 test/TaskMaster/bug_2811/fixture_dir/g | 0 6 files changed, 72 insertions(+) create mode 100644 test/TaskMaster/bug_2811/fixture_dir/SConstruct create mode 100644 test/TaskMaster/bug_2811/fixture_dir/a create mode 100644 test/TaskMaster/bug_2811/fixture_dir/b.in create mode 100644 test/TaskMaster/bug_2811/fixture_dir/c create mode 100644 test/TaskMaster/bug_2811/fixture_dir/f create mode 100644 test/TaskMaster/bug_2811/fixture_dir/g diff --git a/test/TaskMaster/bug_2811/fixture_dir/SConstruct b/test/TaskMaster/bug_2811/fixture_dir/SConstruct new file mode 100644 index 0000000..5fcc5f2 --- /dev/null +++ b/test/TaskMaster/bug_2811/fixture_dir/SConstruct @@ -0,0 +1,62 @@ +""" +This issue requires the following. +1. Generated source file which outputs 2 (or more) files +2. Action string gets scanned providing only compiler as part of implicit scan +3. Generated file gets built. Without the bugfix only the first target's .implicit list is cleared. +4. builder/executor/action gets tried again and implicits scanned. 2nd to Nth targets end up + with the compiler at the beginning of the implicit list and the rest of the scanned files added to that list. +5. That bimplicit gets saved into sconsign +6. Second run loads sconsign, now with generated file present a regular implicit scan occurs. This yields 2nd through + Nth target's implicit lists changing when compared to SConsign's which have been loaded. +7. This forces rebuild of source file and this propagates to massive recompile +""" +import SCons.Tool + + +def _dwo_emitter(target, source, env): + new_targets = [] + for t in target: + base, ext = SCons.Util.splitext(str(t)) + if not any(ext == env[osuffix] for osuffix in ['OBJSUFFIX', 'SHOBJSUFFIX']): + continue + # TODO: Move 'dwo' into DWOSUFFIX so it can be customized? For + # now, GCC doesn't let you control the output filename, so it + # doesn't matter. + dwotarget = (t.builder.target_factory or env.File)(base + ".dwo") + new_targets.append(dwotarget) + targets = target + new_targets + return (targets, source) + + +bld = Builder(action='cp $SOURCE $TARGET') + +env = Environment(BUILDERS={'Foo': bld}) + +env['SHCCCOM'] = 'cp $SOURCE $TARGET && cp $SOURCE ${TARGETS[1]}' +env['SHCCCOMSTR'] = env['SHCCCOM'] + + +suffixes = ['.c'] + +for object_builder in SCons.Tool.createObjBuilders(env): + emitterdict = object_builder.builder.emitter + for suffix in emitterdict.iterkeys(): + if not suffix in suffixes: + continue + base = emitterdict[suffix] + emitterdict[suffix] = SCons.Builder.ListEmitter([ + base, + _dwo_emitter, + ]) + +vs = ['a'] + +for v in vs: + env.Foo('%s.c' % v, v) + env.SharedObject('%s.c'%v) + +env.Foo('b','b.in') +# seems like processing is always alphabetical.. + + +# code: language=python insertSpaces=4 tabSize=4 \ No newline at end of file diff --git a/test/TaskMaster/bug_2811/fixture_dir/a b/test/TaskMaster/bug_2811/fixture_dir/a new file mode 100644 index 0000000..d3f62b8 --- /dev/null +++ b/test/TaskMaster/bug_2811/fixture_dir/a @@ -0,0 +1,8 @@ +#include "b" +// #include "c" +// #include "d" +// #include "e" + +int dummy() { + return 1; +} \ No newline at end of file diff --git a/test/TaskMaster/bug_2811/fixture_dir/b.in b/test/TaskMaster/bug_2811/fixture_dir/b.in new file mode 100644 index 0000000..867daaf --- /dev/null +++ b/test/TaskMaster/bug_2811/fixture_dir/b.in @@ -0,0 +1,2 @@ +#include "f" +#include "g" diff --git a/test/TaskMaster/bug_2811/fixture_dir/c b/test/TaskMaster/bug_2811/fixture_dir/c new file mode 100644 index 0000000..e69de29 diff --git a/test/TaskMaster/bug_2811/fixture_dir/f b/test/TaskMaster/bug_2811/fixture_dir/f new file mode 100644 index 0000000..e69de29 diff --git a/test/TaskMaster/bug_2811/fixture_dir/g b/test/TaskMaster/bug_2811/fixture_dir/g new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From 3031ae8c0063bf49bafcb8a9f77a2822221f76d5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 10:36:30 -0400 Subject: Force runtest to skip looking in this directory --- test/TaskMaster/bug_2811/fixture_dir/sconstest.skip | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/TaskMaster/bug_2811/fixture_dir/sconstest.skip diff --git a/test/TaskMaster/bug_2811/fixture_dir/sconstest.skip b/test/TaskMaster/bug_2811/fixture_dir/sconstest.skip new file mode 100644 index 0000000..e69de29 -- cgit v0.12 From 9cacbc061d39a46b792223d0b74b2dcaf5fa2aba Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 10:43:42 -0400 Subject: Change test logic to run once, and then run again expecting up to date. --- ...n_one_target_generated_source_false_rebuilds.py | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/TaskMaster/bug_2811/issue_2811_emitter_more_than_one_target_generated_source_false_rebuilds.py diff --git a/test/TaskMaster/bug_2811/issue_2811_emitter_more_than_one_target_generated_source_false_rebuilds.py b/test/TaskMaster/bug_2811/issue_2811_emitter_more_than_one_target_generated_source_false_rebuilds.py new file mode 100644 index 0000000..8f2f328 --- /dev/null +++ b/test/TaskMaster/bug_2811/issue_2811_emitter_more_than_one_target_generated_source_false_rebuilds.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# __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. +# +""" +This issue requires the following. +1. Generated source file which outputs 2 (or more) files +2. Action string gets scanned providing only compiler as part of implicit scan +3. Generated file gets built. Without the bugfix only the first target's .implicit list is cleared. +4. builder/executor/action gets tried again and implicits scanned. 2nd to Nth targets end up + with the compiler at the beginning of the implicit list and the rest of the scanned files added to that list. +5. That bimplicit gets saved into sconsign +6. Second run loads sconsign, now with generated file present a regular implicit scan occurs. This yields 2nd through + Nth target's implicit lists changing when compared to SConsign's which have been loaded. +7. This forces rebuild of source file and this propagates to massive recompile +""" +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import TestSCons + +test = TestSCons.TestSCons() +test.dir_fixture('fixture_dir') + +test.run() + +# Should not rebuild +test.up_to_date(arguments = '.') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From 4af18c70308e70cf60fdb3843ce9234415857c4e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 11:29:05 -0400 Subject: Fix sider complain --- src/engine/SCons/Node/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 8e7699b..964e85d 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -800,7 +800,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): try: for peer in parent.target_peers: peer.implicit = None - except AttributeError as e: + except AttributeError: pass -- cgit v0.12 From 1f50cb8818f1325729eef9e64e36793ba600b85d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 12:50:23 -0400 Subject: Fix test to use path to python being used wrather than hardcoded linux path --- test/explain/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/explain/basic.py b/test/explain/basic.py index bd474bb..0d4f0ef 100644 --- a/test/explain/basic.py +++ b/test/explain/basic.py @@ -332,7 +332,7 @@ scons: rebuilding `file3' because: Old:zzz New:xxx ->Depends ->Implicit - Old:/usr/bin/python New:/usr/bin/python + Old:%(_python_)s New:%(_python_)s %(_python_)s %(cat_py)s file3 zzz yyy xxx """ % locals()) -- cgit v0.12 From 1c4b16798ab8b479eb3507dd401c98637faf6114 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 12:55:09 -0400 Subject: Added blurb to RELEASE.txt --- src/RELEASE.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 076e4bb..4885085 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -39,8 +39,18 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY - - List modifications to existing features, where the previous behavior - wouldn't actually be considered a bug + - Enhanced --debug=explain output. Now the separate components of the dependency list are split up + as follows: + + scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python FIXES -- cgit v0.12 From c581c35b7bbc95329dcd48738715b40f331b56c0 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 12:58:52 -0400 Subject: Fix test to work with py3.5+ --- test/TaskMaster/bug_2811/fixture_dir/SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/TaskMaster/bug_2811/fixture_dir/SConstruct b/test/TaskMaster/bug_2811/fixture_dir/SConstruct index 5fcc5f2..c124902 100644 --- a/test/TaskMaster/bug_2811/fixture_dir/SConstruct +++ b/test/TaskMaster/bug_2811/fixture_dir/SConstruct @@ -40,7 +40,7 @@ suffixes = ['.c'] for object_builder in SCons.Tool.createObjBuilders(env): emitterdict = object_builder.builder.emitter - for suffix in emitterdict.iterkeys(): + for suffix in emitterdict.keys(): if not suffix in suffixes: continue base = emitterdict[suffix] -- cgit v0.12 From 1ada08832807e71c4a7660bde286fff9bf02e287 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 13:03:18 -0400 Subject: [skip ci] Add text to RELEASE.txt to cover this change --- src/RELEASE.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 06051ea..101eb21 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -41,8 +41,18 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY - - List modifications to existing features, where the previous behavior - wouldn't actually be considered a bug + - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file + is generated. This was causing the > 1th target to not have it's implicit list cleared when the source + file was actually built, leaving an implicit list similar to follows for 2nd and higher target + ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] + This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this + ['zzz', 'yyy', 'xxx', '/usr/bin/python'] + Which would trigger a rebuild because the order changed. + The fix involved added logic to mark all shared targets as peers and then ensure they're implicit + list is all cleared together. + - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + Renamed to SConsEnvironmentError + - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable FIXES -- cgit v0.12 From 3fdeb198e8c487834045ad763fb3df6b07ec8b00 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 26 Apr 2019 13:07:33 -0400 Subject: [skip ci] remove text from RELEASE.txt --- src/RELEASE.txt | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 101eb21..06051ea 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -41,18 +41,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY - - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file - is generated. This was causing the > 1th target to not have it's implicit list cleared when the source - file was actually built, leaving an implicit list similar to follows for 2nd and higher target - ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] - This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this - ['zzz', 'yyy', 'xxx', '/usr/bin/python'] - Which would trigger a rebuild because the order changed. - The fix involved added logic to mark all shared targets as peers and then ensure they're implicit - list is all cleared together. - - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. - Renamed to SConsEnvironmentError - - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable + - List modifications to existing features, where the previous behavior + wouldn't actually be considered a bug FIXES -- cgit v0.12 From 15326cf04732bbcc5ef62c5452349a4bd029b70e Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 26 Apr 2019 11:10:19 -0600 Subject: [PR #3345] fix more PY3.8 fails File closes in msvs tool Context manager in rpm tool Dummy compiler, assembler scripts can be called in unexpected ways (namely by gcc tool init), which passes --version flag. don't take exception on the getopt call. Try again to undo my breakage of _subproc, which was failing on Win+PY27 Signed-off-by: Mats Wichmann --- src/engine/SCons/Action.py | 5 +---- src/engine/SCons/Platform/PlatformTests.py | 3 ++- src/engine/SCons/Tool/msvs.py | 6 ++++++ src/engine/SCons/Tool/rpm.py | 23 ++++++++++++----------- test/AS/fixture/myas.py | 15 ++++++++++----- test/Fortran/link-with-cxx.py | 20 ++++++++++---------- test/Parallel/failed-build.py | 9 ++++++++- test/gnutools.py | 12 ++++++++++-- test/leaky-handles.py | 9 ++++----- test/packaging/rpm/explicit-target.py | 4 ++-- 10 files changed, 65 insertions(+), 41 deletions(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index fd859ad..f1d4d28 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -784,10 +784,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): if DEVNULL: kw[stream] = DEVNULL else: - if sys.platform == 'win32': - kw[stream] = msvcrt.get_osfhandle(os.open(os.devnull, os.O_RDWR)) - else: - kw[stream] = open(os.devnull, "r+") + kw[stream] = open(os.devnull, "r+") # Figure out what shell environment to use ENV = kw.get('env', None) diff --git a/src/engine/SCons/Platform/PlatformTests.py b/src/engine/SCons/Platform/PlatformTests.py index ae070f8..c89610f 100644 --- a/src/engine/SCons/Platform/PlatformTests.py +++ b/src/engine/SCons/Platform/PlatformTests.py @@ -186,7 +186,8 @@ class TempFileMungeTestCase(unittest.TestCase): cmd = t(None, None, env, 0) # print("CMD is:%s"%cmd) - file_content = open(cmd[-1],'rb').read() + with open(cmd[-1],'rb') as f: + file_content = f.read() # print("Content is:[%s]"%file_content) # ...and restoring its setting. SCons.Action.print_actions = old_actions diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 8ec33e6..1f55a04 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -695,6 +695,7 @@ class _GenerateV6DSP(_DSPGenerator): while line and line != '\n': line = dspfile.readline() datas = datas + line + dspfile.close() # OK, we've found our little pickled cache of data. try: @@ -713,6 +714,7 @@ class _GenerateV6DSP(_DSPGenerator): while line and line != '\n': line = dspfile.readline() datas = datas + line + dspfile.close() # OK, we've found our little pickled cache of data. # it has a "# " in front of it, so we strip that. @@ -1008,6 +1010,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): while line and line != '\n': line = dspfile.readline() datas = datas + line + dspfile.close() # OK, we've found our little pickled cache of data. try: @@ -1491,6 +1494,7 @@ class _GenerateV7DSW(_DSWGenerator): while line: line = dswfile.readline() datas = datas + line + dspfile.close() # OK, we've found our little pickled cache of data. try: @@ -1738,6 +1742,7 @@ def GenerateProject(target, source, env): raise bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath()) + bdsp.close() GenerateDSP(dspfile, source, env) @@ -1754,6 +1759,7 @@ def GenerateProject(target, source, env): raise bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath()) + bdsw.close() GenerateDSW(dswfile, source, env) diff --git a/src/engine/SCons/Tool/rpm.py b/src/engine/SCons/Tool/rpm.py index 5198f84..2fd802a 100644 --- a/src/engine/SCons/Tool/rpm.py +++ b/src/engine/SCons/Tool/rpm.py @@ -51,43 +51,44 @@ def get_cmd(source, env): if SCons.Util.is_List(source): tar_file_with_included_specfile = source[0] return "%s %s %s"%(env['RPM'], env['RPMFLAGS'], - tar_file_with_included_specfile.get_abspath() ) + tar_file_with_included_specfile.get_abspath()) def build_rpm(target, source, env): # create a temporary rpm build root. - tmpdir = os.path.join( os.path.dirname( target[0].get_abspath() ), 'rpmtemp' ) + tmpdir = os.path.join(os.path.dirname(target[0].get_abspath()), 'rpmtemp') if os.path.exists(tmpdir): shutil.rmtree(tmpdir) # now create the mandatory rpm directory structure. for d in ['RPMS', 'SRPMS', 'SPECS', 'BUILD']: - os.makedirs( os.path.join( tmpdir, d ) ) + os.makedirs(os.path.join(tmpdir, d)) # set the topdir as an rpmflag. - env.Prepend( RPMFLAGS = '--define \'_topdir %s\'' % tmpdir ) + env.Prepend(RPMFLAGS = '--define \'_topdir %s\'' % tmpdir) # now call rpmbuild to create the rpm package. handle = subprocess.Popen(get_cmd(source, env), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) - output = SCons.Util.to_str(handle.stdout.read()) + with handle.stdout: + output = SCons.Util.to_str(handle.stdout.read()) status = handle.wait() if status: - raise SCons.Errors.BuildError( node=target[0], - errstr=output, - filename=str(target[0]) ) + raise SCons.Errors.BuildError(node=target[0], + errstr=output, + filename=str(target[0])) else: # XXX: assume that LC_ALL=C is set while running rpmbuild - output_files = re.compile( 'Wrote: (.*)' ).findall( output ) + output_files = re.compile('Wrote: (.*)').findall(output) - for output, input in zip( output_files, target ): + for output, input in zip(output_files, target): rpm_output = os.path.basename(output) expected = os.path.basename(input.get_path()) assert expected == rpm_output, "got %s but expected %s" % (rpm_output, expected) - shutil.copy( output, input.get_abspath() ) + shutil.copy(output, input.get_abspath()) # cleanup before leaving. diff --git a/test/AS/fixture/myas.py b/test/AS/fixture/myas.py index 4f5d9ac..3d05c79 100644 --- a/test/AS/fixture/myas.py +++ b/test/AS/fixture/myas.py @@ -23,11 +23,16 @@ if sys.platform == 'win32': else: import getopt - opts, args = getopt.getopt(sys.argv[1:], 'co:') + try: + opts, args = getopt.getopt(sys.argv[1:], 'co:') + except getopt.GetoptError: + # we may be called with --version, just quit if so + sys.exit(0) for opt, arg in opts: if opt == '-o': out = arg - with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: - for l in ifp.readlines(): - if l[:3] != b'#as': - ofp.write(l) + if args: + with open(args[0], 'rb') as ifp, open(out, 'wb') as ofp: + for l in ifp.readlines(): + if l[:3] != b'#as': + ofp.write(l) sys.exit(0) diff --git a/test/Fortran/link-with-cxx.py b/test/Fortran/link-with-cxx.py index f559b0a..22d9081 100644 --- a/test/Fortran/link-with-cxx.py +++ b/test/Fortran/link-with-cxx.py @@ -39,23 +39,23 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons(match = TestSCons.match_re) -test.write('test_linker.py', r""" +test.write('test_linker.py', """\ import sys if sys.argv[1] == '-o': - ofp = open(sys.argv[2], 'wb') - infiles = sys.argv[3:] + with open(sys.argv[2], 'wb') as ofp: + for infile in sys.argv[3:]: + with open(infile, 'rb') as ifp: + ofp.write(ifp.read()) elif sys.argv[1][:5] == '/OUT:': - ofp = open(sys.argv[1][5:], 'wb') - infiles = sys.argv[2:] -for infile in infiles: - with open(infile, 'rb') as ifp: - ofp.write(ifp.read()) -ofp.close() + with open(sys.argv[1][5:], 'wb') as ofp: + for infile in sys.argv[2:]: + with open(infile, 'rb') as ifp: + ofp.write(ifp.read()) sys.exit(0) """) -test.write('test_fortran.py', r""" +test.write('test_fortran.py', """\ import sys with open(sys.argv[2], 'wb') as ofp: for infile in sys.argv[4:]: diff --git a/test/Parallel/failed-build.py b/test/Parallel/failed-build.py index bfdc01d..12a8f04 100644 --- a/test/Parallel/failed-build.py +++ b/test/Parallel/failed-build.py @@ -77,7 +77,14 @@ test.write('mycopy.py', r"""\ import os import sys import time -os.mkdir('mycopy.started') +try: + os.makedirs('mycopy.started', exist_ok=True) +except TypeError: # Python 2 has no exist_ok + try: + os.mkdir('mycopy.started') + except FileExistsError: + pass + with open(sys.argv[1], 'wb') as ofp, open(sys.argv[2], 'rb') as ifp: ofp.write(ifp.read()) for i in [1, 2, 3, 4, 5]: diff --git a/test/gnutools.py b/test/gnutools.py index bd8e366..040de2a 100644 --- a/test/gnutools.py +++ b/test/gnutools.py @@ -45,7 +45,11 @@ test.subdir('gnutools') test.write(['gnutools','mygcc.py'], """ import getopt import sys -cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) +try: + cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) +except getopt.GetoptError: + # we may be called with --version, just quit if so + sys.exit(0) out = None opt_string = '' for opt, arg in cmd_opts: @@ -62,7 +66,11 @@ sys.exit(0) test.write(['gnutools','myg++.py'], """ import getopt import sys -cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) +try: + cmd_opts, args = getopt.getopt(sys.argv[1:], 'f:s:co:', []) +except getopt.GetoptError: + # we may be called with --version, just quit if so + sys.exit(0) out = None opt_string = '' for opt, arg in cmd_opts: diff --git a/test/leaky-handles.py b/test/leaky-handles.py index 3787ee2..e64053c 100644 --- a/test/leaky-handles.py +++ b/test/leaky-handles.py @@ -41,11 +41,10 @@ if os.name != 'posix' or sys.platform == 'darwin': test.write('SConstruct', """ -#Leak a file handle -open('/dev/null') - -#Check it gets closed -test2 = Command('test2', [], '@ls /proc/$$$$/fd|wc -l') +# Leave a file handle open when invoking a command +with open('/dev/null'): + # Check it gets closed when an external command is forked off: + test2 = Command('test2', [], '@ls /proc/$$$$/fd|wc -l') """) # In theory that should have 3 lines (handles 0/1/2). This is v. unix specific diff --git a/test/packaging/rpm/explicit-target.py b/test/packaging/rpm/explicit-target.py index e8fbd39..553ce27 100644 --- a/test/packaging/rpm/explicit-target.py +++ b/test/packaging/rpm/explicit-target.py @@ -48,7 +48,7 @@ test.subdir('src') mainpath = os.path.join('src', 'main.c') test.file_fixture(mainpath, mainpath) -test.write('SConstruct', """ +test.write('SConstruct', """\ import os env=Environment(tools=['default', 'packaging']) @@ -77,7 +77,7 @@ env.Package( NAME = 'foo', expect = """ scons: *** Setting target is not supported for rpm. -""" + test.python_file_line(test.workpath('SConstruct'), 24) +""" + test.python_file_line(test.workpath('SConstruct'), 12) test.run(arguments='', status=2, stderr=expect) -- cgit v0.12 From fbe96c0207942918a0d5f34addaac57d3b9b528c Mon Sep 17 00:00:00 2001 From: Peter Diener Date: Fri, 26 Apr 2019 15:55:03 -0500 Subject: Also ignore PURE and ELEMENTAL after MODULE in Scanner and Emitter. Add subroutines that are declared pure and elemental to the test of the Emitter. Note that in test_1.f90, the interface is repeated in the submodule, whereas in test_2.f90 the interface is taken from the module. Also note that the regex does not check whether "module pure" or "module elemental" is actually followed by "subroutine" or "function". This would be a syntax error and should trigger a compile time error. --- src/engine/SCons/Scanner/Fortran.py | 13 +++++++----- src/engine/SCons/Tool/FortranCommon.py | 2 +- test/fixture/fortran_unittests/test_1.f90 | 22 ++++++++++++++++++++ test/fixture/fortran_unittests/test_2.f90 | 24 ++++++++++++++++++++++ test/fixture/fortran_unittests/test_submodules.f90 | 12 +++++++++++ 5 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/Scanner/Fortran.py b/src/engine/SCons/Scanner/Fortran.py index a932f21..67e6180 100644 --- a/src/engine/SCons/Scanner/Fortran.py +++ b/src/engine/SCons/Scanner/Fortran.py @@ -287,6 +287,8 @@ def FortranScan(path_variable="FORTRANPATH"): # MODULE PROCEDURE procedure_name # MODULE SUBROUTINE subroutine_name # MODULE FUNCTION function_name +# MODULE PURE SUBROUTINE|FUNCTION subroutine_name|function_name +# MODULE ELEMENTAL SUBROUTINE|FUNCTION subroutine_name|function_name # # Here is a breakdown of the regex: # @@ -296,15 +298,16 @@ def FortranScan(path_variable="FORTRANPATH"): # insensitive # \s+ : match one or more white space # characters -# (?!PROCEDURE|SUBROUTINE|FUNCTION) : but *don't* match if the next word -# matches PROCEDURE, SUBROUTINE or -# FUNCTION (negative lookahead -# assertion), case insensitive +# (?!PROCEDURE|SUBROUTINE|FUNCTION|PURE|ELEMENTAL) +# : but *don't* match if the next word +# matches PROCEDURE, SUBROUTINE, +# FUNCTION, PURE or ELEMENTAL (negative +# lookahead assertion), case insensitive # (\w+) : match one or more alphanumeric # characters that make up the defined # module name and save it in a group - def_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" + def_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION|PURE|ELEMENTAL)(\w+)""" scanner = F90Scanner("FortranScan", "$FORTRANSUFFIXES", diff --git a/src/engine/SCons/Tool/FortranCommon.py b/src/engine/SCons/Tool/FortranCommon.py index a38c6e7..cbb9a03 100644 --- a/src/engine/SCons/Tool/FortranCommon.py +++ b/src/engine/SCons/Tool/FortranCommon.py @@ -65,7 +65,7 @@ def _fortranEmitter(target, source, env): print("Could not locate " + str(node.name)) return ([], []) # This has to match the def_regex in the Fortran scanner - mod_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION)(\w+)""" + mod_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION|PURE|ELEMENTAL)(\w+)""" cre = re.compile(mod_regex,re.M) # Retrieve all USE'd module names modules = cre.findall(node.get_text_contents()) diff --git a/test/fixture/fortran_unittests/test_1.f90 b/test/fixture/fortran_unittests/test_1.f90 index 25ba9d6..50ab99e 100644 --- a/test/fixture/fortran_unittests/test_1.f90 +++ b/test/fixture/fortran_unittests/test_1.f90 @@ -5,6 +5,8 @@ module test_1 contains procedure :: set_n procedure :: get_n + procedure :: increment_n + procedure :: decrement_n end type test_type_1 @@ -20,6 +22,14 @@ interface integer :: get_n end function get_n + module pure subroutine increment_n ( this ) + class(test_type_1), intent(inout) :: this + end subroutine increment_n + + module elemental subroutine decrement_n ( this ) + class(test_type_1), intent(inout) :: this + end subroutine decrement_n + end interface end module test_1 @@ -43,4 +53,16 @@ contains get_n = this%n end procedure get_n + module pure subroutine increment_n ( this ) + class(test_type_1), intent(inout) :: this + + this%n = this%n+1 + end subroutine increment_n + + module elemental subroutine decrement_n ( this ) + class(test_type_1), intent(inout) :: this + + this%n = this%n-1 + end subroutine decrement_n + end submodule test_1_impl diff --git a/test/fixture/fortran_unittests/test_2.f90 b/test/fixture/fortran_unittests/test_2.f90 index 7a39b0d..e271953 100644 --- a/test/fixture/fortran_unittests/test_2.f90 +++ b/test/fixture/fortran_unittests/test_2.f90 @@ -5,6 +5,8 @@ module test_2 contains procedure :: set_m procedure :: get_m + procedure :: increment_m + procedure :: decrement_m end type test_type_2 @@ -20,6 +22,14 @@ interface integer :: get_m end function get_m + module pure subroutine increment_m ( this ) + class(test_type_2), intent(inout) :: this + end subroutine increment_m + + module elemental subroutine decrement_m ( this ) + class(test_type_2), intent(inout) :: this + end subroutine decrement_m + end interface end module test_2 @@ -43,4 +53,18 @@ contains get_m = this%m end procedure get_m + module procedure increment_m + + implicit none + + this%m = this%m+1 + end procedure increment_m + + module procedure decrement_m + + implicit none + + this%m = this%m-1 + end procedure decrement_m + end submodule test_2_impl diff --git a/test/fixture/fortran_unittests/test_submodules.f90 b/test/fixture/fortran_unittests/test_submodules.f90 index 5deec37..08e472c 100644 --- a/test/fixture/fortran_unittests/test_submodules.f90 +++ b/test/fixture/fortran_unittests/test_submodules.f90 @@ -12,4 +12,16 @@ program test_submodules print*,'var1%n = ', var1%get_n() print*,'var2%m = ', var2%get_m() + call var1%increment_n() + call var2%increment_m() + + print*,'var1%n = ', var1%get_n() + print*,'var2%m = ', var2%get_m() + + call var1%decrement_n() + call var2%decrement_m() + + print*,'var1%n = ', var1%get_n() + print*,'var2%m = ', var2%get_m() + end program test_submodules -- cgit v0.12 From 706f641d9d0c1ebf4197d65bc3bf8d049e65d1a9 Mon Sep 17 00:00:00 2001 From: Peter Diener Date: Fri, 26 Apr 2019 18:13:43 -0500 Subject: Update with fixes to handling of submodules. --- src/CHANGES.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 98a414e..5c02f97 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -7,6 +7,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From Peter Diener: + - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + From William Deegan: - Fix Issue #3283 - Handle using --config=force in combination with Decider('MD5-timestamp'). @@ -18,7 +21,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Decider and not clearing it when the configure context is completed. - Add default paths for yacc tool on windows to include cygwin, mingw, and chocolatey - From Github User pdiener: + From Peter Diener: - Fix issue #3135 - Handle Fortran submodules and type bound procedures From Daniel Moody: -- cgit v0.12 From b6bc88eaeb6e254525399a1143e7e536b2dbe4ef Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 27 Apr 2019 15:21:10 -0400 Subject: Update CHANGES.txt fixed CHANGES.txt to have only one section for Peter Dienier --- src/CHANGES.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 5c02f97..024e697 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -9,6 +9,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Peter Diener: - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + - Fix issue #3135 - Handle Fortran submodules and type bound procedures From William Deegan: @@ -21,10 +22,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Decider and not clearing it when the configure context is completed. - Add default paths for yacc tool on windows to include cygwin, mingw, and chocolatey - From Peter Diener: - - Fix issue #3135 - Handle Fortran submodules and type bound procedures - - From Daniel Moody: +From Daniel Moody: - Change the default for AppendENVPath to delete_existing=0, so path order will not be changed, unless explicitly set (Issue #3276) - Fixed bug which threw error when running SCons on windows system with no MSVC installed. -- cgit v0.12 From 40cc7f128dec6f5a73b2dccd1d9841b54e987e96 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 27 Apr 2019 15:35:34 -0400 Subject: switch to using zip_longest and handle py27 naming it izip_longest from ampping None to allow for explain to handel old and new dependency lists of different lengths --- src/engine/SCons/Node/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index e44fc17..7322958 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -50,6 +50,11 @@ import collections import copy from itertools import chain +try: + from itertools import zip_longest +except ImportError: + from itertools import izip_longest as zip_longest + import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Executor @@ -1668,13 +1673,13 @@ class Node(object, with_metaclass(NoSlotsPyPy)): if len(lines) == 0 and old_bkids != new_bkids: lines.append("the dependency order changed:\n") lines.append("->Sources\n") - for (o,n) in map(None, old.bsources, new.bsources): + for (o,n) in zip_longest(old.bsources, new.bsources, fillvalue=None): lines.append("Old:%s\tNew:%s\n"%(o,n)) lines.append("->Depends\n") - for (o,n) in map(None, old.bdepends, new.bdepends): + for (o,n) in zip_longest(old.bdepends, new.bdepends, fillvalue=None): lines.append("Old:%s\tNew:%s\n"%(o,n)) lines.append("->Implicit\n") - for (o,n) in map(None, old.bimplicit, new.bimplicit): + for (o,n) in zip_longest(old.bimplicit, new.bimplicit, fillvalue=None): lines.append("Old:%s\tNew:%s\n"%(o,n)) if len(lines) == 0: -- cgit v0.12 From c1ae73ae94b8437aed7e4ffd10b50620580d305f Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 27 Apr 2019 13:17:30 -0600 Subject: Some more lint-derived cleanups Consistently use "not is" and "not in", many instances used the form "not x is y" instead, which pylint objected to. A couple of bare except clauses got a qualifier. Files otherwise touched had trailing whitespace cleaned up as well. These are all things that sider would complain about if a change happened nearby, so this is pre-emptive. Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 3 +- src/engine/SCons/Action.py | 2 +- src/engine/SCons/Builder.py | 16 +++++---- src/engine/SCons/CacheDir.py | 2 +- src/engine/SCons/Conftest.py | 18 +++++----- src/engine/SCons/Defaults.py | 2 +- src/engine/SCons/Environment.py | 6 ++-- src/engine/SCons/Executor.py | 7 ++-- src/engine/SCons/Job.py | 34 +++++++++--------- src/engine/SCons/Node/FS.py | 30 ++++++++-------- src/engine/SCons/Node/__init__.py | 6 ++-- src/engine/SCons/SConf.py | 2 +- src/engine/SCons/SConsign.py | 7 ++-- src/engine/SCons/Scanner/__init__.py | 2 +- src/engine/SCons/Script/Main.py | 2 +- src/engine/SCons/Script/SConsOptions.py | 6 ++-- src/engine/SCons/Subst.py | 6 ++-- src/engine/SCons/Tool/GettextCommon.py | 56 +++++++++++++++--------------- src/engine/SCons/Tool/JavaCommon.py | 2 +- src/engine/SCons/Tool/MSCommon/common.py | 2 +- src/engine/SCons/Tool/MSCommon/vs.py | 2 +- src/engine/SCons/Tool/jar.py | 8 ++--- src/engine/SCons/Tool/mingw.py | 2 +- src/engine/SCons/Tool/mslink.py | 6 ++-- src/engine/SCons/Tool/msvc.py | 4 +-- src/engine/SCons/Tool/msvs.py | 34 +++++++++--------- src/engine/SCons/Tool/qt.py | 20 +++++------ src/engine/SCons/Tool/tex.py | 2 +- src/engine/SCons/Util.py | 6 ++-- src/engine/SCons/Variables/EnumVariable.py | 2 +- src/engine/SCons/Variables/ListVariable.py | 2 +- src/engine/SCons/Variables/__init__.py | 6 ++-- src/engine/SCons/Warnings.py | 8 ++--- src/engine/SCons/cpp.py | 2 +- src/script/scons-time.py | 18 +++++----- src/script/sconsign.py | 6 ++-- testing/framework/TestSConsMSVS.py | 28 +++++++-------- 37 files changed, 185 insertions(+), 182 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 4d095dc..3496632 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -30,7 +30,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER always present on modern Pythons; no longer need the code for 2.5-and-earlier optparse). cmp is not a builtin function in Py3, drop one (unused) use; replace one. Fix another instance of - renaming to SConsEnvironmentError. + renaming to SConsEnvironmentError. Trailing whitespace. + Consistently use not is/in (if not x is y -> if x is not y). diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index bff6003..1257309 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -1091,7 +1091,7 @@ class LazyAction(CommandGeneratorAction, CommandAction): def get_parent_class(self, env): c = env.get(self.var) - if is_String(c) and not '\n' in c: + if is_String(c) and '\n' not in c: return CommandAction return CommandGeneratorAction diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py index 010d5ff..616d5fc 100644 --- a/src/engine/SCons/Builder.py +++ b/src/engine/SCons/Builder.py @@ -274,7 +274,7 @@ def Builder(**kw): result = BuilderBase(**kw) - if not composite is None: + if composite is not None: result = CompositeBuilder(result, composite) return result @@ -293,7 +293,7 @@ def _node_errors(builder, env, tlist, slist): if t.has_explicit_builder(): # Check for errors when the environments are different # No error if environments are the same Environment instance - if (not t.env is None and not t.env is env and + if (t.env is not None and t.env is not env and # Check OverrideEnvironment case - no error if wrapped Environments # are the same instance, and overrides lists match not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and @@ -309,7 +309,7 @@ def _node_errors(builder, env, tlist, slist): else: try: msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8')) - except UnicodeDecodeError as e: + except UnicodeDecodeError: msg = "Two environments with different actions were specified for the same target: %s"%t raise UserError(msg) if builder.multi: @@ -424,7 +424,7 @@ class BuilderBase(object): if name: self.name = name self.executor_kw = {} - if not chdir is _null: + if chdir is not _null: self.executor_kw['chdir'] = chdir self.is_explicit = is_explicit @@ -554,8 +554,10 @@ class BuilderBase(object): result = [] if target is None: target = [None]*len(source) for tgt, src in zip(target, source): - if not tgt is None: tgt = [tgt] - if not src is None: src = [src] + if tgt is not None: + tgt = [tgt] + if src is not None: + src = [src] result.extend(self._execute(env, tgt, src, overwarn)) return SCons.Node.NodeList(result) @@ -744,7 +746,7 @@ class BuilderBase(object): for s in SCons.Util.flatten(source): if SCons.Util.is_String(s): match_suffix = match_src_suffix(env.subst(s)) - if not match_suffix and not '.' in s: + if not match_suffix and '.' not in s: src_suf = self.get_src_suffix(env) s = self._adjustixes(s, None, src_suf)[0] else: diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index 3d8e7bd..dabda8e 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -209,7 +209,7 @@ class CacheDir(object): self.debugFP.write(fmt % (target, os.path.split(cachefile)[1])) def is_enabled(self): - return cache_enabled and not self.path is None + return cache_enabled and self.path is not None def is_readonly(self): return cache_readonly diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index 84aa992..6b7e810 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -354,7 +354,7 @@ def CheckHeader(context, header_name, header = None, language = None, context.Display("Checking for %s header file %s... " % (lang, header_name)) ret = context.CompileProg(text, suffix) - _YesNoResult(context, ret, "HAVE_" + header_name, text, + _YesNoResult(context, ret, "HAVE_" + header_name, text, "Define to 1 if you have the <%s> header file." % header_name) return ret @@ -439,7 +439,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N Returns: status : int 0 if the check failed, or the found size of the type if the check succeeded.""" - + # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename @@ -454,8 +454,8 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N context.Display("Cannot check for %s type: %s\n" % (type_name, msg)) return msg - src = includetext + header - if not expect is None: + src = includetext + header + if expect is not None: # Only check if the given size is the right one context.Display('Checking %s is %d bytes... ' % (type_name, expect)) @@ -477,7 +477,7 @@ int main(void) st = context.CompileProg(src % (type_name, expect), suffix) if not st: context.Display("yes\n") - _Have(context, "SIZEOF_%s" % type_name, expect, + _Have(context, "SIZEOF_%s" % type_name, expect, "The size of `%s', as computed by sizeof." % type_name) return expect else: @@ -541,7 +541,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): Returns: status : bool True if the check failed, False if succeeded.""" - + # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename @@ -556,7 +556,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): context.Display("Cannot check for declaration %s: %s\n" % (symbol, msg)) return msg - src = includetext + includes + src = includetext + includes context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" @@ -677,7 +677,7 @@ return 0; "Define to 1 if you have the `%s' library." % lib_name) if oldLIBS != -1 and (ret or not autoadd): context.SetLIBS(oldLIBS) - + if not ret: return ret @@ -751,7 +751,7 @@ def _Have(context, key, have, comment = None): line = "#define %s %d\n" % (key_up, have) else: line = "#define %s %s\n" % (key_up, str(have)) - + if comment is not None: lines = "\n/* %s */\n" % comment + line else: diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index aa7dd2f..a69d8b0 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -193,7 +193,7 @@ def chmod_func(dest, mode): SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] - if SCons.Util.is_String(mode) and not 0 in [i in digits for i in mode]: + if SCons.Util.is_String(mode) and 0 not in [i in digits for i in mode]: mode = int(mode, 8) if not SCons.Util.is_String(mode): for element in dest: diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 88fbc3b..488b574 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -608,7 +608,7 @@ class SubstitutionEnvironment(object): Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone. """ - self.added_methods = [dm for dm in self.added_methods if not dm.method is function] + self.added_methods = [dm for dm in self.added_methods if dm.method is not function] def Override(self, overrides): """ @@ -1342,7 +1342,7 @@ class Base(SubstitutionEnvironment): dk = list(filter(lambda x, val=val: x not in val, dk)) self._dict[key] = dk + [val] else: - if not val in dk: + if val not in dk: self._dict[key] = dk + [val] else: if key == 'CPPDEFINES': @@ -1722,7 +1722,7 @@ class Base(SubstitutionEnvironment): dk = [x for x in dk if x not in val] self._dict[key] = [val] + dk else: - if not val in dk: + if val not in dk: self._dict[key] = [val] + dk else: if delete_existing: diff --git a/src/engine/SCons/Executor.py b/src/engine/SCons/Executor.py index 6c68e09..28bb6ad 100644 --- a/src/engine/SCons/Executor.py +++ b/src/engine/SCons/Executor.py @@ -36,6 +36,7 @@ import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Memoize +import SCons.Util from SCons.compat import with_metaclass, NoSlotsPyPy class Batch(object): @@ -71,7 +72,7 @@ class TSList(collections.UserList): return nl[i] def __getslice__(self, i, j): nl = self.func() - i = max(i, 0); j = max(j, 0) + i, j = max(i, 0), max(j, 0) return nl[i:j] def __str__(self): nl = self.func() @@ -572,7 +573,6 @@ def AddBatchExecutor(key, executor): nullenv = None -import SCons.Util class NullEnvironment(SCons.Util.Null): import SCons.CacheDir _CacheDir_path = None @@ -615,7 +615,8 @@ class Null(object, with_metaclass(NoSlotsPyPy)): '_execute_str') def __init__(self, *args, **kw): - if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null') + if SCons.Debug.track_instances: + logInstanceCreation(self, 'Executor.Null') self.batches = [Batch(kw['targets'][:], [])] def get_build_env(self): return get_NullEnvironment() diff --git a/src/engine/SCons/Job.py b/src/engine/SCons/Job.py index 3720ca2..d70125c 100644 --- a/src/engine/SCons/Job.py +++ b/src/engine/SCons/Job.py @@ -53,14 +53,14 @@ interrupt_msg = 'Build interrupted.' class InterruptState(object): - def __init__(self): - self.interrupted = False + def __init__(self): + self.interrupted = False - def set(self): - self.interrupted = True + def set(self): + self.interrupted = True - def __call__(self): - return self.interrupted + def __call__(self): + return self.interrupted class Jobs(object): @@ -87,7 +87,7 @@ class Jobs(object): stack_size = explicit_stack_size if stack_size is None: stack_size = default_stack_size - + try: self.job = Parallel(taskmaster, num, stack_size) self.num_jobs = num @@ -172,14 +172,14 @@ class Serial(object): """ def __init__(self, taskmaster): - """Create a new serial job given a taskmaster. + """Create a new serial job given a taskmaster. The taskmaster's next_task() method should return the next task that needs to be executed, or None if there are no more tasks. The taskmaster's executed() method will be called for each task when it is successfully executed, or failed() will be called if it failed to execute (e.g. execute() raised an exception).""" - + self.taskmaster = taskmaster self.interrupted = InterruptState() @@ -188,7 +188,7 @@ class Serial(object): and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" - + while True: task = self.taskmaster.next_task() @@ -199,7 +199,7 @@ class Serial(object): task.prepare() if task.needs_execute(): task.execute() - except Exception as e: + except Exception: if self.interrupted(): try: raise SCons.Errors.BuildError( @@ -269,7 +269,7 @@ else: def __init__(self, num, stack_size, interrupted): """Create the request and reply queues, and 'num' worker threads. - + One must specify the stack size of the worker threads. The stack size is specified in kilobytes. """ @@ -277,11 +277,11 @@ else: self.resultsQueue = queue.Queue(0) try: - prev_size = threading.stack_size(stack_size*1024) + prev_size = threading.stack_size(stack_size*1024) except AttributeError as e: # Only print a warning if the stack size has been # explicitly set. - if not explicit_stack_size is None: + if explicit_stack_size is not None: msg = "Setting stack size is unsupported by this version of Python:\n " + \ e.args[0] SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) @@ -322,7 +322,7 @@ else: self.requestQueue.put(None) # Wait for all of the workers to terminate. - # + # # If we don't do this, later Python versions (2.4, 2.5) often # seem to raise exceptions during shutdown. This happens # in requestQueue.get(), as an assertion failure that @@ -339,7 +339,7 @@ else: self.workers = [] class Parallel(object): - """This class is used to execute tasks in parallel, and is somewhat + """This class is used to execute tasks in parallel, and is somewhat less efficient than Serial, but is appropriate for parallel builds. This class is thread safe. @@ -373,7 +373,7 @@ else: an exception), then the job will stop.""" jobs = 0 - + while True: # Start up as many available tasks as we're # allowed to. diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 61054f3..44c6f83 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -282,7 +282,7 @@ def set_duplicate(duplicate): 'copy' : _copy_func } - if not duplicate in Valid_Duplicates: + if duplicate not in Valid_Duplicates: raise SCons.Errors.InternalError("The argument of set_duplicate " "should be in Valid_Duplicates") global Link_Funcs @@ -531,7 +531,7 @@ class EntryProxy(SCons.Util.Proxy): except KeyError: try: attr = SCons.Util.Proxy.__getattr__(self, name) - except AttributeError as e: + except AttributeError: # Raise our own AttributeError subclass with an # overridden __str__() method that identifies the # name of the entry that caused the exception. @@ -699,13 +699,13 @@ class Base(SCons.Node.Node): @SCons.Memoize.CountMethodCall def stat(self): - try: + try: return self._memo['stat'] - except KeyError: + except KeyError: pass - try: + try: result = self.fs.stat(self.get_abspath()) - except os.error: + except os.error: result = None self._memo['stat'] = result @@ -719,16 +719,16 @@ class Base(SCons.Node.Node): def getmtime(self): st = self.stat() - if st: + if st: return st[stat.ST_MTIME] - else: + else: return None def getsize(self): st = self.stat() - if st: + if st: return st[stat.ST_SIZE] - else: + else: return None def isdir(self): @@ -1689,7 +1689,7 @@ class Dir(Base): return result def addRepository(self, dir): - if dir != self and not dir in self.repositories: + if dir != self and dir not in self.repositories: self.repositories.append(dir) dir._tpath = '.' self.__clearRepositoryCache() @@ -1729,7 +1729,7 @@ class Dir(Base): if self is other: result = '.' - elif not other in self._path_elements: + elif other not in self._path_elements: try: other_dir = other.get_dir() except AttributeError: @@ -3350,7 +3350,7 @@ class File(Base): df = dmap.get(c_str, None) if df: return df - + if os.altsep: c_str = c_str.replace(os.sep, os.altsep) df = dmap.get(c_str, None) @@ -3387,7 +3387,7 @@ class File(Base): file and just copy the prev_ni provided. If the prev_ni is wrong. It will propagate it. See: https://github.com/SCons/scons/issues/2980 - + Args: self - dependency target - target @@ -3396,7 +3396,7 @@ class File(Base): node to function. So if we detect that it's not passed. we throw DeciderNeedsNode, and caller should handle this and pass node. - Returns: + Returns: Boolean - Indicates if node(File) has changed. """ if node is None: diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index b9aca96..841c3b2 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1160,7 +1160,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): binfo.bactsig = SCons.Util.MD5signature(executor.get_contents()) if self._specific_sources: - sources = [s for s in self.sources if not s in ignore_set] + sources = [s for s in self.sources if s not in ignore_set] else: sources = executor.get_unignored_sources(self, self.ignore) @@ -1647,14 +1647,14 @@ class Node(object, with_metaclass(NoSlotsPyPy)): lines = [] - removed = [x for x in old_bkids if not x in new_bkids] + removed = [x for x in old_bkids if x not in new_bkids] if removed: removed = [stringify(r) for r in removed] fmt = "`%s' is no longer a dependency\n" lines.extend([fmt % s for s in removed]) for k in new_bkids: - if not k in old_bkids: + if k not in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) else: try: diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index c3f93db..59afb40 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -788,7 +788,7 @@ class SConfBase(object): self.active = 0 sconf_global = None - if not self.config_h is None: + if self.config_h is not None: _ac_config_hs[self.config_h] = self.config_h_text self.env.fs = self.lastEnvFs diff --git a/src/engine/SCons/SConsign.py b/src/engine/SCons/SConsign.py index dfafdc9..8b2dc61 100644 --- a/src/engine/SCons/SConsign.py +++ b/src/engine/SCons/SConsign.py @@ -76,7 +76,8 @@ def Get_DataBase(dir): except KeyError: path = d.entry_abspath(DB_Name) try: db = DataBase[d] = DB_Module.open(path, mode) - except (IOError, OSError): pass + except (IOError, OSError): + pass else: if mode != "r": DB_sync_list.append(db) @@ -334,7 +335,7 @@ class DirFile(Dir): Dir.__init__(self, fp, dir) except KeyboardInterrupt: raise - except: + except Exception: SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%self.sconsign) @@ -417,7 +418,7 @@ def File(name, dbm_module=None): else: ForDirectory = DB DB_Name = name - if not dbm_module is None: + if dbm_module is not None: DB_Module = dbm_module # Local Variables: diff --git a/src/engine/SCons/Scanner/__init__.py b/src/engine/SCons/Scanner/__init__.py index f7828ab..a644101 100644 --- a/src/engine/SCons/Scanner/__init__.py +++ b/src/engine/SCons/Scanner/__init__.py @@ -207,7 +207,7 @@ class Base(object): self = self.select(node) - if not self.argument is _null: + if self.argument is not _null: node_list = self.function(node, env, path, self.argument) else: node_list = self.function(node, env, path) diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index fdcd252..acc8678 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -1170,7 +1170,7 @@ def _build_targets(fs, options, targets, target_top): # -U, local SConscript Default() targets target_top = fs.Dir(target_top) def check_dir(x, target_top=target_top): - if hasattr(x, 'cwd') and not x.cwd is None: + if hasattr(x, 'cwd') and x.cwd is not None: cwd = x.cwd.srcnode() return cwd == target_top else: diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index 01d365d..c45cb01 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/engine/SCons/Script/SConsOptions.py @@ -147,7 +147,7 @@ class SConsValues(optparse.Values): """ Sets an option from an SConscript file. """ - if not name in self.settable: + if name not in self.settable: raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name) if name == 'num_jobs': @@ -167,7 +167,7 @@ class SConsValues(optparse.Values): value = str(value) except ValueError: raise SCons.Errors.UserError("A string is required: %s"%repr(value)) - if not value in SCons.Node.FS.Valid_Duplicates: + if value not in SCons.Node.FS.Valid_Duplicates: raise SCons.Errors.UserError("Not a valid duplication style: %s" % value) # Set the duplicate style right away so it can affect linking # of SConscript files. @@ -659,7 +659,7 @@ def Parser(version): metavar="TYPE") def opt_duplicate(option, opt, value, parser): - if not value in SCons.Node.FS.Valid_Duplicates: + if value not in SCons.Node.FS.Valid_Duplicates: raise OptionValueError(opt_invalid('duplication', value, SCons.Node.FS.Valid_Duplicates)) setattr(parser.values, option.dest, value) diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 0b4190b..6f62198 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -350,7 +350,7 @@ _rm_split = re.compile(r'(? or no-. The warning class is munged in order @@ -210,7 +211,6 @@ def process_warn_strings(arguments): As a special case, --warn=all and --warn=no-all will enable or disable (respectively) the base Warning class of all warnings. - """ def _capitalize(s): diff --git a/src/engine/SCons/cpp.py b/src/engine/SCons/cpp.py index c1172aa..5b35390 100644 --- a/src/engine/SCons/cpp.py +++ b/src/engine/SCons/cpp.py @@ -210,7 +210,7 @@ class FunctionEvaluator(object): parts = [] for s in self.expansion: - if not s in self.args: + if s not in self.args: s = repr(s) parts.append(s) statement = ' + '.join(parts) diff --git a/src/script/scons-time.py b/src/script/scons-time.py index 39a6e64..a7120c9 100644 --- a/src/script/scons-time.py +++ b/src/script/scons-time.py @@ -107,7 +107,7 @@ class Line(object): # in the line's index number. We might want to represent # this some way rather than just drawing the line straight # between the two points on either side. - if not y is None: + if y is not None: print(fmt % (x, y)) print('e') @@ -141,13 +141,13 @@ class Gnuplotter(Plotter): result = [] for line in self.lines: result.extend(line.get_x_values()) - return [r for r in result if not r is None] + return [r for r in result if r is not None] def get_all_y_values(self): result = [] for line in self.lines: result.extend(line.get_y_values()) - return [r for r in result if not r is None] + return [r for r in result if r is not None] def get_min_x(self): try: @@ -252,7 +252,7 @@ def tee_to_file(command, log): return '%s 2>&1 | tee %s' % (command, log) - + class SConsTimer(object): """ Usage: scons-time SUBCOMMAND [ARGUMENTS] @@ -348,7 +348,7 @@ class SConsTimer(object): 'SCons' : 'Total SCons execution time', 'commands' : 'Total command execution time', } - + time_string_all = 'Total .* time' # @@ -629,7 +629,7 @@ class SConsTimer(object): return None result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:] result = [ float(r) for r in result ] - if not time_string is None: + if time_string is not None: try: result = result[0] except IndexError: @@ -921,7 +921,7 @@ class SConsTimer(object): elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): - if not a in self.stages: + if a not in self.stages: sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a)) sys.exit(1) stage = a @@ -1035,7 +1035,7 @@ class SConsTimer(object): elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): - if not a in self.stages: + if a not in self.stages: sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) @@ -1423,7 +1423,7 @@ class SConsTimer(object): elif o in ('--title',): self.title = a elif o in ('--which',): - if not a in list(self.time_strings.keys()): + if a not in list(self.time_strings.keys()): sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 6ba0a7c..c7050bc 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -117,7 +117,7 @@ else: # check `pwd`/lib/scons*. temp.append(os.getcwd()) else: - if script_dir == '.' or script_dir == '': + if script_dir in ('.', ''): script_dir = os.getcwd() head, tail = os.path.split(script_dir) if tail == "bin": @@ -261,7 +261,7 @@ def default_mapper(entry, name): """ try: val = eval("entry." + name) - except: + except AttributeError: val = None if sys.version_info.major >= 3 and isinstance(val, bytes): # This is a dirty hack for py 2/3 compatibility. csig is a bytes object @@ -596,7 +596,7 @@ for o, a in opts: # this was handled by calling my_import('SCons.dblite') # again in earlier versions... SCons.dblite.ignore_corrupt_dbfiles = 0 - except: + except ImportError: sys.stderr.write("sconsign: illegal file format `%s'\n" % a) print(helpstr) sys.exit(2) diff --git a/testing/framework/TestSConsMSVS.py b/testing/framework/TestSConsMSVS.py index 4c99bd4..4c853dc 100644 --- a/testing/framework/TestSConsMSVS.py +++ b/testing/framework/TestSConsMSVS.py @@ -38,18 +38,18 @@ expected_dspfile_6_0 = '''\ CFG=Test - Win32 Release !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Test.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Test.mak" CFG="Test - Win32 Release" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Test - Win32 Release" (based on "Win32 (x86) External Target") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -85,7 +85,7 @@ CFG=Test - Win32 Release !IF "$(CFG)" == "Test - Win32 Release" -!ENDIF +!ENDIF # Begin Group "Header Files" @@ -1150,7 +1150,7 @@ import SCons.Tool.MSCommon print("self.scons_version =%%s"%%repr(SCons.__%s__)) print("self._msvs_versions =%%s"%%str(SCons.Tool.MSCommon.query_versions())) """ % 'version' - + self.run(arguments = '-n -q -Q -f -', stdin = input) exec(self.stdout()) @@ -1233,11 +1233,11 @@ print("self._msvs_versions =%%s"%%str(SCons.Tool.MSCommon.query_versions())) finally: os.environ['SCONSFLAGS'] = save_sconsflags or '' return result - + def get_vs_host_arch(self): """ Get an MSVS, SDK , and/or MSVS acceptable platform arch """ - + # Dict to 'canonalize' the arch _ARCH_TO_CANONICAL = { "x86": "x86", @@ -1255,21 +1255,19 @@ print("self._msvs_versions =%%s"%%str(SCons.Tool.MSCommon.query_versions())) # PROCESSOR_ARCHITECTURE. if not host_platform: host_platform = os.environ.get('PROCESSOR_ARCHITECTURE', '') - - + try: host = _ARCH_TO_CANONICAL[host_platform] except KeyError as e: # Default to x86 for all other platforms host = 'x86' - - + return host def validate_msvs_file(self, file): try: x = ElementTree.parse(file) - except: + except: print("--------------------------------------------------------------") print("--------------------------------------------------------------") print(traceback.format_exc()) -- cgit v0.12 From 4ecdcf07580b1bfcd03f7886b6ab9256ee825175 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 27 Apr 2019 13:42:49 -0600 Subject: [#PR 3345] clean up some sider complaints Signed-off-by: Mats Wichmann --- src/engine/SCons/Action.py | 2 -- src/engine/SCons/Tool/msvs.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index f1d4d28..391db06 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -108,8 +108,6 @@ import subprocess import itertools import inspect from collections import OrderedDict -if sys.platform == 'win32': - import msvcrt import SCons.Debug from SCons.Debug import logInstanceCreation diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 1f55a04..008e9ce 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -1494,7 +1494,7 @@ class _GenerateV7DSW(_DSWGenerator): while line: line = dswfile.readline() datas = datas + line - dspfile.close() + dswfile.close() # OK, we've found our little pickled cache of data. try: -- cgit v0.12 From ce51b20a0b22a3eecd8602bdca7a6ff3906113af Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 16 Apr 2019 13:55:04 -0600 Subject: Avoid cachedir races 1. Add a Py3-only version of the cachedir config read, using exclusive open to avoid races. 2. In the Py2-only version, add the hack from issue #3351 to dodge one source of races. Signed-off-by: Mats Wichmann --- src/engine/SCons/CacheDir.py | 75 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index dabda8e..f2d3810 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -139,16 +139,78 @@ warned = dict() class CacheDir(object): def __init__(self, path): + """ + Initialize a CacheDir object. + + The cache configuration is stored in the object. It + is read from the config file in the supplied path if + one exists, if not the config file is created and + the default config is written, as well as saved in the object. + """ self.path = path self.current_cache_debug = None self.debugFP = None self.config = dict() if path is None: return - # See if there's a config file in the cache directory. If there is, - # use it. If there isn't, and the directory exists and isn't empty, - # produce a warning. If the directory doesn't exist or is empty, - # write a config file. + + from SCons.Util import PY3 + if PY3: + self._readconfig3(path) + else: + self._readconfig2(path) + + + def _readconfig3(self, path): + """ + Python3 version of reading the cache config. + + If directory or config file do not exist, create. Take advantage + of Py3 capability in os.makedirs() and in file open(): just try + the operation and handle failure appropriately. + + Omit the check for old cache format, assume that's old enough + there will be none of those left to worry about. + + :param path: path to the cache directory + """ + config_file = os.path.join(path, 'config') + try: + os.makedirs(path, exist_ok=True) + except FileExistsError: + pass + except OSError: + msg = "Failed to create cache directory " + path + raise SCons.Errors.EnvironmentError(msg) + + try: + with open(config_file, 'x') as config: + self.config['prefix_len'] = 2 + try: + json.dump(self.config, config) + except: + msg = "Failed to write cache configuration for " + path + raise SCons.Errors.EnvironmentError(msg) + except FileExistsError: + try: + with open(config_file) as config: + self.config = json.load(config) + except ValueError: + msg = "Failed to read cache configuration for " + path + raise SCons.Errors.EnvironmentError(msg) + + + def _readconfig2(self, path): + """ + Python2 version of reading cache config. + + See if there's a config file in the cache directory. If there is, + use it. If there isn't, and the directory exists and isn't empty, + produce a warning. If the directory doesn't exist or is empty, + write a config file. + + :param path: path to the cache directory + """ config_file = os.path.join(path, 'config') if not os.path.exists(config_file): # A note: There is a race hazard here, if two processes start and @@ -159,14 +221,15 @@ class CacheDir(object): # as an attempt to alleviate this, on the basis that it's a pretty # unlikely occurence (it'd require two builds with a brand new cache # directory) - if os.path.isdir(path) and len(os.listdir(path)) != 0: + #if os.path.isdir(path) and len(os.listdir(path)) != 0: + if os.path.isdir(path) and len([f for f in os.listdir(path) if os.path.basename(f) != "config"]) != 0: self.config['prefix_len'] = 1 # When building the project I was testing this on, the warning # was output over 20 times. That seems excessive global warned if self.path not in warned: msg = "Please upgrade your cache by running " +\ - " scons-configure-cache.py " + self.path + "scons-configure-cache.py " + self.path SCons.Warnings.warn(SCons.Warnings.CacheVersionWarning, msg) warned[self.path] = True else: -- cgit v0.12 From dc498d443efe453ced4bf1e329269c974427ff6b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 19 Apr 2019 10:25:28 -0600 Subject: [PR #3353] quiet sider complaint about bare except: Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 3 +++ src/engine/SCons/CacheDir.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 57c1d4d..eb8930e 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -58,6 +58,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER drop one (unused) use; replace one. Fix another instance of renaming to SConsEnvironmentError. Trailing whitespace. Consistently use not is/in (if not x is y -> if x is not y). + - Add a PY3-only function for setting up the cachedir that should be less + prone to races. Add a hack to the PY2 version (from Issue #3351) to + be less prone to a race in the check for old-style cache. RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index f2d3810..ffbb2f0 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -188,7 +188,7 @@ class CacheDir(object): self.config['prefix_len'] = 2 try: json.dump(self.config, config) - except: + except Exception: msg = "Failed to write cache configuration for " + path raise SCons.Errors.EnvironmentError(msg) except FileExistsError: @@ -247,7 +247,7 @@ class CacheDir(object): try: with open(config_file, 'w') as config: json.dump(self.config, config) - except: + except Exception: msg = "Failed to write cache configuration for " + path raise SCons.Errors.SConsEnvironmentError(msg) else: -- cgit v0.12 From cf295af03fc735fbe8a01d3a72365da26c175351 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 28 Apr 2019 07:53:39 -0600 Subject: [PR #3353] tweaks per review Simplify the Py2 check for an existing-but-old cachedir by using any and a generator expression. Move an import to module scope. Signed-off-by: Mats Wichmann --- src/engine/SCons/CacheDir.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index ffbb2f0..580337a 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -35,6 +35,7 @@ import sys import SCons.Action import SCons.Warnings +from SCons.Util import PY3 cache_enabled = True cache_debug = False @@ -154,7 +155,6 @@ class CacheDir(object): if path is None: return - from SCons.Util import PY3 if PY3: self._readconfig3(path) else: @@ -204,9 +204,9 @@ class CacheDir(object): """ Python2 version of reading cache config. - See if there's a config file in the cache directory. If there is, + See if there is a config file in the cache directory. If there is, use it. If there isn't, and the directory exists and isn't empty, - produce a warning. If the directory doesn't exist or is empty, + produce a warning. If the directory does not exist or is empty, write a config file. :param path: path to the cache directory @@ -215,14 +215,13 @@ class CacheDir(object): if not os.path.exists(config_file): # A note: There is a race hazard here, if two processes start and # attempt to create the cache directory at the same time. However, - # python doesn't really give you the option to do exclusive file - # creation (it doesn't even give you the option to error on opening - # an existing file for writing...). The ordering of events here - # as an attempt to alleviate this, on the basis that it's a pretty - # unlikely occurence (it'd require two builds with a brand new cache + # Python 2.x does not give you the option to do exclusive file + # creation (not even the option to error on opening ad existing + # file for writing...). The ordering of events here as an attempt + # to alleviate this, on the basis that it's a pretty unlikely + # occurence (would require two builds with a brand new cache # directory) - #if os.path.isdir(path) and len(os.listdir(path)) != 0: - if os.path.isdir(path) and len([f for f in os.listdir(path) if os.path.basename(f) != "config"]) != 0: + if os.path.isdir(path) and any(f != "config" for f in os.listdir(path)): self.config['prefix_len'] = 1 # When building the project I was testing this on, the warning # was output over 20 times. That seems excessive -- cgit v0.12 From d745eb81c18d448837740d9543570ddd110243d6 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 28 Apr 2019 08:19:25 -0600 Subject: [PR #3353] fix sider nitpickery sider complained about spelling in a comment after I updated the comment so it got to look at those lines as part of the change. Fix those. Signed-off-by: Mats Wichmann --- src/engine/SCons/CacheDir.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index 580337a..0a378c2 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -213,13 +213,13 @@ class CacheDir(object): """ config_file = os.path.join(path, 'config') if not os.path.exists(config_file): - # A note: There is a race hazard here, if two processes start and + # A note: There is a race hazard here if two processes start and # attempt to create the cache directory at the same time. However, # Python 2.x does not give you the option to do exclusive file - # creation (not even the option to error on opening ad existing - # file for writing...). The ordering of events here as an attempt + # creation (not even the option to error on opening an existing + # file for writing...). The ordering of events here is an attempt # to alleviate this, on the basis that it's a pretty unlikely - # occurence (would require two builds with a brand new cache + # occurrence (would require two builds with a brand new cache # directory) if os.path.isdir(path) and any(f != "config" for f in os.listdir(path)): self.config['prefix_len'] = 1 -- cgit v0.12 From a4ea7c1e2fa09016c0d99bf2bc7a7e57ae43ad15 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 28 Apr 2019 15:37:36 -0600 Subject: Fix misplaced file closing One file close ended up in the wrong method, meaning it was closing a file which needed to stay open for further reading, while another method of the same name in a different class was missing one. (this didn't trigger any test fails, hmmm, just visual inspection) Signed-off-by: Mats Wichmann --- src/engine/SCons/Tool/msvs.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 62a01fa..297c083 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -685,17 +685,18 @@ class _GenerateV6DSP(_DSPGenerator): return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() + # skip until marker while line: if line.find("# End Project") > -1: break line = dspfile.readline() + # read to get configs line = dspfile.readline() datas = line while line and line != '\n': line = dspfile.readline() datas = datas + line - dspfile.close() # OK, we've found our little pickled cache of data. try: @@ -708,6 +709,7 @@ class _GenerateV6DSP(_DSPGenerator): self.configs.update(data) + # keep reading to get sources data = None line = dspfile.readline() datas = line @@ -1000,17 +1002,18 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() + # skip until marker while line: if line.find(' - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + diff --git a/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl b/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl index 1015ecc..1cb254f 100644 --- a/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl +++ b/test/Docbook/basedir/htmlhelp/image/htmlhelp.xsl @@ -1,56 +1,55 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + diff --git a/test/Docbook/basedir/slideshtml/image/slides.xsl b/test/Docbook/basedir/slideshtml/image/slides.xsl index e3f0f21..24e076d 100644 --- a/test/Docbook/basedir/slideshtml/image/slides.xsl +++ b/test/Docbook/basedir/slideshtml/image/slides.xsl @@ -1,56 +1,55 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + diff --git a/test/Docbook/rootname/htmlchunked/image/html.xsl b/test/Docbook/rootname/htmlchunked/image/html.xsl index 49824df..7710dae 100644 --- a/test/Docbook/rootname/htmlchunked/image/html.xsl +++ b/test/Docbook/rootname/htmlchunked/image/html.xsl @@ -1,56 +1,55 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + diff --git a/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl b/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl index 4544b94..e91c1c4 100644 --- a/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl +++ b/test/Docbook/rootname/htmlhelp/image/htmlhelp.xsl @@ -1,56 +1,55 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + diff --git a/test/Docbook/rootname/slideshtml/image/slides.xsl b/test/Docbook/rootname/slideshtml/image/slides.xsl index 23fb3e8..29058f1 100644 --- a/test/Docbook/rootname/slideshtml/image/slides.xsl +++ b/test/Docbook/rootname/slideshtml/image/slides.xsl @@ -1,56 +1,55 @@ - - - - - - - - - - - -/appendix toc,title -article/appendix nop -/article toc,title -book toc,title,figure,table,example,equation -/chapter toc,title -part toc,title -/preface toc,title -reference toc,title -/sect1 toc -/sect2 toc -/sect3 toc -/sect4 toc -/sect5 toc -/section toc -set toc,title - - - - + + + + + + + + + + + +/appendix toc,title +article/appendix nop +/article toc,title +book toc,title,figure,table,example,equation +/chapter toc,title +part toc,title +/preface toc,title +reference toc,title +/sect1 toc +/sect2 toc +/sect3 toc +/sect4 toc +/sect5 toc +/section toc +set toc,title + + + -- cgit v0.12 From 828c5176717655955442b6def9c1028d00b4f467 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 7 Jun 2019 08:24:15 -0600 Subject: test harness: fix TestCmd tests This is the companion to PR #3382. The testing/harness/TestCmdTests.py unit tests do not currently pass. Note they are not run by the CI system, or in fact by doing runtests -a, since they're in a directory that is not searched. After these changes, there are no fails. This is a test-only change. The method simple_diff, modeled on difflib functions, is converted to a generator to match difflib, and now has a doctest as well. This means calls to it which aren't going to iterate needs to convert the return with list(), but that just makes usage more consistent, since the calls to difflib.context_diff and difflib.unified_diff already had to do so. Also, the methods that used Google-style docbook markup are changed to REsT-style markup. Our current doc producer, epydoc, does not understand the Google style, and we shouldn't mix styles; can convert them all in bulk later if we switch to Sphinx as the production tool. Signed-off-by: Mats Wichmann --- testing/framework/TestCmd.py | 144 +++++++++---- testing/framework/TestCmdTests.py | 443 ++++++++++++++++++-------------------- 2 files changed, 318 insertions(+), 269 deletions(-) diff --git a/testing/framework/TestCmd.py b/testing/framework/TestCmd.py index c8aa4ae..81e03f3 100644 --- a/testing/framework/TestCmd.py +++ b/testing/framework/TestCmd.py @@ -468,6 +468,14 @@ def pass_test(self=None, condition=1, function=None): def match_exact(lines=None, matches=None, newline=os.sep): """ + Match function using exact match. + + :param lines: data lines + :type lines: str or list[str] + :param matches: expected lines to match + :type matches: str or list[str] + :param newline: line separator + :returns: an object (1) on match, else None, like re.match """ if isinstance(lines, bytes) or bytes is str: @@ -478,30 +486,51 @@ def match_exact(lines=None, matches=None, newline=os.sep): if not is_List(matches): matches = matches.split(newline) if len(lines) != len(matches): - return - for i in range(len(lines)): - if lines[i] != matches[i]: - return + return None + for line, match in zip(lines, matches): + if line != match: + return None return 1 def match_caseinsensitive(lines=None, matches=None): """ + Match function using case-insensitive matching. + + Only a simplistic comparison is done, based on lowercasing the + strings. This has plenty of holes for unicode data using + non-English languages. + + TODO: casefold() is better than lower() if we don't need Py2 support. + + :param lines: data lines + :type lines: str or list[str] + :param matches: expected lines to match + :type matches: str or list[str] + :returns: True or False + :returns: an object (1) on match, else None, like re.match """ if not is_List(lines): lines = lines.split("\n") if not is_List(matches): matches = matches.split("\n") if len(lines) != len(matches): - return - for i in range(len(lines)): - if lines[i].lower() != matches[i].lower(): - return + return None + for line, match in zip(lines, matches): + if line.lower() != match.lower(): + return None return 1 def match_re(lines=None, res=None): """ + Match function using line-by-line regular expression match. + + :param lines: data lines + :type lines: str or list[str] + :param res: regular expression(s) for matching + :type res: str or list[str] + :returns: an object (1) on match, else None, like re.match """ if not is_List(lines): # CRs mess up matching (Windows) so split carefully @@ -510,29 +539,39 @@ def match_re(lines=None, res=None): res = res.split("\n") if len(lines) != len(res): print("match_re: expected %d lines, found %d" % (len(res), len(lines))) - return - for i in range(len(lines)): - s = "^" + res[i] + "$" + return None + for i, (line, regex) in enumerate(zip(lines, res)): + s = r"^{}$".format(regex) try: expr = re.compile(s) except re.error as e: msg = "Regular expression error in %s: %s" raise re.error(msg % (repr(s), e.args[0])) - if not expr.search(lines[i]): - print("match_re: mismatch at line %d:\n search re='%s'\n line='%s'" % ( - i, s, lines[i])) - return + if not expr.search(line): + miss_tmpl = "match_re: mismatch at line {}:\n search re='{}'\n line='{}'" + print(miss_tmpl.format(i, s, line)) + return None return 1 def match_re_dotall(lines=None, res=None): """ + Match function using regular expression match. + + Unlike match_re, the arguments are converted to strings (if necessary) + and must match exactly. + + :param lines: data lines + :type lines: str or list[str] + :param res: regular expression(s) for matching + :type res: str or list[str] + :returns: a match object, or None as for re.match """ if not isinstance(lines, str): lines = "\n".join(lines) if not isinstance(res, str): res = "\n".join(res) - s = "^" + res + "$" + s = r"^{}$".format(res) try: expr = re.compile(s, re.DOTALL) except re.error as e: @@ -542,11 +581,32 @@ def match_re_dotall(lines=None, res=None): def simple_diff(a, b, fromfile='', tofile='', - fromfiledate='', tofiledate='', n=3, lineterm='\n'): - """ - A function with the same calling signature as difflib.context_diff - (diff -c) and difflib.unified_diff (diff -u) but which prints - output like the simple, unadorned 'diff" command. + fromfiledate='', tofiledate='', n=0, lineterm=''): + r""" + Compare two sequences of lines; generate the delta as a simple diff. + + Similar to difflib.context_diff and difflib.unified_diff but + output is like from the 'diff" command without arguments. The function + keeps the same signature as the difflib ones so they will be + interchangeable, but except for lineterm, the arguments beyond the + two sequences are ignored in this version. By default, the + diff is not created with trailing newlines, set the lineterm + argument to '\n' to do so. + + :raises re.error: if a regex fails to compile + + Example: + + >>> print(''.join(simple_diff('one\ntwo\nthree\nfour\n'.splitlines(True), + ... 'zero\none\ntree\nfour\n'.splitlines(True), lineterm='\n'))) + 0a1 + > zero + 2,3c3 + < two + < three + --- + > tree + """ a = [to_str(q) for q in a] b = [to_str(q) for q in b] @@ -554,25 +614,30 @@ def simple_diff(a, b, fromfile='', tofile='', def comma(x1, x2): return x1 + 1 == x2 and str(x2) or '%s,%s' % (x1 + 1, x2) - result = [] + for op, a1, a2, b1, b2 in sm.get_opcodes(): if op == 'delete': - result.append("%sd%d" % (comma(a1, a2), b1)) - result.extend(['< ' + l for l in a[a1:a2]]) + yield "{}d{}{}".format(comma(a1, a2), b1, lineterm) + for l in a[a1:a2]: + yield '< ' + l elif op == 'insert': - result.append("%da%s" % (a1, comma(b1, b2))) - result.extend(['> ' + l for l in b[b1:b2]]) + yield "{}a{}{}".format(a1, comma(b1, b2), lineterm) + for l in b[b1:b2]: + yield '> ' + l elif op == 'replace': - result.append("%sc%s" % (comma(a1, a2), comma(b1, b2))) - result.extend(['< ' + l for l in a[a1:a2]]) - result.append('---') - result.extend(['> ' + l for l in b[b1:b2]]) - return result + yield "{}c{}{}".format(comma(a1, a2), comma(b1, b2), lineterm) + for l in a[a1:a2]: + yield '< ' + l + yield '---{}'.format(lineterm) + for l in b[b1:b2]: + yield '> ' + l def diff_re(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'): """ + Compare a and b (lists of strings) where a are regexes. + A simple "diff" of two sets of lines when the expected lines are regular expressions. This is a really dumb thing that just compares each line in turn, so it doesn't look for @@ -585,9 +650,8 @@ def diff_re(a, b, fromfile='', tofile='', a = a + [''] * (-diff) elif diff > 0: b = b + [''] * diff - i = 0 - for aline, bline in zip(a, b): - s = "^" + aline + "$" + for i, (aline, bline) in enumerate(zip(a, b)): + s = r"^{}$".format(aline) try: expr = re.compile(s) except re.error as e: @@ -598,7 +662,6 @@ def diff_re(a, b, fromfile='', tofile='', result.append('< ' + repr(a[i])) result.append('---') result.append('> ' + repr(b[i])) - i = i + 1 return result @@ -1030,7 +1093,7 @@ class TestCmd(object): condition = self.condition if self._preserve[condition]: for dir in self._dirlist: - print(u"Preserved directory " + dir + "\n") + print(u"Preserved directory " + dir) else: list = self._dirlist[:] list.reverse() @@ -1246,6 +1309,7 @@ class TestCmd(object): def read(self, file, mode='rb', newline=None): """Reads and returns the contents of the specified file name. + The file name may be a list, in which case the elements are concatenated with the os.path.join() method. The file is assumed to be under the temporary working directory unless it @@ -1265,6 +1329,7 @@ class TestCmd(object): def rmdir(self, dir): """Removes the specified dir name. + The dir name may be a list, in which case the elements are concatenated with the os.path.join() method. The dir is assumed to be under the temporary working directory unless it @@ -1306,6 +1371,7 @@ class TestCmd(object): """Copies the contents of the specified folder srcdir from the directory of the called script, to the current working directory. + The srcdir name may be a list, in which case the elements are concatenated with the os.path.join() method. The dstdir is assumed to be under the temporary working directory, it gets @@ -1347,6 +1413,7 @@ class TestCmd(object): def file_fixture(self, srcfile, dstfile=None): """Copies the file srcfile from the directory of the called script, to the current working directory. + The dstfile is assumed to be under the temporary working directory unless it is an absolute path name. If dstfile is specified its target directory gets created @@ -1443,6 +1510,7 @@ class TestCmd(object): def fix_binary_stream(stream): """ Handle stdout/stderr from popen when we specify universal_newlines = False. + This will read from the pipes in binary mode, not decode the output, and not convert line endings to \n. We do this because in py3 (3.5) with universal_newlines=True, it will @@ -1459,7 +1527,7 @@ class TestCmd(object): return stream # TODO: Run full tests on both platforms and see if this fixes failures # It seems that py3.6 still sets text mode if you set encoding. - elif sys.version_info[0] == 3:# TODO and sys.version_info[1] < 6: + elif sys.version_info[0] == 3: # TODO and sys.version_info[1] < 6: stream = stream.decode('utf-8') stream = stream.replace('\r\n', '\n') elif sys.version_info[0] == 2: @@ -1633,7 +1701,7 @@ class TestCmd(object): try: os.mkdir(new) except OSError as e: - print("Got error creating dir:%s :%s"%(sub,e)) + print("Got error creating dir: %s :%s" % (sub, e)) pass else: count = count + 1 diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index d6922d9..ef76228 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -26,13 +26,22 @@ import os import shutil import signal import stat -from StringIO import StringIO +try: + from cStringIO import StringIO +except ImportError: + from io import StringIO +from contextlib import closing import sys import tempfile import time import types import unittest -from UserList import UserList +try: + from collections import UserList +except ImportError: + from UserList import UserList + +from SCons.Util import to_bytes, to_str # Strip the current directory so we get the right TestCmd.py module. @@ -55,7 +64,7 @@ def _is_executable(path): def _clear_dict(dict, *keys): for key in keys: try: - dict[key] = '' # del dict[key] + del dict[key] except KeyError: pass @@ -156,9 +165,9 @@ class TestCmdTestCase(unittest.TestCase): stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) - stdout, stderr = p.communicate(input) - stdout = self.translate_newlines(stdout) - stderr = self.translate_newlines(stderr) + stdout, stderr = p.communicate(to_bytes(input)) + stdout = self.translate_newlines(to_str(stdout)) + stderr = self.translate_newlines(to_str(stderr)) return stdout, stderr, p.returncode def popen_python(self, input, status=0, stdout="", stderr="", python=None): @@ -181,7 +190,7 @@ class TestCmdTestCase(unittest.TestCase): def run_match(self, content, *args): expect = "%s: %s: %s: %s\n" % args - content = self.translate_newlines(content) + content = self.translate_newlines(to_str(content)) assert content == expect, \ "Expected %s ==========\n" % args[1] + expect + \ "Actual %s ============\n" % args[1] + content @@ -257,6 +266,7 @@ result = TestCmd.TestCmd(workdir = '') sys.exit(0) """ % self.orig_cwd, stdout='my_exitfunc()\n') + @unittest.skipIf(TestCmd.IS_PY3, "No sys.exitfunc in Python 3") def test_exitfunc(self): """Test cleanup() when sys.exitfunc is set""" self.popen_python("""from __future__ import print_function @@ -271,7 +281,6 @@ sys.exit(0) """ % self.orig_cwd, stdout='my_exitfunc()\n') - class chmod_TestCase(TestCmdTestCase): def test_chmod(self): """Test chmod()""" @@ -351,11 +360,8 @@ sys.stderr.write("run2 STDERR third line\\n") test = TestCmd.TestCmd(interpreter = 'python', workdir = '', combine = 1) - try: - output = test.stdout() - except IndexError: - pass - else: + output = test.stdout() + if output is not None: raise IndexError("got unexpected output:\n\t`%s'\n" % output) # The underlying system subprocess implementations can combine @@ -424,10 +430,13 @@ class diff_TestCase(TestCmdTestCase): def test_diff_re(self): """Test diff_re()""" result = TestCmd.diff_re(["abcde"], ["abcde"]) + result = list(result) assert result == [], result result = TestCmd.diff_re(["a.*e"], ["abcde"]) + result = list(result) assert result == [], result result = TestCmd.diff_re(["a.*e"], ["xxx"]) + result = list(result) assert result == ['1c1', "< 'a.*e'", '---', "> 'xxx'"], result def test_diff_custom_function(self): @@ -477,13 +486,13 @@ STDOUT========================================================================== script_input = """import sys sys.path = ['%s'] + sys.path import TestCmd -assert TestCmd.diff_re(["a.*(e"], ["abcde"]) +assert TestCmd.diff_re([r"a.*(e"], ["abcde"]) sys.exit(0) """ % self.orig_cwd stdout, stderr, status = self.call_python(script_input) assert status == 1, status - expect1 = "Regular expression error in '^a.*(e$': missing )\n" - expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis\n" + expect1 = "Regular expression error in '^a.*(e$': missing )" + expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis" assert (stderr.find(expect1) != -1 or stderr.find(expect2) != -1), repr(stderr) @@ -494,6 +503,7 @@ sys.path = ['%s'] + sys.path import TestCmd result = TestCmd.TestCmd.simple_diff(['a', 'b', 'c', 'e', 'f1'], ['a', 'c', 'd', 'e', 'f2']) +result = list(result) expect = ['2d1', '< b', '3a3', '> d', '5c5', '< f1', '---', '> f2'] assert result == expect, result sys.exit(0) @@ -559,6 +569,7 @@ sys.path = ['%s'] + sys.path import TestCmd result = TestCmd.TestCmd.diff_re(['a', 'b', 'c', '.', 'f1'], ['a', 'c', 'd', 'e', 'f2']) +result = list(result) expect = [ '2c2', "< 'b'", @@ -846,22 +857,22 @@ test.%s() _test_it(cwd, 'dir04', 'pass_test', 1) _test_it(cwd, 'dir05', 'fail_test', 1) _test_it(cwd, 'dir06', 'no_result', 1) - os.environ['PRESERVE'] = '' # del os.environ['PRESERVE'] + del os.environ['PRESERVE'] os.environ['PRESERVE_PASS'] = '1' _test_it(cwd, 'dir07', 'pass_test', 1) _test_it(cwd, 'dir08', 'fail_test', 0) _test_it(cwd, 'dir09', 'no_result', 0) - os.environ['PRESERVE_PASS'] = '' # del os.environ['PRESERVE_PASS'] + del os.environ['PRESERVE_PASS'] os.environ['PRESERVE_FAIL'] = '1' _test_it(cwd, 'dir10', 'pass_test', 0) _test_it(cwd, 'dir11', 'fail_test', 1) _test_it(cwd, 'dir12', 'no_result', 0) - os.environ['PRESERVE_FAIL'] = '' # del os.environ['PRESERVE_FAIL'] + del os.environ['PRESERVE_FAIL'] os.environ['PRESERVE_NO_RESULT'] = '1' _test_it(cwd, 'dir13', 'pass_test', 0) _test_it(cwd, 'dir14', 'fail_test', 0) _test_it(cwd, 'dir15', 'no_result', 1) - os.environ['PRESERVE_NO_RESULT'] = '' # del os.environ['PRESERVE_NO_RESULT'] + del os.environ['PRESERVE_NO_RESULT'] finally: _clear_dict(os.environ, 'PRESERVE', 'PRESERVE_PASS', 'PRESERVE_FAIL', 'PRESERVE_NO_RESULT') @@ -982,10 +993,10 @@ class match_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match = TestCmd.match_exact) assert not test.match("abcde\n", "a.*e\n") assert test.match("abcde\n", "abcde\n") - assert not test.match("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match(lines, regexes) assert test.match(lines, lines) @@ -994,10 +1005,10 @@ class match_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match=TestCmd.TestCmd.match_exact) assert not test.match("abcde\n", "a.*e\n") assert test.match("abcde\n", "abcde\n") - assert not test.match("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match(lines, regexes) assert test.match(lines, lines) @@ -1006,10 +1017,10 @@ class match_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match='match_exact') assert not test.match("abcde\n", "a.*e\n") assert test.match("abcde\n", "abcde\n") - assert not test.match("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match(lines, regexes) assert test.match(lines, lines) @@ -1059,16 +1070,16 @@ class match_exact_TestCase(TestCmdTestCase): class match_re_dotall_TestCase(TestCmdTestCase): def test_match_re_dotall_function(self): """Test calling the TestCmd.match_re_dotall() function""" - assert TestCmd.match_re_dotall("abcde\nfghij\n", "a.*j\n") + assert TestCmd.match_re_dotall("abcde\nfghij\n", r"a.*j\n") def test_match_re_dotall_instance_method(self): """Test calling the TestCmd.TestCmd().match_re_dotall() instance method""" test = TestCmd.TestCmd() - test.match_re_dotall("abcde\\nfghij\\n", "a.*j\\n") + test.match_re_dotall("abcde\\nfghij\\n", r"a.*j\\n") def test_match_re_dotall_static_method(self): """Test calling the TestCmd.TestCmd.match_re_dotall() static method""" - assert TestCmd.TestCmd.match_re_dotall("abcde\nfghij\n", "a.*j\n") + assert TestCmd.TestCmd.match_re_dotall("abcde\nfghij\n", r"a.*j\n") def test_error(self): """Test handling a compilation error in TestCmd.match_re_dotall()""" @@ -1081,13 +1092,13 @@ class match_re_dotall_TestCase(TestCmdTestCase): script_input = """import sys sys.path = ['%s'] + sys.path import TestCmd -assert TestCmd.match_re_dotall("abcde", "a.*(e") +assert TestCmd.match_re_dotall("abcde", r"a.*(e") sys.exit(0) """ % cwd stdout, stderr, status = self.call_python(script_input) assert status == 1, status - expect1 = "Regular expression error in '^a.*(e$': missing )\n" - expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis\n" + expect1 = "Regular expression error in '^a.*(e$': missing )" + expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis" assert (stderr.find(expect1) != -1 or stderr.find(expect2) != -1), repr(stderr) finally: @@ -1096,44 +1107,34 @@ sys.exit(0) def test_evaluation(self): """Test match_re_dotall() evaluation""" test = TestCmd.TestCmd() - assert test.match_re_dotall("abcde\nfghij\n", "a.*e\nf.*j\n") - assert test.match_re_dotall("abcde\nfghij\n", "a[^j]*j\n") - assert test.match_re_dotall("abcde\nfghij\n", "abcde\nfghij\n") + assert test.match_re_dotall("abcde\nfghij\n", r"a.*e\nf.*j\n") + assert test.match_re_dotall("abcde\nfghij\n", r"a[^j]*j\n") + assert test.match_re_dotall("abcde\nfghij\n", r"abcde\nfghij\n") assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - ["1[0-9]*5\n", "a.*e\n", "f.*j\n"]) + [r"1[0-9]*5\n", r"a.*e\n", r"f.*j\n"]) assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - ["1.*j\n"]) + [r"1.*j\n"]) assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - ["12345\n", "abcde\n", "fghij\n"]) - assert test.match_re_dotall(UserList(["12345\n", - "abcde\n", - "fghij\n"]), - ["1[0-9]*5\n", "a.*e\n", "f.*j\n"]) - assert test.match_re_dotall(UserList(["12345\n", - "abcde\n", - "fghij\n"]), - ["1.*j\n"]) - assert test.match_re_dotall(UserList(["12345\n", - "abcde\n", - "fghij\n"]), - ["12345\n", "abcde\n", "fghij\n"]) + [r"12345\n", r"abcde\n", r"fghij\n"]) + assert test.match_re_dotall(UserList(["12345\n", "abcde\n", "fghij\n"]), + [r"1[0-9]*5\n", r"a.*e\n", r"f.*j\n"]) + assert test.match_re_dotall(UserList(["12345\n", "abcde\n", "fghij\n"]), + [r"1.*j\n"]) + assert test.match_re_dotall(UserList(["12345\n", "abcde\n", "fghij\n"]), + [r"12345\n", r"abcde\n", r"fghij\n"]) assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - UserList(["1[0-9]*5\n", - "a.*e\n", - "f.*j\n"])) + UserList([r"1[0-9]*5\n", r"a.*e\n", r"f.*j\n"])) assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - UserList(["1.*j\n"])) + UserList([r"1.*j\n"])) assert test.match_re_dotall(["12345\n", "abcde\n", "fghij\n"], - UserList(["12345\n", - "abcde\n", - "fghij\n"])) + UserList([r"12345\n", r"abcde\n", r"fghij\n"])) assert test.match_re_dotall("12345\nabcde\nfghij\n", - "1[0-9]*5\na.*e\nf.*j\n") - assert test.match_re_dotall("12345\nabcde\nfghij\n", "1.*j\n") + r"1[0-9]*5\na.*e\nf.*j\n") + assert test.match_re_dotall("12345\nabcde\nfghij\n", r"1.*j\n") assert test.match_re_dotall("12345\nabcde\nfghij\n", - "12345\nabcde\nfghij\n") + r"12345\nabcde\nfghij\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_re_dotall(lines, regexes) assert test.match_re_dotall(lines, lines) @@ -1169,8 +1170,8 @@ sys.exit(0) """ % cwd stdout, stderr, status = self.call_python(script_input) assert status == 1, status - expect1 = "Regular expression error in '^a.*(e$': missing )\n" - expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis\n" + expect1 = "Regular expression error in '^a.*(e$': missing )" + expect2 = "Regular expression error in '^a.*(e$': unbalanced parenthesis" assert (stderr.find(expect1) != -1 or stderr.find(expect2) != -1), repr(stderr) finally: @@ -1194,7 +1195,7 @@ sys.exit(0) assert test.match_re("12345\nabcde\n", "1[0-9]*5\na.*e\n") assert test.match_re("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_re(lines, regexes) assert test.match_re(lines, lines) @@ -1207,7 +1208,7 @@ class match_stderr_TestCase(TestCmdTestCase): assert test.match_stderr("abcde\n", "a.*e\n") assert test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_stderr(lines, regexes) def test_match_stderr_not_affecting_match_stdout(self): @@ -1219,14 +1220,14 @@ class match_stderr_TestCase(TestCmdTestCase): assert not test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stderr("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stderr(lines, regexes) assert test.match_stderr(lines, lines) assert test.match_stdout("abcde\n", "a.*e\n") assert test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_stdout(lines, regexes) def test_match_stderr_custom_function(self): @@ -1239,7 +1240,7 @@ class match_stderr_TestCase(TestCmdTestCase): assert not test.match_stderr("123\n123\n", "1\n1\n") assert test.match_stderr("123\n123\n", "111\n111\n") lines = ["123\n", "123\n"] - regexes = ["1\n", "1\n"] + regexes = [r"1\n", r"1\n"] assert test.match_stderr(lines, regexes) # equal numbers of lines def test_match_stderr_TestCmd_function(self): @@ -1247,10 +1248,10 @@ class match_stderr_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stderr = TestCmd.match_exact) assert not test.match_stderr("abcde\n", "a.*e\n") assert test.match_stderr("abcde\n", "abcde\n") - assert not test.match_stderr("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stderr("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stderr(lines, regexes) assert test.match_stderr(lines, lines) @@ -1259,10 +1260,10 @@ class match_stderr_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stderr=TestCmd.TestCmd.match_exact) assert not test.match_stderr("abcde\n", "a.*e\n") assert test.match_stderr("abcde\n", "abcde\n") - assert not test.match_stderr("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stderr("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stderr(lines, regexes) assert test.match_stderr(lines, lines) @@ -1271,10 +1272,10 @@ class match_stderr_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stderr='match_exact') assert not test.match_stderr("abcde\n", "a.*e\n") assert test.match_stderr("abcde\n", "abcde\n") - assert not test.match_stderr("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stderr("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stderr(lines, regexes) assert test.match_stderr(lines, lines) @@ -1287,7 +1288,7 @@ class match_stdout_TestCase(TestCmdTestCase): assert test.match_stdout("abcde\n", "a.*e\n") assert test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_stdout(lines, regexes) def test_match_stdout_not_affecting_match_stderr(self): @@ -1299,14 +1300,14 @@ class match_stdout_TestCase(TestCmdTestCase): assert not test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stdout("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stdout(lines, regexes) assert test.match_stdout(lines, lines) assert test.match_stderr("abcde\n", "a.*e\n") assert test.match_stderr("12345\nabcde\n", "1\\d+5\na.*e\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert test.match_stderr(lines, regexes) def test_match_stdout_custom_function(self): @@ -1319,7 +1320,7 @@ class match_stdout_TestCase(TestCmdTestCase): assert not test.match_stdout("123\n123\n", "1\n1\n") assert test.match_stdout("123\n123\n", "111\n111\n") lines = ["123\n", "123\n"] - regexes = ["1\n", "1\n"] + regexes = [r"1\n", r"1\n"] assert test.match_stdout(lines, regexes) # equal numbers of lines def test_match_stdout_TestCmd_function(self): @@ -1327,10 +1328,10 @@ class match_stdout_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stdout = TestCmd.match_exact) assert not test.match_stdout("abcde\n", "a.*e\n") assert test.match_stdout("abcde\n", "abcde\n") - assert not test.match_stdout("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stdout("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stdout(lines, regexes) assert test.match_stdout(lines, lines) @@ -1339,10 +1340,10 @@ class match_stdout_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stdout=TestCmd.TestCmd.match_exact) assert not test.match_stdout("abcde\n", "a.*e\n") assert test.match_stdout("abcde\n", "abcde\n") - assert not test.match_stdout("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stdout("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stdout(lines, regexes) assert test.match_stdout(lines, lines) @@ -1351,10 +1352,10 @@ class match_stdout_TestCase(TestCmdTestCase): test = TestCmd.TestCmd(match_stdout='match_exact') assert not test.match_stdout("abcde\n", "a.*e\n") assert test.match_stdout("abcde\n", "abcde\n") - assert not test.match_stdout("12345\nabcde\n", "1\d+5\na.*e\n") + assert not test.match_stdout("12345\nabcde\n", "1\\d+5\na.*e\n") assert test.match_stdout("12345\nabcde\n", "12345\nabcde\n") lines = ["vwxyz\n", "67890\n"] - regexes = ["v[^a-u]*z\n", "6[^ ]+0\n"] + regexes = [r"v[^a-u]*z\n", r"6[^ ]+0\n"] assert not test.match_stdout(lines, regexes) assert test.match_stdout(lines, lines) @@ -1470,20 +1471,20 @@ class preserve_TestCase(TestCmdTestCase): def test_preserve(self): """Test preserve()""" def cleanup_test(test, cond=None, stdout=""): - io = StringIO() save = sys.stdout - sys.stdout = io - try: - if cond: - test.cleanup(cond) - else: - test.cleanup() - o = io.getvalue() - assert o == stdout, "o = `%s', stdout = `%s'" % (o, stdout) - finally: - sys.stdout = save - - test = TestCmd.TestCmd(workdir = '') + with closing(StringIO()) as io: + sys.stdout = io + try: + if cond: + test.cleanup(cond) + else: + test.cleanup() + o = io.getvalue() + assert o == stdout, "o = `%s', stdout = `%s'" % (o, stdout) + finally: + sys.stdout = save + + test = TestCmd.TestCmd(workdir='') wdir = test.workdir try: test.write('file1', "Test file #1\n") @@ -1492,10 +1493,10 @@ class preserve_TestCase(TestCmdTestCase): assert not os.path.exists(wdir) finally: if os.path.exists(wdir): - shutil.rmtree(wdir, ignore_errors = 1) + shutil.rmtree(wdir, ignore_errors=1) test._dirlist.remove(wdir) - test = TestCmd.TestCmd(workdir = '') + test = TestCmd.TestCmd(workdir='') wdir = test.workdir try: test.write('file2', "Test file #2\n") @@ -1579,15 +1580,15 @@ class read_TestCase(TestCmdTestCase): wdir_file5 = os.path.join(test.workdir, 'file5') with open(wdir_file1, 'wb') as f: - f.write("") + f.write(to_bytes("")) with open(wdir_file2, 'wb') as f: - f.write("Test\nfile\n#2.\n") + f.write(to_bytes("Test\nfile\n#2.\n")) with open(wdir_foo_file3, 'wb') as f: - f.write("Test\nfile\n#3.\n") + f.write(to_bytes("Test\nfile\n#3.\n")) with open(wdir_file4, 'wb') as f: - f.write("Test\nfile\n#4.\n") + f.write(to_bytes("Test\nfile\n#4.\n")) with open(wdir_file5, 'wb') as f: - f.write("Test\r\nfile\r\n#5.\r\n") + f.write(to_bytes("Test\r\nfile\r\n#5.\r\n")) try: contents = test.read('no_file') @@ -1604,6 +1605,7 @@ class read_TestCase(TestCmdTestCase): raise def _file_matches(file, contents, expected): + contents = to_str(contents) assert contents == expected, \ "Expected contents of " + str(file) + "==========\n" + \ expected + \ @@ -1874,29 +1876,25 @@ class run_verbose_TestCase(TestCmdTestCase): workdir = '', verbose = 1) - sys.stdout = StringIO() - sys.stderr = StringIO() - - test.run(arguments = ['arg1 arg2']) - o = sys.stdout.getvalue() - assert o == '', o - e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % t.script_path - assert expect == e, (expect, e) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) + o = sys.stdout.getvalue() + assert o == '', o + e = sys.stderr.getvalue() + expect = 'python "%s" "arg1 arg2"\n' % t.script_path + assert expect == e, (expect, e) testx = TestCmd.TestCmd(program = t.scriptx, workdir = '', verbose = 1) - sys.stdout = StringIO() - sys.stderr = StringIO() - - testx.run(arguments = ['arg1 arg2']) - expect = '"%s" "arg1 arg2"\n' % t.scriptx_path - o = sys.stdout.getvalue() - assert o == '', o - e = sys.stderr.getvalue() - assert expect == e, (expect, e) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + testx.run(arguments = ['arg1 arg2']) + expect = '"%s" "arg1 arg2"\n' % t.scriptx_path + o = sys.stdout.getvalue() + assert o == '', o + e = sys.stderr.getvalue() + assert expect == e, (expect, e) # Test calling TestCmd() with an explicit verbose = 2. @@ -1925,43 +1923,39 @@ class run_verbose_TestCase(TestCmdTestCase): workdir = '', verbose = 2) - sys.stdout = StringIO() - sys.stderr = StringIO() - - test.run(arguments = ['arg1 arg2']) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) - line_fmt = "script: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - stderr_line = line_fmt % ('STDERR', t.sub_dir) - expect = outerr_fmt % (len(stdout_line), stdout_line, - len(stderr_line), stderr_line) - o = sys.stdout.getvalue() - assert expect == o, (expect, o) + line_fmt = "script: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + stderr_line = line_fmt % ('STDERR', t.sub_dir) + expect = outerr_fmt % (len(stdout_line), stdout_line, + len(stderr_line), stderr_line) + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - expect = 'python "%s" "arg1 arg2"\n' % t.script_path - e = sys.stderr.getvalue() - assert e == expect, (e, expect) + expect = 'python "%s" "arg1 arg2"\n' % t.script_path + e = sys.stderr.getvalue() + assert e == expect, (e, expect) testx = TestCmd.TestCmd(program = t.scriptx, workdir = '', verbose = 2) - sys.stdout = StringIO() - sys.stderr = StringIO() + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + testx.run(arguments = ['arg1 arg2']) - testx.run(arguments = ['arg1 arg2']) + line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + stderr_line = line_fmt % ('STDERR', t.sub_dir) + expect = outerr_fmt % (len(stdout_line), stdout_line, + len(stderr_line), stderr_line) + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - stderr_line = line_fmt % ('STDERR', t.sub_dir) - expect = outerr_fmt % (len(stdout_line), stdout_line, - len(stderr_line), stderr_line) - o = sys.stdout.getvalue() - assert expect == o, (expect, o) - - expect = '"%s" "arg1 arg2"\n' % t.scriptx_path - e = sys.stderr.getvalue() - assert e == expect, (e, expect) + expect = '"%s" "arg1 arg2"\n' % t.scriptx_path + e = sys.stderr.getvalue() + assert e == expect, (e, expect) # Test calling TestCmd() with an explicit verbose = 3. @@ -1970,41 +1964,37 @@ class run_verbose_TestCase(TestCmdTestCase): workdir = '', verbose = 2) - sys.stdout = StringIO() - sys.stderr = StringIO() - - test.run(arguments = ['arg1 arg2']) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) - line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - expect = out_fmt % (len(stdout_line), stdout_line) - o = sys.stdout.getvalue() - assert expect == o, (expect, o) + line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + expect = out_fmt % (len(stdout_line), stdout_line) + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) - assert e == expect, (e, expect) + e = sys.stderr.getvalue() + expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + assert e == expect, (e, expect) test = TestCmd.TestCmd(program = t.scriptout, interpreter = 'python', workdir = '', verbose = 3) - sys.stdout = StringIO() - sys.stderr = StringIO() + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) - test.run(arguments = ['arg1 arg2']) + line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + expect = outerr_fmt % (len(stdout_line), stdout_line, + '0', '') + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - line_fmt = "scriptout: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - expect = outerr_fmt % (len(stdout_line), stdout_line, - '0', '') - o = sys.stdout.getvalue() - assert expect == o, (expect, o) - - e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) - assert e == expect, (e, expect) + e = sys.stderr.getvalue() + expect = 'python "%s" "arg1 arg2"\n' % (t.scriptout_path) + assert e == expect, (e, expect) # Test letting TestCmd() pick up verbose = 2 from the environment. @@ -2014,42 +2004,38 @@ class run_verbose_TestCase(TestCmdTestCase): interpreter = 'python', workdir = '') - sys.stdout = StringIO() - sys.stderr = StringIO() - - test.run(arguments = ['arg1 arg2']) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) - line_fmt = "script: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - stderr_line = line_fmt % ('STDERR', t.sub_dir) - expect = outerr_fmt % (len(stdout_line), stdout_line, - len(stderr_line), stderr_line) - o = sys.stdout.getvalue() - assert expect == o, (expect, o) + line_fmt = "script: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + stderr_line = line_fmt % ('STDERR', t.sub_dir) + expect = outerr_fmt % (len(stdout_line), stdout_line, + len(stderr_line), stderr_line) + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - expect = 'python "%s" "arg1 arg2"\n' % t.script_path - e = sys.stderr.getvalue() - assert e == expect, (e, expect) + expect = 'python "%s" "arg1 arg2"\n' % t.script_path + e = sys.stderr.getvalue() + assert e == expect, (e, expect) testx = TestCmd.TestCmd(program = t.scriptx, workdir = '') - sys.stdout = StringIO() - sys.stderr = StringIO() + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + testx.run(arguments = ['arg1 arg2']) - testx.run(arguments = ['arg1 arg2']) + line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n" + stdout_line = line_fmt % ('STDOUT', t.sub_dir) + stderr_line = line_fmt % ('STDERR', t.sub_dir) + expect = outerr_fmt % (len(stdout_line), stdout_line, + len(stderr_line), stderr_line) + o = sys.stdout.getvalue() + assert expect == o, (expect, o) - line_fmt = "scriptx.bat: %s: %s: ['arg1 arg2']\n" - stdout_line = line_fmt % ('STDOUT', t.sub_dir) - stderr_line = line_fmt % ('STDERR', t.sub_dir) - expect = outerr_fmt % (len(stdout_line), stdout_line, - len(stderr_line), stderr_line) - o = sys.stdout.getvalue() - assert expect == o, (expect, o) - - expect = '"%s" "arg1 arg2"\n' % t.scriptx_path - e = sys.stderr.getvalue() - assert e == expect, (e, expect) + expect = '"%s" "arg1 arg2"\n' % t.scriptx_path + e = sys.stderr.getvalue() + assert e == expect, (e, expect) # Test letting TestCmd() pick up verbose = 1 from the environment. @@ -2060,29 +2046,25 @@ class run_verbose_TestCase(TestCmdTestCase): workdir = '', verbose = 1) - sys.stdout = StringIO() - sys.stderr = StringIO() - - test.run(arguments = ['arg1 arg2']) - o = sys.stdout.getvalue() - assert o == '', o - e = sys.stderr.getvalue() - expect = 'python "%s" "arg1 arg2"\n' % t.script_path - assert expect == e, (expect, e) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + test.run(arguments = ['arg1 arg2']) + o = sys.stdout.getvalue() + assert o == '', o + e = sys.stderr.getvalue() + expect = 'python "%s" "arg1 arg2"\n' % t.script_path + assert expect == e, (expect, e) testx = TestCmd.TestCmd(program = t.scriptx, workdir = '', verbose = 1) - sys.stdout = StringIO() - sys.stderr = StringIO() - - testx.run(arguments = ['arg1 arg2']) - expect = '"%s" "arg1 arg2"\n' % t.scriptx_path - o = sys.stdout.getvalue() - assert o == '', o - e = sys.stderr.getvalue() - assert expect == e, (expect, e) + with closing(StringIO()) as sys.stdout, closing(StringIO()) as sys.stderr: + testx.run(arguments = ['arg1 arg2']) + expect = '"%s" "arg1 arg2"\n' % t.scriptx_path + o = sys.stdout.getvalue() + assert o == '', o + e = sys.stderr.getvalue() + assert expect == e, (expect, e) finally: sys.stdout = save_stdout @@ -2624,11 +2606,11 @@ script_recv: STDERR: input p = test.start(stdin=1) input = 'stdin.write() input to the receive script\n' - p.stdin.write(input) + p.stdin.write(to_bytes(input)) p.stdin.close() p.wait() with open(t.recv_out_path, 'rb') as f: - result = f.read() + result = to_str(f.read()) expect = 'script_recv: ' + input assert result == expect, repr(result) @@ -2638,7 +2620,7 @@ script_recv: STDERR: input p.stdin.close() p.wait() with open(t.recv_out_path, 'rb') as f: - result = f.read() + result = to_str(f.read()) expect = 'script_recv: ' + input assert result == expect, repr(result) @@ -2754,11 +2736,8 @@ sys.stderr.write("run2 STDERR second line\\n") # Everything before this prepared our "source directory." # Now do the real test. test = TestCmd.TestCmd(interpreter = 'python', workdir = '') - try: - output = test.stdout() - except IndexError: - pass - else: + output = test.stdout() + if output is not None: raise IndexError("got unexpected output:\n\t`%s'\n" % output) test.program_set('run1') test.run(arguments = 'foo bar') @@ -3330,9 +3309,11 @@ class write_TestCase(TestCmdTestCase): assert not os.path.exists(test.workpath('file10')) with open(test.workpath('file8'), 'r') as f: - assert f.read() == "Test file #8.\n" + res = f.read() + assert res == "Test file #8.\n", res with open(test.workpath('file9'), 'rb') as f: - assert f.read() == "Test file #9.\r\n" + res = to_str(f.read()) + assert res == "Test file #9.\r\n", res class variables_TestCase(TestCmdTestCase): -- cgit v0.12 From 25e993fed6a759758348dea8293ea000c3bf12ec Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Mon, 3 Jun 2019 13:44:11 -0400 Subject: Don't hide exceptions when command does not exist --- src/CHANGES.txt | 1 + src/engine/SCons/Action.py | 7 ++++--- src/engine/SCons/ActionTests.py | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index d09f01d..846d860 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -69,6 +69,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Mathew Robinson: - Update cache debug output to include cache hit rate. + - No longer unintentionally hide exceptions in Action.py RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index d1ab362..3ec8a4c 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -808,7 +808,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): kw['env'] = new_env try: - pobj = subprocess.Popen(cmd, **kw) + pobj = subprocess.Popen(cmd, **kw) except EnvironmentError as e: if error == 'raise': raise # return a dummy Popen instance that only returns error @@ -826,9 +826,10 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): finally: # clean up open file handles stored in parent's kw for k, v in kw.items(): - if hasattr(v, 'close'): + if inspect.ismethod(getattr(v, 'close', None)): v.close() - return pobj + + return pobj class CommandAction(_ActionAction): diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 34fea45..3054368 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -44,6 +44,7 @@ import re import sys import types import unittest +import subprocess import SCons.Action import SCons.Environment @@ -2273,6 +2274,22 @@ class ObjectContentsTestCase(unittest.TestCase): assert c == expected[sys.version_info[:2]], "Got\n" + repr(c) + "\nExpected \n" + "\n" + repr(expected[ sys.version_info[:2]]) + def test_uncaught_exception_bubbles(self): + """Test that _subproc bubbles uncaught exceptions""" + try: + pobj = SCons.Action._subproc(Environment(), + None, + stdin='devnull', + stderr='devnull', + stdout=subprocess.PIPE) + pobj.wait() + except EnvironmentError: + pass + except Exception: + # pass the test + return + + raise Exception("expected a non-EnvironmentError exception") if __name__ == "__main__": unittest.main() -- cgit v0.12 From 3d2e5840dc86bbb534b779e99a3ccd1a5173cd87 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 10 Jun 2019 11:44:44 -0700 Subject: Fix escaping to quiet py38 warnings about bad escapes --- test/Subst/Literal.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/Subst/Literal.py b/test/Subst/Literal.py index dec243d..5d6b15e 100644 --- a/test/Subst/Literal.py +++ b/test/Subst/Literal.py @@ -33,14 +33,13 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """\ -env = Environment(PRE='pre=', MID=Literal('\$$ORIGIN'), SUF='') +env = Environment(PRE='pre=', MID=Literal('\\\\$$ORIGIN'), SUF='') print(env.subst('${_concat(PRE, MID, SUF, __env__)}')) """) test.run() -expect = """\ -pre=\$ORIGIN +expect = r"""pre=\$ORIGIN """ test.run(arguments='-Q -q', stdout=expect) -- cgit v0.12 From 042722921601221fb0258c0dbfd0d4b0c4b0148e Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 12 Jun 2019 14:21:13 -0700 Subject: Move IRC Channel to encrypted so forks won't publish to scons irc channel --- .travis.yml | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0837488..cc9ca91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,17 +2,18 @@ dist: trusty language: python notifications: - irc: "chat.freenode.net#scons" + irc: + secure: TTb+41Bj1qIUc6vj+kDqBME8H3lqXdAe1RWAjjz5hL7bzFah6qCBHNJn4DwzqYs6+Pwuwp+6wFy8hgmQttJnXve4h6GtjtvlWprDqxaC7RkFqMWFDBzDalgbB54Bi4+TTZmSJ1K/duI3LrDaN873nyn+2GBnj+3TiNtgURp1fsJMpPxXJzAsoC8UthEsbx0Zkoal/WF+IfsT2q1yQRmAwB9r/drbahx/FfL16r1QjDbI9y1fKvN5J3PirLUvxtHfuH1r8zq1vlLew2fvldgVRtFv7+Lsk2waG/eiRpMf94V5JWP1rNreV/i4AUbZaTLb3bkrhtvTjSKhvx69Ydm+ygXdRgWOD/KRgqpLNAfA+t/a2J1R++89svQI4dPBpQjlfua1elcDCFddeIslgnjDUPO23Y0o7tHAy8sWkwhTcZH1Wm42uJP6Z6tHTH6+dMLvvZpkq4RUKUcrXvoUvCsVlWMGjcsBX+AEQSFGDJnLtLehO9x0QbgVga/IRKjgpDWgQDZgro3AkGg/zzVj5uFRUoU+rbmEXq9feh5i3HfExAvA3UoEtnQ6uadDyWqtQcLRFmPSWDU82CO+sanGdFL0jBjigE8ubPObzxEAz3Fg1xk56OYBkAdEd+2KEzeO1nqJmrhsnc3c/3+b1cBvaL5ozW4XB4XcWsOi268SoiBrcBo= addons: - apt: - update: true + apt: + update: true os: - linux install: - - ./.travis/install.sh + - ./.travis/install.sh # pypy is not passing atm, but still report build success for now # allow coverage to fail, so we can still do testing for all platforms @@ -47,42 +48,42 @@ jobs: before_script: skip after_success: skip python: pypy3 - env: + env: - PYVER=pypy3 - PYTHON=pypy3 sudo: required - <<: *test_job python: pypy - env: + env: - PYVER=pypy - PYTHON=pypy sudo: required - <<: *test_job python: 2.7 - env: + env: - PYVER=27 - PYTHON=2.7 sudo: required - + - <<: *test_job python: 3.5 - env: + env: - PYVER=35 - PYTHON=3.5 sudo: required - <<: *test_job python: 3.6 - env: + env: - PYVER=36 - PYTHON=3.6 sudo: required - <<: *test_job python: 3.7 - env: + env: - PYVER=37 - PYTHON=3.7 sudo: required @@ -90,7 +91,7 @@ jobs: - <<: *test_job python: 3.8-dev - env: + env: - PYVER=38 - PYTHON=3.8 sudo: required @@ -125,7 +126,7 @@ jobs: - echo "import coverage" | sudo tee --append ${PYSITEDIR}/usercustomize.py - echo "coverage.process_startup()" | sudo tee --append ${PYSITEDIR}/usercustomize.py - script: + script: - export TOTAL_BUILD_JOBS=4 # write the coverage config file - export COVERAGE_PROCESS_START=$PWD/.coveragerc @@ -145,7 +146,7 @@ jobs: - if (( ${start} == 0 )); then start=1; fi - sed -n ${start},${end}p all_tests > build_tests - coverage run -p --rcfile=$PWD/.coveragerc runtest.py -f build_tests -j 2 || if [[ $? == 2 ]]; then true; else false; fi - + after_script: - coverage combine - coverage report @@ -156,48 +157,48 @@ jobs: #- python$PYTHON -m pip install --user -U coveralls #- coveralls --rcfile=$PWD/.coveragerc - env: + env: - PYVER=27 - PYTHON=2.7 - BUILD_JOB_NUM=1 - <<: *coverage_jobs - env: + env: - PYVER=27 - PYTHON=2.7 - BUILD_JOB_NUM=2 - <<: *coverage_jobs - env: + env: - PYVER=27 - PYTHON=2.7 - BUILD_JOB_NUM=3 - <<: *coverage_jobs - env: + env: - PYVER=27 - PYTHON=2.7 - BUILD_JOB_NUM=4 - <<: *coverage_jobs python: 3.6 - env: + env: - PYVER=36 - PYTHON=3.6 - BUILD_JOB_NUM=1 - <<: *coverage_jobs python: 3.6 - env: + env: - PYVER=36 - PYTHON=3.6 - BUILD_JOB_NUM=2 - <<: *coverage_jobs python: 3.6 - env: + env: - PYVER=36 - PYTHON=3.6 - BUILD_JOB_NUM=3 - <<: *coverage_jobs python: 3.6 - env: + env: - PYVER=36 - PYTHON=3.6 - BUILD_JOB_NUM=4 -- cgit v0.12 From 3c7c8ff1e637c827ed519192c173990205b9d937 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 13 Jun 2019 10:30:12 -0600 Subject: Update Travis config: py38, lxml, docbook, ldc Py3.8 taken off "allowed to fail" list xml installed in the Python virtualenv context, not the distro context (else won't be found) Provision with a couple of additional docbook pkgs Bump the version of the reference D compiler to current. Signed-off-by: Mats Wichmann --- .travis.yml | 4 +++- .travis/install.sh | 10 ++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc9ca91..0bccb97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,9 @@ os: - linux install: + # needed for Docbook tests, must be in virtualenv context + - pip install lxml + # do the rest of the image setup - ./.travis/install.sh # pypy is not passing atm, but still report build success for now @@ -21,7 +24,6 @@ matrix: allow_failures: - python: pypy - python: pypy3 - - python: 3.8-dev - stage: Coverage # run coverage first as its still useful to collect diff --git a/.travis/install.sh b/.travis/install.sh index feb3dd4..61fc70c 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -22,21 +22,19 @@ else # dependencies for gdc tests sudo apt-get -y install gdc # dependencies for docbook tests - sudo apt-get -y install docbook-xml xsltproc libxml2-dev libxslt-dev fop docbook-xsl-doc-pdf + sudo apt-get -y install docbook-xml docbook-xsl xsltproc libxml2-dev libxslt-dev fop docbook-xsl-doc-pdf docbook-slides # dependencies for latex tests (try to skip the huge doc pkgs) sudo apt-get -y --no-install-recommends install texlive texlive-latex3 biber texmaker ghostscript # need some things for building dependencies for other tests sudo apt-get -y install python-pip python-dev build-essential libpcre3-dev autoconf automake libtool bison subversion git - # dependencies for docbook tests continued - sudo pip install lxml # dependencies for D tests sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list wget -qO - https://dlang.org/d-keyring.gpg | sudo apt-key add - sudo apt-get update && sudo apt-get -y --allow-unauthenticated install dmd-bin # dependencies for ldc tests - wget https://github.com/ldc-developers/ldc/releases/download/v1.4.0/ldc2-1.4.0-linux-x86_64.tar.xz - tar xf ldc2-1.4.0-linux-x86_64.tar.xz - sudo cp -rf ldc2-1.4.0-linux-x86_64/* / + wget https://github.com/ldc-developers/ldc/releases/download/v1.15.0/ldc2-1.15.0-linux-x86_64.tar.xz + tar xf ldc2-1.15.0-linux-x86_64.tar.xz + sudo cp -rf ldc2-1.15.0-linux-x86_64/* / ls -l /usr/lib/*python*{so,a}* -- cgit v0.12 From 961181aecd44bee3fb3e092e5dacaecb73bddffc Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 13 Jun 2019 11:11:46 -0700 Subject: add comment on how to update irc info --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index cc9ca91..2cb605f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ dist: trusty language: python +# Used: travis encrypt "chat.freenode.net#scons" --add notifications.irc notifications: irc: secure: TTb+41Bj1qIUc6vj+kDqBME8H3lqXdAe1RWAjjz5hL7bzFah6qCBHNJn4DwzqYs6+Pwuwp+6wFy8hgmQttJnXve4h6GtjtvlWprDqxaC7RkFqMWFDBzDalgbB54Bi4+TTZmSJ1K/duI3LrDaN873nyn+2GBnj+3TiNtgURp1fsJMpPxXJzAsoC8UthEsbx0Zkoal/WF+IfsT2q1yQRmAwB9r/drbahx/FfL16r1QjDbI9y1fKvN5J3PirLUvxtHfuH1r8zq1vlLew2fvldgVRtFv7+Lsk2waG/eiRpMf94V5JWP1rNreV/i4AUbZaTLb3bkrhtvTjSKhvx69Ydm+ygXdRgWOD/KRgqpLNAfA+t/a2J1R++89svQI4dPBpQjlfua1elcDCFddeIslgnjDUPO23Y0o7tHAy8sWkwhTcZH1Wm42uJP6Z6tHTH6+dMLvvZpkq4RUKUcrXvoUvCsVlWMGjcsBX+AEQSFGDJnLtLehO9x0QbgVga/IRKjgpDWgQDZgro3AkGg/zzVj5uFRUoU+rbmEXq9feh5i3HfExAvA3UoEtnQ6uadDyWqtQcLRFmPSWDU82CO+sanGdFL0jBjigE8ubPObzxEAz3Fg1xk56OYBkAdEd+2KEzeO1nqJmrhsnc3c/3+b1cBvaL5ozW4XB4XcWsOi268SoiBrcBo= -- cgit v0.12 From b66c759be505e40a7d8f5360724090a6a00be46d Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 16 Jun 2019 15:05:30 -0600 Subject: [PR #3392] leave out docbook-slides Three tests fail if the files are found, issue #3393 filed. Also added some comments on other possible changes. Signed-off-by: Mats Wichmann --- .travis/install.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index 61fc70c..9146e6c 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -21,16 +21,28 @@ else # dependencies for gdc tests sudo apt-get -y install gdc + + # dependencies for fortran tests + sudo apt-get -y install gfortran + # dependencies for docbook tests - sudo apt-get -y install docbook-xml docbook-xsl xsltproc libxml2-dev libxslt-dev fop docbook-xsl-doc-pdf docbook-slides + sudo apt-get -y install docbook-xml docbook-xsl xsltproc libxml2-dev libxslt-dev fop docbook-xsl-doc-pdf + # docbook-slides should be added but triggers GH #3393 so left out for now. + # dependencies for latex tests (try to skip the huge doc pkgs) sudo apt-get -y --no-install-recommends install texlive texlive-latex3 biber texmaker ghostscript + # Should add the following, holding off since it slows down provisioning: + # texlive-bibtex-extra texlive-latex-extra texlive-font-utils + # texlive-latex3 no longer exists, failover to texlive-latex-recommended + # need some things for building dependencies for other tests sudo apt-get -y install python-pip python-dev build-essential libpcre3-dev autoconf automake libtool bison subversion git + # dependencies for D tests sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list wget -qO - https://dlang.org/d-keyring.gpg | sudo apt-key add - sudo apt-get update && sudo apt-get -y --allow-unauthenticated install dmd-bin + # dependencies for ldc tests wget https://github.com/ldc-developers/ldc/releases/download/v1.15.0/ldc2-1.15.0-linux-x86_64.tar.xz tar xf ldc2-1.15.0-linux-x86_64.tar.xz @@ -45,6 +57,4 @@ else tar xzf rel-3.0.12.tar.gz cd swig-rel-3.0.12 && ./autogen.sh && ./configure --prefix=/usr && make && sudo make install && cd .. fi - - which dvipdf fi -- cgit v0.12 From ced31ce9ea3346c78e0763449be7b810c45bb3ba Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 17 Jun 2019 09:33:32 -0600 Subject: [PR #3392] add a few more TeX packages skip fewer tests Signed-off-by: Mats Wichmann --- .travis/install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index 9146e6c..64a300b 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -30,9 +30,7 @@ else # docbook-slides should be added but triggers GH #3393 so left out for now. # dependencies for latex tests (try to skip the huge doc pkgs) - sudo apt-get -y --no-install-recommends install texlive texlive-latex3 biber texmaker ghostscript - # Should add the following, holding off since it slows down provisioning: - # texlive-bibtex-extra texlive-latex-extra texlive-font-utils + sudo apt-get -y --no-install-recommends install texlive texlive-latex3 biber texmaker ghostscript texlive-bibtex-extra texlive-latex-extra texlive-font-utils # texlive-latex3 no longer exists, failover to texlive-latex-recommended # need some things for building dependencies for other tests -- cgit v0.12 From 958fcfe1a37f2abea6104af3a2995cd714d13754 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 18 Jun 2019 15:45:48 -0700 Subject: Added tests to logic changes by mhqtronic PR #3375 --- src/CHANGES.txt | 10 ++ src/engine/SCons/Tool/MSCommon/vc.py | 42 ++++--- src/engine/SCons/Tool/MSCommon/vcTests.py | 180 ++++++++++++++++++++++++++++++ 3 files changed, 215 insertions(+), 17 deletions(-) create mode 100644 src/engine/SCons/Tool/MSCommon/vcTests.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 846d860..cd73140 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -5,6 +5,8 @@ Change Log +**PLEASE ADD YOUR NAME IN ALPHABETICAL ORDER TO AVOID NEEDED TO REORDER BELOW** + RELEASE VERSION/DATE TO BE FILLED IN LATER From Peter Diener: @@ -40,6 +42,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER which specifies what character to join all the argements output into the tempfile. The default remains a space when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) + From Michael Hartmann: + - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + + From Mats Wichmann: - scons-time takes more care closing files and uses safer mkdtemp to avoid possible races on multi-job runs. @@ -66,6 +72,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER ParseFlags: -iquote and -idirafter. - Fix more re patterns that contain \ but not specified as raw strings (affects scanners for D, LaTeX, swig) +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes From Mathew Robinson: - Update cache debug output to include cache hit rate. diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index c8fb19d..e43d0bb 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -60,7 +60,10 @@ class VisualCException(Exception): class UnsupportedVersion(VisualCException): pass -class UnsupportedArch(VisualCException): +class MSVCUnsupportedHostArch(VisualCException): + pass + +class MSVCUnsupportedTargetArch(VisualCException): pass class MissingConfiguration(VisualCException): @@ -89,17 +92,15 @@ _ARCH_TO_CANONICAL = { "aarch64" : "arm64", } -# get path to the cl.exe dir for newer VS versions -# based off a tuple of (host, target) platforms _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = { - ("amd64","amd64") : "Hostx64\\x64", - ("amd64","x86") : "Hostx64\\x86", - ("amd64","arm") : "Hostx64\\arm", - ("amd64","arm64") : "Hostx64\\arm64", - ("x86","amd64") : "Hostx86\\x64", - ("x86","x86") : "Hostx86\\x86", - ("x86","arm") : "Hostx86\\arm", - ("x86","arm64") : "Hostx86\\arm64", + ("amd64","amd64") : ("Hostx64","x64"), + ("amd64","x86") : ("Hostx64","x86"), + ("amd64","arm") : ("Hostx64","arm"), + ("amd64","arm64") : ("Hostx64","arm64"), + ("x86","amd64") : ("Hostx86","x64"), + ("x86","x86") : ("Hostx86","x86"), + ("x86","arm") : ("Hostx86","arm"), + ("x86","arm64") : ("Hostx86","arm64"), } # get path to the cl.exe dir for older VS versions @@ -174,15 +175,15 @@ def get_host_target(env): try: host = _ARCH_TO_CANONICAL[host_platform.lower()] - except KeyError as e: + except KeyError: msg = "Unrecognized host architecture %s" - raise ValueError(msg % repr(host_platform)) + raise MSVCUnsupportedHostArch(msg % repr(host_platform)) try: target = _ARCH_TO_CANONICAL[target_platform.lower()] - except KeyError as e: + except KeyError: all_archs = str(list(_ARCH_TO_CANONICAL.keys())) - raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs)) + raise MSVCUnsupportedTargetArch("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs)) return (host, target,req_target_platform) @@ -425,6 +426,8 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): __INSTALLED_VCS_RUN = None +_VC_TOOLS_VERSION_FILE_PATH = ['Auxiliary', 'Build', 'Microsoft.VCToolsVersion.default.txt'] +_VC_TOOLS_VERSION_FILE = os.sep.join(_VC_TOOLS_VERSION_FILE_PATH) def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): """Find the cl.exe on the filesystem in the vc_dir depending on @@ -468,7 +471,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # 2017 and newer allowed multiple versions of the VC toolset to be installed at the same time. # Just get the default tool version for now #TODO: support setting a specific minor VC version - default_toolset_file = os.path.join(vc_dir, r'Auxiliary\Build\Microsoft.VCToolsVersion.default.txt') + default_toolset_file = os.path.join(vc_dir, _VC_TOOLS_VERSION_FILE) try: with open(default_toolset_file) as f: vc_specific_version = f.readlines()[0].strip() @@ -480,11 +483,16 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): return False host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None) +<<<<<<< Updated upstream if not host_trgt_dir: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') +======= + if host_trgt_dir is None: + debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo: (%s,%s)'%(host_platform, target_platform)) +>>>>>>> Stashed changes return False - cl_path = os.path.join(vc_dir, r'Tools\MSVC', vc_specific_version, 'bin', host_trgt_dir, _CL_EXE_NAME) + cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin', host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME) debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path) if os.path.exists(cl_path): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') diff --git a/src/engine/SCons/Tool/MSCommon/vcTests.py b/src/engine/SCons/Tool/MSCommon/vcTests.py new file mode 100644 index 0000000..09991f5 --- /dev/null +++ b/src/engine/SCons/Tool/MSCommon/vcTests.py @@ -0,0 +1,180 @@ +# +# __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. +# +# from typing import Dict, Any + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +import os +import os.path +import unittest + +import SCons.Node.FS +import SCons.Warnings +import SCons.Tool.MSCommon.vc + +import TestCmd + +original = os.getcwd() + +test = TestCmd.TestCmd(workdir='') + +os.chdir(test.workpath('')) + +MSVCUnsupportedHostArch = SCons.Tool.MSCommon.vc.MSVCUnsupportedHostArch +MSVCUnsupportedTargetArch = SCons.Tool.MSCommon.vc.MSVCUnsupportedTargetArch + +MS_TOOLS_VERSION='1.1.1' + +class MSVcTestCase(unittest.TestCase): + + @staticmethod + def _createDummyCl(path, add_bin=True): + """ + Creates a dummy cl.ex in the correct directory. + It will create all missing parent directories as well + + Args: + path: Relative path to cl.exe for the version about to be tested. + """ + + # print("PATH:%s"%path) + + path = path.replace('\\', os.sep) + if add_bin: + create_path = os.path.join(path,'bin') + else: + create_path = path + if create_path and not os.path.isdir(create_path): + os.makedirs(create_path) + + create_this = os.path.join(create_path,'cl.exe') + + # print("Creating: %s"%create_this) + with open(create_this,'w') as ct: + ct.write('created') + + + + + def runTest(self): + """ + Check that all proper HOST_PLATFORM and TARGET_PLATFORM are handled. + Verify that improper HOST_PLATFORM and/or TARGET_PLATFORM are properly handled. + by SCons.Tool.MSCommon.vc._check_cl_exists_in_vc_dir() + """ + + check = SCons.Tool.MSCommon.vc._check_cl_exists_in_vc_dir + + env={'TARGET_ARCH':'x86'} + p = SCons.Tool.MSCommon.vc._HOST_TARGET_TO_CL_DIR[('x86','x86')] + MSVcTestCase._createDummyCl(p) + + # print("retval:%s"%check(env, '.', '8.0')) + + + # Setup for VC 14+ tests + + # Create the VC minor/major version file + tools_version_file = SCons.Tool.MSCommon.vc._VC_TOOLS_VERSION_FILE + tools_dir = os.path.dirname(tools_version_file) + if not os.path.isdir(tools_dir): + os.makedirs(tools_dir) + try: + with open(tools_version_file, 'w') as tf: + tf.write(MS_TOOLS_VERSION) + except IOError as e: + print("Failed trying to write :%s :%s"%(tools_version_file, e)) + + + # Now walk all the valid combinations of host/target for VC 14 + + vc_gt_14_map = SCons.Tool.MSCommon.vc._HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 + + for key, value in vc_gt_14_map.items(): + # print("GT 14 Got: %s -> %s"%(key,value)) + + env={'TARGET_ARCH':key[1], 'HOST_ARCH':key[0]} + path = os.path.join('.','Tools','MSVC', MS_TOOLS_VERSION, 'bin', value[0], value[1]) + MSVcTestCase._createDummyCl(path, add_bin=False) + result=check(env, '.', '14.1') + # print("for:%s got :%s"%(key[1], result)) + self.assertTrue(result, "Checking host: %s target: %s"%(value[0], value[1])) + + # Now test bogus value for HOST_ARCH + env={'TARGET_ARCH':'x86', 'HOST_ARCH':'GARBAGE'} + try: + result=check(env, '.', '14.1') + # print("for:%s got :%s"%(env, result)) + self.assertFalse(result, "Did not fail with bogus HOST_ARCH host: %s target: %s"%(value[0], value[1])) + except MSVCUnsupportedHostArch: + pass + else: + self.fail('Did not fail when HOST_ARCH specified as: %s'%env['HOST_ARCH']) + + # Now test bogus value for TARGET_ARCH + env={'TARGET_ARCH':'GARBAGE', 'HOST_ARCH':'x86'} + try: + result=check(env, '.', '14.1') + # print("for:%s got :%s"%(env, result)) + self.assertFalse(result, "Did not fail with bogus TARGET_ARCH host: %s target: %s"%(value[0], value[1])) + except MSVCUnsupportedTargetArch: + pass + else: + self.fail('Did not fail when HOST_ARCH specified as: %s'%env['TARGET_ARCH']) + + # Test >8 < 14 VC versions + vc_map = SCons.Tool.MSCommon.vc._HOST_TARGET_TO_CL_DIR + for key,value in vc_map.items(): + # print("LT 14 Got: %s -> %s"%(key,value)) + env={'TARGET_ARCH':key[1], 'HOST_ARCH':key[0]} + path = os.path.join('.', 'bin', value ) + MSVcTestCase._createDummyCl(path, add_bin=False) + result=check(env, '.', '9.0') + # print("for:%s got :%s"%(key[1], result)) + self.assertTrue(result, "Checking host: %s target: %s"%(key[0], key[1])) + + # Now test bogus value for HOST_ARCH + env={'TARGET_ARCH':'x86', 'HOST_ARCH':'GARBAGE'} + try: + result=check(env, '.', '9.0') + # print("for:%s got :%s"%(env, result)) + self.assertFalse(result, "Did not fail with bogus HOST_ARCH host: %s target: %s"%(env['HOST_ARCH'], env['TARGET_ARCH'])) + except MSVCUnsupportedHostArch: + pass + else: + self.fail('Did not fail when HOST_ARCH specified as: %s'%env['HOST_ARCH']) + + # Now test bogus value for TARGET_ARCH + env={'TARGET_ARCH':'GARBAGE', 'HOST_ARCH':'x86'} + try: + result=check(env, '.', '9.0') + # print("for:%s got :%s"%(env, result)) + self.assertFalse(result, "Did not fail with bogus TARGET_ARCH host: %s target: %s"%(env['HOST_ARCH'], env['TARGET_ARCH'])) + except MSVCUnsupportedTargetArch: + pass + else: + self.fail('Did not fail when HOST_ARCH specified as: %s'%env['TARGET_ARCH']) + + + +if __name__ == "__main__": + unittest.main() -- cgit v0.12 From 91cf45e5e5e71c644f0216b93ff5af7f6fc513e5 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 18 Jun 2019 15:49:06 -0700 Subject: [skip ci] remove conflict markers from CHANGES.txt --- src/CHANGES.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index cd73140..6a8d626 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -72,10 +72,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER ParseFlags: -iquote and -idirafter. - Fix more re patterns that contain \ but not specified as raw strings (affects scanners for D, LaTeX, swig) -<<<<<<< Updated upstream -======= ->>>>>>> Stashed changes From Mathew Robinson: - Update cache debug output to include cache hit rate. -- cgit v0.12 From 488d852d52c757bcf87cb7c1c9fdbdb0828a44ef Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 18 Jun 2019 16:11:43 -0700 Subject: Fix conflict --- src/engine/SCons/Tool/MSCommon/vc.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index e43d0bb..1485b8c 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -483,13 +483,8 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): return False host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None) -<<<<<<< Updated upstream - if not host_trgt_dir: - debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') -======= if host_trgt_dir is None: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo: (%s,%s)'%(host_platform, target_platform)) ->>>>>>> Stashed changes return False cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin', host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME) -- cgit v0.12 From 3ae19b9307c1602f303f3a4fe15792bd5a042f51 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 18 Jun 2019 17:24:44 -0700 Subject: Switch from testing for directory value being false to -1 as "" evaluates to false --- src/engine/SCons/Tool/MSCommon/vc.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 1485b8c..d41d572 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -495,8 +495,10 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): elif ver_num <= 14 and ver_num >= 8: - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) - if not host_trgt_dir: + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), -1) + if host_trgt_dir == -1: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') return False @@ -508,8 +510,11 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # older versions of visual studio only had x86 binaries, # so if the host platform is amd64, we need to check cross # compile options (x86 binary compiles some other target on a 64 bit os) - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) - if not host_trgt_dir: + + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), -1) + if host_trgt_dir == -1: return False cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) -- cgit v0.12 From 097b3932eaa083c9f446eab4d8c3ebac09f0aa24 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 18 Jun 2019 17:43:00 -0700 Subject: Switch back to None with proper comparison using is instead of not --- src/engine/SCons/Tool/MSCommon/vc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index d41d572..b3ba0b8 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -497,8 +497,8 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested # if not host_trgt_dir - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), -1) - if host_trgt_dir == -1: + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) + if host_trgt_dir is None: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') return False @@ -513,8 +513,8 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested # if not host_trgt_dir - host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), -1) - if host_trgt_dir == -1: + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) + if host_trgt_dir is None: return False cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) -- cgit v0.12 From c325fae0a27d23b292852d18f8b9b0e649cd5cf0 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 19 Jun 2019 18:08:45 -0700 Subject: Allow MSVCUnsupportedTargetArch and MSVCUnsupportedHostArch exceptions to propagate and cause SCons to exit --- src/engine/SCons/Tool/MSCommon/common.py | 1 - src/engine/SCons/Tool/MSCommon/vc.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Tool/MSCommon/common.py b/src/engine/SCons/Tool/MSCommon/common.py index d8cb20f..c3ba8e5 100644 --- a/src/engine/SCons/Tool/MSCommon/common.py +++ b/src/engine/SCons/Tool/MSCommon/common.py @@ -34,7 +34,6 @@ import re import SCons.Util - LOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG') if LOGFILE == '-': def debug(message): diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index b3ba0b8..1da2643 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -562,6 +562,10 @@ def get_installed_vcs(env=None): debug('find_vc_pdir no compiler found %s' % ver) else: debug('find_vc_pdir return None for ver %s' % ver) + except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch) as e: + # Allow this exception to propagate further as it should cause + # SCons to exit with an error code + raise except VisualCException as e: debug('did not find VC %s: caught exception %s' % (ver, str(e))) return installed_versions -- cgit v0.12 From f0987d093a5bfb86cb337a3d9cdaa541b63fc3ca Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 20 Jun 2019 08:46:00 -0700 Subject: Fix sider warning --- src/engine/SCons/Tool/MSCommon/vc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 1da2643..d2a5573 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -562,7 +562,7 @@ def get_installed_vcs(env=None): debug('find_vc_pdir no compiler found %s' % ver) else: debug('find_vc_pdir return None for ver %s' % ver) - except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch) as e: + except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch): # Allow this exception to propagate further as it should cause # SCons to exit with an error code raise -- cgit v0.12 From 096e6b053fa4b85cf74e846c24bba23794c9eb7b Mon Sep 17 00:00:00 2001 From: bdbaddog Date: Tue, 25 Jun 2019 14:44:05 -0700 Subject: Remove join and list comprehension when not needed in Action.get_content(). Yields some speedup. --- src/engine/SCons/Action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 3ec8a4c..c6fc575 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -534,7 +534,7 @@ class ActionBase(object): result = self.get_presig(target, source, env) if not isinstance(result,(bytes, bytearray)): - result = bytearray("",'utf-8').join([ SCons.Util.to_bytes(r) for r in result ]) + result = bytearray(result, 'utf-8') else: # Make a copy and put in bytearray, without this the contents returned by get_presig # can be changed by the logic below, appending with each call and causing very -- cgit v0.12 From f999d2149d1359327b5b1dd0e1286675c9ba09d4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 25 Jun 2019 17:27:29 -0700 Subject: Restore MD5-Timestamp performance by removing try/except from every call. Also some optimized logic for updating and using the dependency_map built as part of the decider. Fixed tests. Note Deciders now need a fourth argument 'repo_node' which is the repository node for the file if it's to be used. This is currently only used by md5-timestamp decider File.changed_timestamp_then_content() --- src/engine/SCons/Environment.py | 33 +++++++------ src/engine/SCons/Node/FS.py | 87 +++++++++++++++++++++++++---------- src/engine/SCons/Node/__init__.py | 32 ++++++------- src/engine/SCons/SConf.py | 9 ++-- test/Decider/Environment.py | 2 +- test/Decider/Node.py | 2 +- test/Decider/default.py | 2 +- test/Decider/mixed.py | 6 +-- test/packaging/rpm/explicit-target.py | 2 +- 9 files changed, 103 insertions(+), 72 deletions(-) diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 7f9a76c..eb3284a 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -864,18 +864,21 @@ class SubstitutionEnvironment(object): return self -def default_decide_source(dependency, target, prev_ni): +def default_decide_source(dependency, target, prev_ni, repo_node=None): f = SCons.Defaults.DefaultEnvironment().decide_source - return f(dependency, target, prev_ni) + return f(dependency, target, prev_ni, repo_node) -def default_decide_target(dependency, target, prev_ni): + +def default_decide_target(dependency, target, prev_ni, repo_node=None): f = SCons.Defaults.DefaultEnvironment().decide_target - return f(dependency, target, prev_ni) + return f(dependency, target, prev_ni, repo_node) + def default_copy_from_cache(src, dst): f = SCons.Defaults.DefaultEnvironment().copy_from_cache return f(src, dst) + class Base(SubstitutionEnvironment): """Base class for "real" construction Environments. These are the primary objects used to communicate dependency and construction @@ -1434,13 +1437,13 @@ class Base(SubstitutionEnvironment): _warn_copy_deprecated = False return self.Clone(*args, **kw) - def _changed_build(self, dependency, target, prev_ni): - if dependency.changed_state(target, prev_ni): + def _changed_build(self, dependency, target, prev_ni, repo_node=None): + if dependency.changed_state(target, prev_ni, repo_node): return 1 - return self.decide_source(dependency, target, prev_ni) + return self.decide_source(dependency, target, prev_ni, repo_node) - def _changed_content(self, dependency, target, prev_ni): - return dependency.changed_content(target, prev_ni) + def _changed_content(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_content(target, prev_ni, repo_node) def _changed_source(self, dependency, target, prev_ni): target_env = dependency.get_build_env() @@ -1450,14 +1453,14 @@ class Base(SubstitutionEnvironment): else: return target_env.decide_target(dependency, target, prev_ni) - def _changed_timestamp_then_content(self, dependency, target, prev_ni): - return dependency.changed_timestamp_then_content(target, prev_ni) + def _changed_timestamp_then_content(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_then_content(target, prev_ni, repo_node) - def _changed_timestamp_newer(self, dependency, target, prev_ni): - return dependency.changed_timestamp_newer(target, prev_ni) + def _changed_timestamp_newer(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_newer(target, prev_ni, repo_node) - def _changed_timestamp_match(self, dependency, target, prev_ni): - return dependency.changed_timestamp_match(target, prev_ni) + def _changed_timestamp_match(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_match(target, prev_ni, repo_node) def _copy_from_cache(self, src, dst): return self.fs.copy(src, dst) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 91d349d..ac85638 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -2635,6 +2635,7 @@ class File(Base): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File') Base.__init__(self, name, directory, fs) self._morph() + self.attributes.changed_timestamp_then_content = None def Entry(self, name): """Create an entry node named 'name' relative to @@ -3283,14 +3284,14 @@ class File(Base): self._memo['changed'] = has_changed return has_changed - def changed_content(self, target, prev_ni): + def changed_content(self, target, prev_ni, repo_node=None): cur_csig = self.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 - def changed_state(self, target, prev_ni): + def changed_state(self, target, prev_ni, repo_node=None): return self.state != SCons.Node.up_to_date @@ -3324,6 +3325,21 @@ class File(Base): return binfo.dependency_map + # @profile + def _add_strings_to_dependency_map(self, dmap): + """ + In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map + :return: + """ + + first_string = str(next(iter(dmap))) + + # print("DMAP:%s"%id(dmap)) + if first_string not in dmap: + string_dict = {str(child): signature for child, signature in dmap.items()} + dmap.update(string_dict) + return dmap + def _get_previous_signatures(self, dmap): """ Return a list of corresponding csigs from previous @@ -3342,37 +3358,62 @@ class File(Base): if len(dmap) == 0: if MD5_TIMESTAMP_DEBUG: print("Nothing dmap shortcutting") return None + elif MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) + - if MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) - # First try the simple name for node - c_str = str(self) - if MD5_TIMESTAMP_DEBUG: print("Checking :%s"%c_str) - df = dmap.get(c_str, None) + # First try retrieving via Node + if MD5_TIMESTAMP_DEBUG: print("Checking if self is in map:%s id:%s type:%s"%(str(self), id(self), type(self))) + df = dmap.get(self, False) if df: return df + # Now check if self's repository file is in map. + rf = self.rfile() + if MD5_TIMESTAMP_DEBUG: print("Checking if self.rfile is in map:%s id:%s type:%s"%(str(rf), id(rf), type(rf))) + rfm = dmap.get(rf, False) + if rfm: + return rfm + + # get default string for node and then also string swapping os.altsep for os.sep (/ for \) + c_strs = [str(self)] + if os.altsep: - c_str = c_str.replace(os.sep, os.altsep) - df = dmap.get(c_str, None) - if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + c_strs.append(c_strs[0].replace(os.sep, os.altsep)) + + # In some cases the dependency_maps' keys are already strings check. + # Check if either string is now in dmap. + for s in c_strs: + if MD5_TIMESTAMP_DEBUG: print("Checking if str(self) is in map :%s" % s) + df = dmap.get(s, False) if df: return df + # Strings didn't existing in map, add them and try again + # If there are no strings in this dmap, then add them. + # This may not be necessary, we could walk the nodes in the dmap and check each string + # rather than adding ALL the strings to dmap. In theory that would be n/2 vs 2n str() calls on node + # if not dmap.has_strings: + dmap = self._add_strings_to_dependency_map(dmap) + + # In some cases the dependency_maps' keys are already strings check. + # Check if either string is now in dmap. + for s in c_strs: + if MD5_TIMESTAMP_DEBUG: print("Checking if str(self) is in map (now with strings) :%s" % s) + df = dmap.get(s, False) + if df: + return df + + # Lastly use nodes get_path() to generate string and see if that's in dmap if not df: try: # this should yield a path which matches what's in the sconsign c_str = self.get_path() - df = dmap.get(c_str, None) - if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) - if df: - return df - if os.altsep: c_str = c_str.replace(os.sep, os.altsep) - df = dmap.get(c_str, None) - if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) - if df: - return df + + if MD5_TIMESTAMP_DEBUG: print("Checking if self.get_path is in map (now with strings) :%s" % s) + + df = dmap.get(c_str, None) except AttributeError as e: raise FileBuildInfoFileToCsigMappingError("No mapping from file name to content signature for :%s"%c_str) @@ -3399,9 +3440,6 @@ class File(Base): Returns: Boolean - Indicates if node(File) has changed. """ - if node is None: - # We need required node argument to get BuildInfo to function - raise DeciderNeedsNode(self.changed_timestamp_then_content) # Now get sconsign name -> csig map and then get proper prev_ni if possible bi = node.get_stored_info().binfo @@ -3433,7 +3471,6 @@ class File(Base): print("Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s"%(str(target), old, new)) new_prev_ni = self._get_previous_signatures(dependency_map) - if not new: try: # NOTE: We're modifying the current node's csig in a query. @@ -3443,13 +3480,13 @@ class File(Base): return False return self.changed_content(target, new_prev_ni) - def changed_timestamp_newer(self, target, prev_ni): + def changed_timestamp_newer(self, target, prev_ni, repo_node=None): try: return self.get_timestamp() > target.get_timestamp() except AttributeError: return 1 - def changed_timestamp_match(self, target, prev_ni): + def changed_timestamp_match(self, target, prev_ni, repo_node=None): """ Return True if the timestamps don't match or if there is no previous timestamp :param target: diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index aeb7092..ff98e2d 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -271,7 +271,7 @@ class DeciderNeedsNode(Exception): # # First, the single decider functions # -def changed_since_last_build_node(node, target, prev_ni): +def changed_since_last_build_node(node, target, prev_ni, repo_node=None): """ Must be overridden in a specific subclass to return True if this @@ -292,7 +292,7 @@ def changed_since_last_build_node(node, target, prev_ni): raise NotImplementedError -def changed_since_last_build_alias(node, target, prev_ni): +def changed_since_last_build_alias(node, target, prev_ni, repo_node=None): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig @@ -300,24 +300,24 @@ def changed_since_last_build_alias(node, target, prev_ni): return 1 -def changed_since_last_build_entry(node, target, prev_ni): +def changed_since_last_build_entry(node, target, prev_ni, repo_node=None): node.disambiguate() - return _decider_map[node.changed_since_last_build](node, target, prev_ni) + return _decider_map[node.changed_since_last_build](node, target, prev_ni, repo_node) -def changed_since_last_build_state_changed(node, target, prev_ni): +def changed_since_last_build_state_changed(node, target, prev_ni, repo_node=None): return node.state != SCons.Node.up_to_date -def decide_source(node, target, prev_ni): - return target.get_build_env().decide_source(node, target, prev_ni) +def decide_source(node, target, prev_ni, repo_node=None): + return target.get_build_env().decide_source(node, target, prev_ni, repo_node) -def decide_target(node, target, prev_ni): - return target.get_build_env().decide_target(node, target, prev_ni) +def decide_target(node, target, prev_ni, repo_node=None): + return target.get_build_env().decide_target(node, target, prev_ni, repo_node) -def changed_since_last_build_python(node, target, prev_ni): +def changed_since_last_build_python(node, target, prev_ni, repo_node=None): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig @@ -1505,17 +1505,11 @@ class Node(object, with_metaclass(NoSlotsPyPy)): result = True for child, prev_ni in zip(children, then): - try: - if _decider_map[child.changed_since_last_build](child, self, prev_ni): - if t: Trace(': %s changed' % child) - result = True - except DeciderNeedsNode as e: - if e.decider(self, prev_ni, node=node): - if t: Trace(': %s changed' % child) - result = True + if _decider_map[child.changed_since_last_build](child, self, prev_ni, node): + if t: Trace(': %s changed' % child) + result = True if self.has_builder(): - import SCons.Util contents = self.get_executor().get_contents() newsig = SCons.Util.MD5signature(contents) if bi.bactsig != newsig: diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py index 59afb40..71729c9 100644 --- a/src/engine/SCons/SConf.py +++ b/src/engine/SCons/SConf.py @@ -56,7 +56,6 @@ import SCons.Warnings import SCons.Conftest from SCons.Debug import Trace -from SCons.Node import DeciderNeedsNode # Turn off the Conftest error logging SCons.Conftest.LogInputFiles = 0 @@ -407,12 +406,10 @@ class SConfBase(object): # that the correct .sconsign info will get calculated # and keep the build state consistent. def force_build(dependency, target, prev_ni, - env_decider=env.decide_source, - node=None): + repo_node=None, + env_decider=env.decide_source): try: - env_decider(dependency, target, prev_ni) - except DeciderNeedsNode as e: - e.decider(target, prev_ni, node=target) + env_decider(dependency, target, prev_ni, repo_node) except Exception as e: raise e return True diff --git a/test/Decider/Environment.py b/test/Decider/Environment.py index 58cd57b..4a23b5c 100644 --- a/test/Decider/Environment.py +++ b/test/Decider/Environment.py @@ -38,7 +38,7 @@ DefaultEnvironment(tools=[]) import os.path env = Environment(tools=[]) env.Command('file.out', 'file.in', Copy('$TARGET', '$SOURCE')) -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node=None): return os.path.exists('has-changed') env.Decider(my_decider) """) diff --git a/test/Decider/Node.py b/test/Decider/Node.py index c1910de..0fa9726 100644 --- a/test/Decider/Node.py +++ b/test/Decider/Node.py @@ -38,7 +38,7 @@ import os.path file_in = File('file.in') file_out = File('file.out') Command(file_out, file_in, Copy('$TARGET', '$SOURCE')) -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node): return os.path.exists('has-changed') file_in.Decider(my_decider) """) diff --git a/test/Decider/default.py b/test/Decider/default.py index 5d0a452..78f981e 100644 --- a/test/Decider/default.py +++ b/test/Decider/default.py @@ -36,7 +36,7 @@ test.write('SConstruct', """ DefaultEnvironment(tools=[]) import os.path Command('file.out', 'file.in', Copy('$TARGET', '$SOURCE')) -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node=None): return os.path.exists('has-changed') Decider(my_decider) """) diff --git a/test/Decider/mixed.py b/test/Decider/mixed.py index 08daa7d..711bd2b 100644 --- a/test/Decider/mixed.py +++ b/test/Decider/mixed.py @@ -47,11 +47,11 @@ denv.Command('ddd.out', 'ddd.in', Copy('$TARGET', '$SOURCE')) denv.Command('n2.out', n2_in, Copy('$TARGET', '$SOURCE')) env.Command( 'eee.out', 'eee.in', Copy('$TARGET', '$SOURCE')) env.Command( 'n3.out', n3_in, Copy('$TARGET', '$SOURCE')) -def default_decider(dependency, target, prev_ni): +def default_decider(dependency, target, prev_ni, repo_node=None): return os.path.exists('default-has-changed') -def env_decider(dependency, target, prev_ni): +def env_decider(dependency, target, prev_ni, repo_node=None): return os.path.exists('env-has-changed') -def node_decider(dependency, target, prev_ni): +def node_decider(dependency, target, prev_ni, repo_node=None): return os.path.exists('node-has-changed') Decider(default_decider) env.Decider(env_decider) diff --git a/test/packaging/rpm/explicit-target.py b/test/packaging/rpm/explicit-target.py index 553ce27..48b5c83 100644 --- a/test/packaging/rpm/explicit-target.py +++ b/test/packaging/rpm/explicit-target.py @@ -77,7 +77,7 @@ env.Package( NAME = 'foo', expect = """ scons: *** Setting target is not supported for rpm. -""" + test.python_file_line(test.workpath('SConstruct'), 12) +""" + test.python_file_line(test.workpath('SConstruct'), 23) test.run(arguments='', status=2, stderr=expect) -- cgit v0.12 From 948478e12095f480a9c0ad91dc8bae2cd19ac82d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 28 Jun 2019 09:12:41 -0700 Subject: Fix _add_strings_to_dependency_map() perf degredation --- src/engine/SCons/Node/FS.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index ac85638..3604ac1 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -3319,8 +3319,7 @@ class File(Base): return {} - # store this info so we can avoid regenerating it. - binfo.dependency_map = { str(child):signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), + binfo.dependency_map = { child:signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))} return binfo.dependency_map -- cgit v0.12 From 2ecf9b252ea0793c329cbde9d513fd67b65328f5 Mon Sep 17 00:00:00 2001 From: Lukas Schrangl Date: Tue, 2 Jul 2019 19:37:12 +0200 Subject: LaTeX scanner: Find > 1 includes per line "^[^%\n]*" at the beginning of the reg ex would match all but the last include so that they were lost. There is no point checking for "%" since comments are stripped anyways, so just remove that part. Also add test case for multiple includes per line. --- src/engine/SCons/Scanner/LaTeX.py | 1 - src/engine/SCons/Scanner/LaTeXTests.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py index f48c84d..ce4c310 100644 --- a/src/engine/SCons/Scanner/LaTeX.py +++ b/src/engine/SCons/Scanner/LaTeX.py @@ -187,7 +187,6 @@ class LaTeX(SCons.Scanner.Base): # lines), interfering with a match on the next line. # add option for whitespace before the '[options]' or the '{filename}' regex = r''' - ^[^%\n]* \\( include | includegraphics(?:\s*\[[^\]]+\])? diff --git a/src/engine/SCons/Scanner/LaTeXTests.py b/src/engine/SCons/Scanner/LaTeXTests.py index 6dd7dac..409699c 100644 --- a/src/engine/SCons/Scanner/LaTeXTests.py +++ b/src/engine/SCons/Scanner/LaTeXTests.py @@ -61,6 +61,12 @@ test.write('test3.latex',r""" \includegraphics[width=60mm]{inc5.xyz} """) +test.write('test4.latex',r""" +\include{inc1}\include{inc2} +\only<1>{\includegraphics{inc5.xyz}}% +\only<2>{\includegraphics{inc7.png}} +""") + test.subdir('subdir') test.write('inc1.tex',"\n") @@ -73,6 +79,7 @@ test.write(['subdir', 'inc3c.tex'], "\n") test.write(['subdir', 'inc4.eps'], "\n") test.write('inc5.xyz', "\n") test.write('inc6.tex', "\n") +test.write('inc7.png', "\n") test.write('incNO.tex', "\n") # define some helpers: @@ -155,6 +162,15 @@ class LaTeXScannerTestCase3(unittest.TestCase): files = ['inc5.xyz', 'subdir/inc4.eps'] deps_match(self, deps, files) +class LaTeXScannerTestCase4(unittest.TestCase): + def runTest(self): + env = DummyEnvironment(TEXINPUTS=[test.workpath("subdir")],LATEXSUFFIXES = [".tex", ".ltx", ".latex"]) + s = SCons.Scanner.LaTeX.LaTeXScanner() + path = s.path(env) + deps = s(env.File('test4.latex'), env, path) + files = ['inc1.tex', 'inc2.tex', 'inc5.xyz', 'inc7.png'] + deps_match(self, deps, files) + if __name__ == "__main__": unittest.main() -- cgit v0.12 From 90bde577a88c6a9dfd49696549e562363e0bfc58 Mon Sep 17 00:00:00 2001 From: Lukas Schrangl Date: Tue, 2 Jul 2019 23:11:26 +0200 Subject: Update CHANGES.txt with LaTeX scanner > 1 include per line change --- src/CHANGES.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 6a8d626..a491ba5 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -42,9 +42,15 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER which specifies what character to join all the argements output into the tempfile. The default remains a space when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) - From Michael Hartmann: + From Michael Hartmann: - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + From Mathew Robinson: + - Update cache debug output to include cache hit rate. + - No longer unintentionally hide exceptions in Action.py + + From Lukas Schrangl: + - Enable LaTeX scanner to find more than one include per line From Mats Wichmann: - scons-time takes more care closing files and uses safer mkdtemp to avoid @@ -72,11 +78,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER ParseFlags: -iquote and -idirafter. - Fix more re patterns that contain \ but not specified as raw strings (affects scanners for D, LaTeX, swig) - - From Mathew Robinson: - - Update cache debug output to include cache hit rate. - - No longer unintentionally hide exceptions in Action.py RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 -- cgit v0.12 From 9a0e8e503a49485a2d50c8a24d9f041bc50d1cd1 Mon Sep 17 00:00:00 2001 From: Lukas Schrangl Date: Wed, 3 Jul 2019 10:56:50 +0200 Subject: LaTeX scanner: Remove obsolete comment The comment referred to the "old" regular expression that would only find the last include in each line. --- src/engine/SCons/Scanner/LaTeX.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/engine/SCons/Scanner/LaTeX.py b/src/engine/SCons/Scanner/LaTeX.py index ce4c310..d1cf04d 100644 --- a/src/engine/SCons/Scanner/LaTeX.py +++ b/src/engine/SCons/Scanner/LaTeX.py @@ -179,13 +179,6 @@ class LaTeX(SCons.Scanner.Base): 'inputfrom', 'subinputfrom'] def __init__(self, name, suffixes, graphics_extensions, *args, **kw): - - # We have to include \n with the % we exclude from the first part - # part of the regex because the expression is compiled with re.M. - # Without the \n, the ^ could match the beginning of a *previous* - # line followed by one or more newline characters (i.e. blank - # lines), interfering with a match on the next line. - # add option for whitespace before the '[options]' or the '{filename}' regex = r''' \\( include -- cgit v0.12 From e9cd61941fe3f1766e8bd917caa2dd6271ec9bf1 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 5 Jul 2019 17:28:54 -0400 Subject: remove unnecessary DeciderNeedsNode exception --- src/engine/SCons/Node/__init__.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index ff98e2d..3073d59 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -253,21 +253,6 @@ _target_from_source_map = {0 : target_from_source_none, # used by it. # - -class DeciderNeedsNode(Exception): - """ - Indicate that the decider needs the node as well as the target and the dependency. - Normally the node and the target are the same, but in the case of repository - They may be different. Also the NodeInfo is retrieved from the node - """ - def __init__(self, call_this_decider): - """ - :param call_this_decider: to return the decider to call directly since deciders - are called through several levels of indirection - """ - self.decider = call_this_decider - - # # First, the single decider functions # -- cgit v0.12 From c648cbc9224a566f73655602a7b12876d1e9adb1 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 5 Jul 2019 17:29:55 -0400 Subject: Fix __slots = ('single element') -> ('single element',) per finding by mwichmann --- src/engine/SCons/Node/FS.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 3604ac1..94d77a3 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -2261,7 +2261,7 @@ class RootDir(Dir): this directory. """ - __slots__ = ['_lookupDict'] + __slots__ = ('_lookupDict', ) def __init__(self, drive, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir') @@ -2467,7 +2467,7 @@ class FileNodeInfo(SCons.Node.NodeInfoBase): """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): - for name in getattr(obj,'__slots__',()): + for name in getattr(obj, '__slots__', ()): if hasattr(self, name): state[name] = getattr(self, name) @@ -2511,7 +2511,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase): or count of any of these could yield writing wrong csig, and then false positive rebuilds """ - __slots__ = ('dependency_map') + __slots__ = ('dependency_map', ) current_version_id = 2 def __setattr__(self, key, value): -- cgit v0.12 From 9668453b90f94019074ef65aaf29863e3d23602f Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Fri, 28 Jun 2019 14:34:48 -0400 Subject: Allow builders to inherit from OverrideEnvironments --- src/CHANGES.txt | 4 ++++ src/engine/SCons/Environment.py | 15 ++++++++++++++- src/engine/SCons/EnvironmentTests.py | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a491ba5..965bc28 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -79,6 +79,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fix more re patterns that contain \ but not specified as raw strings (affects scanners for D, LaTeX, swig) + From Mathew Robinson: + - Update cache debug output to include cache hit rate. + - No longer unintentionally hide exceptions in Action.py + - Allow builders and pseudo-builders to inherit from OverrideEnvironments RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 7f9a76c..395a6a7 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -2305,7 +2305,20 @@ class OverrideEnvironment(Base): # Methods that make this class act like a proxy. def __getattr__(self, name): - return getattr(self.__dict__['__subject'], name) + attr = getattr(self.__dict__['__subject'], name) + # Here we check if attr is one of the Wrapper classes. For + # example when a pseudo-builder is being called from an + # OverrideEnvironment. + # + # These wrappers when they're constructed capture the + # Environment they are being constructed with and so will not + # have access to overrided values. So we rebuild them with the + # OverrideEnvironment so they have access to overrided values. + if isinstance(attr, (MethodWrapper, BuilderWrapper)): + return attr.clone(self) + else: + return attr + def __setattr__(self, name, value): setattr(self.__dict__['__subject'], name, value) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 1a75a90..834cfd1 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -3587,6 +3587,10 @@ class OverrideEnvironmentTestCase(unittest.TestCase,TestEnvironmentFixture): def setUp(self): env = Environment() env._dict = {'XXX' : 'x', 'YYY' : 'y'} + def verify_value(env, key, value, *args, **kwargs): + """Verifies that key is value on the env this is called with.""" + assert env[key] == value + env.AddMethod(verify_value) env2 = OverrideEnvironment(env, {'XXX' : 'x2'}) env3 = OverrideEnvironment(env2, {'XXX' : 'x3', 'YYY' : 'y3', 'ZZZ' : 'z3'}) self.envs = [ env, env2, env3 ] @@ -3777,6 +3781,13 @@ class OverrideEnvironmentTestCase(unittest.TestCase,TestEnvironmentFixture): # """Test the OverrideEnvironment WhereIs() method""" # pass + def test_PseudoBuilderInherits(self): + """Test that pseudo-builders inherit the overrided values.""" + env, env2, env3 = self.envs + env.verify_value('XXX', 'x') + env2.verify_value('XXX', 'x2') + env3.verify_value('XXX', 'x3') + def test_Dir(self): """Test the OverrideEnvironment Dir() method""" env, env2, env3 = self.envs -- cgit v0.12 From d13584b4110cf9b725c862919baf7b773933d096 Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Tue, 9 Jul 2019 12:19:36 -0400 Subject: [no ci] Update RELEASE.txt with OverrideEnvironment change --- src/RELEASE.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RELEASE.txt b/src/RELEASE.txt index efa35eb..c95c336 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -54,6 +54,14 @@ ->Implicit Old:/usr/bin/python New:/usr/bin/python + + - Changed: Pseudo-builders now inherit OverrideEnvironments. For + example when calling a pseudo-builder from another + pseudo-builder the override variables passed to the first + pseudo-builder call had to be explicitly passed on to the + internal pseudo-builder call. Now the second pseudo-builder call + will automatically inherit these override values. + FIXES - List fixes of outright bugs -- cgit v0.12 From cb2bf0787dce3f00d926dc9b8ac45c738d9f26b9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 9 Jul 2019 15:36:46 -0400 Subject: Clean up __slots__ specification to be list, remove some obsoleted code --- src/engine/SCons/Node/FS.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 94d77a3..2973f0a 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -57,7 +57,6 @@ import SCons.Util import SCons.Warnings from SCons.Debug import Trace -from . import DeciderNeedsNode print_duplicate = 0 @@ -2511,7 +2510,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase): or count of any of these could yield writing wrong csig, and then false positive rebuilds """ - __slots__ = ('dependency_map', ) + __slots__ = ['dependency_map', ] current_version_id = 2 def __setattr__(self, key, value): @@ -2635,7 +2634,6 @@ class File(Base): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.File') Base.__init__(self, name, directory, fs) self._morph() - self.attributes.changed_timestamp_then_content = None def Entry(self, name): """Create an entry node named 'name' relative to @@ -3387,7 +3385,7 @@ class File(Base): if df: return df - # Strings didn't existing in map, add them and try again + # Strings don't exist in map, add them and try again # If there are no strings in this dmap, then add them. # This may not be necessary, we could walk the nodes in the dmap and check each string # rather than adding ALL the strings to dmap. In theory that would be n/2 vs 2n str() calls on node -- cgit v0.12 From 0e1a849fbc2f8e2214cb738d9d1159bf8aa00e1f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 9 Jul 2019 15:37:05 -0400 Subject: Add missing repo_node argument to _changed_source() --- src/engine/SCons/Environment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index eb3284a..70b8166 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -1445,13 +1445,13 @@ class Base(SubstitutionEnvironment): def _changed_content(self, dependency, target, prev_ni, repo_node=None): return dependency.changed_content(target, prev_ni, repo_node) - def _changed_source(self, dependency, target, prev_ni): + def _changed_source(self, dependency, target, prev_ni, repo_node=None): target_env = dependency.get_build_env() type = target_env.get_tgt_sig_type() if type == 'source': - return target_env.decide_source(dependency, target, prev_ni) + return target_env.decide_source(dependency, target, prev_ni, repo_node) else: - return target_env.decide_target(dependency, target, prev_ni) + return target_env.decide_target(dependency, target, prev_ni, repo_node) def _changed_timestamp_then_content(self, dependency, target, prev_ni, repo_node=None): return dependency.changed_timestamp_then_content(target, prev_ni, repo_node) -- cgit v0.12 From b9133757d9bb1562cd6cc159ef6a435ad7f43eb0 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 9 Jul 2019 18:23:07 -0400 Subject: pin libxml so it should build with py3.8 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7893b18..8a55575 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ os: install: # needed for Docbook tests, must be in virtualenv context - - pip install lxml + - pip install lxml==4.3.3 # do the rest of the image setup - ./.travis/install.sh -- cgit v0.12 From 26dc1670b9d7fc67e70912bb4a74783c299483c6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Thu, 11 Jul 2019 09:58:05 -0400 Subject: Pin lxml so it will work with 3.8.0b2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7893b18..8a55575 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ os: install: # needed for Docbook tests, must be in virtualenv context - - pip install lxml + - pip install lxml==4.3.3 # do the rest of the image setup - ./.travis/install.sh -- cgit v0.12 From 2f38ee65e95cdcea441f028d7c3ce9d1b4746862 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jul 2019 14:36:51 -0400 Subject: [ci skip] re-add generation of src-tar-gz and src-zip files as they're used by debian scons packager --- SConstruct | 11 ++++++++--- bin/upload-release-files.sh | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/SConstruct b/SConstruct index dc9ee5d..d4b3e00 100644 --- a/SConstruct +++ b/SConstruct @@ -204,6 +204,10 @@ packaging_flavors = [ ('zip', "The normal .zip file for end-user installation."), ('local-zip', "A .zip file for dropping into other software " + "for local use."), + ('src-tar-gz', "A .tar.gz file containing all the source " + + "(including tests and documentation)."), + ('src-zip', "A .zip file containing all the source " + + "(including tests and documentation)."), ] test_tar_gz_dir = os.path.join(build_dir, "test-tar-gz") @@ -851,10 +855,11 @@ SConscript('doc/SConscript') # -sfiles = None +sfiles = [l.split()[-1] for l in git_status_lines] if git_status_lines: - slines = [l for l in git_status_lines if 'modified:' in l] - sfiles = [l.split()[-1] for l in slines] + # slines = [l for l in git_status_lines if 'modified:' in l] + # sfiles = [l.split()[-1] for l in slines] + pass else: print("Not building in a Git tree; skipping building src package.") diff --git a/bin/upload-release-files.sh b/bin/upload-release-files.sh index 014134a..9a09206 100755 --- a/bin/upload-release-files.sh +++ b/bin/upload-release-files.sh @@ -35,12 +35,12 @@ $RSYNC $RSYNCOPTS \ Announce.txt CHANGES.txt RELEASE.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-local/$VERSION/ -# Source packages: -#$RSYNC $RSYNCOPTS \ -# scons-src-$VERSION.tar.gz \ -# scons-src-$VERSION.zip \ -# Announce.txt CHANGES.txt RELEASE.txt \ -# $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/ +Source packages: +$RSYNC $RSYNCOPTS \ + scons-src-$VERSION.tar.gz \ + scons-src-$VERSION.zip \ + Announce.txt CHANGES.txt RELEASE.txt \ + $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/ # Readme $RSYNC $RSYNCOPTS \ -- cgit v0.12 From d4877dbb4fd0612633535f6917fd94fa98214e1b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jul 2019 20:25:07 -0400 Subject: Doc updates for repo_node addition to Decider function args --- doc/user/depends.xml | 2 +- src/CHANGES.txt | 8 ++++++++ src/RELEASE.txt | 8 ++++++++ src/engine/SCons/Environment.xml | 13 ++++++++++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/doc/user/depends.xml b/doc/user/depends.xml index 297eaa2..c13828f 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -517,7 +517,7 @@ cc -o hello hello.o Program('hello.c') -def decide_if_changed(dependency, target, prev_ni): +def decide_if_changed(dependency, target, prev_ni, repo_node=None): if dependency.get_timestamp() != prev_ni.timestamp: dep = str(dependency) tgt = str(target) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 6a8d626..9729ac4 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -41,6 +41,14 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable which specifies what character to join all the argements output into the tempfile. The default remains a space when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) + - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. + From: + def my_decider(dependency, target, prev_ni): + To: + def my_decider(dependency, target, prev_ni, repo_node): + Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. + + From Michael Hartmann: - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM diff --git a/src/RELEASE.txt b/src/RELEASE.txt index efa35eb..2857cbf 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -41,6 +41,14 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY + - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. + From: + def my_decider(dependency, target, prev_ni): + To: + def my_decider(dependency, target, prev_ni, repo_node): + Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. + + - Enhanced --debug=explain output. Now the separate components of the dependency list are split up as follows: diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index 0982c31..1b0a04c 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -1213,6 +1213,17 @@ size, or content signature. + +repo_node + + +Use this node instead of the one specified by +dependency + to determine if the dependency has changed. + + + + @@ -1249,7 +1260,7 @@ Example: -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node=None): return not os.path.exists(str(target)) env.Decider(my_decider) -- cgit v0.12 From c690868a050e53522c141905d18188c23f31ce23 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jul 2019 20:25:26 -0400 Subject: Re-add src packages to upload script --- bin/upload-release-files.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/upload-release-files.sh b/bin/upload-release-files.sh index 014134a..72a949a 100755 --- a/bin/upload-release-files.sh +++ b/bin/upload-release-files.sh @@ -35,12 +35,12 @@ $RSYNC $RSYNCOPTS \ Announce.txt CHANGES.txt RELEASE.txt \ $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-local/$VERSION/ -# Source packages: -#$RSYNC $RSYNCOPTS \ -# scons-src-$VERSION.tar.gz \ -# scons-src-$VERSION.zip \ -# Announce.txt CHANGES.txt RELEASE.txt \ -# $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/ + Source packages: +$RSYNC $RSYNCOPTS \ + scons-src-$VERSION.tar.gz \ + scons-src-$VERSION.zip \ + Announce.txt CHANGES.txt RELEASE.txt \ + $SF_USER@$SF_MACHINE:$SF_TOPDIR/scons-src/$VERSION/ # Readme $RSYNC $RSYNCOPTS \ -- cgit v0.12 From e4b1e1f1275dd6f73d8b558514795e5814122cb9 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jul 2019 20:25:58 -0400 Subject: re-add src packages --- SConstruct | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/SConstruct b/SConstruct index dc9ee5d..c54961c 100644 --- a/SConstruct +++ b/SConstruct @@ -204,6 +204,11 @@ packaging_flavors = [ ('zip', "The normal .zip file for end-user installation."), ('local-zip', "A .zip file for dropping into other software " + "for local use."), + ('src-tar-gz', "A .tar.gz file containing all the source " + + "(including tests and documentation)."), + ('src-zip', "A .zip file containing all the source " + + "(including tests and documentation)."), + ] test_tar_gz_dir = os.path.join(build_dir, "test-tar-gz") @@ -851,11 +856,9 @@ SConscript('doc/SConscript') # -sfiles = None -if git_status_lines: - slines = [l for l in git_status_lines if 'modified:' in l] - sfiles = [l.split()[-1] for l in slines] -else: + +sfiles = [l.split()[-1] for l in git_status_lines] +if not git_status_lines: print("Not building in a Git tree; skipping building src package.") if sfiles: -- cgit v0.12 From e86e78f27aa3ba751d93b87327ab5662212bd87a Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 13 Jul 2019 20:26:16 -0400 Subject: Fix docstrings and comments for repo node changes --- src/engine/SCons/Node/FS.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 2973f0a..1000cf8 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -3316,7 +3316,6 @@ class File(Base): len(binfo.bimplicitsigs)) == 0: return {} - binfo.dependency_map = { child:signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))} @@ -3430,9 +3429,8 @@ class File(Base): self - dependency target - target prev_ni - The NodeInfo object loaded from previous builds .sconsign - node - Node instance. This is the only changed* function which requires - node to function. So if we detect that it's not passed. - we throw DeciderNeedsNode, and caller should handle this and pass node. + node - Node instance. Check this node for file existance/timestamp + if specified. Returns: Boolean - Indicates if node(File) has changed. @@ -3496,14 +3494,18 @@ class File(Base): return 1 def is_up_to_date(self): + """Check for whether the Node is current + In all cases self is the target we're checking to see if it's up to date + """ + T = 0 if T: Trace('is_up_to_date(%s):' % self) if not self.exists(): if T: Trace(' not self.exists():') - # The file doesn't exist locally... + # The file (always a target) doesn't exist locally... r = self.rfile() if r != self: - # ...but there is one in a Repository... + # ...but there is one (always a target) in a Repository... if not self.changed(r): if T: Trace(' changed(%s):' % r) # ...and it's even up-to-date... -- cgit v0.12 From 658870342222021627416b070ea1b8f5e860ea5b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jul 2019 13:19:53 -0400 Subject: Update docs --- doc/generated/examples/caching_ex-random_1.xml | 4 ++-- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- doc/generated/functions.gen | 13 ++++++++++++- doc/generated/tools.gen | 12 ++++++------ doc/generated/tools.mod | 4 ++-- doc/generated/variables.gen | 20 ++++++++++---------- doc/generated/variables.mod | 4 ++-- 7 files changed, 35 insertions(+), 24 deletions(-) diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 9f59db5..adf6401 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q +cc -o f3.o -c f3.c cc -o f2.o -c f2.c cc -o f1.o -c f1.c -cc -o f5.o -c f5.c cc -o f4.o -c f4.c -cc -o f3.o -c f3.c +cc -o f5.o -c f5.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index a461f60..8f06986 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/home/bdeegan/devel/scons/git/scons/bootstrap/src/script/scons.py", line 204, in <module> +File "/Users/bdbaddog/devel/scons/git/scons-bugfixes-3/bootstrap/src/script/scons.py", line 204, in <module> diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 953d374..5e8bebb 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -1139,6 +1139,17 @@ size, or content signature. + +repo_node + + +Use this node instead of the one specified by +dependency + to determine if the dependency has changed. + + + + @@ -1175,7 +1186,7 @@ Example: -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node=None): return not os.path.exists(str(target)) env.Decider(my_decider) diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index be717e3..ecd9c98 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -779,19 +779,19 @@ Sets construction variables for the Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. - - packaging + + Packaging -A framework for building binary and source packages. +Sets construction variables for the Package Builder. - - Packaging + + packaging -Sets construction variables for the Package Builder. +A framework for building binary and source packages. diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index f9bc1d7..1209d74 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> @@ -186,8 +186,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index ad64b70..5606e2e 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -6789,6 +6789,16 @@ Example + + SHLIBVERSIONFLAGS + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is +set. + + + _SHLIBVERSIONFLAGS @@ -6802,16 +6812,6 @@ and some extra dynamically generated options (such as - - SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is -set. - - - SHLINK diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 47576f4..372a15f 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -504,8 +504,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> @@ -1144,8 +1144,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> -- cgit v0.12 From c5ed45079b29b4878962d30a8296a266034c8f77 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jul 2019 13:21:17 -0400 Subject: add macos's .DS_Store to gitignore. --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 546c893..99c8ab2 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,6 @@ htmlcov *.bak *~ !/test/Decider/switch-rebuild.py + +# Mac junk +**/.DS_Store -- cgit v0.12 From 5a4d8a9e8b203f9eb135245382d772a6b6ef0559 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jul 2019 13:51:28 -0400 Subject: Add BuildInfo as a classname --- doc/scons.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/scons.mod b/doc/scons.mod index 974ec02..77fa39b 100644 --- a/doc/scons.mod +++ b/doc/scons.mod @@ -67,6 +67,7 @@ Action"> ActionBase"> +BuildInfo"> CommandAction"> FunctionAction"> ListAction"> -- cgit v0.12 From 13fe5fdf1e6b9092e7b88242f5e4410523f40d56 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jul 2019 13:51:54 -0400 Subject: More decider doc updates regarding adding new repo_node argument --- doc/generated/examples/caching_ex-random_1.xml | 6 +++--- doc/user/depends.xml | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index adf6401..9ad59e0 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q -cc -o f3.o -c f3.c -cc -o f2.o -c f2.c -cc -o f1.o -c f1.c cc -o f4.o -c f4.c +cc -o f2.o -c f2.c +cc -o f3.o -c f3.c cc -o f5.o -c f5.c +cc -o f1.o -c f1.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/user/depends.xml b/doc/user/depends.xml index c13828f..7947900 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -561,6 +561,13 @@ int main() { printf("Hello, world!\n"); } + + The fourth argument repo_node, + is the &Node; to use if it is not None when comparing &BuildInfo;. + This is typically only set when the target node only exists in a + &Repository; + + @@ -637,7 +644,7 @@ int main() { printf("Hello, world!\n"); } env = Environment() -def config_file_decider(dependency, target, prev_ni): +def config_file_decider(dependency, target, prev_ni, repo_node=None): import os.path # We always have to init the .csig value... -- cgit v0.12 From 9f4c9d817efe1817e3315f6299186e9e42502dfb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sun, 14 Jul 2019 14:52:52 -0400 Subject: [ci skip] Fix spelling picked up by sider --- src/engine/SCons/Node/FS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 1000cf8..33105fb 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -3429,7 +3429,7 @@ class File(Base): self - dependency target - target prev_ni - The NodeInfo object loaded from previous builds .sconsign - node - Node instance. Check this node for file existance/timestamp + node - Node instance. Check this node for file existence/timestamp if specified. Returns: -- cgit v0.12 From ddf32bc74aba050f91be4b864a155ac2bd47c052 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 10 Jun 2019 07:41:30 -0600 Subject: msvs host-target fix + vs19 support This patch combines several bits of work - PR #3391 and the discussion/patch in Issue #3346 to improve the support of Visual Studio 2019. VS 2019 is now a recognized version, and the selection of that version specifically should be working. Signed-off-by: Mats Wichmann --- src/CHANGES.txt | 12 ++++- src/engine/SCons/Tool/MSCommon/vc.py | 91 ++++++++++++++++++++---------------- src/engine/SCons/Tool/MSCommon/vs.py | 11 +++++ src/engine/SCons/Tool/msvc.xml | 1 + 4 files changed, 73 insertions(+), 42 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a07165a..89e0124 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -9,6 +9,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From Joseph Brill: + - Code to supply correct version-specifier argument to vswhere for + VS version selection. + From Peter Diener: - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures - Fix issue #3135 - Handle Fortran submodules and type bound procedures @@ -48,15 +52,19 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER def my_decider(dependency, target, prev_ni, repo_node): Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. - - From Michael Hartmann: - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + From Bert Huijben: + - Added support for Visual Studio 2019 toolset. + From Mathew Robinson: - Update cache debug output to include cache hit rate. - No longer unintentionally hide exceptions in Action.py + From Leonard de Ruijter: + - Add logic to derive correct version argument to vswhere + From Lukas Schrangl: - Enable LaTeX scanner to find more than one include per line diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index d2a5573..0e4ef15 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -189,11 +189,19 @@ def get_host_target(env): # If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the # MSVC_VERSION documentation in Tool/msvc.xml. -_VCVER = ["14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] +_VCVER = ["14.2", "14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] + +# if using vswhere, a further mapping is needed +_VCVER_TO_VSWHERE_VER = { + '14.2' : '[16.0, 17.0)', + '14.1' : '[15.0, 16.0)', +} _VCVER_TO_PRODUCT_DIR = { + '14.2' : [ + (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2019 doesn't set this key '14.1' : [ - (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # Visual Studio 2017 doesn't set this registry key anymore + (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2017 doesn't set this key '14.0' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\14.0\Setup\VC\ProductDir')], '14.0Exp' : [ @@ -254,42 +262,40 @@ def msvc_version_to_maj_min(msvc_version): raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) def is_host_target_supported(host_target, msvc_version): - """Check if the given (host, target) tuple is supported for given version. - - Args: - host_target: tuple - tuple of (canonalized) host-targets, e.g. ("x86", "amd64") - for cross compilation from 32 bit Windows to 64 bits. - msvc_version: str - msvc version (major.minor, e.g. 10.0) + """Check if (host, target) pair is supported for a VC version. - Returns: - bool: - - Note: - This only checks whether a given version *may* support the given (host, + :note: only checks whether a given version *may* support the given (host, target), not that the toolchain is actually present on the machine. + :param tuple host_target: canonalized host-targets pair, e.g. + ("x86", "amd64") for cross compilation from 32 bit Windows to 64 bits. + :param str msvc_version: Visual C++ version (major.minor), e.g. "10.0" + :returns: True or False """ # We assume that any Visual Studio version supports x86 as a target if host_target[1] != "x86": maj, min = msvc_version_to_maj_min(msvc_version) if maj < 8: return False - return True def find_vc_pdir_vswhere(msvc_version): """ - Find the MSVC product directory using vswhere.exe. + Find the MSVC product directory using the vswhere program. - Run it asking for specified version and get MSVS install location - :param msvc_version: + :param msvc_version: MSVC version to search for :return: MSVC install dir or None + :raises UnsupportedVersion: if the version is not known by this file """ + try: + vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version] + except KeyError: + debug("Unknown version of MSVC: %s" % msvc_version) + raise UnsupportedVersion("Unknown version %s" % msvc_version) + # For bug 3333 - support default location of vswhere for both 64 and 32 bit windows - # installs. + # installs. for pf in ['Program Files (x86)', 'Program Files']: vswhere_path = os.path.join( 'C:\\', @@ -301,31 +307,36 @@ def find_vc_pdir_vswhere(msvc_version): if os.path.exists(vswhere_path): # If we found vswhere, then use it. break + else: + # No vswhere on system, no install info available + return None - vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath'] - - if os.path.exists(vswhere_path): - #TODO PY27 cannot use Popen as context manager - # try putting it back to the old way for now - sp = subprocess.Popen(vswhere_cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - vsdir, err = sp.communicate() - if vsdir: - vsdir = vsdir.decode("mbcs").splitlines() - # vswhere could easily return multiple lines - # we could define a way to pick the one we prefer, but since - # this data is currently only used to make a check for existence, - # returning the first hit should be good enough for now. - vc_pdir = os.path.join(vsdir[0], 'VC') - return vc_pdir + vswhere_cmd = [vswhere_path, + '-products', '*', + '-version', vswhere_version, + '-property', 'installationPath'] + + #TODO PY27 cannot use Popen as context manager + # try putting it back to the old way for now + sp = subprocess.Popen(vswhere_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + vsdir, err = sp.communicate() + if vsdir: + vsdir = vsdir.decode("mbcs").splitlines() + # vswhere could easily return multiple lines + # we could define a way to pick the one we prefer, but since + # this data is currently only used to make a check for existence, + # returning the first hit should be good enough for now. + vc_pdir = os.path.join(vsdir[0], 'VC') + return vc_pdir else: # No vswhere on system, no install info available return None def find_vc_pdir(msvc_version): - """Find the product directory for the given version. + """Find the MSVC product directory for the given version. Tries to look up the path using a registry key from the table _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere @@ -462,7 +473,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): host_platform = _ARCH_TO_CANONICAL[host_platform] target_platform = _ARCH_TO_CANONICAL[target_platform] - debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s' % (host_platform, target_platform)) + debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s for version %s' % (host_platform, target_platform, msvc_version)) ver_num = float(get_msvc_version_numeric(msvc_version)) @@ -510,7 +521,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # older versions of visual studio only had x86 binaries, # so if the host platform is amd64, we need to check cross # compile options (x86 binary compiles some other target on a 64 bit os) - + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested # if not host_trgt_dir host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) diff --git a/src/engine/SCons/Tool/MSCommon/vs.py b/src/engine/SCons/Tool/MSCommon/vs.py index 598b5e6..dfca48d 100644 --- a/src/engine/SCons/Tool/MSCommon/vs.py +++ b/src/engine/SCons/Tool/MSCommon/vs.py @@ -198,6 +198,17 @@ class VisualStudio(object): # Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml. SupportedVSList = [ + # Visual Studio 2019 + VisualStudio('14.2', + vc_version='14.2', + sdk_version='10.0A', + hkeys=[], + common_tools_var='VS160COMNTOOLS', + executable_path=r'Common7\IDE\devenv.com', + batch_file_path=r'VC\Auxiliary\Build\vsvars32.bat', + supported_arch=['x86', 'amd64', "arm"], + ), + # Visual Studio 2017 VisualStudio('14.1', vc_version='14.1', diff --git a/src/engine/SCons/Tool/msvc.xml b/src/engine/SCons/Tool/msvc.xml index dacdcba..ff65364 100644 --- a/src/engine/SCons/Tool/msvc.xml +++ b/src/engine/SCons/Tool/msvc.xml @@ -353,6 +353,7 @@ constructor; setting it later has no effect. Valid values for Windows are +14.2, 14.1, 14.0, 14.0Exp, -- cgit v0.12 From 4e6e6fd6ea115e28446241c0a54cc6517c1e161b Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Tue, 16 Jul 2019 13:26:08 -0400 Subject: Upgrade and improve Visual Studio solution/project generation code This change improves the Visual Studio solution and project generation code in the following ways: 1. Adds support for Visual Studio 2019 and 2017 project files. In this part, I went a different direction than the existing VS2015 code by doing all of this in the V10 class. I have found this to be the easiest way to continue to add support for new versions of Visual Studio; for example, VS2019 support was a 4-line change after the initial changes. 2. Adds support for consumers to specify C++ include paths and C++ preprocessor definitions to be included in the .vcxproj file. This helps Intellisense function better. (Tests included for this part as well, including one to cover an issue pickling Dir() objects when writing miscellaneous CPPPATH info to the .vcxproj file) 3. Adds to the project file so we are not prompted to upgrade. This helps the case where a developer has a new version of Visual Studio installed and generates projects for that, while the underlying SCons build uses an older toolset. 4. Excludes .filters files from dspfile processing. 5. Adds a test to cover VS2015 support. --- src/engine/SCons/Tool/msvs.py | 96 ++++++++++++++++++-------- src/engine/SCons/Tool/msvsTests.py | 134 +++++++++++++++++++++++++++++-------- 2 files changed, 174 insertions(+), 56 deletions(-) diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 297c083..e92a226 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -47,6 +47,7 @@ import sys import SCons.Builder import SCons.Node.FS import SCons.Platform.win32 +import SCons.Script import SCons.Script.SConscript import SCons.PathList import SCons.Util @@ -75,6 +76,10 @@ def xmlify(s): def processIncludes(includes, env, target, source): return SCons.PathList.PathList(includes).subst_path(env, target, source) +# Convert a file to its absolute path. +def processSource(file): + return SCons.Script.File(file).abspath + external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' @@ -348,10 +353,20 @@ V10DebugSettings = { } class _GenerateV10User(_UserGenerator): - """Generates a Project'user file for MSVS 2010""" + """Generates a Project'user file for MSVS 2010 or later""" def __init__(self, dspfile, source, env): - self.versionstr = '4.0' + version_num, suite = msvs_parse_version(env['MSVS_VERSION']) + if version_num >= 14.2: + # Visual Studio 2019 is considered to be version 16. + self.versionstr = '16.0' + elif version_num >= 14.1: + # Visual Studio 2017 is considered to be version 15. + self.versionstr = '15.0' + elif version_num == 14.0: + self.versionstr = '14.0' + else: + self.versionstr = '4.0' self.usrhead = V10UserHeader self.usrconf = V10UserConfiguration self.usrdebg = V10DebugSettings @@ -462,15 +477,25 @@ class _DSPGenerator(object): self.sconscript = env['MSVSSCONSCRIPT'] - if 'cmdargs' not in env or env['cmdargs'] is None: - cmdargs = [''] * len(variants) - elif SCons.Util.is_String(env['cmdargs']): - cmdargs = [env['cmdargs']] * len(variants) - elif SCons.Util.is_List(env['cmdargs']): - if len(env['cmdargs']) != len(variants): - raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.") + def GetKeyFromEnv(env, key, variants): + if key not in env or env[key] is None: + return [''] * len(variants) + elif SCons.Util.is_String(env[key]): + return [env[key]] * len(variants) + elif SCons.Util.is_List(env[key]): + if len(env[key]) != len(variants): + raise SCons.Errors.InternalError("Sizes of '%s' and 'variant' lists must be the same." % key) + else: + return env[key] else: - cmdargs = env['cmdargs'] + raise SCons.Errors.InternalError("Unsupported type for key '%s' in environment: %s" % + (key, type(env[key]))) + + cmdargs = GetKeyFromEnv(env, 'cmdargs', variants) + cppdefines = GetKeyFromEnv(env, 'cppdefines', variants) + + dirpathfunc = lambda x: x.abspath if hasattr(x, 'abspath') else x + cpppaths = [dirpathfunc(path) for path in GetKeyFromEnv(env, 'cpppaths', variants)] self.env = env @@ -513,11 +538,13 @@ class _DSPGenerator(object): for n in sourcenames: self.sources[n].sort(key=lambda a: a.lower()) - def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile): + def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines=[], cpppaths=[], dspfile=dspfile): config = Config() config.buildtarget = buildtarget config.outdir = outdir config.cmdargs = cmdargs + config.cppdefines = cppdefines + config.cpppaths = cpppaths config.runfile = runfile match = re.match(r'(.*)\|(.*)', variant) @@ -532,7 +559,7 @@ class _DSPGenerator(object): print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'") for i in range(len(variants)): - AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i]) + 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()): @@ -882,6 +909,8 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): buildtarget = self.configs[kind].buildtarget runfile = self.configs[kind].runfile cmdargs = self.configs[kind].cmdargs + cpppaths = self.configs[kind].cpppaths + cppdefines = self.configs[kind].cppdefines env_has_buildtarget = 'MSVSBUILDTARGET' in self.env if not env_has_buildtarget: @@ -899,8 +928,8 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE, # so they could vary depending on the command being generated. This code # assumes they don't. - preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', [])))) - includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None) + preprocdefs = xmlify(';'.join(processDefines(cppdefines))) + includepath_Dirs = processIncludes(cpppaths, self.env, None, None) includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) if not env_has_buildtarget: @@ -1060,7 +1089,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): V10DSPHeader = """\ - + """ V10DSPProjectConfiguration = """\ @@ -1075,6 +1104,7 @@ V10DSPGlobals = """\ \t\t%(project_guid)s %(scc_attrs)s\t\t%(name)s \t\tMakeFileProj +\t\tNoUpgrade \t """ @@ -1112,9 +1142,9 @@ V15DSPHeader = """\ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): """Generates a Project file for MSVS 2010""" - def __init__(self, dspfile, header, source, env): + def __init__(self, dspfile, source, env): _DSPGenerator.__init__(self, dspfile, source, env) - self.dspheader = header + self.dspheader = V10DSPHeader self.dspconfiguration = V10DSPProjectConfiguration self.dspglobals = V10DSPGlobals @@ -1123,6 +1153,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): def PrintHeader(self): env = self.env name = self.name + versionstr = self.versionstr encoding = env.subst('$MSVSENCODING') project_guid = env.get('MSVS_PROJECT_GUID', '') scc_provider = env.get('MSVS_SCC_PROVIDER', '') @@ -1234,7 +1265,8 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): raise SCons.Errors.InternalError('Unable to open "' + self.filtersabs + '" for writing:' + str(detail)) self.filters_file.write('\n' - '\n') + '\n' % + self.versionstr) self.PrintSourceFiles() @@ -1285,7 +1317,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): file = value if commonprefix: file = os.path.join(commonprefix, value) - file = os.path.normpath(file) + file = processSource(file) self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file)) self.filters_file.write('\t\t<%s Include="%s">\n' @@ -1466,6 +1498,9 @@ class _GenerateV7DSW(_DSWGenerator): for dspfile in self.dspfiles: dsp_folder_path, name = os.path.split(dspfile) dsp_folder_path = os.path.abspath(dsp_folder_path) + if SCons.Util.splitext(name)[1] == '.filters': + # Ignore .filters project files + continue dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path) if dsp_relative_folder_path == os.curdir: dsp_relative_file_path = name @@ -1515,7 +1550,11 @@ class _GenerateV7DSW(_DSWGenerator): def PrintSolution(self): """Writes a solution file""" self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr) - if self.version_num > 14.0: + if self.version_num >= 14.2: + # Visual Studio 2019 is considered to be version 16. + self.file.write('# Visual Studio 16\n') + elif self.version_num > 14.0: + # Visual Studio 2015 and 2017 are both considered to be version 15. self.file.write('# Visual Studio 15\n') elif self.version_num >= 12.0: self.file.write('# Visual Studio 14\n') @@ -1695,11 +1734,8 @@ def GenerateDSP(dspfile, source, env): version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) - if version_num > 14.0: - g = _GenerateV10DSP(dspfile, V15DSPHeader, source, env) - g.Build() - elif version_num >= 10.0: - g = _GenerateV10DSP(dspfile, V10DSPHeader, source, env) + if version_num >= 10.0: + g = _GenerateV10DSP(dspfile, source, env) g.Build() elif version_num >= 7.0: g = _GenerateV7DSP(dspfile, source, env) @@ -1973,8 +2009,14 @@ def generate(env): default_MSVS_SConscript = env.File('SConstruct') env['MSVSSCONSCRIPT'] = default_MSVS_SConscript - env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) - env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}' + # Allow consumers to provide their own versions of MSVSSCONS and + # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to + # invoke scons. + if 'MSVSSCONS' not in env: + env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) + if 'MSVSSCONSFLAGS' not in env: + env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}' + env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS' env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py index 477694a..c9d6b13 100644 --- a/src/engine/SCons/Tool/msvsTests.py +++ b/src/engine/SCons/Tool/msvsTests.py @@ -32,6 +32,7 @@ import copy import TestCmd import TestUnit +from SCons.Script import Dir from SCons.Tool.msvs import * from SCons.Tool.MSCommon.vs import SupportedVSList import SCons.Util @@ -352,6 +353,36 @@ regdata_80 = r''' "VCXDCMakeTool"="*.xdc" '''.split('\n') +regdata_140 = r''' +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS] +"MSMDir"="C:\\Program Files (x86)\\Common Files\\Merge Modules\\" +"ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\" +"VS7EnvironmentLocation"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe" +"EnvironmentPath"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\devenv.exe" +"EnvironmentDirectory"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\" +"VS7CommonDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\" +"VS7CommonBinDir"="" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\BuildNumber] +"1033"="14.0" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\Community] +"ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\JSLS_MSI] +"Version"="14.0.25527" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\JSPS_MSI] +"Version"="14.0.25527" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\Pro] +"ProductDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\professional] +"IsInstallInProgress"="0" +"CurrentOperation"="install" +"SetupFeedUri"="http://go.microsoft.com/fwlink/?LinkID=659004&clcid=0x409" +"SetupFeedLocalCache"="C:\\ProgramData\\Microsoft\\VisualStudioSecondaryInstaller\\14.0\\LastUsedFeed\\{68432bbb-c9a5-4a7b-bab3-ae5a49b28303}\\Feed.xml" +"InstallResult"="0" +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\SecondaryInstaller] +[HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\14.0\Setup\VS\SecondaryInstaller\AppInsightsTools] +"Version"="7.0.20620.1" +'''.split('\n') + regdata_cv = r'''[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion] "ProgramFilesDir"="C:\Program Files" "CommonFilesDir"="C:\Program Files\Common Files" @@ -385,6 +416,12 @@ class DummyEnv(object): def has_key(self,name): return name in self.dict + def get(self, name, value=None): + if self.has_key(name): + return self.dict[name] + else: + return value + class RegKey(object): """key class for storing an 'open' registry key""" def __init__(self,key): @@ -607,13 +644,15 @@ class msvsTestCase(unittest.TestCase): version_num, suite = msvs_parse_version(self.highest_version) if version_num >= 10.0: function_test = _GenerateV10DSP + dspfile = 'test.vcxproj' elif version_num >= 7.0: function_test = _GenerateV7DSP + dspfile = 'test.dsp' else: function_test = _GenerateV6DSP + dspfile = 'test.dsp' str_function_test = str(function_test.__init__) - dspfile = 'test.dsp' source = 'test.cpp' # Create the cmdargs test list @@ -623,50 +662,69 @@ class msvsTestCase(unittest.TestCase): 'debug=False target_arch=32', 'debug=True target_arch=x64', 'debug=False target_arch=x64'] - - # Tuple list : (parameter, dictionary of expected result per variant) - tests_cmdargs = [(None, dict.fromkeys(list_variant, '')), - ('', dict.fromkeys(list_variant, '')), - (list_cmdargs[0], dict.fromkeys(list_variant, list_cmdargs[0])), - (list_cmdargs, dict(list(zip(list_variant, list_cmdargs))))] - + list_cppdefines = ['_A', '_B', 'C', None] + list_cpppaths = [r'C:\test1', r'C:\test1;C:\test2', Dir('subdir'), None] + + def TestParamsFromList(test_variant, test_list): + # Tuple list: (parameter, dictionary of expected result per variant) + dirpathfunc = lambda x: x.abspath if hasattr(x, 'abspath') else x + return [ + (None, dict.fromkeys(test_variant, '')), + ('', dict.fromkeys(test_variant, '')), + (test_list[0], dict.fromkeys(test_variant, dirpathfunc(test_list[0]))), + (test_list, dict(list(zip(test_variant, [dirpathfunc(x) for x in test_list])))) + ] + + tests_cmdargs = TestParamsFromList(list_variant, list_cmdargs) + tests_cppdefines = TestParamsFromList(list_variant, list_cppdefines) + tests_cpppaths = TestParamsFromList(list_variant, list_cpppaths) + # Run the test for each test case for param_cmdargs, expected_cmdargs in tests_cmdargs: - debug('Testing %s. with :\n variant = %s \n cmdargs = "%s"' % \ - (str_function_test, list_variant, param_cmdargs)) - param_configs = [] - expected_configs = {} - for platform in ['Win32', 'x64']: - for variant in ['Debug', 'Release']: - variant_platform = '%s|%s' % (variant, platform) - runfile = '%s\\%s\\test.exe' % (platform, variant) - buildtarget = '%s\\%s\\test.exe' % (platform, variant) - outdir = '%s\\%s' % (platform, variant) - - # Create parameter list for this variant_platform - param_configs.append([variant_platform, runfile, buildtarget, outdir]) + for param_cppdefines, expected_cppdefines in tests_cppdefines: + for param_cpppaths, expected_cpppaths in tests_cpppaths: + debug('Testing %s. with :\n variant = %s \n cmdargs = "%s" \n cppdefines = "%s" \n cpppaths = "%s"' % \ + (str_function_test, list_variant, param_cmdargs, param_cppdefines, param_cpppaths)) + param_configs = [] + expected_configs = {} + for platform in ['Win32', 'x64']: + for variant in ['Debug', 'Release']: + variant_platform = '%s|%s' % (variant, platform) + runfile = '%s\\%s\\test.exe' % (platform, variant) + buildtarget = '%s\\%s\\test.exe' % (platform, variant) + outdir = '%s\\%s' % (platform, variant) - # Create expected dictionary result for this variant_platform - expected_configs[variant_platform] = \ - {'variant': variant, 'platform': platform, - 'runfile': runfile, - 'buildtarget': buildtarget, - 'outdir': outdir, - 'cmdargs': expected_cmdargs[variant_platform]} + # Create parameter list for this variant_platform + param_configs.append([variant_platform, runfile, buildtarget, outdir]) + # Create expected dictionary result for this variant_platform + expected_configs[variant_platform] = { + 'variant': variant, + 'platform': platform, + 'runfile': runfile, + 'buildtarget': buildtarget, + 'outdir': outdir, + 'cmdargs': expected_cmdargs[variant_platform], + 'cppdefines': expected_cppdefines[variant_platform], + 'cpppaths': expected_cpppaths[variant_platform], + } + # Create parameter environment with final parameter dictionary param_dict = dict(list(zip(('variant', 'runfile', 'buildtarget', 'outdir'), [list(l) for l in zip(*param_configs)]))) param_dict['cmdargs'] = param_cmdargs + param_dict['cppdefines'] = param_cppdefines + param_dict['cpppaths'] = param_cpppaths # Hack to be able to run the test with a 'DummyEnv' class _DummyEnv(DummyEnv): - def subst(self, string) : + def subst(self, string, *args, **kwargs): return string env = _DummyEnv(param_dict) env['MSVSSCONSCRIPT'] = '' env['MSVS_VERSION'] = self.highest_version + env['MSVSBUILDTARGET'] = 'target' # Call function to test genDSP = function_test(dspfile, source, env) @@ -676,6 +734,11 @@ class msvsTestCase(unittest.TestCase): for key in list(genDSP.configs.keys()): self.assertDictEqual(genDSP.configs[key].__dict__, expected_configs[key]) + genDSP.Build() + + # Delete the resulting file so we don't leave anything behind. + os.remove(os.path.realpath(dspfile)) + class msvs6aTestCase(msvsTestCase): """Test MSVS 6 Registry""" registry = DummyRegistry(regdata_6a + regdata_cv) @@ -787,6 +850,18 @@ class msvs80TestCase(msvsTestCase): } default_install_loc = install_locs['8.0'] +class msvs140TestCase(msvsTestCase): + """Test MSVS 140 Registry""" + registry = DummyRegistry(regdata_140 + regdata_cv) + default_version = '14.0' + highest_version = '14.0' + number_of_versions = 2 + install_locs = { + '14.0' : {'VSINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 14.0', + 'VCINSTALLDIR': 'C:\\Program Files\\Microsoft Visual Studio 14.0\\VC'}, + } + default_install_loc = install_locs['14.0'] + class msvsEmptyTestCase(msvsTestCase): """Test Empty Registry""" registry = DummyRegistry(regdata_none) @@ -829,6 +904,7 @@ if __name__ == "__main__": msvs71TestCase, msvs8ExpTestCase, msvs80TestCase, + msvs140TestCase, msvsEmptyTestCase, ] -- cgit v0.12 From a50f82ba0673e6922504e74dad3bb259e9edc0d3 Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Wed, 17 Jul 2019 14:26:29 -0400 Subject: Fix issues raised in code review --- src/engine/SCons/Tool/msvs.py | 40 +++++++++++------------ src/engine/SCons/Tool/msvsTests.py | 66 ++++++++++++++++++++++++++++++-------- 2 files changed, 72 insertions(+), 34 deletions(-) diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index e92a226..7dd1dc7 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -47,7 +47,6 @@ import sys import SCons.Builder import SCons.Node.FS import SCons.Platform.win32 -import SCons.Script import SCons.Script.SConscript import SCons.PathList import SCons.Util @@ -71,14 +70,14 @@ def xmlify(s): s = s.replace('\n', ' ') return s -# Process a CPPPATH list in includes, given the env, target and source. -# Returns a tuple of nodes. def processIncludes(includes, env, target, source): - return SCons.PathList.PathList(includes).subst_path(env, target, source) - -# Convert a file to its absolute path. -def processSource(file): - return SCons.Script.File(file).abspath + """ + Process a CPPPATH list in includes, given the env, target and source. + Returns a list of directory paths. These paths are absolute so we avoid + putting pound-prefixed paths in a Visual Studio project file. + """ + return [env.Dir(i).abspath for i in + SCons.PathList.PathList(includes).subst_path(env, target, source)] external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' @@ -493,9 +492,7 @@ class _DSPGenerator(object): cmdargs = GetKeyFromEnv(env, 'cmdargs', variants) cppdefines = GetKeyFromEnv(env, 'cppdefines', variants) - - dirpathfunc = lambda x: x.abspath if hasattr(x, 'abspath') else x - cpppaths = [dirpathfunc(path) for path in GetKeyFromEnv(env, 'cpppaths', variants)] + cpppaths = GetKeyFromEnv(env, 'cpppaths', variants) self.env = env @@ -538,15 +535,17 @@ class _DSPGenerator(object): for n in sourcenames: self.sources[n].sort(key=lambda a: a.lower()) - def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines=[], cpppaths=[], dspfile=dspfile): + def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines, cpppaths, dspfile=dspfile, env=env): config = Config() config.buildtarget = buildtarget config.outdir = outdir config.cmdargs = cmdargs config.cppdefines = cppdefines - config.cpppaths = cpppaths config.runfile = runfile + # Dir objects can't be pickled, so we need an absolute path here. + config.cpppaths = processIncludes(cpppaths, env, None, None) + match = re.match(r'(.*)\|(.*)', variant) if match: config.variant = match.group(1) @@ -929,8 +928,7 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): # so they could vary depending on the command being generated. This code # assumes they don't. preprocdefs = xmlify(';'.join(processDefines(cppdefines))) - includepath_Dirs = processIncludes(cpppaths, self.env, None, None) - includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) + includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None))) if not env_has_buildtarget: del self.env['MSVSBUILDTARGET'] @@ -1229,6 +1227,8 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): buildtarget = self.configs[kind].buildtarget runfile = self.configs[kind].runfile cmdargs = self.configs[kind].cmdargs + cpppaths = self.configs[kind].cpppaths + cppdefines = self.configs[kind].cppdefines env_has_buildtarget = 'MSVSBUILDTARGET' in self.env if not env_has_buildtarget: @@ -1246,9 +1246,8 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE, # so they could vary depending on the command being generated. This code # assumes they don't. - preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', [])))) - includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None) - includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) + preprocdefs = xmlify(';'.join(processDefines(cppdefines))) + includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None))) if not env_has_buildtarget: del self.env['MSVSBUILDTARGET'] @@ -1317,7 +1316,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): file = value if commonprefix: file = os.path.join(commonprefix, value) - file = processSource(file) + file = os.path.normpath(file) self.file.write('\t\t<%s Include="%s" />\n' % (keywords[kind], file)) self.filters_file.write('\t\t<%s Include="%s">\n' @@ -1828,8 +1827,7 @@ def projectEmitter(target, source, env): # Project file depends on CPPDEFINES and CPPPATH preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', [])))) - includepath_Dirs = processIncludes(env.get('CPPPATH', []), env, None, None) - includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) + includepath = xmlify(';'.join(processIncludes(env.get('CPPPATH', []), env, None, None))) source = source + "; ppdefs:%s incpath:%s"%(preprocdefs, includepath) if 'buildtarget' in env and env['buildtarget'] is not None: diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py index c9d6b13..3573287 100644 --- a/src/engine/SCons/Tool/msvsTests.py +++ b/src/engine/SCons/Tool/msvsTests.py @@ -32,7 +32,6 @@ import copy import TestCmd import TestUnit -from SCons.Script import Dir from SCons.Tool.msvs import * from SCons.Tool.MSCommon.vs import SupportedVSList import SCons.Util @@ -422,6 +421,12 @@ class DummyEnv(object): else: return value + def Dir(self, name): + # Depend upon SCons.Script.Dir so we can create a Directory object + # that doesn't actually exist on disk without problems or side effects. + return SCons.Script.Dir(name) + + class RegKey(object): """key class for storing an 'open' registry key""" def __init__(self,key): @@ -644,13 +649,17 @@ class msvsTestCase(unittest.TestCase): version_num, suite = msvs_parse_version(self.highest_version) if version_num >= 10.0: function_test = _GenerateV10DSP - dspfile = 'test.vcxproj' + suffix = '.vcxproj' elif version_num >= 7.0: function_test = _GenerateV7DSP - dspfile = 'test.dsp' + suffix = '.dsp' else: function_test = _GenerateV6DSP - dspfile = 'test.dsp' + suffix = '.dsp' + + # Avoid any race conditions between the test cases when we test + # actually writing the files. + dspfile = 'test%s%s' % (hash(self), suffix) str_function_test = str(function_test.__init__) source = 'test.cpp' @@ -662,17 +671,43 @@ class msvsTestCase(unittest.TestCase): 'debug=False target_arch=32', 'debug=True target_arch=x64', 'debug=False target_arch=x64'] - list_cppdefines = ['_A', '_B', 'C', None] - list_cpppaths = [r'C:\test1', r'C:\test1;C:\test2', Dir('subdir'), None] + list_cppdefines = [['_A', '_B', 'C'], ['_B', '_C_'], ['D'], []] + list_cpppaths = [[r'C:\test1'], [r'C:\test1;C:\test2'], + [DummyEnv().Dir('subdir')], []] def TestParamsFromList(test_variant, test_list): - # Tuple list: (parameter, dictionary of expected result per variant) - dirpathfunc = lambda x: x.abspath if hasattr(x, 'abspath') else x + """ + Generates test data based on the parameters passed in. + + Returns tuple list: + 1. Parameter. + 2. Dictionary of expected result per variant. + """ + def normalizeParam(param): + """ + Converts the raw data based into the AddConfig function of + msvs.py to the expected result. + + Expects the following behavior: + 1. A value of None will be converted to an empty list. + 2. A File or Directory object will be converted to an + absolute path (because those objects can't be pickled). + 3. Otherwise, the parameter will be used. + """ + if param is None: + return [] + elif isinstance(param, list): + return [normalizeParam(p) for p in param] + elif hasattr(param, 'abspath'): + return param.abspath + else: + return param + return [ (None, dict.fromkeys(test_variant, '')), ('', dict.fromkeys(test_variant, '')), - (test_list[0], dict.fromkeys(test_variant, dirpathfunc(test_list[0]))), - (test_list, dict(list(zip(test_variant, [dirpathfunc(x) for x in test_list])))) + (test_list[0], dict.fromkeys(test_variant, normalizeParam(test_list[0]))), + (test_list, dict(list(zip(test_variant, [normalizeParam(x) for x in test_list])))) ] tests_cmdargs = TestParamsFromList(list_variant, list_cmdargs) @@ -700,9 +735,9 @@ class msvsTestCase(unittest.TestCase): # Create expected dictionary result for this variant_platform expected_configs[variant_platform] = { 'variant': variant, - 'platform': platform, + 'platform': platform, 'runfile': runfile, - 'buildtarget': buildtarget, + 'buildtarget': buildtarget, 'outdir': outdir, 'cmdargs': expected_cmdargs[variant_platform], 'cppdefines': expected_cppdefines[variant_platform], @@ -737,7 +772,12 @@ class msvsTestCase(unittest.TestCase): genDSP.Build() # Delete the resulting file so we don't leave anything behind. - os.remove(os.path.realpath(dspfile)) + for file in [dspfile, dspfile + '.filters']: + path = os.path.realpath(file) + try: + os.remove(path) + except OSError: + pass class msvs6aTestCase(msvsTestCase): """Test MSVS 6 Registry""" -- cgit v0.12 From b3dcc756c51b86220685acf88d4f5dea49af307f Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Thu, 18 Jul 2019 15:20:08 -0400 Subject: Fix msvs tests --- src/engine/SCons/Tool/msvs.py | 22 +- test/MSVS/vs-10.0-files.py | 110 ------ test/MSVS/vs-10.0-scc-files.py | 115 ------ test/MSVS/vs-10.0-scc-legacy-files.py | 98 ------ test/MSVS/vs-11.0-files.py | 110 ------ test/MSVS/vs-11.0-scc-files.py | 115 ------ test/MSVS/vs-11.0-scc-legacy-files.py | 98 ------ test/MSVS/vs-14.0-files.py | 110 ------ test/MSVS/vs-14.0-scc-files.py | 115 ------ test/MSVS/vs-14.0-scc-legacy-files.py | 98 ------ test/MSVS/vs-14.1-files.py | 108 ------ test/MSVS/vs-14.1-scc-files.py | 113 ------ test/MSVS/vs-14.1-scc-legacy-files.py | 96 ----- test/MSVS/vs-8.0-clean.py | 117 ------ test/MSVS/vs-8.0-files.py | 106 ------ test/MSVS/vs-8.0-scc-files.py | 115 ------ test/MSVS/vs-8.0-scc-legacy-files.py | 98 ------ test/MSVS/vs-8.0-variant_dir.py | 95 ----- test/MSVS/vs-8.0-x64-files.py | 114 ------ test/MSVS/vs-9.0-files.py | 106 ------ test/MSVS/vs-9.0-scc-files.py | 115 ------ test/MSVS/vs-9.0-scc-legacy-files.py | 98 ------ test/MSVS/vs-files.py | 112 ++++++ test/MSVS/vs-scc-files.py | 128 +++++++ test/MSVS/vs-scc-legacy-files.py | 110 ++++++ test/MSVS/vs-variant_dir.py | 93 +++++ testing/framework/TestSConsMSVS.py | 645 +++++++--------------------------- 27 files changed, 598 insertions(+), 2762 deletions(-) delete mode 100644 test/MSVS/vs-10.0-files.py delete mode 100644 test/MSVS/vs-10.0-scc-files.py delete mode 100644 test/MSVS/vs-10.0-scc-legacy-files.py delete mode 100644 test/MSVS/vs-11.0-files.py delete mode 100644 test/MSVS/vs-11.0-scc-files.py delete mode 100644 test/MSVS/vs-11.0-scc-legacy-files.py delete mode 100644 test/MSVS/vs-14.0-files.py delete mode 100644 test/MSVS/vs-14.0-scc-files.py delete mode 100644 test/MSVS/vs-14.0-scc-legacy-files.py delete mode 100644 test/MSVS/vs-14.1-files.py delete mode 100644 test/MSVS/vs-14.1-scc-files.py delete mode 100644 test/MSVS/vs-14.1-scc-legacy-files.py delete mode 100644 test/MSVS/vs-8.0-clean.py delete mode 100644 test/MSVS/vs-8.0-files.py delete mode 100644 test/MSVS/vs-8.0-scc-files.py delete mode 100644 test/MSVS/vs-8.0-scc-legacy-files.py delete mode 100644 test/MSVS/vs-8.0-variant_dir.py delete mode 100644 test/MSVS/vs-8.0-x64-files.py delete mode 100644 test/MSVS/vs-9.0-files.py delete mode 100644 test/MSVS/vs-9.0-scc-files.py delete mode 100644 test/MSVS/vs-9.0-scc-legacy-files.py create mode 100644 test/MSVS/vs-files.py create mode 100644 test/MSVS/vs-scc-files.py create mode 100644 test/MSVS/vs-scc-legacy-files.py create mode 100644 test/MSVS/vs-variant_dir.py diff --git a/src/engine/SCons/Tool/msvs.py b/src/engine/SCons/Tool/msvs.py index 7dd1dc7..d27294b 100644 --- a/src/engine/SCons/Tool/msvs.py +++ b/src/engine/SCons/Tool/msvs.py @@ -477,6 +477,13 @@ class _DSPGenerator(object): self.sconscript = env['MSVSSCONSCRIPT'] def GetKeyFromEnv(env, key, variants): + """ + Retrieves a specific key from the environment. If the key is + present, it is expected to either be a string or a list with length + equal to the number of variants. The function returns a list of + the desired value (e.g. cpp include paths) guaranteed to be of + length equal to the length of the variants list. + """ if key not in env or env[key] is None: return [''] * len(variants) elif SCons.Util.is_String(env[key]): @@ -491,8 +498,19 @@ class _DSPGenerator(object): (key, type(env[key]))) cmdargs = GetKeyFromEnv(env, 'cmdargs', variants) - cppdefines = GetKeyFromEnv(env, 'cppdefines', variants) - cpppaths = GetKeyFromEnv(env, 'cpppaths', variants) + + # The caller is allowed to put 'cppdefines' and/or 'cpppaths' in the + # environment, which is useful if they want to provide per-variant + # values for these. Otherwise, we fall back to using the global + # 'CPPDEFINES' and 'CPPPATH' functions. + if 'cppdefines' in env: + cppdefines = GetKeyFromEnv(env, 'cppdefines', variants) + else: + cppdefines = [env.get('CPPDEFINES', [])] * len(variants) + if 'cpppaths' in env: + cpppaths = GetKeyFromEnv(env, 'cpppaths', variants) + else: + cpppaths = [env.get('CPPPATH', [])] * len(variants) self.env = env diff --git a/test/MSVS/vs-10.0-files.py b/test/MSVS/vs-10.0-files.py deleted file mode 100644 index 8cdc152..0000000 --- a/test/MSVS/vs-10.0-files.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 10.0 project (.vcxproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['10.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_10_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_10_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_10_0 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '10.0', None, 'SConstruct') -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '10.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcxproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '10.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-10.0-scc-files.py b/test/MSVS/vs-10.0-scc-files.py deleted file mode 100644 index 8a08ece..0000000 --- a/test/MSVS/vs-10.0-scc-files.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 10.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['10.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_10_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_10_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcxproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\t. -\t\tMSSCCI:Perforce SCM -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '10.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '10.0', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-10.0-scc-legacy-files.py b/test/MSVS/vs-10.0-scc-legacy-files.py deleted file mode 100644 index 9cb65d8..0000000 --- a/test/MSVS/vs-10.0-scc-legacy-files.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 10.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['10.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_10_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_10_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\tC:\\MyMsVsProjects -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '10.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '10.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-11.0-files.py b/test/MSVS/vs-11.0-files.py deleted file mode 100644 index 6c4933c..0000000 --- a/test/MSVS/vs-11.0-files.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 11.0 project (.vcxproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['11.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_11_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_11_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_11_0 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '11.0', None, 'SConstruct') -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '11.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcxproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '11.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-11.0-scc-files.py b/test/MSVS/vs-11.0-scc-files.py deleted file mode 100644 index 2b13e46..0000000 --- a/test/MSVS/vs-11.0-scc-files.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 11.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['11.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_11_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_11_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcxproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\t. -\t\tMSSCCI:Perforce SCM -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '11.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '11.0', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-11.0-scc-legacy-files.py b/test/MSVS/vs-11.0-scc-legacy-files.py deleted file mode 100644 index 9e46f6a..0000000 --- a/test/MSVS/vs-11.0-scc-legacy-files.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 11.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['11.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_11_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_11_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\tC:\\MyMsVsProjects -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '11.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '11.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.0-files.py b/test/MSVS/vs-14.0-files.py deleted file mode 100644 index e4ba8e2..0000000 --- a/test/MSVS/vs-14.0-files.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.0 project (.vcxproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_14_0 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.0', None, 'SConstruct') -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcxproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.0-scc-files.py b/test/MSVS/vs-14.0-scc-files.py deleted file mode 100644 index d706b32..0000000 --- a/test/MSVS/vs-14.0-scc-files.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcxproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\t. -\t\tMSSCCI:Perforce SCM -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.0', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.0-scc-legacy-files.py b/test/MSVS/vs-14.0-scc-legacy-files.py deleted file mode 100644 index 904a103..0000000 --- a/test/MSVS/vs-14.0-scc-legacy-files.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.0 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\tC:\\MyMsVsProjects -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.1-files.py b/test/MSVS/vs-14.1-files.py deleted file mode 100644 index a7c8437..0000000 --- a/test/MSVS/vs-14.1-files.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.1 project (.vcxproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.1'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_1 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_1 -SConscript_contents = TestSConsMSVS.SConscript_contents_14_1 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.1', None, 'SConstruct') -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.1', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -test.must_exist(test.workpath('Test.vcxproj.filters')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcxproj')) -test.must_not_exist(test.workpath('Test.vcxproj.filters')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcxproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcxproj') - -test.must_exist(test.workpath('Test.vcxproj')) -vcxproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.1', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.1-scc-files.py b/test/MSVS/vs-14.1-scc-files.py deleted file mode 100644 index 465c904..0000000 --- a/test/MSVS/vs-14.1-scc-files.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.1 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.1'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_1 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_1 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcxproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\t. -\t\tMSSCCI:Perforce SCM -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.1', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.1', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-14.1-scc-legacy-files.py b/test/MSVS/vs-14.1-scc-legacy-files.py deleted file mode 100644 index 45d94a6..0000000 --- a/test/MSVS/vs-14.1-scc-legacy-files.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 14.1 project (.vcxproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['14.1'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_14_1 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_14_1 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\t\tPerforce Project -\t\tC:\\MyMsVsProjects -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcxproj") - -test.must_exist(test.workpath('Test.vcxproj')) -vcproj = test.read('Test.vcxproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '14.1', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '14.1', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-clean.py b/test/MSVS/vs-8.0-clean.py deleted file mode 100644 index 7ca1c46..0000000 --- a/test/MSVS/vs-8.0-clean.py +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Verify the -c option's ability to clean generated Visual Studio 8.0 -project (.vcproj) and solution (.sln) files. -""" - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 - - - -test.write('SConstruct', """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='8.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -p = env.MSVSProject(target = 'Test.vcproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release', - auto_build_solution = 0) - -env.MSVSSolution(target = 'Test.sln', - slnguid = '{SLNGUID}', - projects = [p], - variant = 'Release') -"""%{'HOST_ARCH': host_arch}) - -test.run(arguments=".") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='.') - -test.must_exist(test.workpath('Test.vcproj')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.vcproj') - -test.must_not_exist(test.workpath('Test.vcproj')) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-files.py b/test/MSVS/vs-8.0-files.py deleted file mode 100644 index 038a5bf..0000000 --- a/test/MSVS/vs-8.0-files.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 8.0 project (.vcproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_8_0 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-scc-files.py b/test/MSVS/vs-8.0-scc-files.py deleted file mode 100644 index 05a8a5f..0000000 --- a/test/MSVS/vs-8.0-scc-files.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 8.0 project (.vcproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='8.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\tSccProjectName="Perforce Project" -\tSccLocalPath="." -\tSccProvider="MSSCCI:Perforce SCM" -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-scc-legacy-files.py b/test/MSVS/vs-8.0-scc-legacy-files.py deleted file mode 100644 index bfb8416..0000000 --- a/test/MSVS/vs-8.0-scc-legacy-files.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 8.0 project (.vcproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='8.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\tSccProjectName="Perforce Project" -\tSccLocalPath="C:\\MyMsVsProjects" -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-variant_dir.py b/test/MSVS/vs-8.0-variant_dir.py deleted file mode 100644 index 20c7381..0000000 --- a/test/MSVS/vs-8.0-variant_dir.py +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 8.0 project (.vcproj) and -solution (.sln) files that look correct when using a variant_dir. -""" - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_8_0 - - - -test.subdir('src') - -test.write('SConstruct', """\ -SConscript('src/SConscript', variant_dir='build') -""") - -test.write(['src', 'SConscript'], SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments=".") - -project_guid = "{25F6CE89-8E22-2910-8B6E-FFE6DC1E2792}" -vcproj = test.read(['src', 'Test.vcproj'], 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct', - project_guid=project_guid) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('src', 'Test.sln')) -sln = test.read(['src', 'Test.sln'], 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', 'src', - project_guid=project_guid) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.must_match(['build', 'Test.vcproj'], """\ -This is just a placeholder file. -The real project file is here: -%s -""" % test.workpath('src', 'Test.vcproj'), - mode='r') - -test.must_match(['build', 'Test.sln'], """\ -This is just a placeholder file. -The real workspace file is here: -%s -""" % test.workpath('src', 'Test.sln'), - mode='r') - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-8.0-x64-files.py b/test/MSVS/vs-8.0-x64-files.py deleted file mode 100644 index 072ba22..0000000 --- a/test/MSVS/vs-8.0-x64-files.py +++ /dev/null @@ -1,114 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 8.0 project (.vcproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['8.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_8_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_8_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_8_0 - -# We didn't create an API for putting parameters like this into -# the common generated and expected files. Until we do, just patch -# in the values. -expected_slnfile = expected_slnfile.replace('Win32', 'x64') -expected_vcprojfile = expected_vcprojfile.replace('Win32', 'x64') -SConscript_contents = SConscript_contents.replace('\'Release\'', '\'Release|x64\'') - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '8.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '8.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-9.0-files.py b/test/MSVS/vs-9.0-files.py deleted file mode 100644 index eccca51..0000000 --- a/test/MSVS/vs-9.0-files.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 9.0 project (.vcproj) and -solution (.sln) files that look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() -host_arch = test.get_vs_host_arch() - - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['9.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_9_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_9_0 -SConscript_contents = TestSConsMSVS.SConscript_contents_9_0 - - - -test.write('SConstruct', SConscript_contents%{'HOST_ARCH': host_arch}) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '9.0', None, 'SConstruct') -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '9.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - -test.run(arguments='-c .') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -test.must_exist(test.workpath('Test.sln')) - -test.run(arguments='-c Test.sln') - -test.must_not_exist(test.workpath('Test.vcproj')) -test.must_not_exist(test.workpath('Test.sln')) - - - -# Test that running SCons with $PYTHON_ROOT in the environment -# changes the .vcproj output as expected. -os.environ['PYTHON_ROOT'] = 'xyzzy' -python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) - -test.run(arguments='Test.vcproj') - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '9.0', None, 'SConstruct', - python=python) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-9.0-scc-files.py b/test/MSVS/vs-9.0-scc-files.py deleted file mode 100644 index c270010..0000000 --- a/test/MSVS/vs-9.0-scc-files.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 9.0 project (.vcproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['9.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_9_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_9_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='9.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_CONNECTION_ROOT='.', - MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_sln_sccinfo = """\ -\tGlobalSection(SourceCodeControl) = preSolution -\t\tSccNumberOfProjects = 2 -\t\tSccProjectName0 = Perforce\\u0020Project -\t\tSccLocalPath0 = . -\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM -\t\tCanCheckoutShared = true -\t\tSccProjectUniqueName1 = Test.vcproj -\t\tSccLocalPath1 = . -\t\tCanCheckoutShared = true -\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ -\tEndGlobalSection -""" - -expected_vcproj_sccinfo = """\ -\tSccProjectName="Perforce Project" -\tSccLocalPath="." -\tSccProvider="MSSCCI:Perforce SCM" -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '9.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '9.0', None, 'SConstruct', - sln_sccinfo=expected_sln_sccinfo) -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-9.0-scc-legacy-files.py b/test/MSVS/vs-9.0-scc-legacy-files.py deleted file mode 100644 index 0085f64..0000000 --- a/test/MSVS/vs-9.0-scc-legacy-files.py +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/env python -# -# __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__" - -""" -Test that we can generate Visual Studio 9.0 project (.vcproj) and -solution (.sln) files that contain SCC information and look correct. -""" - -import os - -import TestSConsMSVS - -test = TestSConsMSVS.TestSConsMSVS() - -# Make the test infrastructure think we have this version of MSVS installed. -test._msvs_versions = ['9.0'] - - - -expected_slnfile = TestSConsMSVS.expected_slnfile_9_0 -expected_vcprojfile = TestSConsMSVS.expected_vcprojfile_9_0 -SConscript_contents = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='9.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', - MSVS_SCC_PROJECT_NAME='Perforce Project') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -expected_vcproj_sccinfo = """\ -\tSccProjectName="Perforce Project" -\tSccLocalPath="C:\\MyMsVsProjects" -""" - - -test.write('SConstruct', SConscript_contents) - -test.run(arguments="Test.vcproj") - -test.must_exist(test.workpath('Test.vcproj')) -vcproj = test.read('Test.vcproj', 'r') -expect = test.msvs_substitute(expected_vcprojfile, '9.0', None, 'SConstruct', - vcproj_sccinfo=expected_vcproj_sccinfo) -# don't compare the pickled data -assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) - -test.must_exist(test.workpath('Test.sln')) -sln = test.read('Test.sln', 'r') -expect = test.msvs_substitute(expected_slnfile, '9.0', None, 'SConstruct') -# don't compare the pickled data -assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) - - -test.pass_test() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-files.py b/test/MSVS/vs-files.py new file mode 100644 index 0000000..b330ce7 --- /dev/null +++ b/test/MSVS/vs-files.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that we can generate Visual Studio 10.0 or later project (.vcxproj) and +solution (.sln) files that look correct. +""" + +import os + +import TestSConsMSVS + +for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): + test = TestSConsMSVS.TestSConsMSVS() + host_arch = test.get_vs_host_arch() + + # Make the test infrastructure think we have this version of MSVS installed. + test._msvs_versions = [vc_version] + + dirs = ['inc1', 'inc2'] + major, minor = test.parse_vc_version(vc_version) + project_file = 'Test.vcproj' if major <= 9 else 'Test.vcxproj' + filters_file = project_file + '.filters' + filters_file_expected = major >= 10 + expected_slnfile = test.get_expected_sln_file_contents(vc_version, project_file) + expected_vcprojfile = test.get_expected_proj_file_contents(vc_version, dirs, project_file) + + test.write('SConstruct', test.get_expected_sconscript_file_contents(vc_version, project_file)) + + test.run(arguments=project_file) + + test.must_exist(test.workpath(project_file)) + if filters_file_expected: + test.must_exist(test.workpath(filters_file)) + else: + test.must_not_exist(test.workpath(filters_file)) + vcxproj = test.read(project_file, 'r') + expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct') + # don't compare the pickled data + assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) + + test.must_exist(test.workpath('Test.sln')) + sln = test.read('Test.sln', 'r') + expect = test.msvs_substitute(expected_slnfile, vc_version, None, 'SConstruct') + # don't compare the pickled data + assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + test.run(arguments='-c .') + + test.must_not_exist(test.workpath(project_file)) + test.must_not_exist(test.workpath(filters_file)) + test.must_not_exist(test.workpath('Test.sln')) + + test.run(arguments=project_file) + + test.must_exist(test.workpath(project_file)) + if filters_file_expected: + test.must_exist(test.workpath(filters_file)) + else: + test.must_not_exist(test.workpath(filters_file)) + test.must_exist(test.workpath('Test.sln')) + + test.run(arguments='-c Test.sln') + + test.must_not_exist(test.workpath(project_file)) + test.must_not_exist(test.workpath(filters_file)) + test.must_not_exist(test.workpath('Test.sln')) + + # Test that running SCons with $PYTHON_ROOT in the environment + # changes the .vcxproj output as expected. + os.environ['PYTHON_ROOT'] = 'xyzzy' + python = os.path.join('$(PYTHON_ROOT)', os.path.split(TestSConsMSVS.python)[1]) + + test.run(arguments=project_file) + + test.must_exist(test.workpath(project_file)) + vcxproj = test.read(project_file, 'r') + expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct', + python=python) + # don't compare the pickled data + assert vcxproj[:len(expect)] == expect, test.diff_substr(expect, vcxproj) + + test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-scc-files.py b/test/MSVS/vs-scc-files.py new file mode 100644 index 0000000..a02ba5c --- /dev/null +++ b/test/MSVS/vs-scc-files.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that we can generate Visual Studio 10.0 project (.vcxproj) and +solution (.sln) files that contain SCC information and look correct. +""" + +import os + +import TestSConsMSVS + +for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): + test = TestSConsMSVS.TestSConsMSVS() + + # Make the test infrastructure think we have this version of MSVS installed. + test._msvs_versions = [vc_version] + + dirs = ['inc1', 'inc2'] + major, minor = test.parse_vc_version(vc_version) + project_file = 'Test.vcproj' if major <= 9 else 'Test.vcxproj' + filters_file = project_file + '.filters' + filters_file_expected = major >= 10 + expected_slnfile = test.get_expected_sln_file_contents(vc_version, project_file) + expected_vcprojfile = test.get_expected_proj_file_contents(vc_version, dirs, project_file) + SConscript_contents = """\ +env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='{vc_version}', + CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], + CPPPATH=['inc1', 'inc2'], + MSVS_SCC_CONNECTION_ROOT='.', + MSVS_SCC_PROVIDER='MSSCCI:Perforce SCM', + MSVS_SCC_PROJECT_NAME='Perforce Project') + +testsrc = ['test1.cpp', 'test2.cpp'] +testincs = [r'sdk_dir\\sdk.h'] +testlocalincs = ['test.h'] +testresources = ['test.rc'] +testmisc = ['readme.txt'] + +env.MSVSProject(target = '{project_file}', + srcs = testsrc, + incs = testincs, + localincs = testlocalincs, + resources = testresources, + misc = testmisc, + buildtarget = 'Test.exe', + variant = 'Release') +""".format(vc_version=vc_version, project_file=project_file) + + expected_sln_sccinfo = """\ +\tGlobalSection(SourceCodeControl) = preSolution +\t\tSccNumberOfProjects = 2 +\t\tSccProjectName0 = Perforce\\u0020Project +\t\tSccLocalPath0 = . +\t\tSccProvider0 = MSSCCI:Perforce\\u0020SCM +\t\tCanCheckoutShared = true +\t\tSccProjectUniqueName1 = {project_file} +\t\tSccLocalPath1 = . +\t\tCanCheckoutShared = true +\t\tSccProjectFilePathRelativizedFromConnection1 = .\\\\ +\tEndGlobalSection +""".format(project_file=project_file) + + if major < 10: + # VC8 and VC9 used key-value pair format. + expected_vcproj_sccinfo = """\ +\tSccProjectName="Perforce Project" +\tSccLocalPath="." +\tSccProvider="MSSCCI:Perforce SCM" +""" + else: + # VC10 and later use XML format. + expected_vcproj_sccinfo = """\ +\t\tPerforce Project +\t\t. +\t\tMSSCCI:Perforce SCM +""" + + + test.write('SConstruct', SConscript_contents) + + test.run(arguments=project_file) + + test.must_exist(test.workpath(project_file)) + vcproj = test.read(project_file, 'r') + expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct', + vcproj_sccinfo=expected_vcproj_sccinfo) + # don't compare the pickled data + assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) + + test.must_exist(test.workpath('Test.sln')) + sln = test.read('Test.sln', 'r') + expect = test.msvs_substitute(expected_slnfile, vc_version, None, 'SConstruct', + sln_sccinfo=expected_sln_sccinfo) + # don't compare the pickled data + assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + + test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-scc-legacy-files.py b/test/MSVS/vs-scc-legacy-files.py new file mode 100644 index 0000000..813025a --- /dev/null +++ b/test/MSVS/vs-scc-legacy-files.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that we can generate Visual Studio 10.0 or later project (.vcxproj) and +solution (.sln) files that contain SCC information and look correct. +""" + +import os + +import TestSConsMSVS + +for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): + test = TestSConsMSVS.TestSConsMSVS() + + # Make the test infrastructure think we have this version of MSVS installed. + test._msvs_versions = [vc_version] + + dirs = ['inc1', 'inc2'] + major, minor = test.parse_vc_version(vc_version) + project_file = 'Test.vcproj' if major <= 9 else 'Test.vcxproj' + filters_file = project_file + '.filters' + filters_file_expected = major >= 10 + expected_slnfile = test.get_expected_sln_file_contents(vc_version, project_file) + expected_vcprojfile = test.get_expected_proj_file_contents(vc_version, dirs, project_file) + + SConscript_contents = """\ +env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='{vc_version}', + CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], + CPPPATH=['inc1', 'inc2'], + MSVS_SCC_LOCAL_PATH=r'C:\\MyMsVsProjects', + MSVS_SCC_PROJECT_NAME='Perforce Project') + +testsrc = ['test1.cpp', 'test2.cpp'] +testincs = [r'sdk_dir\\sdk.h'] +testlocalincs = ['test.h'] +testresources = ['test.rc'] +testmisc = ['readme.txt'] + +env.MSVSProject(target = '{project_file}', + srcs = testsrc, + incs = testincs, + localincs = testlocalincs, + resources = testresources, + misc = testmisc, + buildtarget = 'Test.exe', + variant = 'Release') +""".format(vc_version=vc_version, project_file=project_file) + + if major < 10: + # VC8 and VC9 used key-value pair format. + expected_vcproj_sccinfo = """\ +\tSccProjectName="Perforce Project" +\tSccLocalPath="C:\\MyMsVsProjects" +""" + else: + # VC10 and later use XML format. + expected_vcproj_sccinfo = """\ +\t\tPerforce Project +\t\tC:\\MyMsVsProjects +""" + + test.write('SConstruct', SConscript_contents) + + test.run(arguments=project_file) + + test.must_exist(test.workpath(project_file)) + vcproj = test.read(project_file, 'r') + expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct', + vcproj_sccinfo=expected_vcproj_sccinfo) + # don't compare the pickled data + assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) + + test.must_exist(test.workpath('Test.sln')) + sln = test.read('Test.sln', 'r') + expect = test.msvs_substitute(expected_slnfile, vc_version, None, 'SConstruct') + # don't compare the pickled data + assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + + test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/MSVS/vs-variant_dir.py b/test/MSVS/vs-variant_dir.py new file mode 100644 index 0000000..15b46e8 --- /dev/null +++ b/test/MSVS/vs-variant_dir.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Test that we can generate Visual Studio 8.0 project (.vcproj) and +solution (.sln) files that look correct when using a variant_dir. +""" + +import TestSConsMSVS + +for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): + test = TestSConsMSVS.TestSConsMSVS() + host_arch = test.get_vs_host_arch() + + # Make the test infrastructure think we have this version of MSVS installed. + test._msvs_versions = [vc_version] + + dirs = ['inc1', 'inc2'] + major, minor = test.parse_vc_version(vc_version) + project_file = 'Test.vcproj' if major <= 9 else 'Test.vcxproj' + expected_slnfile = test.get_expected_sln_file_contents(vc_version, project_file) + expected_vcprojfile = test.get_expected_proj_file_contents(vc_version, dirs, project_file) + + test.subdir('src') + + test.write('SConstruct', """\ +SConscript('src/SConscript', variant_dir='build') +""") + + test.write('SConstruct', """\ +SConscript('src/SConscript', variant_dir='build') +""") + + test.write(['src', 'SConscript'], test.get_expected_sconscript_file_contents(vc_version, project_file)) + + test.run(arguments=".") + + project_guid = "{25F6CE89-8E22-2910-8B6E-FFE6DC1E2792}" + vcproj = test.read(['src', project_file], 'r') + expect = test.msvs_substitute(expected_vcprojfile, vc_version, None, 'SConstruct', + project_guid=project_guid) + # don't compare the pickled data + assert vcproj[:len(expect)] == expect, test.diff_substr(expect, vcproj) + + test.must_exist(test.workpath('src', 'Test.sln')) + sln = test.read(['src', 'Test.sln'], 'r') + expect = test.msvs_substitute(expected_slnfile, '8.0', 'src', + project_guid=project_guid) + # don't compare the pickled data + assert sln[:len(expect)] == expect, test.diff_substr(expect, sln) + + test.must_match(['build', 'Test.vcproj'], """\ +This is just a placeholder file. +The real project file is here: +%s +""" % test.workpath('src', project_file), mode='r') + + test.must_match(['build', 'Test.sln'], """\ +This is just a placeholder file. +The real workspace file is here: +%s +""" % test.workpath('src', 'Test.sln'), mode='r') + + test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/testing/framework/TestSConsMSVS.py b/testing/framework/TestSConsMSVS.py index 348d7ed..9e6e069 100644 --- a/testing/framework/TestSConsMSVS.py +++ b/testing/framework/TestSConsMSVS.py @@ -23,6 +23,7 @@ import platform import traceback from xml.etree import ElementTree +import SCons.Errors from TestSCons import * from TestSCons import __all__ @@ -435,31 +436,10 @@ env.MSVSProject(target = 'Test.vcproj', """ - -expected_slnfile_8_0 = """\ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test.vcproj", "" -EndProject -Global - -\tGlobalSection(SolutionConfigurationPlatforms) = preSolution -\t\tRelease|Win32 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(ProjectConfigurationPlatforms) = postSolution -\t\t.Release|Win32.ActiveCfg = Release|Win32 -\t\t.Release|Win32.Build.0 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(SolutionProperties) = preSolution -\t\tHideSolutionNode = FALSE -\tEndGlobalSection -EndGlobal -""" - -expected_slnfile_9_0 = """\ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test", "Test.vcproj", "" +expected_slnfile_fmt = """\ +Microsoft Visual Studio Solution File, Format Version %(FORMAT_VERSION)s +# Visual Studio %(VS_NUMBER)s +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "%(PROJECT_NAME)s", "%(PROJECT_FILE)s", "" EndProject Global @@ -476,91 +456,11 @@ Global EndGlobal """ -expected_slnfile_10_0 = """\ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test.vcxproj", "Test.vcxproj", "{39A97E1F-1A52-8954-A0B1-A10A8487545E}" -EndProject -Global - -\tGlobalSection(SolutionConfigurationPlatforms) = preSolution -\t\tRelease|Win32 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(ProjectConfigurationPlatforms) = postSolution -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.ActiveCfg = Release|Win32 -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.Build.0 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(SolutionProperties) = preSolution -\t\tHideSolutionNode = FALSE -\tEndGlobalSection -EndGlobal -""" - -expected_slnfile_11_0 = """\ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 11 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test.vcxproj", "Test.vcxproj", "{39A97E1F-1A52-8954-A0B1-A10A8487545E}" -EndProject -Global - -\tGlobalSection(SolutionConfigurationPlatforms) = preSolution -\t\tRelease|Win32 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(ProjectConfigurationPlatforms) = postSolution -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.ActiveCfg = Release|Win32 -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.Build.0 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(SolutionProperties) = preSolution -\t\tHideSolutionNode = FALSE -\tEndGlobalSection -EndGlobal -""" - -expected_slnfile_14_0 = """\ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test.vcxproj", "Test.vcxproj", "{39A97E1F-1A52-8954-A0B1-A10A8487545E}" -EndProject -Global - -\tGlobalSection(SolutionConfigurationPlatforms) = preSolution -\t\tRelease|Win32 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(ProjectConfigurationPlatforms) = postSolution -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.ActiveCfg = Release|Win32 -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.Build.0 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(SolutionProperties) = preSolution -\t\tHideSolutionNode = FALSE -\tEndGlobalSection -EndGlobal -""" - -expected_slnfile_14_1 = """\ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Test.vcxproj", "Test.vcxproj", "{39A97E1F-1A52-8954-A0B1-A10A8487545E}" -EndProject -Global - -\tGlobalSection(SolutionConfigurationPlatforms) = preSolution -\t\tRelease|Win32 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(ProjectConfigurationPlatforms) = postSolution -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.ActiveCfg = Release|Win32 -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E}.Release|Win32.Build.0 = Release|Win32 -\tEndGlobalSection -\tGlobalSection(SolutionProperties) = preSolution -\t\tHideSolutionNode = FALSE -\tEndGlobalSection -EndGlobal -""" - -expected_vcprojfile_8_0 = """\ +expected_vcprojfile_fmt = """\ \t\t\t +\t\t\t\tRelativePath="sdk_dir\\sdk.h"> \t\t\t \t\t \t\t """ -expected_vcprojfile_9_0 = """\ - - -\tKeyword="MakeFileProj"> -\t -\t\t -\t -\t -\t -\t -\t\t -\t\t\t -\t\t -\t -\t -\t -\t -\t\t -\t\t\t -\t\t\t -\t\t -\t\t -\t\t\t -\t\t\t -\t\t -\t\t -\t\t\t -\t\t\t -\t\t -\t\t -\t\t\t -\t\t\t -\t\t -\t\t -\t\t\t -\t\t\t -\t\t\t -\t\t\t -\t\t -\t\t -\t\t -\t -\t -\t - -""" - -expected_vcprojfile_10_0 = """\ +expected_vcxprojfile_fmt = """\ - + \t \t\t \t\t\tRelease @@ -746,6 +558,7 @@ expected_vcprojfile_10_0 = """\ \t\tTest \t\tMakeFileProj +\t\tNoUpgrade \t \t \t @@ -767,7 +580,7 @@ expected_vcprojfile_10_0 = """\ \t\techo Starting SCons && "" -c "" -C "" -f SConstruct -c "Test.exe" \t\tTest.exe \t\tDEF1;DEF2;DEF3=1234 -\t\tinc1;inc2 +\t\t%(INCLUDE_DIRS)s \t\t$(NMakeForcedIncludes) \t\t$(NMakeAssemblySearchPath) \t\t$(NMakeForcedUsingAssemblies) @@ -797,249 +610,8 @@ expected_vcprojfile_10_0 = """\ """ -expected_vcprojfile_11_0 = """\ - - -\t -\t\t -\t\t\tRelease -\t\t\tWin32 -\t\t -\t -\t -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E} - -\t\tTest -\t\tMakeFileProj -\t -\t -\t -\t\tMakefile -\t\tfalse -\t\tv110 -\t -\t -\t -\t -\t -\t\t -\t -\t -\t -\t<_ProjectFileVersion>10.0.30319.1 -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct -c "Test.exe" -\t\tTest.exe -\t\tDEF1;DEF2;DEF3=1234 -\t\tinc1;inc2 -\t\t$(NMakeForcedIncludes) -\t\t$(NMakeAssemblySearchPath) -\t\t$(NMakeForcedUsingAssemblies) -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t\t -\t -\t -\t\t -\t -\t -\t -\t - -""" - -expected_vcprojfile_14_0 = """\ - - -\t -\t\t -\t\t\tRelease -\t\t\tWin32 -\t\t -\t -\t -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E} - -\t\tTest -\t\tMakeFileProj -\t -\t -\t -\t\tMakefile -\t\tfalse -\t\tv140 -\t -\t -\t -\t -\t -\t\t -\t -\t -\t -\t<_ProjectFileVersion>10.0.30319.1 -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct -c "Test.exe" -\t\tTest.exe -\t\tDEF1;DEF2;DEF3=1234 -\t\tinc1;inc2 -\t\t$(NMakeForcedIncludes) -\t\t$(NMakeAssemblySearchPath) -\t\t$(NMakeForcedUsingAssemblies) -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t\t -\t -\t -\t\t -\t -\t -\t -\t - -""" - -expected_vcprojfile_14_1 = """\ - - -\t -\t\t -\t\t\tRelease -\t\t\tWin32 -\t\t -\t -\t -\t\t{39A97E1F-1A52-8954-A0B1-A10A8487545E} - -\t\tTest -\t\tMakeFileProj -\t -\t -\t -\t\tMakefile -\t\tfalse -\t\tv141 -\t -\t -\t -\t -\t -\t\t -\t -\t -\t -\t<_ProjectFileVersion>10.0.30319.1 -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct "Test.exe" -\t\techo Starting SCons && "" -c "" -C "" -f SConstruct -c "Test.exe" -\t\tTest.exe -\t\tDEF1;DEF2;DEF3=1234 -\t\tinc1;inc2 -\t\t$(NMakeForcedIncludes) -\t\t$(NMakeAssemblySearchPath) -\t\t$(NMakeForcedUsingAssemblies) -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t -\t -\t\t -\t\t -\t -\t -\t\t -\t -\t -\t -\t - -""" - -SConscript_contents_8_0 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='8.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - slnguid = '{SLNGUID}', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -SConscript_contents_9_0 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='9.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = ['sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcproj', - slnguid = '{SLNGUID}', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -SConscript_contents_10_0 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='10.0', +SConscript_contents_fmt = """\ +env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='%(MSVS_VERSION)s', CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], CPPPATH=['inc1', 'inc2'], HOST_ARCH='%(HOST_ARCH)s') @@ -1050,7 +622,7 @@ testlocalincs = ['test.h'] testresources = ['test.rc'] testmisc = ['readme.txt'] -env.MSVSProject(target = 'Test.vcxproj', +env.MSVSProject(target = '%(PROJECT_FILE)s', slnguid = '{SLNGUID}', srcs = testsrc, incs = testincs, @@ -1061,74 +633,14 @@ env.MSVSProject(target = 'Test.vcxproj', variant = 'Release') """ -SConscript_contents_11_0 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='11.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] +def get_tested_proj_file_vc_versions(): + """ + Returns all MSVC versions that we want to test project file creation for. + """ + #return ['8.0', '9.0', '10.0', '11.0', '12.0', '14.0', '14.1', '14.2'] + return ['9.0'] -env.MSVSProject(target = 'Test.vcxproj', - slnguid = '{SLNGUID}', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -SConscript_contents_14_0 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.0', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - slnguid = '{SLNGUID}', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" - -SConscript_contents_14_1 = """\ -env=Environment(platform='win32', tools=['msvs'], MSVS_VERSION='14.1', - CPPDEFINES=['DEF1', 'DEF2',('DEF3','1234')], - CPPPATH=['inc1', 'inc2'], - HOST_ARCH='%(HOST_ARCH)s') - -testsrc = ['test1.cpp', 'test2.cpp'] -testincs = [r'sdk_dir\\sdk.h'] -testlocalincs = ['test.h'] -testresources = ['test.rc'] -testmisc = ['readme.txt'] - -env.MSVSProject(target = 'Test.vcxproj', - slnguid = '{SLNGUID}', - srcs = testsrc, - incs = testincs, - localincs = testlocalincs, - resources = testresources, - misc = testmisc, - buildtarget = 'Test.exe', - variant = 'Release') -""" class TestSConsMSVS(TestSCons): """Subclass for testing MSVS-specific portions of SCons.""" @@ -1276,6 +788,119 @@ print("self._msvs_versions =%%s"%%str(SCons.Tool.MSCommon.query_versions())) print("--------------------------------------------------------------") print("--------------------------------------------------------------") self.fail_test() + + def parse_vc_version(self, vc_version): + """ + Parses the string vc_version to determine the major and minor version + included. + """ + components = vc_version.split('.') + major = int(components[0]) + minor = 0 if len(components) < 2 else int(components[1]) + return major, minor + + def _get_solution_file_format_version(self, vc_version): + """ + Returns the Visual Studio format version expected in the .sln file. + """ + major, _ = self.parse_vc_version(vc_version) + if major == 8: + return '9.00' + elif major == 9: + return '10.00' + elif major == 10: + return '11.00' + elif major > 10: + return '12.00' + else: + raise SCons.Errors.UserError('Received unexpected VC version %s' % vc_version) + + def _get_solution_file_vs_number(self, vc_version): + """ + Returns the Visual Studio number expected in the .sln file. + """ + major, minor = self.parse_vc_version(vc_version) + if major == 8: + return '2005' + elif major == 9: + return '2008' + if major == 10: + return '2010' + elif major == 11: + return '11' + elif major == 12: + return '14' + elif major == 14 and (minor == 0 or minor == 1): + # Visual Studio 2015 and 2017 both use 15 in this entry. + return '15' + elif major == 14 and minor == 2: + return '16' + else: + raise SCons.Errors.UserError('Received unexpected VC version %s' % vc_version) + + def _get_vcxproj_file_tools_version(self, vc_version): + """ + Returns the version entry expected in the project file. + For .vcxproj files, this goes is ToolsVersion. + For .vcproj files, this goes in Version. + """ + major, minor = self.parse_vc_version(vc_version) + if major == 8: + # Version="8.00" + return '8.00' + elif major == 9: + # Version="9.00" + return '9.00' + elif major < 14: + # ToolsVersion='4.0' + return '4.0' + elif major == 14 and minor == 0: + # ToolsVersion='14.0' + return '14.0' + elif major == 14 and minor == 1: + # ToolsVersion='15.0' + return '15.0' + elif vc_version == '14.2': + # ToolsVersion='16' + return '16.0' + else: + raise SCons.Errors.UserError('Received unexpected VC version %s' % vc_version) + + def _get_vcxproj_file_cpp_path(self, dirs): + """Returns the include paths expected in the .vcxproj file""" + return ';'.join([self.workpath(dir) for dir in dirs]) + + def get_expected_sln_file_contents(self, vc_version, project_file): + """ + Returns the expected .sln file contents. + Currently this function only supports the newer VC versions that use + the .vcxproj file format. + """ + return expected_slnfile_fmt % { + 'FORMAT_VERSION': self._get_solution_file_format_version(vc_version), + 'VS_NUMBER': self._get_solution_file_vs_number(vc_version), + 'PROJECT_NAME': project_file.split('.')[0], + 'PROJECT_FILE': project_file, + } + + def get_expected_proj_file_contents(self, vc_version, dirs, project_file): + """Returns the expected .vcxproj file contents""" + if project_file.endswith('.vcxproj'): + fmt = expected_vcxprojfile_fmt + else: + fmt = expected_vcprojfile_fmt + return fmt % { + 'TOOLS_VERSION': self._get_vcxproj_file_tools_version(vc_version), + 'INCLUDE_DIRS': self._get_vcxproj_file_cpp_path(dirs), + } + + def get_expected_sconscript_file_contents(self, vc_version, project_file): + return SConscript_contents_fmt % { + 'HOST_ARCH': self.get_vs_host_arch(), + 'MSVS_VERSION': vc_version, + 'PROJECT_FILE': project_file, + } + # Local Variables: # tab-width:4 # indent-tabs-mode:nil -- cgit v0.12 From 137d881becfe690a0a039fc7a3b15a9ecb20b8b7 Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Thu, 18 Jul 2019 16:41:17 -0400 Subject: Fix accidental removal of some VS versions My last change accidentally had several VS versions commented out in get_tested_proj_file_vc_versions(). --- testing/framework/TestSConsMSVS.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/framework/TestSConsMSVS.py b/testing/framework/TestSConsMSVS.py index 9e6e069..4b05ddd 100644 --- a/testing/framework/TestSConsMSVS.py +++ b/testing/framework/TestSConsMSVS.py @@ -638,8 +638,7 @@ def get_tested_proj_file_vc_versions(): """ Returns all MSVC versions that we want to test project file creation for. """ - #return ['8.0', '9.0', '10.0', '11.0', '12.0', '14.0', '14.1', '14.2'] - return ['9.0'] + return ['8.0', '9.0', '10.0', '11.0', '12.0', '14.0', '14.1', '14.2'] class TestSConsMSVS(TestSCons): -- cgit v0.12 From ba96ce7dffcff1fb4b07ab407a98d82a84b588bc Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Thu, 18 Jul 2019 16:44:46 -0400 Subject: Fix flake8 issues raised by sider --- test/MSVS/vs-scc-files.py | 2 -- test/MSVS/vs-scc-legacy-files.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/test/MSVS/vs-scc-files.py b/test/MSVS/vs-scc-files.py index a02ba5c..85fa27c 100644 --- a/test/MSVS/vs-scc-files.py +++ b/test/MSVS/vs-scc-files.py @@ -29,8 +29,6 @@ Test that we can generate Visual Studio 10.0 project (.vcxproj) and solution (.sln) files that contain SCC information and look correct. """ -import os - import TestSConsMSVS for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): diff --git a/test/MSVS/vs-scc-legacy-files.py b/test/MSVS/vs-scc-legacy-files.py index 813025a..8e2ca15 100644 --- a/test/MSVS/vs-scc-legacy-files.py +++ b/test/MSVS/vs-scc-legacy-files.py @@ -29,8 +29,6 @@ Test that we can generate Visual Studio 10.0 or later project (.vcxproj) and solution (.sln) files that contain SCC information and look correct. """ -import os - import TestSConsMSVS for vc_version in TestSConsMSVS.get_tested_proj_file_vc_versions(): -- cgit v0.12 From afacb7ff545d11b6db9bfb555a80e4902c27cc8d Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Fri, 19 Jul 2019 09:59:47 -0400 Subject: Integrate requested changes to msvsTests.py This change integrates changes requested by @bdbaddog to avoid using SCons.Script.Dir --- src/engine/SCons/Tool/msvsTests.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py index 3573287..cc4f717 100644 --- a/src/engine/SCons/Tool/msvsTests.py +++ b/src/engine/SCons/Tool/msvsTests.py @@ -34,6 +34,7 @@ import TestUnit from SCons.Tool.msvs import * from SCons.Tool.MSCommon.vs import SupportedVSList +import SCons.Node.FS import SCons.Util import SCons.Warnings @@ -393,6 +394,7 @@ regdata_none = [] class DummyEnv(object): def __init__(self, dict=None): + self.fs = SCons.Node.FS.FS() if dict: self.dict = dict else: @@ -422,10 +424,8 @@ class DummyEnv(object): return value def Dir(self, name): - # Depend upon SCons.Script.Dir so we can create a Directory object - # that doesn't actually exist on disk without problems or side effects. - return SCons.Script.Dir(name) - + return self.fs.Dir(name) + class RegKey(object): """key class for storing an 'open' registry key""" @@ -596,6 +596,11 @@ class msvsTestCase(unittest.TestCase): from SCons.Tool.MSCommon.vs import reset_installed_visual_studios reset_installed_visual_studios() + self.test = TestCmd.TestCmd(workdir='') + # FS doesn't like the cwd to be something other than its root. + os.chdir(self.test.workpath("")) + self.fs = SCons.Node.FS.FS() + def test_get_default_version(self): """Test retrieval of the default visual studio version""" @@ -673,7 +678,7 @@ class msvsTestCase(unittest.TestCase): 'debug=False target_arch=x64'] list_cppdefines = [['_A', '_B', 'C'], ['_B', '_C_'], ['D'], []] list_cpppaths = [[r'C:\test1'], [r'C:\test1;C:\test2'], - [DummyEnv().Dir('subdir')], []] + [self.fs.Dir('subdir')], []] def TestParamsFromList(test_variant, test_list): """ -- cgit v0.12 From 447ed918290c0cd614c22236c6c475fec6a173e8 Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Fri, 19 Jul 2019 13:55:23 -0400 Subject: [ci skip] Updated CHANGES.txt and msvs.xml documentation --- src/CHANGES.txt | 3 +++ src/engine/SCons/Tool/msvs.xml | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a491ba5..ad42104 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -9,6 +9,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From Adam Gross: + - Upgrade and improve Visual Studio solution/project generation code + From Peter Diener: - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures - Fix issue #3135 - Handle Fortran submodules and type bound procedures diff --git a/src/engine/SCons/Tool/msvs.xml b/src/engine/SCons/Tool/msvs.xml index 6467a2b..6e622a7 100644 --- a/src/engine/SCons/Tool/msvs.xml +++ b/src/engine/SCons/Tool/msvs.xml @@ -48,14 +48,16 @@ See its __doc__ string for a discussion of the format. latest installed version, or the version specified by &cv-link-MSVS_VERSION; in the Environment constructor). For Visual Studio 6, it will generate a .dsp - file. For Visual Studio 7 (.NET) and later versions, it will - generate a .vcproj file. + file. For Visual Studio 7, 8, and 9, it will + generate a .vcproj file. For Visual + Studio 10 and later, it will generate a + .vcxproj file. By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for - Visual Studio 7 (.NET). This behavior may be disabled by + Visual Studio 7 and later. This behavior may be disabled by specifying auto_build_solution=0 when you call &b-MSVSProject;, in which case you presumably want to build the solution file(s) by calling the &b-MSVSSolution; @@ -128,6 +130,36 @@ See its __doc__ string for a discussion of the format. + cppdefines + + + Preprocessor definitions for the different variants. + The number of cppdefines entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPDEFINES entry for all variants. + + + + + cpppaths + + + Compiler include paths for the different variants. + The number of cpppaths entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPPATH entry for all variants. + + + + buildtarget -- cgit v0.12 From 90435d7ff83120522db995857eff49e0e268297a Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Fri, 19 Jul 2019 15:53:07 -0400 Subject: [ci skip] MSVS doc fix and output of rerunning doc generation --- doc/generated/builders.gen | 926 +++-- doc/generated/examples/buildersbuiltin_libs_1.xml | 34 +- doc/generated/examples/buildersbuiltin_libs_2.xml | 6 +- doc/generated/examples/commandline_Default1_1.xml | 90 +- doc/generated/examples/commandline_Default1_2.xml | 35 +- doc/generated/examples/commandline_Default2_1.xml | 64 +- doc/generated/examples/commandline_Default3_1.xml | 92 +- doc/generated/examples/commandline_Default4_1.xml | 64 +- .../examples/commandline_PackageVariable_1.xml | 116 +- .../environments_Replace-nonexistent_1.xml | 33 +- doc/generated/examples/environments_missing2_1.xml | 34 +- doc/generated/examples/environments_missing3_1.xml | 33 +- doc/generated/examples/sideeffect_parallel_1.xml | 33 +- doc/generated/examples/simple_clean_1.xml | 68 +- doc/generated/examples/simple_clean_2.xml | 4 +- doc/generated/examples/sourcecode_cvs_1.xml | 34 +- doc/generated/functions.gen | 1221 +++---- doc/generated/tools.gen | 633 ++-- doc/generated/variables.gen | 3659 ++++++++------------ src/engine/SCons/Tool/msvs.xml | 4 +- 20 files changed, 3418 insertions(+), 3765 deletions(-) diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index dc05443..17bfa21 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,7 +12,7 @@ %variables-mod; ]> - + CFile() @@ -20,18 +20,17 @@ env.CFile() - - + Builds a C source file given a lex (.l) or yacc (.y) input file. -The suffix specified by the $CFILESUFFIX construction variable +The suffix specified by the $CFILESUFFIX construction variable (.c by default) is automatically added to the target if it is not already present. Example: - + # builds foo.c env.CFile(target = 'foo.c', source = 'foo.l') # builds bar.c @@ -46,13 +45,12 @@ env.CFile(target = 'bar', source = 'bar.y') env.Command() - - -The Command "Builder" is actually implemented + +The Command "Builder" is actually implemented as a function that looks like a Builder, but actually takes an additional argument of the action from which the Builder should be made. -See the Command function description +See the Command function description for the calling syntax and details. @@ -64,19 +62,18 @@ for the calling syntax and details. env.CXXFile() - - + Builds a C++ source file given a lex (.ll) or yacc (.yy) input file. -The suffix specified by the $CXXFILESUFFIX construction variable +The suffix specified by the $CXXFILESUFFIX construction variable (.cc by default) is automatically added to the target if it is not already present. Example: - + # builds foo.cc env.CXXFile(target = 'foo.cc', source = 'foo.ll') # builds bar.cc @@ -91,20 +88,19 @@ env.CXXFile(target = 'bar', source = 'bar.yy') env.DocbookEpub() - - + A pseudo-Builder, providing a Docbook toolchain for EPUB output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookEpub('manual.epub', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookEpub('manual') @@ -117,17 +113,16 @@ env.DocbookEpub('manual') env.DocbookHtml() - - + A pseudo-Builder, providing a Docbook toolchain for HTML output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual') @@ -139,35 +134,34 @@ env.DocbookHtml('manual') env.DocbookHtmlChunked() - - + A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. It supports the base.dir parameter. The chunkfast.xsl file (requires "EXSLT") is used as the default stylesheet. Basic syntax: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual') - + where manual.xml is the input file. -If you use the root.filename +If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') -Some basic support for the base.dir is provided. You +Some basic support for the base.dir is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -179,35 +173,34 @@ your files get renamed only! env.DocbookHtmlhelp() - - + A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. Its basic syntax is: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') - + where manual.xml is the input file. -If you use the root.filename +If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') -Some basic support for the base.dir parameter +Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -220,16 +213,15 @@ your files get renamed only! env.DocbookMan() - - + A pseudo-Builder, providing a Docbook toolchain for Man page output. Its basic syntax is: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookMan('manual') - + where manual.xml is the input file. Note, that you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. @@ -243,20 +235,19 @@ set from the refname entries in your XML source. env.DocbookPdf() - - + A pseudo-Builder, providing a Docbook toolchain for PDF output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookPdf('manual.pdf', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookPdf('manual') @@ -269,33 +260,32 @@ env.DocbookPdf('manual') env.DocbookSlidesHtml() - - + A pseudo-Builder, providing a Docbook toolchain for HTML slides output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual') -If you use the titlefoil.html parameter in +If you use the titlefoil.html parameter in your own stylesheets you have to give the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') -Some basic support for the base.dir parameter +Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -308,20 +298,19 @@ your files get renamed only! env.DocbookSlidesPdf() - - + A pseudo-Builder, providing a Docbook toolchain for PDF slides output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual.pdf', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual') @@ -333,12 +322,11 @@ env.DocbookSlidesPdf('manual') env.DocbookXInclude() - - + A pseudo-Builder, for resolving XIncludes in a separate processing step. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') @@ -350,16 +338,15 @@ env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') env.DocbookXslt() - - + A pseudo-Builder, applying a given XSL transformation to the input file. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') -Note, that this builder requires the xsl parameter +Note, that this builder requires the xsl parameter to be set. @@ -371,41 +358,40 @@ to be set. env.DVI() - - + Builds a .dvi file from a .tex, .ltx or .latex input file. If the source file suffix is .tex, -scons +scons will examine the contents of the file; if the string \documentclass or \documentstyle is found, the file is assumed to be a LaTeX file and -the target is built by invoking the $LATEXCOM command line; -otherwise, the $TEXCOM command line is used. +the target is built by invoking the $LATEXCOM command line; +otherwise, the $TEXCOM command line is used. If the file is a LaTeX file, the -DVI +DVI builder method will also examine the contents of the .aux -file and invoke the $BIBTEX command line +file and invoke the $BIBTEX command line if the string bibdata is found, -start $MAKEINDEX to generate an index if a +start $MAKEINDEX to generate an index if a .ind file is found and will examine the contents .log -file and re-run the $LATEXCOM command +file and re-run the $LATEXCOM command if the log file says it is necessary. - + The suffix .dvi (hard-coded within TeX itself) is automatically added to the target @@ -413,7 +399,7 @@ if it is not already present. Examples: - + # builds from aaa.tex env.DVI(target = 'aaa.dvi', source = 'aaa.tex') # builds bbb.dvi @@ -430,14 +416,13 @@ env.DVI(target = 'ccc.dvi', source = 'ccc.latex') env.Gs() - - + A Builder for explicitly calling the gs executable. Depending on the underlying OS, the different names gs, gsos2 and gswin32c are tried. -env = Environment(tools=['gs']) +env = Environment(tools=['gs']) env.Gs('cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') ) @@ -451,8 +436,7 @@ env.Gs('cover.jpg','scons-scons.pdf', env.Install() - - + Installs one or more source files or directories in the specified target, which must be a directory. @@ -462,7 +446,7 @@ sources may be given as a string or as a node returned by a builder. - + env.Install('/usr/local/bin', source = ['foo', 'bar']) @@ -474,8 +458,7 @@ env.Install('/usr/local/bin', source = ['foo', 'bar']) env.InstallAs() - - + Installs one or more source files or directories to specific names, allowing changing a file or directory name @@ -487,7 +470,7 @@ source arguments list different numbers of files or directories. - + env.InstallAs(target = '/usr/local/bin/foo', source = 'foo_debug') env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], @@ -503,13 +486,12 @@ env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], env.InstallVersionedLib() - - + Installs a versioned shared library. The symlinks appropriate to the architecture will be generated based on symlinks of the source library. - + env.InstallVersionedLib(target = '/usr/local/bin/foo', source = 'libxyz.1.5.2.so') @@ -522,41 +504,40 @@ env.InstallVersionedLib(target = '/usr/local/bin/foo', env.Jar() - - + Builds a Java archive (.jar) file from the specified list of sources. Any directories in the source list will be searched for .class files). Any .java files in the source list will be compiled to .class files -by calling the Java Builder. +by calling the Java Builder. - -If the $JARCHDIR value is set, the -jar + +If the $JARCHDIR value is set, the +jar command will change to the specified directory using the option. -If $JARCHDIR is not set explicitly, -SCons will use the top of any subdirectory tree +If $JARCHDIR is not set explicitly, +SCons will use the top of any subdirectory tree in which Java .class -were built by the Java Builder. +were built by the Java Builder. - + If the contents any of the source files begin with the string Manifest-Version, the file is assumed to be a manifest and is passed to the -jar +jar command with the option set. - + env.Jar(target = 'foo.jar', source = 'classes') env.Jar(target = 'bar.jar', @@ -571,8 +552,7 @@ env.Jar(target = 'bar.jar', env.Java() - - + Builds one or more Java class files. The sources may be any combination of explicit .java @@ -581,7 +561,7 @@ env.Jar(target = 'bar.jar', for .java files. - + SCons will parse each source .java file to find the classes (including inner classes) @@ -592,7 +572,7 @@ env.Jar(target = 'bar.jar', the specified target directory. - + SCons will also search each Java file for the Java package name, which it assumes can be found on a line @@ -615,17 +595,17 @@ env.Jar(target = 'bar.jar', class file. - + Examples: - + env.Java(target = 'classes', source = 'src') env.Java(target = 'classes', source = ['src1', 'src2']) env.Java(target = 'classes', source = ['File1.java', 'File2.java']) - + Java source files can use the native encoding for the underlying OS. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, @@ -638,7 +618,7 @@ env.Jar(target = 'bar.jar', with a different encoding. - + env = Environment() env['ENV']['LANG'] = 'en_GB.UTF-8' @@ -651,8 +631,7 @@ env.Jar(target = 'bar.jar', env.JavaH() - - + Builds C header and source files for implementing Java native methods. The target can be either a directory @@ -662,29 +641,29 @@ will contain all of the definitions. The source can be the names of .class files, the names of .java files to be compiled into .class files -by calling the Java builder method, +by calling the Java builder method, or the objects returned from the -Java +Java builder method. - + If the construction variable -$JAVACLASSDIR +$JAVACLASSDIR is set, either in the environment or in the call to the -JavaH +JavaH builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. - + Examples: - + # builds java_native.h classes = env.Java(target = 'classdir', source = 'src') env.JavaH(target = 'java_native.h', source = classes) @@ -707,10 +686,9 @@ env.JavaH(target = 'export', env.Library() - - + A synonym for the -StaticLibrary +StaticLibrary builder method. @@ -722,11 +700,10 @@ builder method. env.LoadableModule() - - + On most systems, this is the same as -SharedLibrary. +SharedLibrary. On Mac OS X (Darwin) platforms, this creates a loadable module bundle. @@ -739,10 +716,9 @@ this creates a loadable module bundle. env.M4() - - + Builds an output file from an M4 input file. -This uses a default $M4FLAGS value of +This uses a default $M4FLAGS value of , which considers all warnings to be fatal and stops on the first warning @@ -750,7 +726,7 @@ when using the GNU version of m4. Example: - + env.M4(target = 'foo.c', source = 'foo.c.m4') @@ -762,15 +738,14 @@ env.M4(target = 'foo.c', source = 'foo.c.m4') env.Moc() - - + Builds an output file from a moc input file. Moc input files are either header files or cxx files. This builder is only available after using the -tool 'qt'. See the $QTDIR variable for more information. +tool 'qt'. See the $QTDIR variable for more information. Example: - + env.Moc('foo.h') # generates moc_foo.cc env.Moc('foo.cpp') # generates foo.moc @@ -783,48 +758,47 @@ env.Moc('foo.cpp') # generates foo.moc env.MOFiles() - - -This builder belongs to msgfmt tool. The builder compiles + +This builder belongs to msgfmt tool. The builder compiles PO files to MO files. - + Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: - + # ... env.MOFiles(['pl', 'en']) - + Example 2. Compile files for languages defined in LINGUAS file: - + # ... env.MOFiles(LINGUAS_FILE = 1) - + Example 3. Create pl.mo and en.mo by compiling pl.po and en.po plus files for languages defined in LINGUAS file: - + # ... env.MOFiles(['pl', 'en'], LINGUAS_FILE = 1) - + Example 4. Compile files for languages defined in LINGUAS file (another version): - + # ... env['LINGUAS_FILE'] = 1 env.MOFiles() @@ -838,52 +812,53 @@ Compile files for languages defined in LINGUAS file env.MSVSProject() - - + Builds a Microsoft Visual Studio project file, and by default builds a solution file as well. - + This builds a Visual Studio project file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by - $MSVS_VERSION in the Environment constructor). For + $MSVS_VERSION in the Environment constructor). For Visual Studio 6, it will generate a .dsp - file. For Visual Studio 7 (.NET) and later versions, it will - generate a .vcproj file. + file. For Visual Studio 7, 8, and 9, it will + generate a .vcproj file. For Visual + Studio 10 and later, it will generate a + .vcxproj file. - + By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for - Visual Studio 7 (.NET). This behavior may be disabled by + Visual Studio 7 and later. This behavior may be disabled by specifying auto_build_solution=0 when you - call MSVSProject, in which case you presumably want to - build the solution file(s) by calling the MSVSSolution + call MSVSProject, in which case you presumably want to + build the solution file(s) by calling the MSVSSolution Builder (see below). - - The MSVSProject builder takes several lists of filenames + + The MSVSProject builder takes several lists of filenames to be placed into the project file. These are currently limited to srcs, incs, localincs, resources, and misc. These are pretty self-explanatory, but it should be noted that these lists are added to the - $SOURCES construction variable as strings, NOT as + $SOURCES construction variable as strings, NOT as SCons File Nodes. This is because they represent file names to be added to the project file, not the source files used to build the project file. - + The above filename lists are all optional, although at least one must be specified for the resulting project file to be non-empty. - + In addition to the above lists of values, the following values may be specified: - + target @@ -891,7 +866,7 @@ Compile files for languages defined in LINGUAS file The name of the target .dsp or .vcproj file. The correct suffix for the version of Visual Studio - must be used, but the $MSVSPROJECTSUFFIX + must be used, but the $MSVSPROJECTSUFFIX construction variable will be defined to the correct value (see example below). @@ -909,7 +884,7 @@ Compile files for languages defined in LINGUAS file separated from the variant name by a | (vertical pipe) character: Debug|Xbox. The default target platform is Win32. Multiple calls - to MSVSProject with different variants are allowed; + to MSVSProject with different variants are allowed; all variants will be added to the project file with their appropriate build targets and sources. @@ -929,6 +904,36 @@ Compile files for languages defined in LINGUAS file + cppdefines + + + Preprocessor definitions for the different variants. + The number of cppdefines entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPDEFINES entry for all variants. + + + + + cpppaths + + + Compiler include paths for the different variants. + The number of cpppaths entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPPATH entry for all variants. + + + + buildtarget @@ -955,20 +960,20 @@ Compile files for languages defined in LINGUAS file - - Note that because SCons always executes its build commands - from the directory in which the SConstruct file is located, + + Note that because SCons always executes its build commands + from the directory in which the SConstruct file is located, if you generate a project file in a different directory - than the SConstruct directory, users will not be able to + than the SConstruct directory, users will not be able to double-click on the file name in compilation error messages displayed in the Visual Studio console output window. This can be remedied by adding the Visual C/C++ /FC - compiler option to the $CCFLAGS variable so that + compiler option to the $CCFLAGS variable so that the compiler will print the full path name of any files that cause compilation errors. - Example usage: - + Example usage: + barsrcs = ['bar.cpp'] barincs = ['bar.h'] barlocalincs = ['StdAfx.h'] @@ -987,13 +992,13 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], buildtarget=buildtarget, variant='Release') - + Starting with version 2.4 of SCons it is also possible to specify the optional argument DebugSettings, which creates files for debugging under Visual Studio: - + DebugSettings @@ -1009,7 +1014,7 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], - + Currently, only Visual Studio v9.0 and Visual Studio version v11 are implemented, for other versions no file is generated. To generate the user file, you just need to @@ -1018,11 +1023,11 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], the dictionary is empty, or does not contain any good value, no file will be generated. - + Following is a more contrived example, involving the setup of a project for variants and DebugSettings: - + # Assuming you store your defaults in a file vars = Variables('variables.py') msvcver = vars.args.get('vc', '9') @@ -1146,26 +1151,25 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], env.MSVSSolution() - - Builds a Microsoft Visual Studio solution file. - + Builds a Microsoft Visual Studio solution file. + This builds a Visual Studio solution file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by - $MSVS_VERSION in the construction environment). For + $MSVS_VERSION in the construction environment). For Visual Studio 6, it will generate a .dsw file. For Visual Studio 7 (.NET), it will generate a .sln file. - The following values must be specified: - + The following values must be specified: + target The name of the target .dsw or .sln file. The correct suffix for the version of Visual Studio must be used, - but the value $MSVSSOLUTIONSUFFIX will be + but the value $MSVSSOLUTIONSUFFIX will be defined to the correct value (see example below). @@ -1184,7 +1188,7 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], projects A list of project file names, or Project nodes returned - by calls to the MSVSProject Builder, to be placed + by calls to the MSVSProject Builder, to be placed into the solution file. It should be noted that these file names are NOT added to the $SOURCES environment variable in form of files, but rather as strings. @@ -1195,8 +1199,8 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], - Example Usage: - + Example Usage: + env.MSVSSolution(target='Bar' + env['MSVSSOLUTIONSUFFIX'], projects=['bar' + env['MSVSPROJECTSUFFIX']], variant='Release') @@ -1208,10 +1212,9 @@ env.MSVSSolution(target='Bar' + env['MSVSSOLUTIONSUFFIX'], projects=['bar' + env env.Object() - - + A synonym for the -StaticObject +StaticObject builder method. @@ -1223,41 +1226,39 @@ builder method. env.Package() - - + Builds a Binary Package of the given source files. - + env.Package(source = FindInstalledFiles()) - - + Builds software distribution packages. Packages consist of files to install and packaging information. -The former may be specified with the source parameter and may be left out, -in which case the FindInstalledFiles function will collect -all files that have an Install or InstallAs Builder attached. -If the target is not specified +The former may be specified with the source parameter and may be left out, +in which case the FindInstalledFiles function will collect +all files that have an Install or InstallAs Builder attached. +If the target is not specified it will be deduced from additional information given to this Builder. - + The packaging information is specified with the help of construction variables documented below. This information is called a tag to stress that -some of them can also be attached to files with the Tag function. +some of them can also be attached to files with the Tag function. The mandatory ones will complain if they were not specified. They vary depending on chosen target packager. - + The target packager may be selected with the "PACKAGETYPE" command line -option or with the $PACKAGETYPE construction variable. Currently +option or with the $PACKAGETYPE construction variable. Currently the following packagers available: - + * msi - Microsoft Installer * rpm - RPM Package Manger * ipkg - Itsy Package Management System @@ -1271,11 +1272,11 @@ the following packagers available: * src_zip - zip file source - + An updated list is always available under the "package_type" option when running "scons --help" on a project that has packaging activated. - + env = Environment(tools=['default', 'packaging']) env.Install('/bin/', 'my_program') env.Package( NAME = 'foo', @@ -1298,8 +1299,7 @@ env.Package( NAME = 'foo', env.PCH() - - + Builds a Microsoft Visual C++ precompiled header. Calling this builder method returns a list of two targets: the PCH as the first element, and the object @@ -1311,7 +1311,7 @@ conjunction with the PCH construction variable to force object files to use the precompiled header: - + env['PCH'] = env.PCH('StdAfx.cpp')[0] @@ -1323,21 +1323,20 @@ env['PCH'] = env.PCH('StdAfx.cpp')[0] env.PDF() - - + Builds a .pdf file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). -The suffix specified by the $PDFSUFFIX construction variable +The suffix specified by the $PDFSUFFIX construction variable (.pdf by default) is added automatically to the target if it is not already present. Example: - + # builds from aaa.tex env.PDF(target = 'aaa.pdf', source = 'aaa.tex') # builds bbb.pdf from bbb.dvi @@ -1352,100 +1351,99 @@ env.PDF(target = 'bbb', source = 'bbb.dvi') env.POInit() - - -This builder belongs to msginit tool. The builder initializes missing -PO file(s) if $POAUTOINIT is set. If -$POAUTOINIT is not set (default), POInit prints instruction for + +This builder belongs to msginit tool. The builder initializes missing +PO file(s) if $POAUTOINIT is set. If +$POAUTOINIT is not set (default), POInit prints instruction for user (that is supposed to be a translator), telling how the PO file should be initialized. In normal projects -you should not use POInit and use POUpdate -instead. POUpdate chooses intelligently between -msgmerge(1) and msginit(1). POInit +you should not use POInit and use POUpdate +instead. POUpdate chooses intelligently between +msgmerge(1) and msginit(1). POInit always uses msginit(1) and should be regarded as builder for special purposes or for temporary use (e.g. for quick, one time initialization of a bunch of PO files) or for tests. - -Target nodes defined through POInit are not built by default (they're + +Target nodes defined through POInit are not built by default (they're Ignored from '.' node) but are added to special Alias ('po-create' by default). -The alias name may be changed through the $POCREATE_ALIAS +The alias name may be changed through the $POCREATE_ALIAS construction variable. All PO files defined through -POInit may be easily initialized by scons po-create. +POInit may be easily initialized by scons po-create. - + Example 1. Initialize en.po and pl.po from messages.pot: - + # ... env.POInit(['en', 'pl']) # messages.pot --> [en.po, pl.po] - + Example 2. Initialize en.po and pl.po from foo.pot: - + # ... env.POInit(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.po] - + Example 3. Initialize en.po and pl.po from -foo.pot but using $POTDOMAIN construction +foo.pot but using $POTDOMAIN construction variable: - + # ... env.POInit(['en', 'pl'], POTDOMAIN='foo') # foo.pot --> [en.po, pl.po] - + Example 4. Initialize PO files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: - + # ... env.POInit(LINGUAS_FILE = 1) # needs 'LINGUAS' file - + Example 5. Initialize en.po and pl.pl PO files plus files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: - + # ... env.POInit(['en', 'pl'], LINGUAS_FILE = 1) - + Example 6. You may preconfigure your environment first, and then initialize PO files: - + # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POInit() - + which has same efect as: - + # ... env.POInit(POAUTOINIT = 1, LINGUAS_FILE = 1, POTDOMAIN = 'foo') @@ -1458,21 +1456,20 @@ which has same efect as: env.PostScript() - - + Builds a .ps file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). -The suffix specified by the $PSSUFFIX construction variable +The suffix specified by the $PSSUFFIX construction variable (.ps by default) is added automatically to the target if it is not already present. Example: - + # builds from aaa.tex env.PostScript(target = 'aaa.ps', source = 'aaa.tex') # builds bbb.ps from bbb.dvi @@ -1487,24 +1484,23 @@ env.PostScript(target = 'bbb', source = 'bbb.dvi') env.POTUpdate() - - -The builder belongs to xgettext tool. The builder updates target + +The builder belongs to xgettext tool. The builder updates target POT file if exists or creates one if it doesn't. The node is not built by default (i.e. it is Ignored from '.'), but only on demand (i.e. when given POT file is required or when special alias is invoked). This builder adds its targe node (messages.pot, say) to a special alias (pot-update by default, see -$POTUPDATE_ALIAS) so you can update/create them easily with +$POTUPDATE_ALIAS) so you can update/create them easily with scons pot-update. The file is not written until there is no real change in internationalized messages (or in comments that enter POT file). - + You may see xgettext(1) being invoked by the -xgettext tool even if there is no real change in internationalized +xgettext tool even if there is no real change in internationalized messages (so the POT file is not being updated). This happens every time a source file has changed. In such case we invoke xgettext(1) and compare its output with the content of @@ -1512,38 +1508,38 @@ happens every time a source file has changed. In such case we invoke not. - + Example 1. Let's create po/ directory and place following SConstruct script there: - + # SConstruct in 'po/' subdir env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(['foo'], ['../a.cpp', '../b.cpp']) env.POTUpdate(['bar'], ['../c.cpp', '../d.cpp']) - + Then invoke scons few times: - + user@host:$ scons # Does not create foo.pot nor bar.pot user@host:$ scons foo.pot # Updates or creates foo.pot user@host:$ scons pot-update # Updates or creates foo.pot and bar.pot user@host:$ scons -c # Does not clean foo.pot nor bar.pot. - + the results shall be as the comments above say. - + Example 2. -The POTUpdate builder may be used with no target specified, in which +The POTUpdate builder may be used with no target specified, in which case default target messages.pot will be used. The -default target may also be overridden by setting $POTDOMAIN construction -variable or providing it as an override to POTUpdate builder: +default target may also be overridden by setting $POTDOMAIN construction +variable or providing it as an override to POTUpdate builder: - + # SConstruct script env = Environment( tools = ['default', 'xgettext'] ) env['POTDOMAIN'] = "foo" @@ -1551,49 +1547,49 @@ variable or providing it as an override to - + Example 3. The sources may be specified within separate file, for example POTFILES.in: - + # POTFILES.in in 'po/' subdirectory ../a.cpp ../b.cpp # end of file - + The name of the file (POTFILES.in) containing the list of -sources is provided via $XGETTEXTFROM: +sources is provided via $XGETTEXTFROM: - + # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in') - + Example 4. -You may use $XGETTEXTPATH to define source search path. Assume, for +You may use $XGETTEXTPATH to define source search path. Assume, for example, that you have files a.cpp, b.cpp, po/SConstruct, po/POTFILES.in. Then your POT-related files could look as below: - + # POTFILES.in in 'po/' subdirectory a.cpp b.cpp # end of file - + # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH='../') - + Example 5. Multiple search directories may be defined within a list, i.e. XGETTEXTPATH = ['dir1', 'dir2', ...]. The order in the list @@ -1601,48 +1597,48 @@ determines the search order of source files. The path to the first file found is used. - + Let's create 0/1/po/SConstruct script: - + # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../', '../../']) - + and 0/1/po/POTFILES.in: - + # POTFILES.in in '0/1/po/' subdirectory a.cpp # end of file - + Write two *.cpp files, the first one is 0/a.cpp: - + /* 0/a.cpp */ gettext("Hello from ../../a.cpp") - + and the second is 0/1/a.cpp: - + /* 0/1/a.cpp */ gettext("Hello from ../a.cpp") - + then run scons. You'll obtain 0/1/po/messages.pot with the message "Hello from ../a.cpp". When you reverse order in $XGETTEXTFOM, i.e. when you write SConscript as - + # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../../', '../']) - + then the messages.pot will contain msgid "Hello from ../../a.cpp" line and not msgid "Hello from ../a.cpp". @@ -1657,107 +1653,106 @@ then the messages.pot will contain env.POUpdate() - - -The builder belongs to msgmerge tool. The builder updates + +The builder belongs to msgmerge tool. The builder updates PO files with msgmerge(1), or initializes missing PO files as described in documentation of -msginit tool and POInit builder (see also -$POAUTOINIT). Note, that POUpdate does not add its -targets to po-create alias as POInit +msginit tool and POInit builder (see also +$POAUTOINIT). Note, that POUpdate does not add its +targets to po-create alias as POInit does. - -Target nodes defined through POUpdate are not built by default + +Target nodes defined through POUpdate are not built by default (they're Ignored from '.' node). Instead, they are added automatically to special Alias ('po-update' by default). The alias name may be changed -through the $POUPDATE_ALIAS construction variable. You can easily +through the $POUPDATE_ALIAS construction variable. You can easily update PO files in your project by scons po-update. - + Example 1. Update en.po and pl.po from -messages.pot template (see also $POTDOMAIN), +messages.pot template (see also $POTDOMAIN), assuming that the later one exists or there is rule to build it (see -POTUpdate): +POTUpdate): - + # ... env.POUpdate(['en','pl']) # messages.pot --> [en.po, pl.po] - + Example 2. Update en.po and pl.po from foo.pot template: - + # ... env.POUpdate(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.pl] - + Example 3. Update en.po and pl.po from foo.pot (another version): - + # ... env.POUpdate(['en', 'pl'], POTDOMAIN='foo') # foo.pot -- > [en.po, pl.pl] - + Example 4. Update files for languages defined in LINGUAS file. The files are updated from messages.pot template: - + # ... env.POUpdate(LINGUAS_FILE = 1) # needs 'LINGUAS' file - + Example 5. Same as above, but update from foo.pot template: - + # ... env.POUpdate(LINGUAS_FILE = 1, source = ['foo']) - + Example 6. Update en.po and pl.po plus files for languages defined in LINGUAS file. The files are updated from messages.pot template: - + # produce 'en.po', 'pl.po' + files defined in 'LINGUAS': env.POUpdate(['en', 'pl' ], LINGUAS_FILE = 1) - + Example 7. -Use $POAUTOINIT to automatically initialize PO file +Use $POAUTOINIT to automatically initialize PO file if it doesn't exist: - + # ... env.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1) - + Example 8. Update PO files for languages defined in LINGUAS file. The files are updated from foo.pot template. All necessary settings are pre-configured via environment. - + # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 @@ -1774,29 +1769,28 @@ pre-configured via environment. env.Program() - - + Builds an executable given one or more object files or C, C++, D, or Fortran source files. If any C, C++, D or Fortran source files are specified, then they will be automatically compiled to object files using the -Object +Object builder method; see that builder method's description for a list of legal source file suffixes and how they are interpreted. The target executable file prefix -(specified by the $PROGPREFIX construction variable; nothing by default) +(specified by the $PROGPREFIX construction variable; nothing by default) and suffix -(specified by the $PROGSUFFIX construction variable; +(specified by the $PROGSUFFIX construction variable; by default, .exe on Windows systems, nothing on POSIX systems) are automatically added to the target if not already present. Example: - + env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) @@ -1808,67 +1802,64 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) env.ProgramAllAtOnce() - - + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. - - + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. - - + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others @@ -1883,8 +1874,7 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) env.RES() - - + Builds a Microsoft Visual C++ resource file. This builder method is only provided when Microsoft Visual C++ or MinGW is being used as the compiler. The @@ -1897,7 +1887,7 @@ file is scanned for implicit dependencies as though it were a C file. Example: - + env.RES('resource.rc') @@ -1909,8 +1899,7 @@ env.RES('resource.rc') env.RMIC() - - + Builds stub and skeleton class files for remote objects from Java .class files. @@ -1919,16 +1908,16 @@ relative to which the stub and skeleton class files will be written. The source can be the names of .class files, or the objects return from the -Java +Java builder method. - + If the construction variable -$JAVACLASSDIR +$JAVACLASSDIR is set, either in the environment or in the call to the -RMIC +RMIC builder method itself, then the value of the variable will be stripped from the @@ -1936,7 +1925,7 @@ beginning of any .class file names. - + classes = env.Java(target = 'classdir', source = 'src') env.RMIC(target = 'outdir1', source = classes) @@ -1956,8 +1945,7 @@ env.RMIC(target = 'outdir3', env.RPCGenClient() - - + Generates an RPC client stub (_clnt.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -1966,7 +1954,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_clnt.c env.RPCGenClient('src/rpcif.x') @@ -1979,8 +1967,7 @@ env.RPCGenClient('src/rpcif.x') env.RPCGenHeader() - - + Generates an RPC header (.h) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -1989,7 +1976,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif.h env.RPCGenHeader('src/rpcif.x') @@ -2002,8 +1989,7 @@ env.RPCGenHeader('src/rpcif.x') env.RPCGenService() - - + Generates an RPC server-skeleton (_svc.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -2012,7 +1998,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_svc.c env.RPCGenClient('src/rpcif.x') @@ -2025,8 +2011,7 @@ env.RPCGenClient('src/rpcif.x') env.RPCGenXDR() - - + Generates an RPC XDR routine (_xdr.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -2035,7 +2020,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_xdr.c env.RPCGenClient('src/rpcif.x') @@ -2048,8 +2033,7 @@ env.RPCGenClient('src/rpcif.x') env.SharedLibrary() - - + Builds a shared library (.so on a POSIX system, .dll on Windows) @@ -2061,24 +2045,24 @@ compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix -(specified by the $SHLIBPREFIX construction variable; +(specified by the $SHLIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix -(specified by the $SHLIBSUFFIX construction variable; +(specified by the $SHLIBSUFFIX construction variable; by default, .dll on Windows systems, .so on POSIX systems) are automatically added to the target if not already present. Example: - + env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o']) - + On Windows systems, the -SharedLibrary +SharedLibrary builder method will always build an import (.lib) library in addition to the shared (.dll) library, @@ -2087,9 +2071,9 @@ if there is not already a .lib file explicitly listed in the targets. - + On Cygwin systems, the -SharedLibrary +SharedLibrary builder method will always build an import (.dll.a) library in addition to the shared (.dll) library, @@ -2098,36 +2082,36 @@ if there is not already a .dll.a file explicitly listed in the targets. - + Any object files listed in the source must have been built for a shared library (that is, using the -SharedObject +SharedObject builder method). -scons +scons will raise an error if there is any mismatch. - + On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action). -For maximum portability, use the LoadableModule builder for the latter. +For maximum portability, use the LoadableModule builder for the latter. - -When the $SHLIBVERSION construction variable is defined a versioned -shared library is created. This modifies the $SHLINKFLAGS as required, + +When the $SHLIBVERSION construction variable is defined a versioned +shared library is created. This modifies the $SHLINKFLAGS as required, adds the version number to the library name, and creates the symlinks that are needed. - + env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') - + On a POSIX system, versions with a single token create exactly one symlink: libbar.so.6 would have symlinks libbar.so only. On a POSIX system, versions with two or more @@ -2136,28 +2120,28 @@ libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be libbar.2.3.1.dylib and the link would be libbar.dylib. - + On Windows systems, specifying register=1 will cause the .dll to be registered after it is built using REGSVR32. The command that is run -("regsvr32" by default) is determined by $REGSVR construction -variable, and the flags passed are determined by $REGSVRFLAGS. By -default, $REGSVRFLAGS includes the option, +("regsvr32" by default) is determined by $REGSVR construction +variable, and the flags passed are determined by $REGSVRFLAGS. By +default, $REGSVRFLAGS includes the option, to prevent dialogs from popping up and requiring user attention when it is run. If you change -$REGSVRFLAGS, be sure to include the option. +$REGSVRFLAGS, be sure to include the option. For example, - + env.SharedLibrary(target = 'bar', source = ['bar.cxx', 'foo.obj'], register=1) - + will register bar.dll as a COM object when it is done linking it. @@ -2170,13 +2154,12 @@ when it is done linking it. env.SharedObject() - - + Builds an object file for inclusion in a shared library. Source files must have one of the same set of extensions specified above for the -StaticObject +StaticObject builder method. On some platforms building a shared object requires additional compiler option @@ -2191,21 +2174,21 @@ and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects. The target object file prefix -(specified by the $SHOBJPREFIX construction variable; -by default, the same as $OBJPREFIX) +(specified by the $SHOBJPREFIX construction variable; +by default, the same as $OBJPREFIX) and suffix -(specified by the $SHOBJSUFFIX construction variable) +(specified by the $SHOBJSUFFIX construction variable) are automatically added to the target if not already present. Examples: - + env.SharedObject(target = 'ddd', source = 'ddd.c') env.SharedObject(target = 'eee.o', source = 'eee.cpp') env.SharedObject(target = 'fff.obj', source = 'fff.for') - + Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner @@ -2222,8 +2205,7 @@ below, for more information. env.StaticLibrary() - - + Builds a static library given one or more object files or C, C++, D or Fortran source files. If any source files are given, @@ -2232,29 +2214,29 @@ compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix -(specified by the $LIBPREFIX construction variable; +(specified by the $LIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix -(specified by the $LIBSUFFIX construction variable; +(specified by the $LIBSUFFIX construction variable; by default, .lib on Windows systems, .a on POSIX systems) are automatically added to the target if not already present. Example: - + env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o']) - + Any object files listed in the source must have been built for a static library (that is, using the -StaticObject +StaticObject builder method). -scons +scons will raise an error if there is any mismatch. @@ -2266,14 +2248,13 @@ will raise an error if there is any mismatch. env.StaticObject() - - + Builds a static object file from one or more C, C++, D, or Fortran source files. Source files must have one of the following extensions: - + .asm assembly language file .ASM assembly language file .c C file @@ -2304,24 +2285,24 @@ Source files must have one of the following extensions: .SPP assembly language file + C pre-processor - + The target object file prefix -(specified by the $OBJPREFIX construction variable; nothing by default) +(specified by the $OBJPREFIX construction variable; nothing by default) and suffix -(specified by the $OBJSUFFIX construction variable; +(specified by the $OBJSUFFIX construction variable; .obj on Windows systems, .o on POSIX systems) are automatically added to the target if not already present. Examples: - + env.StaticObject(target = 'aaa', source = 'aaa.c') env.StaticObject(target = 'bbb.o', source = 'bbb.c++') env.StaticObject(target = 'ccc.obj', source = 'ccc.f') - + Note that the source files will be scanned according to the suffix mappings in SourceFileScanner @@ -2338,28 +2319,27 @@ below, for more information. env.Substfile() - - -The Substfile builder creates a single text file from another file or set of -files by concatenating them with $LINESEPARATOR and replacing text -using the $SUBST_DICT construction variable. Nested lists of source files -are flattened. See also Textfile. + +The Substfile builder creates a single text file from another file or set of +files by concatenating them with $LINESEPARATOR and replacing text +using the $SUBST_DICT construction variable. Nested lists of source files +are flattened. See also Textfile. - + If a single source file is present with an .in suffix, the suffix is stripped and the remainder is used as the default target name. - -The prefix and suffix specified by the $SUBSTFILEPREFIX -and $SUBSTFILESUFFIX construction variables + +The prefix and suffix specified by the $SUBSTFILEPREFIX +and $SUBSTFILESUFFIX construction variables (the null string by default in both cases) are automatically added to the target if they are not already present. - -If a construction variable named $SUBST_DICT is present, + +If a construction variable named $SUBST_DICT is present, it may be either a Python dictionary or a sequence of (key,value) tuples. If it is a dictionary it is converted into a list of tuples in an arbitrary order, so if one key is a prefix of another key @@ -2367,7 +2347,7 @@ or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur. - + Any occurrences of a key in the source are replaced by the corresponding value, which may be a Python callable function or a string. @@ -2376,7 +2356,7 @@ Strings are subst-expanded and the result replaces the key. - + env = Environment(tools=['default']) env['prefix'] = '/usr/bin' @@ -2428,13 +2408,12 @@ subst.Substfile('pgm2.c', [Value('#include "@foo@.h"'), env.Tar() - - + Builds a tar archive of the specified files and/or directories. Unlike most builder methods, the -Tar +Tar builder method may be called multiple times for a given target; each additional call @@ -2444,11 +2423,11 @@ Any source directories will be scanned for changes to any on-disk files, regardless of whether or not -scons +scons knows about them from other Builder or function calls. - + env.Tar('src.tar', 'src') # Create the stuff.tar file. @@ -2474,29 +2453,28 @@ env.Tar('foo') env.Textfile() - - -The Textfile builder generates a single text file. + +The Textfile builder generates a single text file. The source strings constitute the lines; nested lists of sources are flattened. -$LINESEPARATOR is used to separate the strings. +$LINESEPARATOR is used to separate the strings. - -If present, the $SUBST_DICT construction variable + +If present, the $SUBST_DICT construction variable is used to modify the strings before they are written; -see the Substfile description for details. +see the Substfile description for details. - -The prefix and suffix specified by the $TEXTFILEPREFIX -and $TEXTFILESUFFIX construction variables + +The prefix and suffix specified by the $TEXTFILEPREFIX +and $TEXTFILESUFFIX construction variables (the null string and .txt by default, respectively) are automatically added to the target if they are not already present. Examples: - + # builds/writes foo.txt env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) @@ -2545,50 +2523,49 @@ blob.txt env.Translate() - - -This pseudo-builder belongs to gettext toolset. The builder extracts + +This pseudo-builder belongs to gettext toolset. The builder extracts internationalized messages from source files, updates POT template (if necessary) and then updates PO translations (if -necessary). If $POAUTOINIT is set, missing PO files +necessary). If $POAUTOINIT is set, missing PO files will be automatically created (i.e. without translator person intervention). -The variables $LINGUAS_FILE and $POTDOMAIN are taken into -acount too. All other construction variables used by POTUpdate, and -POUpdate work here too. +The variables $LINGUAS_FILE and $POTDOMAIN are taken into +acount too. All other construction variables used by POTUpdate, and +POUpdate work here too. - + Example 1. The simplest way is to specify input files and output languages inline in -a SCons script when invoking Translate +a SCons script when invoking Translate - + # SConscript in 'po/' directory env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env.Translate(['en','pl'], ['../a.cpp','../b.cpp']) - + Example 2. If you wish, you may also stick to conventional style known from autotools, i.e. using POTFILES.in and LINGUAS files - + # LINGUAS en pl #end - + # POTFILES.in a.cpp b.cpp # end - + # SConscript env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 @@ -2596,7 +2573,7 @@ env['XGETTEXTPATH'] = ['../'] env.Translate(LINGUAS_FILE = 1, XGETTEXTFROM = 'POTFILES.in') - + The last approach is perhaps the recommended one. It allows easily split internationalization/localization onto separate SCons scripts, where a script in source tree is responsible for translations (from sources to @@ -2613,11 +2590,11 @@ so the source tree looks familiar to translators, and they may work with the project in their usual way. - + Example 3. Let's prepare a development tree as below - + project/ + SConstruct + build/ @@ -2628,11 +2605,11 @@ Let's prepare a development tree as below + POTFILES.in + LINGUAS - + with build being variant directory. Write the top-level SConstruct script as follows - + # SConstruct env = Environment( tools = ["default", "gettext"] ) VariantDir('build', 'src', duplicate = 0) @@ -2640,23 +2617,23 @@ with build being variant directory. Write the top-level SConscript('src/po/SConscript.i18n', exports = 'env') SConscript('build/po/SConscript', exports = 'env') - + the src/po/SConscript.i18n as - + # src/po/SConscript.i18n Import('env') env.Translate(LINGUAS_FILE=1, XGETTEXTFROM='POTFILES.in', XGETTEXTPATH=['../']) - + and the src/po/SConscript - + # src/po/SConscript Import('env') env.MOFiles(LINGUAS_FILE = 1) - + Such setup produces POT and PO files under source tree in src/po/ and binary MO files under variant tree in @@ -2666,7 +2643,7 @@ not be committed back to source repositories (e.g. MO files). - + In above example, the PO files are not updated, nor created automatically when you issue scons '.' command. The files must be updated (created) by hand via scons @@ -2683,8 +2660,7 @@ running scons '.'. env.TypeLibrary() - - + Builds a Windows type library (.tlb) file from an input IDL file (.idl). In addition, it will build the associated interface stub and @@ -2693,11 +2669,11 @@ naming them according to the base name of the .idl file. For example, - + env.TypeLibrary(source="foo.idl") - + Will create foo.tlb, foo.h, foo_i.c, @@ -2715,22 +2691,21 @@ files. env.Uic() - - + Builds a header file, an implementation file and a moc file from an ui file. and returns the corresponding nodes in the above order. This builder is only available after using the tool 'qt'. Note: you can specify .ui files directly as source -files to the Program, -Library and SharedLibrary builders +files to the Program, +Library and SharedLibrary builders without using this builder. Using this builder lets you override the standard naming conventions (be careful: prefixes are always prepended to names of built files; if you don't want prefixes, you may set them to ``). -See the $QTDIR variable for more information. +See the $QTDIR variable for more information. Example: - + env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc'] @@ -2744,13 +2719,12 @@ env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), env.Zip() - - + Builds a zip archive of the specified files and/or directories. Unlike most builder methods, the -Zip +Zip builder method may be called multiple times for a given target; each additional call @@ -2760,11 +2734,11 @@ Any source directories will be scanned for changes to any on-disk files, regardless of whether or not -scons +scons knows about them from other Builder or function calls. - + env.Zip('src.zip', 'src') # Create the stuff.zip file. diff --git a/doc/generated/examples/buildersbuiltin_libs_1.xml b/doc/generated/examples/buildersbuiltin_libs_1.xml index 8e1ee49..8b44352 100644 --- a/doc/generated/examples/buildersbuiltin_libs_1.xml +++ b/doc/generated/examples/buildersbuiltin_libs_1.xml @@ -1,6 +1,30 @@ - -% scons -Q -cc -o goodbye.o -c goodbye.c -cc -o hello.o -c hello.c -cc -o hello hello.o goodbye.o -L/usr/dir1 -Ldir2 -lfoo1 -lfoo2 + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/buildersbuiltin_libs_2.xml b/doc/generated/examples/buildersbuiltin_libs_2.xml index 41a9c1e..c2c263e 100644 --- a/doc/generated/examples/buildersbuiltin_libs_2.xml +++ b/doc/generated/examples/buildersbuiltin_libs_2.xml @@ -1,7 +1,7 @@ - -C:\>scons -Q + +C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c /nologo cl /Fohello.obj /c hello.c /nologo -link /nologo /OUT:hello.exe /LIBPATH:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj +link /nologo /OUT:hello.exe /LIBPATH:C:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/commandline_Default1_1.xml b/doc/generated/examples/commandline_Default1_1.xml index 18008d8..0e5dbd9 100644 --- a/doc/generated/examples/commandline_Default1_1.xml +++ b/doc/generated/examples/commandline_Default1_1.xml @@ -1,10 +1,86 @@ - -% scons -Q -cc -o hello.o -c hello.c -cc -o hello hello.o + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q -scons: `hello' is up to date. +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q goodbye -cc -o goodbye.o -c goodbye.c -cc -o goodbye goodbye.o +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/commandline_Default1_2.xml b/doc/generated/examples/commandline_Default1_2.xml index 0f1a93e..fdbbb91 100644 --- a/doc/generated/examples/commandline_Default1_2.xml +++ b/doc/generated/examples/commandline_Default1_2.xml @@ -1,7 +1,30 @@ - -% scons -Q . -cc -o goodbye.o -c goodbye.c -cc -o goodbye goodbye.o -cc -o hello.o -c hello.c -cc -o hello hello.o + +% scons -Q . +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/commandline_Default2_1.xml b/doc/generated/examples/commandline_Default2_1.xml index 606ed67..8e27885 100644 --- a/doc/generated/examples/commandline_Default2_1.xml +++ b/doc/generated/examples/commandline_Default2_1.xml @@ -1,10 +1,58 @@ - -% scons -Q -cc -o prog1.o -c prog1.c -cc -o prog1 prog1.o -cc -o prog3.o -c prog3.c -cc -o prog3 prog3.o + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q . -cc -o prog2.o -c prog2.c -cc -o prog2 prog2.o +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/commandline_Default3_1.xml b/doc/generated/examples/commandline_Default3_1.xml index d18575c..fe3d1e0 100644 --- a/doc/generated/examples/commandline_Default3_1.xml +++ b/doc/generated/examples/commandline_Default3_1.xml @@ -1,12 +1,86 @@ - -% scons -Q -cc -o prog1/foo.o -c prog1/foo.c -cc -o prog1/main.o -c prog1/main.c -cc -o prog1/main prog1/main.o prog1/foo.o + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q -scons: `prog1' is up to date. +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q . -cc -o prog2/bar.o -c prog2/bar.c -cc -o prog2/main.o -c prog2/main.c -cc -o prog2/main prog2/main.o prog2/bar.o +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/commandline_Default4_1.xml b/doc/generated/examples/commandline_Default4_1.xml index 35e0b10..8e27885 100644 --- a/doc/generated/examples/commandline_Default4_1.xml +++ b/doc/generated/examples/commandline_Default4_1.xml @@ -1,10 +1,58 @@ - -% scons -Q -scons: *** No targets specified and no Default() targets found. Stop. -Found nothing to build + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q . -cc -o prog1.o -c prog1.c -cc -o prog1 prog1.o -cc -o prog2.o -c prog2.c -cc -o prog2 prog2.o +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/commandline_PackageVariable_1.xml b/doc/generated/examples/commandline_PackageVariable_1.xml index b83fd80..3dd9724 100644 --- a/doc/generated/examples/commandline_PackageVariable_1.xml +++ b/doc/generated/examples/commandline_PackageVariable_1.xml @@ -1,10 +1,114 @@ - -% scons -Q foo.o -cc -o foo.o -c -DPACKAGE="/opt/location" foo.c + +% scons -Q foo.o +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q PACKAGE=/usr/local/location foo.o -cc -o foo.o -c -DPACKAGE="/usr/local/location" foo.c +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q PACKAGE=yes foo.o -cc -o foo.o -c -DPACKAGE="True" foo.c +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -Q PACKAGE=no foo.o -cc -o foo.o -c -DPACKAGE="False" foo.c +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/environments_Replace-nonexistent_1.xml b/doc/generated/examples/environments_Replace-nonexistent_1.xml index c4480b5..8b44352 100644 --- a/doc/generated/examples/environments_Replace-nonexistent_1.xml +++ b/doc/generated/examples/environments_Replace-nonexistent_1.xml @@ -1,5 +1,30 @@ - -% scons -Q -NEW_VARIABLE = xyzzy -scons: `.' is up to date. + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/environments_missing2_1.xml b/doc/generated/examples/environments_missing2_1.xml index ffb308c..8b44352 100644 --- a/doc/generated/examples/environments_missing2_1.xml +++ b/doc/generated/examples/environments_missing2_1.xml @@ -1,6 +1,30 @@ - -% scons -Q - -scons: *** NameError `MISSING' trying to evaluate `$MISSING' -File "/home/my/project/SConstruct", line 3, in <module> + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/environments_missing3_1.xml b/doc/generated/examples/environments_missing3_1.xml index edf136f..8b44352 100644 --- a/doc/generated/examples/environments_missing3_1.xml +++ b/doc/generated/examples/environments_missing3_1.xml @@ -1,5 +1,30 @@ - -% scons -Q -value is: -><- -scons: `.' is up to date. + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/sideeffect_parallel_1.xml b/doc/generated/examples/sideeffect_parallel_1.xml index 9478c52..2e000a1 100644 --- a/doc/generated/examples/sideeffect_parallel_1.xml +++ b/doc/generated/examples/sideeffect_parallel_1.xml @@ -1,5 +1,30 @@ - -% scons -Q --jobs=2 -echo > file1.out data1 -echo > file2.out data2 + +% scons -Q --jobs=2 +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/simple_clean_1.xml b/doc/generated/examples/simple_clean_1.xml index 21adbe7..e90f1f2 100644 --- a/doc/generated/examples/simple_clean_1.xml +++ b/doc/generated/examples/simple_clean_1.xml @@ -1,16 +1,60 @@ - -% scons + +% scons scons: Reading SConscript files ... -scons: done reading SConscript files. -scons: Building targets ... -cc -o hello.o -c hello.c -cc -o hello hello.o -scons: done building targets. +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] % scons -c scons: Reading SConscript files ... -scons: done reading SConscript files. -scons: Cleaning targets ... -Removed hello.o -Removed hello -scons: done cleaning targets. +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/examples/simple_clean_2.xml b/doc/generated/examples/simple_clean_2.xml index 26f3c37..6e50fe9 100644 --- a/doc/generated/examples/simple_clean_2.xml +++ b/doc/generated/examples/simple_clean_2.xml @@ -1,5 +1,5 @@ - -C:\>scons + +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/sourcecode_cvs_1.xml b/doc/generated/examples/sourcecode_cvs_1.xml index 01ddb6b..8b44352 100644 --- a/doc/generated/examples/sourcecode_cvs_1.xml +++ b/doc/generated/examples/sourcecode_cvs_1.xml @@ -1,6 +1,30 @@ - -% scons -Q -AttributeError: 'SConsEnvironment' object has no attribute 'CVS': - File "/home/my/project/SConstruct", line 2: - env.SourceCode('.', env.CVS('/usr/local/CVS')) + +% scons -Q +KeyError: 'RANLIBCOM': + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: + _exec_main(parser, values) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: + _main(parser) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: + SCons.Script._SConscript._SConscript(fs, script) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: + exec(sys.stdin.read(), call_stack[-1].globals) + File "<string>", line 206: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: + env = self.factory() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: + default_env = SCons.Defaults.DefaultEnvironment() + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: + _default_env = SCons.Environment.Environment(*args, **kw) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: + apply_tools(self, tools, toolpath) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: + env.Tool(tool) + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: + tool(self) + File "<string>", line 67: + None + File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: + return self._dict[key] diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 953d374..63f9f8c 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,7 +12,7 @@ %variables-mod; ]> - + Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) @@ -20,8 +20,7 @@ env.Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) - - + Creates an Action object for the specified action. @@ -29,7 +28,7 @@ See the section "Action Objects," below, for a complete explanation of the arguments and behavior. - + Note that the env.Action() form of the invocation will expand @@ -56,8 +55,7 @@ until the Action object is actually used. env.AddMethod(function, [name]) - - + When called with the AddMethod() form, @@ -86,11 +84,11 @@ specified itself is used for the method name. - + Examples: - + # Note that the first argument to the function to # be attached as a method must be the object through # which the method will be called; the Python @@ -116,8 +114,7 @@ env.other_method_name('another arg') AddOption(arguments) - - + This function adds a new command-line option to be recognized. The specified arguments @@ -129,12 +126,12 @@ see the documentation for for a thorough discussion of its option-processing capabities. - + In addition to the arguments and values supported by the optparse.add_option() method, the SCons -AddOption +AddOption function allows you to set the nargs keyword value to @@ -146,7 +143,7 @@ argument. When nargs = '?' is passed to the -AddOption +AddOption function, the const keyword argument @@ -156,28 +153,28 @@ option is specified on the command line without an explicit argument. - + If no default= keyword argument is supplied when calling -AddOption, +AddOption, the option will have a default value of None. - + Once a new command-line option has been added with -AddOption, +AddOption, the option value may be accessed using -GetOption +GetOption or env.GetOption(). The value may also be set, using -SetOption +SetOption or env.SetOption(), if conditions in a -SConscript +SConscript require overriding any default value. Note, however, that a value specified on the command line will @@ -185,7 +182,7 @@ value specified on the command line will override a value set by any SConscript file. - + Any specified help= strings for the new option(s) @@ -197,22 +194,22 @@ options (the latter only if no other help text is specified in the SConscript files). The help text for the local options specified by -AddOption +AddOption will appear below the SCons options themselves, under a separate Local Options heading. The options will appear in the help text in the order in which the -AddOption +AddOption calls occur. - + Example: - + AddOption('--prefix', dest='prefix', nargs=1, type='string', @@ -230,8 +227,7 @@ env = Environment(PREFIX = GetOption('prefix')) env.AddPostAction(target, action) - - + Arranges for the specified action to be performed @@ -244,7 +240,7 @@ can be converted into an Action object (see below). - + When multiple targets are supplied, the action may be called multiple times, once after each action that generates @@ -259,8 +255,7 @@ one or more targets in the list. env.AddPreAction(target, action) - - + Arranges for the specified action to be performed @@ -273,14 +268,14 @@ can be converted into an Action object (see below). - + When multiple targets are specified, the action(s) may be called multiple times, once before each action that generates one or more targets in the list. - + Note that if any of the targets are built in multiple steps, the action will be invoked just before the "final" action that specifically @@ -291,16 +286,16 @@ from a specified source file via an intermediate object file: - + foo = Program('foo.c') AddPreAction(foo, 'pre_action') - + The specified pre_action would be executed before -scons +scons calls the link command that actually generates the executable program binary foo, @@ -317,8 +312,7 @@ file into an object file. env.Alias(alias, [targets, [action]]) - - + Creates one or more phony targets that expand to one or more other targets. An optional @@ -332,17 +326,17 @@ which exists outside of any file system. This Node object, or the alias name, may be used as a dependency of any other target, including another alias. -Alias +Alias can be called multiple times for the same alias to add additional targets to the alias, or additional actions to the list for this alias. - + Examples: - + Alias('install') Alias('install', '/usr/bin') Alias(['install', 'install-lib'], '/usr/local/lib') @@ -358,8 +352,7 @@ env.Alias('update', ['file1', 'file2'], "update_database $SOURCES") AllowSubstExceptions([exception, ...]) - - + Specifies the exceptions that will be allowed when expanding construction variables. By default, @@ -375,19 +368,19 @@ will generate an error message and terminate processing. - + If -AllowSubstExceptions +AllowSubstExceptions is called multiple times, each call completely overwrites the previous list of allowed exceptions. - + Example: - + # Requires that all construction variable names exist. # (You may wish to do this if you want to enforce strictly # that all construction variables must be defined before use.) @@ -406,14 +399,13 @@ AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) env.AlwaysBuild(target, ...) - - + Marks each given target so that it is always assumed to be out of date, and will always be rebuilt if needed. Note, however, that -AlwaysBuild +AlwaysBuild does not add its target(s) to the default target list, so the targets will only be built if they are specified on the command line, @@ -422,7 +414,7 @@ they will always be built if so specified. Multiple targets can be passed in to a single call to -AlwaysBuild. +AlwaysBuild. @@ -430,8 +422,7 @@ Multiple targets can be passed in to a single call to env.Append(key=val, [...]) - - + Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have @@ -447,11 +438,11 @@ and the lists are added together. (See also the Prepend method, below.) - + Example: - + env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) @@ -460,8 +451,7 @@ env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) env.AppendENVPath(name, newpath, [envname, sep, delete_existing]) - - + This appends new path elements to the given path in the specified external environment (ENV @@ -479,18 +469,18 @@ case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. - + If delete_existing is 0, then adding a path that already exists will not move it to the end; it will stay where it is in the list. - + Example: - + print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.AppendENVPath('INCLUDE', include_path) @@ -506,8 +496,7 @@ after: /biz:/foo/bar:/foo env.AppendUnique(key=val, [...], delete_existing=0) - - + Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have @@ -523,11 +512,11 @@ existing matching values are removed first, so existing values in the arg list move to the end of the list. - + Example: - + env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) @@ -539,10 +528,9 @@ env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) env.BuildDir(build_dir, src_dir, [duplicate]) - - + Deprecated synonyms for -VariantDir +VariantDir and env.VariantDir(). The @@ -550,7 +538,7 @@ The argument becomes the variant_dir argument of -VariantDir +VariantDir or env.VariantDir(). @@ -563,8 +551,7 @@ or env.Builder(action, [arguments]) - - + Creates a Builder object for the specified action. @@ -572,7 +559,7 @@ See the section "Builder Objects," below, for a complete explanation of the arguments and behavior. - + Note that the env.Builder() form of the invocation will expand @@ -587,7 +574,7 @@ construction environment through which env.Builder() was called. The -Builder +Builder form delays all variable expansion until after the Builder object is actually called. @@ -600,15 +587,14 @@ until after the Builder object is actually called. env.CacheDir(cache_dir) - - + Specifies that -scons +scons will maintain a cache of derived files in cache_dir. The derived files in the cache will be shared among all the builds using the same -CacheDir +CacheDir call. Specifying a cache_dir @@ -617,13 +603,13 @@ of disables derived file caching. - + Calling env.CacheDir() will only affect targets built through the specified construction environment. Calling -CacheDir +CacheDir sets a global default that will be used by all targets built through construction environments @@ -634,21 +620,21 @@ have an specified. - + When a CacheDir() is being used and -scons +scons finds a derived file that needs to be rebuilt, it will first look in the cache to see if a derived file has already been built from identical input files and an identical build action (as incorporated into the MD5 build signature). If so, -scons +scons will retrieve the file from the cache. If the derived file is not present in the cache, -scons +scons will rebuild it and then place a copy of the built file in the cache (identified by its MD5 build signature), @@ -657,20 +643,20 @@ builds that need to build the same derived file from identical inputs. - + Use of a specified -CacheDir +CacheDir may be disabled for any invocation by using the option. - + If the option is used, -scons +scons will place a copy of all derived files in the cache, @@ -678,17 +664,17 @@ even if they already existed and were not built by this invocation. This is useful to populate a cache the first time -CacheDir +CacheDir is added to a build, or after using the option. - + When using -CacheDir, -scons +CacheDir, +scons will report, "Retrieved `file' from cache," unless the @@ -697,7 +683,7 @@ option is being used. When the option is used, -scons +scons will print the action that would have been used to build the file, @@ -709,9 +695,9 @@ a given derived file has been built in-place or retrieved from the cache. - + The -NoCache +NoCache method can be used to disable caching of specific files. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large. @@ -725,8 +711,7 @@ predict or prohibitively large. env.Clean(targets, files_or_dirs) - - + This specifies a list of files or directories which should be removed whenever the targets are specified with the @@ -734,28 +719,28 @@ command line option. The specified targets may be a list or an individual target. Multiple calls to -Clean +Clean are legal, and create new targets or add files and directories to the clean list for the specified targets. - + Multiple files or directories should be specified either as separate arguments to the -Clean +Clean method, or as a list. -Clean +Clean will also accept the return value of any of the construction environment Builder methods. Examples: - + The related -NoClean +NoClean function overrides calling -Clean +Clean for the same target, and any targets passed to both functions will not @@ -764,23 +749,23 @@ be removed by the option. - + Examples: - + Clean('foo', ['bar', 'baz']) Clean('dist', env.Program('hello', 'hello.c')) Clean(['foo', 'bar'], 'something_else_to_clean') - + In this example, installing the project creates a subdirectory for the documentation. This statement causes the subdirectory to be removed if the project is deinstalled. - + Clean(docdir, os.path.join(docdir, projectname)) @@ -789,8 +774,7 @@ Clean(docdir, os.path.join(docdir, projectname)) env.Clone([key=val, ...]) - - + Returns a separate copy of a construction environment. If there are any keyword arguments specified, they are added to the returned copy, @@ -798,34 +782,34 @@ overwriting any existing values for the keywords. - + Example: - + env2 = env.Clone() env3 = env.Clone(CCFLAGS = '-g') - + Additionally, a list of tools and a toolpath may be specified, as in the Environment constructor: - + def MyTool(env): env['FOO'] = 'bar' env4 = env.Clone(tools = ['msvc', MyTool]) - + The parse_flags keyword argument is also recognized to allow merging command-line style arguments into the appropriate construction -variables (see env.MergeFlags). +variables (see env.MergeFlags). - + # create an environment for compiling programs that use wxWidgets wx_env = env.Clone(parse_flags='!wx-config --cflags --cxxflags') @@ -838,8 +822,7 @@ wx_env = env.Clone(parse_flags='!wx-config --cflags --cxxflags') env.Command(target, source, action, [key=val, ...]) - - + Executes a specific action (or list of actions) to build a target file or files. @@ -848,7 +831,7 @@ than defining a separate Builder object for a single special-case build. - + As a special case, the source_scanner keyword argument can @@ -864,12 +847,12 @@ changes to files that aren't already specified in other Builder of function calls.) - + Any other keyword arguments specified override any same-named existing construction variables. - + An action can be an external command, specified as a string, or a callable Python object; @@ -886,11 +869,11 @@ or by a to ignore the exit status of the external command. - + Examples: - + env.Command('foo.out', 'foo.in', "$FOO_BUILD < $SOURCES > $TARGET") @@ -908,9 +891,9 @@ env.Command('baz.out', 'baz.in', rename ]) - + Note that the -Command +Command function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration @@ -919,24 +902,24 @@ If necessary, you can explicitly specify that targets or source nodes should be treated as directoriese by using the -Dir +Dir or env.Dir() functions. - + Examples: - + env.Command('ddd.list', Dir('ddd'), 'ls -l $SOURCE > $TARGET') env['DISTDIR'] = 'destination/directory' env.Command(env.Dir('$DISTDIR')), None, make_distdir) - + (Also note that SCons will usually automatically create any directory necessary to hold a target file, so you normally don't need to create directories by hand.) @@ -950,8 +933,7 @@ so you normally don't need to create directories by hand.) env.Configure([custom_tests, conf_dir, log_file, config_h]) - - + Creates a Configure object for integrated functionality similar to GNU autoconf. See the section "Configure Contexts," @@ -963,8 +945,7 @@ below, for a complete explanation of the arguments and behavior. env.Copy([key=val, ...]) - - + A now-deprecated synonym for env.Clone(). @@ -977,8 +958,7 @@ A now-deprecated synonym for env.Decider(function) - - + Specifies that all up-to-date decisions for targets built through this construction environment will be handled by the specified @@ -990,7 +970,7 @@ that specify the type of decision function to be performed: - + timestamp-newer @@ -1073,11 +1053,11 @@ all within a single second. - + Examples: - + # Use exact timestamp matches by default. Decider('timestamp-match') @@ -1086,7 +1066,7 @@ Decider('timestamp-match') env.Decider('content') - + In addition to the above already-available functions, the function @@ -1094,7 +1074,7 @@ argument may be an actual Python function that takes the following three arguments: - + dependency @@ -1142,7 +1122,7 @@ size, or content signature. - + The function should return a @@ -1170,11 +1150,11 @@ Ignoring some or all of the function arguments is perfectly normal. - + Example: - + def my_decider(dependency, target, prev_ni): return not os.path.exists(str(target)) @@ -1189,14 +1169,13 @@ env.Decider(my_decider) env.Default(targets) - - + This specifies a list of default targets, which will be built by -scons +scons if no explicit targets are given on the command line. Multiple calls to -Default +Default are legal, and add to the list of default targets. As noted above, both forms of this call affect the @@ -1205,43 +1184,43 @@ construction environment method applies construction variable expansion to the targets. - + Multiple targets should be specified as separate arguments to the -Default +Default method, or as a list. -Default +Default will also accept the Node returned by any of a construction environment's builder methods. - + Examples: - + Default('foo', 'bar', 'baz') env.Default(['a', 'b', 'c']) hello = env.Program('hello', 'hello.c') env.Default(hello) - + An argument to -Default +Default of None will clear all default targets. Later calls to -Default +Default will add to the (now empty) default-target list like normal. - + The current list of targets added using the -Default +Default function or method is available in the DEFAULT_TARGETS list; @@ -1253,8 +1232,7 @@ see below. DefaultEnvironment([args]) - - + Creates and returns a default construction environment object. This construction environment is used internally by SCons in order to execute many of the global functions in this list, @@ -1270,8 +1248,7 @@ from source code management systems. env.Depends(target, dependency) - - + Specifies an explicit dependency; the target @@ -1294,11 +1271,11 @@ is not caught by a Scanner for the file. - + Example: - + env.Depends('foo', 'other-input-file-for-foo') mylib = env.Library('mylib.c') @@ -1319,8 +1296,7 @@ env.Depends(bar, installed_lib) env.Dictionary([vars]) - - + Returns a dictionary object containing copies of all of the construction variables in the environment. @@ -1329,11 +1305,11 @@ only the specified construction variables are returned in the dictionary. - + Example: - + dict = env.Dictionary() cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') @@ -1346,8 +1322,7 @@ cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') env.Dir(name, [directory]) - - + This returns a Directory Node, an object that represents the specified directory name. @@ -1360,7 +1335,7 @@ If no is specified, the current script's directory is used as the parent. - + If name is a list, SCons returns a list of Dir nodes. @@ -1368,7 +1343,7 @@ Construction variables are expanded in name. - + Directory Nodes can be used anywhere you would supply a string as a directory name to a Builder method or function. @@ -1382,8 +1357,7 @@ see "File and Directory Nodes," below. env.Dump([key]) - - + Returns a pretty printable representation of the environment. key, if not @@ -1391,36 +1365,36 @@ if not should be a string containing the name of the variable of interest. - + This SConstruct: - + env=Environment() print env.Dump('CCCOM') - + will print: - + '$CC -c -o $TARGET $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES' - + While this SConstruct: - + env=Environment() print env.Dump() - + will print: - + { 'AR': 'ar', 'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES\n$RANLIB $RANLIBFLAGS $TARGET', 'ARFLAGS': ['r'], @@ -1438,8 +1412,7 @@ will print: env.EnsurePythonVersion(major, minor) - - + Ensure that the Python version is at least major.minor. This function will @@ -1447,11 +1420,11 @@ print out an error message and exit SCons with a non-zero exit code if the actual Python version is not late enough. - + Example: - + EnsurePythonVersion(2,2) @@ -1463,8 +1436,7 @@ EnsurePythonVersion(2,2) env.EnsureSConsVersion(major, minor, [revision]) - - + Ensure that the SCons version is at least major.minor, or @@ -1477,11 +1449,11 @@ print out an error message and exit SCons with a non-zero exit code if the actual SCons version is not late enough. - + Examples: - + EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) @@ -1495,8 +1467,7 @@ EnsureSConsVersion(0,96,90) env.Environment([key=value, ...]) - - + Return a new construction environment initialized with the specified key=value @@ -1511,8 +1482,7 @@ pairs. env.Execute(action, [strfunction, varlist]) - - + Executes an Action object. The specified action @@ -1530,14 +1500,14 @@ or return value of the Python function will be returned. - + Note that -scons +scons will print an error message if the executed action fails--that is, exits with or returns a non-zero value. -scons +scons will not, however, @@ -1546,12 +1516,12 @@ if the specified action fails. If you want the build to stop in response to a failed -Execute +Execute call, you must explicitly check for a non-zero return value: - + Execute(Copy('file.out', 'file.in')) if Execute("mkdir sub/dir/ectory"): @@ -1567,10 +1537,9 @@ if Execute("mkdir sub/dir/ectory"): env.Exit([value]) - - + This tells -scons +scons to exit immediately with the specified value. @@ -1588,29 +1557,28 @@ is used if no value is specified. env.Export(vars) - - + This tells -scons +scons to export a list of variables from the current SConscript file to all other SConscript files. The exported variables are kept in a global collection, so subsequent calls to -Export +Export will over-write previous exports that have the same name. Multiple variable names can be passed to -Export +Export as separate arguments or as a list. Keyword arguments can be used to provide names and their values. A dictionary can be used to map variables to a different name when exported. Both local variables and global variables can be exported. - + Examples: - + env = Environment() # Make env available for all SConscript files to Import(). Export("env") @@ -1629,15 +1597,15 @@ Export(debug = env) Export({"debug":env}) - + Note that the -SConscript +SConscript function supports an exports argument that makes it easier to to export a variable or set of variables to a single SConscript file. See the description of the -SConscript +SConscript function, below. @@ -1649,8 +1617,7 @@ function, below. env.File(name, [directory]) - - + This returns a File Node, an object that represents the specified file @@ -1661,7 +1628,7 @@ can be a relative or absolute path. is an optional directory that will be used as the parent directory. - + If name is a list, SCons returns a list of File nodes. @@ -1669,7 +1636,7 @@ Construction variables are expanded in name. - + File Nodes can be used anywhere you would supply a string as a file name to a Builder method or function. @@ -1686,8 +1653,7 @@ see "File and Directory Nodes," below. env.FindFile(file, dirs) - - + Search for file in the path specified by @@ -1699,11 +1665,11 @@ this function also searches for derived files that have not yet been built. - + Example: - + foo = env.FindFile('foo', ['dir1', 'dir2']) @@ -1715,25 +1681,24 @@ foo = env.FindFile('foo', ['dir1', 'dir2']) env.FindInstalledFiles() - - + Returns the list of targets set up by the -Install +Install or -InstallAs +InstallAs builders. - + This function serves as a convenient method to select the contents of a binary package. - + Example: - + Install( '/bin', [ 'executable_a', 'executable_b' ] ) # will return the file node list @@ -1752,8 +1717,7 @@ FindInstalledFiles() FindPathDirs(variable) - - + Returns a function (actually a callable Python object) intended to be used as the @@ -1765,14 +1729,14 @@ in a construction environment and treat the construction variable's value as a list of directory paths that should be searched (like -$CPPPATH, -$LIBPATH, +$CPPPATH, +$LIBPATH, etc.). - + Note that use of -FindPathDirs +FindPathDirs is generally preferable to writing your own path_function @@ -1780,11 +1744,11 @@ for the following reasons: 1) The returned list will contain all appropriate directories found in source trees (when -VariantDir +VariantDir is used) or in code repositories (when -Repository +Repository or the option are used). @@ -1796,11 +1760,11 @@ and avoid re-scanning the directories for files, when possible. - + Example: - + def my_scan(node, env, path, arg): # Code to scan file contents goes here... return include_files @@ -1818,8 +1782,7 @@ scanner = Scanner(name = 'myscanner', env.FindSourceFiles(node='"."') - - + Returns the list of nodes which serve as the source of the built files. It does so by inspecting the dependency tree starting at the optional argument @@ -1829,16 +1792,16 @@ which defaults to the '"."'-node. It will then return all leaves of These are all children which have no further children. - + This function is a convenient method to select the contents of a Source Package. - + Example: - + Program( 'src/main_a.c' ) Program( 'src/main_b.c' ) Program( 'main_c.c' ) @@ -1850,7 +1813,7 @@ FindSourceFiles() FindSourceFiles( 'src' ) - + As you can see build support files (SConstruct in the above example) will also be returned by this function. @@ -1863,8 +1826,7 @@ will also be returned by this function. env.Flatten(sequence) - - + Takes a sequence (that is, a Python list or tuple) that may contain nested sequences and returns a flattened list containing @@ -1877,11 +1839,11 @@ but direct Python manipulation of these lists does not. - + Examples: - + foo = Object('foo.c') bar = Object('bar.c') @@ -1904,8 +1866,7 @@ for object in Flatten(objects): GetBuildFailures() - - + Returns a list of exceptions for the actions that failed while attempting to build targets. @@ -1917,13 +1878,13 @@ that record various aspects of the build failure: - + .node The node that was being built when the build failure occurred. - + .status The numeric exit status returned by the command or Python function @@ -1931,7 +1892,7 @@ that failed when trying to build the specified Node. - + .errstr The SCons error string describing the build failure. @@ -1941,7 +1902,7 @@ to indicate that an executed command exited with a status of 2.) - + .filename The name of the file or directory that actually caused the failure. @@ -1964,7 +1925,7 @@ attribute will be sub/dir. - + .executor The SCons Executor object for the target Node @@ -1974,7 +1935,7 @@ the construction environment used for the failed action. - + .action The actual SCons Action object that failed. This will be one specific action @@ -1983,26 +1944,26 @@ actions that would have been executed to build the target. - + .command The actual expanded command that was executed and failed, after expansion of -$TARGET, -$SOURCE, +$TARGET, +$SOURCE, and other construction variables. - + Note that the -GetBuildFailures +GetBuildFailures function will always return an empty list until any build failure has occurred, which means that -GetBuildFailures +GetBuildFailures will always return an empty list while the -SConscript +SConscript files are being read. Its primary intended use is for functions that will be @@ -2014,7 +1975,7 @@ function. Example: - + import atexit def print_build_failures(): @@ -2033,10 +1994,9 @@ atexit.register(print_build_failures) env.GetBuildPath(file, [...]) - - + Returns the -scons +scons path name (or names) for the specified file (or files). @@ -2044,7 +2004,7 @@ The specified file or files may be -scons +scons Nodes or strings representing path names. @@ -2056,10 +2016,9 @@ Nodes or strings representing path names. env.GetLaunchDir() - - + Returns the absolute path name of the directory from which -scons +scons was initially invoked. This can be useful when using the , @@ -2068,7 +2027,7 @@ or options, which internally change to the directory in which the -SConstruct +SConstruct file is found. @@ -2080,17 +2039,16 @@ file is found. env.GetOption(name) - - + This function provides a way to query the value of SCons options set on scons command line (or set using the -SetOption +SetOption function). The options supported are: - + cache_debug @@ -2335,7 +2293,7 @@ which corresponds to --warn and --warning. - + See the documentation for the corresponding command line object for information about each specific option. @@ -2349,12 +2307,11 @@ option. env.Glob(pattern, [ondisk, source, strings, exclude]) - - + Returns Nodes (or strings) that match the specified pattern, relative to the directory of the current -SConscript +SConscript file. The env.Glob() @@ -2364,20 +2321,20 @@ and returns whatever matches the resulting expanded pattern. - + The specified pattern uses Unix shell style metacharacters for matching: - + * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq - + If the first character of a filename is a dot, it must be matched explicitly. Character matches do @@ -2385,17 +2342,17 @@ Character matches do span directory separators. - + The -Glob +Glob knows about repositories (see the -Repository +Repository function) and source directories (see the -VariantDir +VariantDir function) and returns a Node (or string, if so configured) @@ -2405,7 +2362,7 @@ anywhere in a corresponding repository or source directory. - + The ondisk argument may be set to @@ -2419,7 +2376,7 @@ return corresponding Nodes for any on-disk matches found. - + The source argument may be set to @@ -2427,20 +2384,20 @@ argument may be set to (or any equivalent value) to specify that, when the local directory is a -VariantDir, +VariantDir, the returned Nodes should be from the corresponding source directory, not the local directory. - + The strings argument may be set to True (or any equivalent value) to have the -Glob +Glob function return strings, not Nodes, that represent the matched files or directories. The returned strings will be relative to @@ -2449,18 +2406,18 @@ the local (SConscript) directory. arbitrary manipulation of file names, but if the returned strings are passed to a different -SConscript +SConscript file, any Node translation will be relative to the other -SConscript +SConscript directory, not the original -SConscript +SConscript directory.) - + The exclude argument may be set to a pattern or a list of patterns @@ -2470,11 +2427,11 @@ Elements matching a least one pattern of this list will be excluded. - + Examples: - + Program('foo', Glob('*.c')) Zip('/tmp/everything', Glob('.??*') + Glob('*')) sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_*.cpp'%currentOS) @@ -2488,20 +2445,19 @@ sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_ env.Help(text, append=False) - - + This specifies help text to be printed if the argument is given to -scons. +scons. If -Help +Help is called multiple times, the text is appended together in the order that -Help +Help is called. With append set to False, any -Help +Help text generated with -AddOption +AddOption is clobbered. If append is True, the AddOption help is prepended to the help string, thus preserving the @@ -2516,34 +2472,33 @@ message. env.Ignore(target, dependency) - - + The specified dependency file(s) will be ignored when deciding if the target file(s) need to be rebuilt. - + You can also use -Ignore +Ignore to remove a target from the default build. In order to do this you must specify the directory the target will be built in as the target, and the file you want to skip building as the dependency. - + Note that this will only remove the dependencies listed from the files built by default. It will still be built if that dependency is needed by another object being built. See the third and forth examples below. - + Examples: - + env.Ignore('foo', 'foo.c') env.Ignore('bar', ['bar1.h', 'bar2.h']) env.Ignore('.','foobar.obj') @@ -2558,31 +2513,30 @@ env.Ignore('bar','bar/foobar.obj') env.Import(vars) - - + This tells -scons +scons to import a list of variables into the current SConscript file. This will import variables that were exported with -Export +Export or in the exports argument to -SConscript. +SConscript. Variables exported by -SConscript +SConscript have precedence. Multiple variable names can be passed to -Import +Import as separate arguments or as a list. The variable "*" can be used to import all variables. - + Examples: - + Import("env") Import("env", "variable") Import(["env", "variable"]) @@ -2597,8 +2551,7 @@ Import("*") env.Literal(string) - - + The specified string will be preserved as-is @@ -2613,8 +2566,7 @@ and not have construction variables expanded. env.Local(targets) - - + The specified targets will have copies made in the local tree, @@ -2628,8 +2580,7 @@ Returns a list of the target Node or Nodes. env.MergeFlags(arg, [unique]) - - + Merges the specified arg values to the construction environment's construction variables. @@ -2637,7 +2588,7 @@ If the arg argument is not a dictionary, it is converted to one by calling -env.ParseFlags +env.ParseFlags on the argument before the values are merged. Note that @@ -2646,10 +2597,10 @@ must be a single value, so multiple strings must be passed in as a list, not as separate arguments to -env.MergeFlags. +env.MergeFlags. - + By default, duplicate values are eliminated; you can, however, specify @@ -2665,11 +2616,11 @@ All other construction variables keep the right-most unique value. - + Examples: - + # Add an optimization flag to $CCFLAGS. env.MergeFlags('-O3') @@ -2692,39 +2643,38 @@ env.MergeFlags(['-O3', env.NoCache(target, ...) - - + Specifies a list of files which should not be cached whenever the -CacheDir +CacheDir method has been activated. The specified targets may be a list or an individual target. - + Multiple files should be specified either as separate arguments to the -NoCache +NoCache method, or as a list. -NoCache +NoCache will also accept the return value of any of the construction environment Builder methods. - + Calling -NoCache +NoCache on directories and other non-File Node types has no effect because only File Nodes are cached. - + Examples: - + NoCache('foo.elf') NoCache(env.Program('hello', 'hello.c')) @@ -2737,8 +2687,7 @@ NoCache(env.Program('hello', 'hello.c')) env.NoClean(target, ...) - - + Specifies a list of files or directories which should not be removed whenever the targets (or their dependencies) @@ -2748,7 +2697,7 @@ command line option. The specified targets may be a list or an individual target. Multiple calls to -NoClean +NoClean are legal, and prevent each specified target from being removed by calls to the @@ -2756,21 +2705,21 @@ from being removed by calls to the option. - + Multiple files or directories should be specified either as separate arguments to the -NoClean +NoClean method, or as a list. -NoClean +NoClean will also accept the return value of any of the construction environment Builder methods. - + Calling -NoClean +NoClean for a target overrides calling -Clean +Clean for the same target, and any targets passed to both functions will not @@ -2779,11 +2728,11 @@ be removed by the option. - + Examples: - + NoClean('foo.elf') NoClean(env.Program('hello', 'hello.c')) @@ -2793,8 +2742,7 @@ NoClean(env.Program('hello', 'hello.c')) env.ParseConfig(command, [function, unique]) - - + Calls the specified function to modify the environment as specified by the output of @@ -2802,7 +2750,7 @@ to modify the environment as specified by the output of The default function is -env.MergeFlags, +env.MergeFlags, which expects the output of a typical *-config command @@ -2819,11 +2767,11 @@ to allow duplicate values to be added. - + Interpreted options and the construction variables they affect are as specified for the -env.ParseFlags +env.ParseFlags method (which this method calls). See that method's description, below, for a table of options and construction variables. @@ -2837,18 +2785,17 @@ for a table of options and construction variables. env.ParseDepends(filename, [must_exist, only_one]) - - + Parses the contents of the specified filename as a list of dependencies in the style of -Make +Make or mkdep, and explicitly establishes all of the listed dependencies. - + By default, it is not an error if the specified @@ -2864,7 +2811,7 @@ generate an error if the file does not exist, or is otherwise inaccessible. - + The optional only_one argument may be set to a non-zero @@ -2886,15 +2833,15 @@ one output file into a corresponding file. - + The filename and all of the files listed therein will be interpreted relative to the directory of the -SConscript +SConscript file which calls the -ParseDepends +ParseDepends function. @@ -2903,26 +2850,25 @@ function. env.ParseFlags(flags, ...) - - + Parses one or more strings containing typical command-line flags for GCC tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables. This is intended as a companion to the -env.MergeFlags +env.MergeFlags method, but allows for the values in the returned dictionary to be modified, if necessary, before merging them into the construction environment. (Note that -env.MergeFlags +env.MergeFlags will call this method if its argument is not a dictionary, so it is usually not necessary to call -env.ParseFlags +env.ParseFlags directly unless you want to manipulate the values.) - + If the first character in any string is an exclamation mark (!), the rest of the string is executed as a command, @@ -2931,12 +2877,12 @@ parsed as GCC tool chain command-line flags and added to the resulting dictionary. - + Flag values are translated accordig to the prefix found, and added to the following construction variables: - + -arch CCFLAGS, LINKFLAGS -D CPPDEFINES -framework FRAMEWORKS @@ -2963,19 +2909,19 @@ and added to the following construction variables: + CCFLAGS, LINKFLAGS - + Any other strings not associated with options are assumed to be the names of libraries and added to the -$LIBS +$LIBS construction variable. - + Examples (all of which produce the same result): - + dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) @@ -2987,39 +2933,38 @@ dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') Platform(string) - - + The -Platform +Platform form returns a callable object that can be used to initialize a construction environment using the platform keyword of the -Environment +Environment function. - + Example: - + env = Environment(platform = Platform('win32')) - + The -env.Platform +env.Platform form applies the callable object for the specified platform string to the environment through which the method was called. - + env.Platform('posix') - + Note that the win32 platform adds the @@ -3028,7 +2973,7 @@ and SystemRoot variables from the user's external environment to the construction environment's -$ENV +$ENV dictionary. This is so that any executed commands that use sockets to connect with other systems @@ -3046,15 +2991,14 @@ will work on Windows systems. env.Precious(target, ...) - - + Marks each given target as precious so it is not deleted before it is rebuilt. Normally -scons +scons deletes a target before building it. Multiple targets can be passed in to a single call to -Precious. +Precious. @@ -3062,8 +3006,7 @@ Multiple targets can be passed in to a single call to env.Prepend(key=val, [...]) - - + Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have @@ -3079,11 +3022,11 @@ and the lists are added together. (See also the Append method, above.) - + Example: - + env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) @@ -3092,11 +3035,10 @@ env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) env.PrependENVPath(name, newpath, [envname, sep, delete_existing]) - - + This appends new path elements to the given path in the specified external environment -($ENV +($ENV by default). This will only add any particular path once (leaving the first one it encounters and @@ -3111,7 +3053,7 @@ case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. - + If delete_existing is 0, then adding a path that already exists @@ -3119,22 +3061,22 @@ will not move it to the beginning; it will stay where it is in the list. - + Example: - + print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.PrependENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] - + The above example will print: - + before: /biz:/foo after: /foo/bar:/foo:/biz @@ -3144,8 +3086,7 @@ after: /foo/bar:/foo:/biz env.PrependUnique(key=val, delete_existing=0, [...]) - - + Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have @@ -3161,11 +3102,11 @@ existing matching values are removed first, so existing values in the arg list move to the front of the list. - + Example: - + env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) @@ -3180,14 +3121,13 @@ env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) Progress(list_of_strings, [interval, file, overwrite]) - - + Allows SCons to show progress made during the build by displaying a string or calling a function while evaluating Nodes (e.g. files). - + If the first specified argument is a Python callable (a function or an object that has a __call__() @@ -3209,19 +3149,19 @@ if SCons ever changes the interface to call the function with additional arguments in the future.) - + An example of a simple custom progress function that prints a string containing the Node name every 10 Nodes: - + def my_progress_function(node, *args, **kw): print('Evaluating node %s!' % node) Progress(my_progress_function, interval=10) - + A more complicated example of a custom progress display object that prints a string containing a count every 100 evaluated Nodes. @@ -3232,7 +3172,7 @@ at the end so that the string will overwrite itself on a display: - + import sys class ProgressCounter(object): count = 0 @@ -3242,9 +3182,9 @@ class ProgressCounter(object): Progress(ProgressCounter(), interval=100) - + If the first argument -Progress +Progress is a string, the string will be displayed every @@ -3260,14 +3200,14 @@ on the error output, one dot for every 100 evaluated Nodes: - + import sys Progress('.', interval=100, file=sys.stderr) - + If the string contains the verbatim substring -$TARGET, +$TARGET, it will be replaced with the Node. Note that, for performance reasons, this is not @@ -3285,14 +3225,14 @@ keyword argument to make sure the previously-printed file name is overwritten with blank spaces: - + import sys Progress('$TARGET\r', overwrite=True) - + If the first argument to -Progress +Progress is a list of strings, then each string in the list will be displayed in rotating fashion every @@ -3302,7 +3242,7 @@ This can be used to implement a "spinner" on the user's screen as follows: - + Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) @@ -3314,18 +3254,17 @@ Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) env.Pseudo(target, ...) - - + This indicates that each given target should not be created by the build rule, and if the target is created, an error will be generated. This is similar to the gnu make .PHONY target. However, in the vast majority of cases, an -Alias +Alias is more appropriate. Multiple targets can be passed in to a single call to -Pseudo. +Pseudo. @@ -3336,8 +3275,7 @@ Multiple targets can be passed in to a single call to env.PyPackageDir(modulename) - - + This returns a Directory Node similar to Dir. The python module / package is looked up and if located the directory is returned for the location. @@ -3345,7 +3283,7 @@ the directory is returned for the location. Is a named python package / module to lookup the directory for it's location. - + If modulename is a list, SCons returns a list of Dir nodes. @@ -3358,17 +3296,16 @@ Construction variables are expanded in env.Replace(key=val, [...]) - - + Replaces construction variables in the Environment with the specified keyword arguments. - + Example: - + env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') @@ -3380,21 +3317,20 @@ env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') env.Repository(directory) - - + Specifies that directory is a repository to be searched for files. Multiple calls to -Repository +Repository are legal, and each one adds to the list of repositories that will be searched. - + To -scons, +scons, a repository is a copy of the source tree, from the top-level directory on down, which may contain @@ -3405,26 +3341,26 @@ The canonical example would be an official source tree maintained by an integrator. If the repository contains derived files, then the derived files should have been built using -scons, +scons, so that the repository contains the necessary signature information to allow -scons +scons to figure out when it is appropriate to use the repository copy of a derived file, instead of building one locally. - + Note that if an up-to-date derived file already exists in a repository, -scons +scons will not make a copy in the local directory tree. In order to guarantee that a local copy will be made, use the -Local +Local method. @@ -3436,8 +3372,7 @@ method. env.Requires(target, prerequisite) - - + Specifies an order-only relationship between the specified target file(s) and the specified prerequisite file(s). @@ -3451,11 +3386,11 @@ and will not be rebuilt simply because the prerequisite file(s) change. - + Example: - + env.Requires('foo', 'file-that-must-be-built-before-foo') @@ -3464,8 +3399,7 @@ env.Requires('foo', 'file-that-must-be-built-before-foo') Return([vars..., stop=]) - - + By default, this stops processing the current SConscript file and returns to the calling SConscript file @@ -3473,32 +3407,32 @@ the values of the variables named in the vars string arguments. Multiple strings contaning variable names may be passed to -Return. +Return. Any strings that contain white space - + The optional stop= keyword argument may be set to a false value to continue processing the rest of the SConscript file after the -Return +Return call. This was the default behavior prior to SCons 0.98. However, the values returned are still the values of the variables in the named vars at the point -Return +Return is called. - + Examples: - + # Returns without returning a value. Return() @@ -3520,8 +3454,7 @@ Return('val1 val2') env.Scanner(function, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]) - - + Creates a Scanner object for the specified function. @@ -3543,24 +3476,23 @@ below, for a complete explanation of the arguments and behavior. env.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) - - + This tells -scons +scons to execute one or more subsidiary SConscript (configuration) files. Any variables returned by a called script using -Return +Return will be returned by the call to -SConscript. +SConscript. There are two ways to call the -SConscript +SConscript function. - + The first way you can call -SConscript +SConscript is to explicitly specify one or more scripts as the first argument. @@ -3568,45 +3500,45 @@ A single script may be specified as a string; multiple scripts must be specified as a list (either explicitly or as created by a function like -Split). +Split). Examples: - + SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') - + The second way you can call -SConscript +SConscript is to specify a list of (sub)directory names as a dirs=subdirs keyword argument. In this case, -scons +scons will, by default, execute a subsidiary configuration file named -SConscript +SConscript in each of the specified directories. You may specify a name other than -SConscript +SConscript by supplying an optional name=script keyword argument. The first three examples below have the same effect as the first three examples above: - + SConscript(dirs='.') # run SConscript in the current directory SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') - + The optional exports argument provides a list of variable names or a dictionary of @@ -3615,28 +3547,28 @@ named values to export to the These variables are locally exported only to the specified script(s), and do not affect the global pool of variables used by the -Export +Export function. The subsidiary script(s) must use the -Import +Import function to import the variables. Examples: - + foo = SConscript('sub/SConscript', exports='env') SConscript('dir/SConscript', exports=['env', 'variable']) SConscript(dirs='subdir', exports='env variable') SConscript(dirs=['one', 'two', 'three'], exports='shared_info') - + If the optional variant_dir argument is present, it causes an effect equivalent to the -VariantDir +VariantDir method described below. (If variant_dir @@ -3653,14 +3585,14 @@ and arguments are interpreted relative to the directory of the calling --> argument is interpreted relative to the directory of the calling -SConscript +SConscript file. See the description of the -VariantDir +VariantDir function below for additional details and restrictions. - + If variant_dir is present, @@ -3670,46 +3602,46 @@ but is not, --> the source directory is the directory in which the -SConscript +SConscript file resides and the -SConscript +SConscript file is evaluated as if it were in the variant_dir directory: - + SConscript('src/SConscript', variant_dir = 'build') - + is equivalent to - + VariantDir('build', 'src') SConscript('build/SConscript') - + This later paradigm is often used when the sources are in the same directory as the -SConstruct: +SConstruct: - + SConscript('SConscript', variant_dir = 'build') - + is equivalent to - + VariantDir('build', '.') SConscript('build/SConscript') - + - + The optional must_exist argument, if true, causes an exception to be raised if a requested -SConscript file is not found. The current default is false, +SConscript file is not found. The current default is false, causing only a warning to be omitted, but this behavior is deprecated. For scripts which truly intend to be optional, transition to explicty supplying must_exist=False to the call. - + Here are some composite examples: - + # collect the configuration information and use it to build src and doc shared_info = SConscript('MyConfig.py') SConscript('src/SConscript', exports='shared_info') SConscript('doc/SConscript', exports='shared_info') - + # build debugging and production versions. SConscript # can use Dir('.').path to determine variant. SConscript('SConscript', variant_dir='debug', duplicate=0) SConscript('SConscript', variant_dir='prod', duplicate=0) - + # build debugging and production versions. SConscript # is passed flags to use. opts = { 'CPPDEFINES' : ['DEBUG'], 'CCFLAGS' : '-pgdb' } @@ -3780,7 +3712,7 @@ opts = { 'CPPDEFINES' : ['NODEBUG'], 'CCFLAGS' : '-O' } SConscript('SConscript', variant_dir='prod', duplicate=0, exports=opts) - + # build common documentation and compile for different architectures SConscript('doc/SConscript', variant_dir='build/doc', duplicate=0) SConscript('src/SConscript', variant_dir='build/x86', duplicate=0) @@ -3795,10 +3727,9 @@ SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0) env.SConscriptChdir(value) - - + By default, -scons +scons changes its working directory to the directory in which each subsidiary SConscript file lives. @@ -3806,14 +3737,14 @@ This behavior may be disabled by specifying either: - + SConscriptChdir(0) env.SConscriptChdir(0) - + in which case -scons +scons will stay in the top-level directory while reading all SConscript files. (This may be necessary when building from repositories, @@ -3825,11 +3756,11 @@ SConscriptChdir() multiple times. - + Example: - + env = Environment() SConscriptChdir(0) SConscript('foo/SConscript') # will not chdir to foo @@ -3845,10 +3776,9 @@ SConscript('bar/SConscript') # will chdir to bar env.SConsignFile([file, dbm_module]) - - + This tells -scons +scons to store all file signatures in the specified database file. @@ -3865,17 +3795,17 @@ If file is not an absolute path name, the file is placed in the same directory as the top-level -SConstruct +SConstruct file. - + If file is None, then -scons +scons will store file signatures in a separate .sconsign @@ -3885,7 +3815,7 @@ not in one global database file. prior to SCons 0.96.91 and 0.97.) - + The optional dbm_module argument can be used to specify @@ -3897,11 +3827,11 @@ Python data structures, and which works on all Python versions. - + Examples: - + # Explicitly stores signatures in ".sconsign.dblite" # in the top-level SConstruct directory (the # default behavior). @@ -3924,14 +3854,13 @@ SConsignFile(None) env.SetDefault(key=val, [...]) - - + Sets construction variables to default values specified with the keyword arguments if (and only if) the variables are not already set. The following statements are equivalent: - + env.SetDefault(FOO = 'foo') if 'FOO' not in env: env['FOO'] = 'foo' @@ -3945,13 +3874,12 @@ if 'FOO' not in env: env['FOO'] = 'foo' env.SetOption(name, value) - - + This function provides a way to set a select subset of the scons command line options from a SConscript file. The options supported are: - + clean @@ -4036,17 +3964,17 @@ which corresponds to --stack-size. - + See the documentation for the corresponding command line object for information about each specific option. - + Example: - + SetOption('max_drift', 1) @@ -4058,8 +3986,7 @@ SetOption('max_drift', 1) env.SideEffect(side_effect, target) - - + Declares side_effect as a side effect of building @@ -4077,7 +4004,7 @@ files for a static library, and various log files are created updated as side effects of various TeX commands. If a target is a side effect of multiple build commands, -scons +scons will ensure that only one set of commands is executed at a time. Consequently, you only need to use this method @@ -4085,7 +4012,7 @@ for side-effect targets that are built as a result of multiple build commands. - + Because multiple build commands may update the same side effect file, by default the @@ -4109,9 +4036,9 @@ is cleaned whenever a specific is cleaned, you must specify this explicitly with the -Clean +Clean or -env.Clean +env.Clean function. @@ -4123,17 +4050,16 @@ function. env.SourceCode(entries, builder) - - + This function and its associate factory functions are deprecated. There is no replacement. The intended use was to keep a local tree in sync with an archive, but in actuality the function only causes the archive to be fetched on the first run. -Synchronizing with the archive is best done external to SCons. +Synchronizing with the archive is best done external to SCons. - + Arrange for non-existent source files to be fetched from a source code management system using the specified @@ -4146,30 +4072,30 @@ source files or directories in which source files can be found. - + For any non-existent source files, -scons +scons will search up the directory tree and use the first -SourceCode +SourceCode builder it finds. The specified builder may be None, in which case -scons +scons will not use a builder to fetch source files for the specified entries, even if a -SourceCode +SourceCode builder has been specified for a directory higher up the tree. - -scons + +scons will, by default, fetch files from SCCS or RCS subdirectories without explicit configuration. @@ -4181,11 +4107,11 @@ and speed up your build a little by disabling these searches as follows: - + env.SourceCode('.', None) - + Note that if the specified builder is one you create by hand, @@ -4194,8 +4120,8 @@ construction environment to use when fetching a source file. - -scons + +scons provides a set of canned factory functions that return appropriate Builders for various popular @@ -4203,14 +4129,14 @@ source code management systems. Canonical examples of invocation include: - + env.SourceCode('.', env.BitKeeper('/usr/local/BKsources')) env.SourceCode('src', env.CVS('/usr/local/CVSROOT')) env.SourceCode('/', env.RCS()) env.SourceCode(['f1.c', 'f2.c'], env.SCCS()) env.SourceCode('no_source.c', None) - + @@ -4222,21 +4148,20 @@ env.SourceCode('no_source.c', None) env.SourceSignatures(type) - - + Note: Although it is not yet officially deprecated, use of this function is discouraged. See the -Decider +Decider function for a more flexible and straightforward way to configure SCons' decision-making. - + The -SourceSignatures +SourceSignatures function tells -scons +scons how to decide if a source file (a file that is not built from any other files) has changed since the last time it @@ -4247,7 +4172,7 @@ or timestamp. - + If the environment method is used, the specified type of source signature is only used when deciding whether targets @@ -4258,19 +4183,19 @@ used for all decisions about whether targets are up-to-date. - + MD5 means -scons +scons decides that a source file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild a particular target file. - + timestamp means -scons +scons decides that a source file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild a particular target file. @@ -4280,14 +4205,14 @@ by default it will also rebuild if the dependency is than the last time it was used to rebuild the target file.) - + There is no different between the two behaviors for Python -Value +Value node objects. - + MD5 signatures take longer to compute, but are more accurate than @@ -4297,21 +4222,21 @@ The default value is MD5. - + Note that the default -TargetSignatures +TargetSignatures setting (see below) is to use this -SourceSignatures +SourceSignatures setting for any target files that are used to build other target files. Consequently, changing the value of -SourceSignatures +SourceSignatures will, by default, affect the up-to-date decision for all files in the build (or all files built with a specific construction environment when -env.SourceSignatures +env.SourceSignatures is used). @@ -4323,8 +4248,7 @@ is used). env.Split(arg) - - + Returns a list of file names or other objects. If arg is a string, it will be split on strings of white-space characters @@ -4337,11 +4261,11 @@ it will be returned as a list containing just the object. - + Example: - + files = Split("f1.c f2.c f3.c") files = env.Split("f4.c f5.c f6.c") files = Split(""" @@ -4356,14 +4280,13 @@ files = Split(""" env.subst(input, [raw, target, source, conv]) - - + Performs construction variable interpolation on the specified string or sequence argument input. - + By default, leading or trailing white space will be removed from the result. @@ -4395,7 +4318,7 @@ pairs (as is done for signature calculation). - + If the input is a sequence (list or tuple), the individual elements of @@ -4403,7 +4326,7 @@ the sequence will be expanded, and the results will be returned as a list. - + The optional target and @@ -4412,20 +4335,20 @@ keyword arguments must be set to lists of target and source nodes, respectively, if you want the -$TARGET, -$TARGETS, -$SOURCE +$TARGET, +$TARGETS, +$SOURCE and -$SOURCES +$SOURCES to be available for expansion. This is usually necessary if you are calling -env.subst +env.subst from within a Python function used as an SCons action. - + Returned string values or sequence elements are converted to their string representation by default. The optional @@ -4443,11 +4366,11 @@ idiom to pass in an unnamed function that simply returns its unconverted argument. - + Example: - + print env.subst("The C compiler is: $CC") def compile(target, source, env): @@ -4464,20 +4387,19 @@ source_nodes = env.subst('$EXPAND_TO_NODELIST', Tag(node, tags) - - + Annotates file or directory Nodes with information about how the -Package +Package Builder should package those files or directories. All tags are optional. - + Examples: - + # makes sure the built library will be installed with 0644 file # access mode Tag( Library( 'lib.c' ), UNIX_ATTR="0644" ) @@ -4494,21 +4416,20 @@ Tag( 'file2.txt', DOC ) env.TargetSignatures(type) - - + Note: Although it is not yet officially deprecated, use of this function is discouraged. See the -Decider +Decider function for a more flexible and straightforward way to configure SCons' decision-making. - + The -TargetSignatures +TargetSignatures function tells -scons +scons how to decide if a target file (a file that is @@ -4525,7 +4446,7 @@ or "source". - + If the environment method is used, the specified type of target signature is only used for targets built with that environment. @@ -4536,17 +4457,17 @@ don't have an explicit target signature type specified for their environments. - + "content" (or its synonym "MD5") means -scons +scons decides that a target file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild some other target file. This means -scons +scons will open up MD5 sum the contents of target files after they're built, @@ -4555,10 +4476,10 @@ and may decide that it does not need to rebuild rebuilt with exactly the same contents as the last time. - + "timestamp" means -scons +scons decides that a target file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild some other target file. @@ -4568,33 +4489,33 @@ by default it will also rebuild if the dependency is than the last time it was used to rebuild the target file.) - + "source" means -scons +scons decides that a target file has changed as specified by the corresponding -SourceSignatures +SourceSignatures setting ("MD5" or "timestamp"). This means that -scons +scons will treat all input files to a target the same way, regardless of whether they are source files or have been built from other files. - + "build" means -scons +scons decides that a target file has changed if it has been rebuilt in this invocation or if its content or timestamp have changed as specified by the corresponding -SourceSignatures +SourceSignatures setting. This "propagates" the status of a rebuilt file so that other "downstream" target files @@ -4603,7 +4524,7 @@ even if the contents or the timestamp have not changed. - + "build" signatures are fastest because "content" @@ -4625,18 +4546,18 @@ The default value is "source". - + Because the default setting is "source", using -SourceSignatures +SourceSignatures is generally preferable to -TargetSignatures, +TargetSignatures, so that the up-to-date decision will be consistent for all files (or all files built with a specific construction environment). Use of -TargetSignatures +TargetSignatures provides specific control for how built target files affect their "downstream" dependencies. @@ -4649,10 +4570,9 @@ affect their "downstream" dependencies. env.Tool(string, [toolpath, **kw]) - - + The -Tool +Tool form of the function returns a callable object that can be used to initialize @@ -4664,21 +4584,21 @@ in which case the object will add the necessary variables to the construction environment and the name of the tool will be added to the -$TOOLS +$TOOLS construction variable. - + Additional keyword arguments are passed to the tool's generate() method. - + Examples: - + env = Environment(tools = [ Tool('msvc') ]) env = Environment() @@ -4688,22 +4608,22 @@ u = Tool('opengl', toolpath = ['tools']) u(env) # adds 'opengl' to the TOOLS variable - + The -env.Tool +env.Tool form of the function applies the callable object for the specified tool string to the environment through which the method was called. - + Additional keyword arguments are passed to the tool's generate() method. - + env.Tool('gcc') env.Tool('opengl', toolpath = ['build/tools']) @@ -4716,8 +4636,7 @@ env.Tool('opengl', toolpath = ['build/tools']) env.Value(value, [built_value]) - - + Returns a Node object representing the specified Python value. Value Nodes can be used as dependencies of targets. If the result of calling @@ -4731,7 +4650,7 @@ When using timestamp source signatures, Value Nodes' timestamps are equal to the system time when the Node is created. - + The returned Value Node object has a write() method that can be used to "build" a Value Node @@ -4747,11 +4666,11 @@ There is a corresponding method that will return the built value of the Node. - + Examples: - + env = Environment() def create(target, source, env): @@ -4793,10 +4712,9 @@ env.UpdateValue(target = Value(output), source = Value(input)) env.VariantDir(variant_dir, src_dir, [duplicate]) - - + Use the -VariantDir +VariantDir function to create a copy of your sources in another location: if a name under variant_dir @@ -4809,8 +4727,8 @@ than the original sources by simply refering to the sources (and targets) within the variant tree. - -VariantDir + +VariantDir can be called multiple times with the same src_dir to set up multiple builds with different options @@ -4828,9 +4746,9 @@ TODO: src_dir = '.' works fine with a build dir under it. --> - + The default behavior is for -scons +scons to physically duplicate the source files in the variant tree. Thus, a build performed in the variant tree is guaranteed to be identical to a build performed in the source tree even if @@ -4841,7 +4759,7 @@ or individual compilers or other invoked tools are hard-coded to put derived files in the same directory as source files. - + If possible on the platform, the duplication is performed by linking rather than copying; see also the @@ -4852,14 +4770,14 @@ files and directories that are not used are not present in variant_dir. - + Duplicating the source tree may be disabled by setting the duplicate argument to 0 (zero). This will cause -scons +scons to invoke Builders using the path names of source files in src_dir and the path names of derived files within @@ -4870,9 +4788,9 @@ and is usually safe for most builds (but see above for cases that may cause problems). - + Note that -VariantDir +VariantDir works most naturally with a subsidiary SConscript file. However, you would then call the subsidiary SConscript file not in the source directory, but in the @@ -4880,11 +4798,11 @@ not in the source directory, but in the regardless of the value of duplicate. This is how you tell -scons +scons which variant of a source tree to build: - + # run src/SConscript in two variant directories VariantDir('build/variant1', 'src') SConscript('build/variant1/SConscript') @@ -4892,31 +4810,31 @@ VariantDir('build/variant2', 'src') SConscript('build/variant2/SConscript') - + See also the -SConscript +SConscript function, described above, for another way to specify a variant directory in conjunction with calling a subsidiary SConscript file. - + Examples: - + # use names in the build directory, not the source directory VariantDir('build', 'src', duplicate=0) Program('build/prog', 'build/source.c') - + # this builds both the source and docs in a separate subtree VariantDir('build', '.', duplicate=0) SConscript(dirs=['build/src','build/doc']) - + # same as previous example, but only uses SConscript SConscript(dirs='src', variant_dir='build/src', duplicate=0) SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) @@ -4930,8 +4848,7 @@ SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) env.WhereIs(program, [path, pathext, reject]) - - + Searches for the specified executable program, returning the full path name to the program diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index be717e3..be96ed5 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,133 +12,117 @@ %variables-mod; ]> - + 386asm - - + Sets construction variables for the 386ASM assembler for the Phar Lap ETS embedded operating system. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. aixc++ - - + Sets construction variables for the IMB xlc / Visual Age C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. aixcc - - + Sets construction variables for the IBM xlc / Visual Age C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCC;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCC;. aixf77 - - + Sets construction variables for the IBM Visual Age f77 Fortran compiler. -Sets: &cv-link-F77;, &cv-link-SHF77;. +Sets: &cv-link-F77;, &cv-link-SHF77;. aixlink - - + Sets construction variables for the IBM Visual Age linker. -Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. applelink - - + Sets construction variables for the Apple linker (similar to the GNU linker). - Sets: &cv-link-APPLELINK_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_CURRENT_VERSION;, &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_NO_CURRENT_VERSION;, &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LINKCOM;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_APPLELINK_COMPATIBILITY_VERSION;, &cv-link-_APPLELINK_CURRENT_VERSION;, &cv-link-_FRAMEWORKPATH;, &cv-link-_FRAMEWORKS;.Uses: &cv-link-FRAMEWORKSFLAGS;. + Sets: &cv-link-APPLELINK_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_CURRENT_VERSION;, &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_NO_CURRENT_VERSION;, &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LINKCOM;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_APPLELINK_COMPATIBILITY_VERSION;, &cv-link-_APPLELINK_CURRENT_VERSION;, &cv-link-_FRAMEWORKPATH;, &cv-link-_FRAMEWORKS;.Uses: &cv-link-FRAMEWORKSFLAGS;. ar - - -Sets construction variables for the ar library archiver. + +Sets construction variables for the ar library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-RANLIB;, &cv-link-RANLIBCOM;, &cv-link-RANLIBFLAGS;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-RANLIB;, &cv-link-RANLIBCOM;, &cv-link-RANLIBFLAGS;. as - - -Sets construction variables for the as assembler. + +Sets construction variables for the as assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. bcc32 - - + Sets construction variables for the bcc32 compiler. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. cc - - + Sets construction variables for generic POSIX C copmilers. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. clang - - + Set construction variables for the Clang C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. clangxx - - + Set construction variables for the Clang C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. cvf - - + Sets construction variables for the Compaq Visual Fortran compiler. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;. cXX - - + Sets construction variables for generic POSIX C++ compilers. -Sets: &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CXXCOMSTR;. +Sets: &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CXXCOMSTR;. cyglink - - + Set construction variables for cygwin linker/loader. -Sets: &cv-link-IMPLIBPREFIX;, &cv-link-IMPLIBSUFFIX;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LINKFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBPREFIX;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULEVERSIONFLAGS;, &cv-link-_SHLIBVERSIONFLAGS;. +Sets: &cv-link-IMPLIBPREFIX;, &cv-link-IMPLIBSUFFIX;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LINKFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBPREFIX;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULEVERSIONFLAGS;, &cv-link-_SHLIBVERSIONFLAGS;. default - - + Sets variables by calling a default list of Tool modules for the platform on which SCons is running. @@ -146,16 +130,14 @@ for the platform on which SCons is running. dmd - - + Sets construction variables for D language compiler DMD. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. docbook - -This tool tries to make working with Docbook in SCons a little easier. + This tool tries to make working with Docbook in SCons a little easier. It provides several toolchains for creating different output formats, like HTML or PDF. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1.76.1. @@ -163,27 +145,27 @@ As long as you don't specify your own stylesheets for customization, these official versions are picked as default...which should reduce the inevitable setup hassles for you. -Implicit dependencies to images and XIncludes are detected automatically +Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements. The additional stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. -Note, that there is no support for XML catalog resolving offered! This tool calls +Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that's it. The rest lies in your hands and you still have to know what you're doing when resolving names via a catalog. -For activating the tool "docbook", you have to add its name to the Environment constructor, +For activating the tool "docbook", you have to add its name to the Environment constructor, like this -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) -On its startup, the Docbook tool tries to find a required xsltproc processor, and +On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e.g. fop. So make sure that these are added to your system's environment PATH and can be called directly, without specifying their full path. -For the most basic processing of Docbook to HTML, you need to have installed +For the most basic processing of Docbook to HTML, you need to have installed -the Python lxml binding to libxml2, or +the Python lxml binding to libxml2, or the direct Python bindings for libxml2/libxslt, or @@ -194,49 +176,49 @@ and xalan. -Rendering to PDF requires you to have one of the applications +Rendering to PDF requires you to have one of the applications fop or xep installed. -Creating a HTML or PDF document is very simple and straightforward. Say +Creating a HTML or PDF document is very simple and straightforward. Say -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') env.DocbookPdf('manual.pdf', 'manual.xml') -to get both outputs from your XML source manual.xml. As a shortcut, you can +to get both outputs from your XML source manual.xml. As a shortcut, you can give the stem of the filenames alone, like this: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual') env.DocbookPdf('manual') -and get the same result. Target and source lists are also supported: +and get the same result. Target and source lists are also supported: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) -or even +or even -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml(['manual','reference']) -Whenever you leave out the list of sources, you may not specify a file extension! The +Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly. -The rules given above are valid for the Builders DocbookHtml, -DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the -DocbookMan transformation you +The rules given above are valid for the Builders DocbookHtml, +DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the +DocbookMan transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. -The Builders DocbookHtmlChunked, DocbookHtmlhelp and -DocbookSlidesHtml are special, in that: +The Builders DocbookHtmlChunked, DocbookHtmlhelp and +DocbookSlidesHtml are special, in that: -they create a large set of files, where the exact names and their number depend +they create a large set of files, where the exact names and their number depend on the content of the source file, and @@ -245,24 +227,24 @@ XSL transformation is not picked up by the stylesheets. -As a result, there is simply no use in specifying a target HTML name. +As a result, there is simply no use in specifying a target HTML name. So the basic syntax for these builders is always: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') -If you want to use a specific XSL file, you can set the +If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: -env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') +env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') -Since this may get tedious if you always use the same local naming for your customized XSL files, +Since this may get tedious if you always use the same local naming for your customized XSL files, e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of variables for setting the default XSL name is provided. These are: -DOCBOOK_DEFAULT_XSL_HTML +DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF @@ -271,733 +253,654 @@ DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML -and you can set them when constructing your environment: +and you can set them when constructing your environment: -env = Environment(tools=['docbook'], +env = Environment(tools=['docbook'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl -Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. +Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. dvi - - -Attaches the DVI builder to the + +Attaches the DVI builder to the construction environment. dvipdf - - + Sets construction variables for the dvipdf utility. -Sets: &cv-link-DVIPDF;, &cv-link-DVIPDFCOM;, &cv-link-DVIPDFFLAGS;.Uses: &cv-link-DVIPDFCOMSTR;. +Sets: &cv-link-DVIPDF;, &cv-link-DVIPDFCOM;, &cv-link-DVIPDFFLAGS;.Uses: &cv-link-DVIPDFCOMSTR;. dvips - - + Sets construction variables for the dvips utility. -Sets: &cv-link-DVIPS;, &cv-link-DVIPSFLAGS;, &cv-link-PSCOM;, &cv-link-PSPREFIX;, &cv-link-PSSUFFIX;.Uses: &cv-link-PSCOMSTR;. +Sets: &cv-link-DVIPS;, &cv-link-DVIPSFLAGS;, &cv-link-PSCOM;, &cv-link-PSPREFIX;, &cv-link-PSSUFFIX;.Uses: &cv-link-PSCOMSTR;. f03 - - + Set construction variables for generic POSIX Fortran 03 compilers. -Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;. +Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;. f08 - - + Set construction variables for generic POSIX Fortran 08 compilers. -Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;. +Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;. f77 - - + Set construction variables for generic POSIX Fortran 77 compilers. -Sets: &cv-link-F77;, &cv-link-F77COM;, &cv-link-F77FILESUFFIXES;, &cv-link-F77FLAGS;, &cv-link-F77PPCOM;, &cv-link-F77PPFILESUFFIXES;, &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHF77;, &cv-link-SHF77COM;, &cv-link-SHF77FLAGS;, &cv-link-SHF77PPCOM;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;, &cv-link-_F77INCFLAGS;.Uses: &cv-link-F77COMSTR;, &cv-link-F77PPCOMSTR;, &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHF77COMSTR;, &cv-link-SHF77PPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. +Sets: &cv-link-F77;, &cv-link-F77COM;, &cv-link-F77FILESUFFIXES;, &cv-link-F77FLAGS;, &cv-link-F77PPCOM;, &cv-link-F77PPFILESUFFIXES;, &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHF77;, &cv-link-SHF77COM;, &cv-link-SHF77FLAGS;, &cv-link-SHF77PPCOM;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;, &cv-link-_F77INCFLAGS;.Uses: &cv-link-F77COMSTR;, &cv-link-F77PPCOMSTR;, &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHF77COMSTR;, &cv-link-SHF77PPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. f90 - - + Set construction variables for generic POSIX Fortran 90 compilers. -Sets: &cv-link-F90;, &cv-link-F90COM;, &cv-link-F90FLAGS;, &cv-link-F90PPCOM;, &cv-link-SHF90;, &cv-link-SHF90COM;, &cv-link-SHF90FLAGS;, &cv-link-SHF90PPCOM;, &cv-link-_F90INCFLAGS;.Uses: &cv-link-F90COMSTR;, &cv-link-F90PPCOMSTR;, &cv-link-SHF90COMSTR;, &cv-link-SHF90PPCOMSTR;. +Sets: &cv-link-F90;, &cv-link-F90COM;, &cv-link-F90FLAGS;, &cv-link-F90PPCOM;, &cv-link-SHF90;, &cv-link-SHF90COM;, &cv-link-SHF90FLAGS;, &cv-link-SHF90PPCOM;, &cv-link-_F90INCFLAGS;.Uses: &cv-link-F90COMSTR;, &cv-link-F90PPCOMSTR;, &cv-link-SHF90COMSTR;, &cv-link-SHF90PPCOMSTR;. f95 - - + Set construction variables for generic POSIX Fortran 95 compilers. -Sets: &cv-link-F95;, &cv-link-F95COM;, &cv-link-F95FLAGS;, &cv-link-F95PPCOM;, &cv-link-SHF95;, &cv-link-SHF95COM;, &cv-link-SHF95FLAGS;, &cv-link-SHF95PPCOM;, &cv-link-_F95INCFLAGS;.Uses: &cv-link-F95COMSTR;, &cv-link-F95PPCOMSTR;, &cv-link-SHF95COMSTR;, &cv-link-SHF95PPCOMSTR;. +Sets: &cv-link-F95;, &cv-link-F95COM;, &cv-link-F95FLAGS;, &cv-link-F95PPCOM;, &cv-link-SHF95;, &cv-link-SHF95COM;, &cv-link-SHF95FLAGS;, &cv-link-SHF95PPCOM;, &cv-link-_F95INCFLAGS;.Uses: &cv-link-F95COMSTR;, &cv-link-F95PPCOMSTR;, &cv-link-SHF95COMSTR;, &cv-link-SHF95PPCOMSTR;. fortran - - + Set construction variables for generic POSIX Fortran compilers. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. g++ - - -Set construction variables for the gXX C++ compiler. + +Set construction variables for the gXX C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;. g77 - - -Set construction variables for the g77 Fortran compiler. -Calls the f77 Tool module + +Set construction variables for the g77 Fortran compiler. +Calls the f77 Tool module to set variables. gas - - -Sets construction variables for the gas assembler. -Calls the as module. + +Sets construction variables for the gas assembler. +Calls the as module. -Sets: &cv-link-AS;. +Sets: &cv-link-AS;. gcc - - -Set construction variables for the gcc C compiler. + +Set construction variables for the gcc C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. gdc - - + Sets construction variables for the D language compiler GDC. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. gettext - - + This is actually a toolset, which supports internationalization and localization of software being constructed with SCons. The toolset loads following tools: - + - xgettext - to extract internationalized messages from source code to + xgettext - to extract internationalized messages from source code to POT file(s), - msginit - may be optionally used to initialize PO + msginit - may be optionally used to initialize PO files, - msgmerge - to update PO files, that already contain + msgmerge - to update PO files, that already contain translated messages, - msgfmt - to compile textual PO file to binary + msgfmt - to compile textual PO file to binary installable MO file. - -When you enable gettext, it internally loads all abovementioned tools, + +When you enable gettext, it internally loads all abovementioned tools, so you're encouraged to see their individual documentation. - + Each of the above tools provides its own builder(s) which may be used to perform particular activities related to software internationalization. You may be however interested in top-level builder -Translate described few paragraphs later. +Translate described few paragraphs later. - -To use gettext tools add 'gettext' tool to your + +To use gettext tools add 'gettext' tool to your environment: - + env = Environment( tools = ['default', 'gettext'] ) gfortran - - + Sets construction variables for the GNU F95/F2003 GNU compiler. -Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. gnulink - - + Set construction variables for GNU linker/loader. -Sets: &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULESONAME;, &cv-link-_SHLIBSONAME;. +Sets: &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULESONAME;, &cv-link-_SHLIBSONAME;. gs - - + This Tool sets the required construction variables for working with the Ghostscript command. It also registers an appropriate Action -with the PDF Builder (PDF), such that the conversion from +with the PDF Builder (PDF), such that the conversion from PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain. -Finally, it adds an explicit Ghostscript Builder (Gs) to the +Finally, it adds an explicit Ghostscript Builder (Gs) to the environment. -Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. +Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. hpc++ - - + Set construction variables for the compilers aCC on HP/UX systems. hpcc - - + Set construction variables for the aCC on HP/UX systems. -Calls the cXX tool for additional variables. +Calls the cXX tool for additional variables. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;. hplink - - + Sets construction variables for the linker on HP/UX systems. -Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. icc - - + Sets construction variables for the icc compiler on OS/2 systems. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;.Uses: &cv-link-CCFLAGS;, &cv-link-CFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;.Uses: &cv-link-CCFLAGS;, &cv-link-CFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. icl - - + Sets construction variables for the Intel C/C++ compiler. -Calls the intelc Tool module to set its variables. +Calls the intelc Tool module to set its variables. ifl - - + Sets construction variables for the Intel Fortran compiler. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;. ifort - - + Sets construction variables for newer versions of the Intel Fortran compiler for Linux. -Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. ilink - - + Sets construction variables for the ilink linker on OS/2 systems. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. ilink32 - - + Sets construction variables for the Borland ilink32 linker. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. install - - + Sets construction variables for file and directory installation. -Sets: &cv-link-INSTALL;, &cv-link-INSTALLSTR;. +Sets: &cv-link-INSTALL;, &cv-link-INSTALLSTR;. intelc - - + Sets construction variables for the Intel C/C++ compiler (Linux and Windows, version 7 and later). -Calls the gcc or msvc +Calls the gcc or msvc (on Linux and Windows, respectively) to set underlying variables. -Sets: &cv-link-AR;, &cv-link-CC;, &cv-link-CXX;, &cv-link-INTEL_C_COMPILER_VERSION;, &cv-link-LINK;. +Sets: &cv-link-AR;, &cv-link-CC;, &cv-link-CXX;, &cv-link-INTEL_C_COMPILER_VERSION;, &cv-link-LINK;. jar - - -Sets construction variables for the jar utility. + +Sets construction variables for the jar utility. -Sets: &cv-link-JAR;, &cv-link-JARCOM;, &cv-link-JARFLAGS;, &cv-link-JARSUFFIX;.Uses: &cv-link-JARCOMSTR;. +Sets: &cv-link-JAR;, &cv-link-JARCOM;, &cv-link-JARFLAGS;, &cv-link-JARSUFFIX;.Uses: &cv-link-JARCOMSTR;. javac - - - Sets construction variables for the javac compiler. + + Sets construction variables for the javac compiler. - Sets: &cv-link-JAVABOOTCLASSPATH;, &cv-link-JAVAC;, &cv-link-JAVACCOM;, &cv-link-JAVACFLAGS;, &cv-link-JAVACLASSPATH;, &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAINCLUDES;, &cv-link-JAVASOURCEPATH;, &cv-link-JAVASUFFIX;.Uses: &cv-link-JAVACCOMSTR;. + Sets: &cv-link-JAVABOOTCLASSPATH;, &cv-link-JAVAC;, &cv-link-JAVACCOM;, &cv-link-JAVACFLAGS;, &cv-link-JAVACLASSPATH;, &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAINCLUDES;, &cv-link-JAVASOURCEPATH;, &cv-link-JAVASUFFIX;.Uses: &cv-link-JAVACCOMSTR;. javah - - -Sets construction variables for the javah tool. + +Sets construction variables for the javah tool. -Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAH;, &cv-link-JAVAHCOM;, &cv-link-JAVAHFLAGS;.Uses: &cv-link-JAVACLASSPATH;, &cv-link-JAVAHCOMSTR;. +Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAH;, &cv-link-JAVAHCOM;, &cv-link-JAVAHFLAGS;.Uses: &cv-link-JAVACLASSPATH;, &cv-link-JAVAHCOMSTR;. latex - - -Sets construction variables for the latex utility. + +Sets construction variables for the latex utility. -Sets: &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;.Uses: &cv-link-LATEXCOMSTR;. +Sets: &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;.Uses: &cv-link-LATEXCOMSTR;. ldc - - + Sets construction variables for the D language compiler LDC2. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. lex - - -Sets construction variables for the lex lexical analyser. + +Sets construction variables for the lex lexical analyser. -Sets: &cv-link-LEX;, &cv-link-LEXCOM;, &cv-link-LEXFLAGS;, &cv-link-LEXUNISTD;.Uses: &cv-link-LEXCOMSTR;. +Sets: &cv-link-LEX;, &cv-link-LEXCOM;, &cv-link-LEXFLAGS;, &cv-link-LEXUNISTD;.Uses: &cv-link-LEXCOMSTR;. link - - + Sets construction variables for generic POSIX linkers. -Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. linkloc - - + Sets construction variables for the LinkLoc linker for the Phar Lap ETS embedded operating system. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. m4 - - -Sets construction variables for the m4 macro processor. + +Sets construction variables for the m4 macro processor. -Sets: &cv-link-M4;, &cv-link-M4COM;, &cv-link-M4FLAGS;.Uses: &cv-link-M4COMSTR;. +Sets: &cv-link-M4;, &cv-link-M4COM;, &cv-link-M4FLAGS;.Uses: &cv-link-M4COMSTR;. masm - - + Sets construction variables for the Microsoft assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. midl - - + Sets construction variables for the Microsoft IDL compiler. -Sets: &cv-link-MIDL;, &cv-link-MIDLCOM;, &cv-link-MIDLFLAGS;.Uses: &cv-link-MIDLCOMSTR;. +Sets: &cv-link-MIDL;, &cv-link-MIDLCOM;, &cv-link-MIDLFLAGS;.Uses: &cv-link-MIDLCOMSTR;. mingw - - + Sets construction variables for MinGW (Minimal Gnu on Windows). -Sets: &cv-link-AS;, &cv-link-CC;, &cv-link-CXX;, &cv-link-LDMODULECOM;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-RCINCFLAGS;, &cv-link-RCINCPREFIX;, &cv-link-RCINCSUFFIX;, &cv-link-SHCCFLAGS;, &cv-link-SHCXXFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;.Uses: &cv-link-RCCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-AS;, &cv-link-CC;, &cv-link-CXX;, &cv-link-LDMODULECOM;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-RCINCFLAGS;, &cv-link-RCINCPREFIX;, &cv-link-RCINCSUFFIX;, &cv-link-SHCCFLAGS;, &cv-link-SHCXXFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;.Uses: &cv-link-RCCOMSTR;, &cv-link-SHLINKCOMSTR;. msgfmt - - -This scons tool is a part of scons gettext toolset. It provides scons + +This scons tool is a part of scons gettext toolset. It provides scons interface to msgfmt(1) command, which generates binary message catalog (MO) from a textual translation description (PO). -Sets: &cv-link-MOSUFFIX;, &cv-link-MSGFMT;, &cv-link-MSGFMTCOM;, &cv-link-MSGFMTCOMSTR;, &cv-link-MSGFMTFLAGS;, &cv-link-POSUFFIX;.Uses: &cv-link-LINGUAS_FILE;. +Sets: &cv-link-MOSUFFIX;, &cv-link-MSGFMT;, &cv-link-MSGFMTCOM;, &cv-link-MSGFMTCOMSTR;, &cv-link-MSGFMTFLAGS;, &cv-link-POSUFFIX;.Uses: &cv-link-LINGUAS_FILE;. msginit - - -This scons tool is a part of scons gettext toolset. It provides + +This scons tool is a part of scons gettext toolset. It provides scons interface to msginit(1) program, which creates new PO file, initializing the meta information with values from user's environment (or options). -Sets: &cv-link-MSGINIT;, &cv-link-MSGINITCOM;, &cv-link-MSGINITCOMSTR;, &cv-link-MSGINITFLAGS;, &cv-link-POAUTOINIT;, &cv-link-POCREATE_ALIAS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-_MSGINITLOCALE;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. +Sets: &cv-link-MSGINIT;, &cv-link-MSGINITCOM;, &cv-link-MSGINITCOMSTR;, &cv-link-MSGINITFLAGS;, &cv-link-POAUTOINIT;, &cv-link-POCREATE_ALIAS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-_MSGINITLOCALE;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. msgmerge - - -This scons tool is a part of scons gettext toolset. It provides + +This scons tool is a part of scons gettext toolset. It provides scons interface to msgmerge(1) command, which merges two Uniform style .po files together. -Sets: &cv-link-MSGMERGE;, &cv-link-MSGMERGECOM;, &cv-link-MSGMERGECOMSTR;, &cv-link-MSGMERGEFLAGS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-POUPDATE_ALIAS;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. +Sets: &cv-link-MSGMERGE;, &cv-link-MSGMERGECOM;, &cv-link-MSGMERGECOMSTR;, &cv-link-MSGMERGEFLAGS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-POUPDATE_ALIAS;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. mslib - - + Sets construction variables for the Microsoft mslib library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. mslink - - + Sets construction variables for the Microsoft linker. -Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-REGSVR;, &cv-link-REGSVRCOM;, &cv-link-REGSVRFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-WIN32DEFPREFIX;, &cv-link-WIN32DEFSUFFIX;, &cv-link-WIN32EXPPREFIX;, &cv-link-WIN32EXPSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;, &cv-link-WINDOWSEXPPREFIX;, &cv-link-WINDOWSEXPSUFFIX;, &cv-link-WINDOWSPROGMANIFESTPREFIX;, &cv-link-WINDOWSPROGMANIFESTSUFFIX;, &cv-link-WINDOWSSHLIBMANIFESTPREFIX;, &cv-link-WINDOWSSHLIBMANIFESTSUFFIX;, &cv-link-WINDOWS_INSERT_DEF;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-REGSVRCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-REGSVR;, &cv-link-REGSVRCOM;, &cv-link-REGSVRFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-WIN32DEFPREFIX;, &cv-link-WIN32DEFSUFFIX;, &cv-link-WIN32EXPPREFIX;, &cv-link-WIN32EXPSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;, &cv-link-WINDOWSEXPPREFIX;, &cv-link-WINDOWSEXPSUFFIX;, &cv-link-WINDOWSPROGMANIFESTPREFIX;, &cv-link-WINDOWSPROGMANIFESTSUFFIX;, &cv-link-WINDOWSSHLIBMANIFESTPREFIX;, &cv-link-WINDOWSSHLIBMANIFESTSUFFIX;, &cv-link-WINDOWS_INSERT_DEF;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-REGSVRCOMSTR;, &cv-link-SHLINKCOMSTR;. mssdk - - + Sets variables for Microsoft Platform SDK and/or Windows SDK. Note that unlike most other Tool modules, mssdk does not set construction variables, but sets the environment variables -in the environment SCons uses to execute +in the environment SCons uses to execute the Microsoft toolchain: %INCLUDE%, %LIB%, %LIBPATH% and %PATH%. -Uses: &cv-link-MSSDK_DIR;, &cv-link-MSSDK_VERSION;, &cv-link-MSVS_VERSION;. +Uses: &cv-link-MSSDK_DIR;, &cv-link-MSSDK_VERSION;, &cv-link-MSVS_VERSION;. msvc - - + Sets construction variables for the Microsoft Visual C/C++ compiler. -Sets: &cv-link-BUILDERS;, &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CCPCHFLAGS;, &cv-link-CCPDBFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJPREFIX;, &cv-link-OBJSUFFIX;, &cv-link-PCHCOM;, &cv-link-PCHPDBFLAGS;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-PCH;, &cv-link-PCHSTOP;, &cv-link-PDB;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. +Sets: &cv-link-BUILDERS;, &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CCPCHFLAGS;, &cv-link-CCPDBFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJPREFIX;, &cv-link-OBJSUFFIX;, &cv-link-PCHCOM;, &cv-link-PCHPDBFLAGS;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-PCH;, &cv-link-PCHSTOP;, &cv-link-PDB;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. msvs - - Sets construction variables for Microsoft Visual Studio. - Sets: &cv-link-MSVSBUILDCOM;, &cv-link-MSVSCLEANCOM;, &cv-link-MSVSENCODING;, &cv-link-MSVSPROJECTCOM;, &cv-link-MSVSREBUILDCOM;, &cv-link-MSVSSCONS;, &cv-link-MSVSSCONSCOM;, &cv-link-MSVSSCONSCRIPT;, &cv-link-MSVSSCONSFLAGS;, &cv-link-MSVSSOLUTIONCOM;. + Sets construction variables for Microsoft Visual Studio. + Sets: &cv-link-MSVSBUILDCOM;, &cv-link-MSVSCLEANCOM;, &cv-link-MSVSENCODING;, &cv-link-MSVSPROJECTCOM;, &cv-link-MSVSREBUILDCOM;, &cv-link-MSVSSCONS;, &cv-link-MSVSSCONSCOM;, &cv-link-MSVSSCONSCRIPT;, &cv-link-MSVSSCONSFLAGS;, &cv-link-MSVSSOLUTIONCOM;. mwcc - - + Sets construction variables for the Metrowerks CodeWarrior compiler. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-MWCW_VERSION;, &cv-link-MWCW_VERSIONS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-MWCW_VERSION;, &cv-link-MWCW_VERSIONS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. mwld - - + Sets construction variables for the Metrowerks CodeWarrior linker. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;. nasm - - + Sets construction variables for the nasm Netwide Assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. packaging - - + A framework for building binary and source packages. Packaging - - -Sets construction variables for the Package Builder. + +Sets construction variables for the Package Builder. pdf - - + Sets construction variables for the Portable Document Format builder. -Sets: &cv-link-PDFPREFIX;, &cv-link-PDFSUFFIX;. +Sets: &cv-link-PDFPREFIX;, &cv-link-PDFSUFFIX;. pdflatex - - -Sets construction variables for the pdflatex utility. + +Sets construction variables for the pdflatex utility. -Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;. +Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;. pdftex - - -Sets construction variables for the pdftex utility. + +Sets construction variables for the pdftex utility. -Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;. +Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;. qt - - + Sets construction variables for building Qt applications. -Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;. +Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;. rmic - - -Sets construction variables for the rmic utility. + +Sets construction variables for the rmic utility. -Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-RMIC;, &cv-link-RMICCOM;, &cv-link-RMICFLAGS;.Uses: &cv-link-RMICCOMSTR;. +Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-RMIC;, &cv-link-RMICCOM;, &cv-link-RMICFLAGS;.Uses: &cv-link-RMICCOMSTR;. rpcgen - - + Sets construction variables for building with RPCGEN. -Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;. +Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;. sgiar - - + Sets construction variables for the SGI library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOMSTR;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-ARCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOMSTR;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-ARCOMSTR;, &cv-link-SHLINKCOMSTR;. sgic++ - - + Sets construction variables for the SGI C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXFLAGS;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXFLAGS;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. sgicc - - + Sets construction variables for the SGI C compiler. -Sets: &cv-link-CXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-SHOBJSUFFIX;. sgilink - - + Sets construction variables for the SGI linker. -Sets: &cv-link-LINK;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINK;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. sunar - - + Sets construction variables for the Sun library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. sunc++ - - + Sets construction variables for the Sun C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. suncc - - + Sets construction variables for the Sun C compiler. -Sets: &cv-link-CXX;, &cv-link-SHCCFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-SHCCFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. sunf77 - - -Set construction variables for the Sun f77 Fortran compiler. + +Set construction variables for the Sun f77 Fortran compiler. -Sets: &cv-link-F77;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf90 - - -Set construction variables for the Sun f90 Fortran compiler. + +Set construction variables for the Sun f90 Fortran compiler. -Sets: &cv-link-F90;, &cv-link-FORTRAN;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F90;, &cv-link-FORTRAN;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf95 - - -Set construction variables for the Sun f95 Fortran compiler. + +Set construction variables for the Sun f95 Fortran compiler. -Sets: &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunlink - - + Sets construction variables for the Sun linker. -Sets: &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. swig - - + Sets construction variables for the SWIG interface generator. -Sets: &cv-link-SWIG;, &cv-link-SWIGCFILESUFFIX;, &cv-link-SWIGCOM;, &cv-link-SWIGCXXFILESUFFIX;, &cv-link-SWIGDIRECTORSUFFIX;, &cv-link-SWIGFLAGS;, &cv-link-SWIGINCPREFIX;, &cv-link-SWIGINCSUFFIX;, &cv-link-SWIGPATH;, &cv-link-SWIGVERSION;, &cv-link-_SWIGINCFLAGS;.Uses: &cv-link-SWIGCOMSTR;. +Sets: &cv-link-SWIG;, &cv-link-SWIGCFILESUFFIX;, &cv-link-SWIGCOM;, &cv-link-SWIGCXXFILESUFFIX;, &cv-link-SWIGDIRECTORSUFFIX;, &cv-link-SWIGFLAGS;, &cv-link-SWIGINCPREFIX;, &cv-link-SWIGINCSUFFIX;, &cv-link-SWIGPATH;, &cv-link-SWIGVERSION;, &cv-link-_SWIGINCFLAGS;.Uses: &cv-link-SWIGCOMSTR;. tar - - -Sets construction variables for the tar archiver. + +Sets construction variables for the tar archiver. -Sets: &cv-link-TAR;, &cv-link-TARCOM;, &cv-link-TARFLAGS;, &cv-link-TARSUFFIX;.Uses: &cv-link-TARCOMSTR;. +Sets: &cv-link-TAR;, &cv-link-TARCOM;, &cv-link-TARFLAGS;, &cv-link-TARSUFFIX;.Uses: &cv-link-TARCOMSTR;. tex - - + Sets construction variables for the TeX formatter and typesetter. -Sets: &cv-link-BIBTEX;, &cv-link-BIBTEXCOM;, &cv-link-BIBTEXFLAGS;, &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;, &cv-link-MAKEINDEX;, &cv-link-MAKEINDEXCOM;, &cv-link-MAKEINDEXFLAGS;, &cv-link-TEX;, &cv-link-TEXCOM;, &cv-link-TEXFLAGS;.Uses: &cv-link-BIBTEXCOMSTR;, &cv-link-LATEXCOMSTR;, &cv-link-MAKEINDEXCOMSTR;, &cv-link-TEXCOMSTR;. +Sets: &cv-link-BIBTEX;, &cv-link-BIBTEXCOM;, &cv-link-BIBTEXFLAGS;, &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;, &cv-link-MAKEINDEX;, &cv-link-MAKEINDEXCOM;, &cv-link-MAKEINDEXFLAGS;, &cv-link-TEX;, &cv-link-TEXCOM;, &cv-link-TEXFLAGS;.Uses: &cv-link-BIBTEXCOMSTR;, &cv-link-LATEXCOMSTR;, &cv-link-MAKEINDEXCOMSTR;, &cv-link-TEXCOMSTR;. textfile - - -Set construction variables for the Textfile and Substfile builders. + +Set construction variables for the Textfile and Substfile builders. -Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.Uses: &cv-link-SUBST_DICT;. +Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.Uses: &cv-link-SUBST_DICT;. tlib - - + Sets construction variables for the Borlan tib library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. xgettext - - -This scons tool is a part of scons gettext toolset. It provides + +This scons tool is a part of scons gettext toolset. It provides scons interface to xgettext(1) program, which extracts internationalized messages from source code. The tool -provides POTUpdate builder to make PO +provides POTUpdate builder to make PO Template files. -Sets: &cv-link-POTSUFFIX;, &cv-link-POTUPDATE_ALIAS;, &cv-link-XGETTEXTCOM;, &cv-link-XGETTEXTCOMSTR;, &cv-link-XGETTEXTFLAGS;, &cv-link-XGETTEXTFROM;, &cv-link-XGETTEXTFROMPREFIX;, &cv-link-XGETTEXTFROMSUFFIX;, &cv-link-XGETTEXTPATH;, &cv-link-XGETTEXTPATHPREFIX;, &cv-link-XGETTEXTPATHSUFFIX;, &cv-link-_XGETTEXTDOMAIN;, &cv-link-_XGETTEXTFROMFLAGS;, &cv-link-_XGETTEXTPATHFLAGS;.Uses: &cv-link-POTDOMAIN;. +Sets: &cv-link-POTSUFFIX;, &cv-link-POTUPDATE_ALIAS;, &cv-link-XGETTEXTCOM;, &cv-link-XGETTEXTCOMSTR;, &cv-link-XGETTEXTFLAGS;, &cv-link-XGETTEXTFROM;, &cv-link-XGETTEXTFROMPREFIX;, &cv-link-XGETTEXTFROMSUFFIX;, &cv-link-XGETTEXTPATH;, &cv-link-XGETTEXTPATHPREFIX;, &cv-link-XGETTEXTPATHSUFFIX;, &cv-link-_XGETTEXTDOMAIN;, &cv-link-_XGETTEXTFROMFLAGS;, &cv-link-_XGETTEXTPATHFLAGS;.Uses: &cv-link-POTDOMAIN;. yacc - - -Sets construction variables for the yacc parse generator. + +Sets construction variables for the yacc parse generator. -Sets: &cv-link-YACC;, &cv-link-YACCCOM;, &cv-link-YACCFLAGS;, &cv-link-YACCHFILESUFFIX;, &cv-link-YACCHXXFILESUFFIX;, &cv-link-YACCVCGFILESUFFIX;.Uses: &cv-link-YACCCOMSTR;. +Sets: &cv-link-YACC;, &cv-link-YACCCOM;, &cv-link-YACCFLAGS;, &cv-link-YACCHFILESUFFIX;, &cv-link-YACCHXXFILESUFFIX;, &cv-link-YACCVCGFILESUFFIX;.Uses: &cv-link-YACCCOMSTR;. zip - - -Sets construction variables for the zip archiver. + +Sets construction variables for the zip archiver. -Sets: &cv-link-ZIP;, &cv-link-ZIPCOM;, &cv-link-ZIPCOMPRESSION;, &cv-link-ZIPFLAGS;, &cv-link-ZIPSUFFIX;.Uses: &cv-link-ZIPCOMSTR;. +Sets: &cv-link-ZIP;, &cv-link-ZIPCOM;, &cv-link-ZIPCOMPRESSION;, &cv-link-ZIPFLAGS;, &cv-link-ZIPSUFFIX;.Uses: &cv-link-ZIPCOMSTR;. diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index ad64b70..9b4173a 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,125 +12,115 @@ %variables-mod; ]> - + __LDMODULEVERSIONFLAGS - - -This construction variable automatically introduces $_LDMODULEVERSIONFLAGS -if $LDMODULEVERSION is set. Othervise it evaluates to an empty string. + +This construction variable automatically introduces $_LDMODULEVERSIONFLAGS +if $LDMODULEVERSION is set. Othervise it evaluates to an empty string. __SHLIBVERSIONFLAGS - - -This construction variable automatically introduces $_SHLIBVERSIONFLAGS -if $SHLIBVERSION is set. Othervise it evaluates to an empty string. + +This construction variable automatically introduces $_SHLIBVERSIONFLAGS +if $SHLIBVERSION is set. Othervise it evaluates to an empty string. _APPLELINK_COMPATIBILITY_VERSION - - + A macro (by default a generator function) used to create the linker flags to specify apple's linker's -compatibility_version flag. - The default generator uses $APPLELINK_COMPATIBILITY_VERSION - and $APPLELINK_NO_COMPATIBILITY_VERSION and $SHLIBVERSION + The default generator uses $APPLELINK_COMPATIBILITY_VERSION + and $APPLELINK_NO_COMPATIBILITY_VERSION and $SHLIBVERSION to determine the correct flag. APPLELINK_COMPATIBILITY_VERSION - - + On Mac OS X this is used to set the linker flag: -compatibility_version - + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and - 255, Z can be omitted or between 1 and 255. This value will be derived from $SHLIBVERSION if + 255, Z can be omitted or between 1 and 255. This value will be derived from $SHLIBVERSION if not specified. The lowest digit will be dropped and replaced by a 0. - - If the $APPLELINK_NO_COMPATIBILITY_VERSION is set then no -compatibility_version will be + + If the $APPLELINK_NO_COMPATIBILITY_VERSION is set then no -compatibility_version will be output. - See MacOS's ld manpage for more details + See MacOS's ld manpage for more details _APPLELINK_CURRENT_VERSION - - + A macro (by default a generator function) used to create the linker flags to specify apple's linker's - -current_version flag. The default generator uses $APPLELINK_CURRENT_VERSION and - $APPLELINK_NO_CURRENT_VERSION and $SHLIBVERSION to determine the correct flag. + -current_version flag. The default generator uses $APPLELINK_CURRENT_VERSION and + $APPLELINK_NO_CURRENT_VERSION and $SHLIBVERSION to determine the correct flag. APPLELINK_CURRENT_VERSION - - + On Mac OS X this is used to set the linker flag: -current_version - + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and - 255, Z can be omitted or between 1 and 255. This value will be set to $SHLIBVERSION if not + 255, Z can be omitted or between 1 and 255. This value will be set to $SHLIBVERSION if not specified. - - If the $APPLELINK_NO_CURRENT_VERSION is set then no -current_version will be + + If the $APPLELINK_NO_CURRENT_VERSION is set then no -current_version will be output. - See MacOS's ld manpage for more details + See MacOS's ld manpage for more details APPLELINK_NO_COMPATIBILITY_VERSION - - + Set this to any True (1|True|non-empty string) value to disable adding -compatibility_version flag when generating versioned shared libraries. - - This overrides $APPLELINK_COMPATIBILITY_VERSION. + + This overrides $APPLELINK_COMPATIBILITY_VERSION. APPLELINK_NO_CURRENT_VERSION - - + Set this to any True (1|True|non-empty string) value to disable adding -current_version flag when generating versioned shared libraries. - - This overrides $APPLELINK_CURRENT_VERSION. + + This overrides $APPLELINK_CURRENT_VERSION. AR - - + The static library archiver. ARCHITECTURE - - + Specifies the system architecture for which the package is being built. The default is the system architecture @@ -147,46 +137,41 @@ as well as forming part of the name of a generated RPM package file. ARCOM - - + The command line used to generate a static library from object files. ARCOMSTR - - + The string displayed when an object file is generated from an assembly-language source file. -If this is not set, then $ARCOM (the command line) is displayed. +If this is not set, then $ARCOM (the command line) is displayed. - + env = Environment(ARCOMSTR = "Archiving $TARGET") ARFLAGS - - + General options passed to the static library archiver. AS - - + The assembler. ASCOM - - + The command line used to generate an object file from an assembly-language source file. @@ -194,69 +179,63 @@ from an assembly-language source file. ASCOMSTR - - + The string displayed when an object file is generated from an assembly-language source file. -If this is not set, then $ASCOM (the command line) is displayed. +If this is not set, then $ASCOM (the command line) is displayed. - + env = Environment(ASCOMSTR = "Assembling $TARGET") ASFLAGS - - + General options passed to the assembler. ASPPCOM - - + The command line used to assemble an assembly-language source file into an object file after first running the file through the C preprocessor. Any options specified -in the $ASFLAGS and $CPPFLAGS construction variables +in the $ASFLAGS and $CPPFLAGS construction variables are included on this command line. ASPPCOMSTR - - + The string displayed when an object file is generated from an assembly-language source file after first running the file through the C preprocessor. -If this is not set, then $ASPPCOM (the command line) is displayed. +If this is not set, then $ASPPCOM (the command line) is displayed. - + env = Environment(ASPPCOMSTR = "Assembling $TARGET") ASPPFLAGS - - + General options when an assembling an assembly-language source file into an object file after first running the file through the C preprocessor. -The default is to use the value of $ASFLAGS. +The default is to use the value of $ASFLAGS. BIBTEX - - + The bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -264,8 +243,7 @@ LaTeX structured formatter and typesetter. BIBTEXCOM - - + The command line used to call the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -274,22 +252,20 @@ typesetter. BIBTEXCOMSTR - - + The string displayed when generating a bibliography for TeX or LaTeX. -If this is not set, then $BIBTEXCOM (the command line) is displayed. +If this is not set, then $BIBTEXCOM (the command line) is displayed. - + env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET") BIBTEXFLAGS - - + General options passed to the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -297,8 +273,7 @@ and typesetter and the LaTeX structured formatter and typesetter. BUILDERS - - + A dictionary mapping the names of the builders available through this environment to underlying Builder objects. @@ -309,26 +284,26 @@ If you initialize this variable when an Environment is created: - + env = Environment(BUILDERS = {'NewBuilder' : foo}) - + the default Builders will no longer be available. To use a new Builder object in addition to the default Builders, add your new Builder object like this: - + env = Environment() env.Append(BUILDERS = {'NewBuilder' : foo}) - + or this: - + env = Environment() env['BUILDERS']['NewBuilder'] = foo @@ -336,70 +311,64 @@ env['BUILDERS']['NewBuilder'] = foo CC - - + The C compiler. CCCOM - - + The command line used to compile a C source file to a (static) object -file. Any options specified in the $CFLAGS, $CCFLAGS and -$CPPFLAGS construction variables are included on this command +file. Any options specified in the $CFLAGS, $CCFLAGS and +$CPPFLAGS construction variables are included on this command line. CCCOMSTR - - + The string displayed when a C source file is compiled to a (static) object file. -If this is not set, then $CCCOM (the command line) is displayed. +If this is not set, then $CCCOM (the command line) is displayed. - + env = Environment(CCCOMSTR = "Compiling static object $TARGET") CCFLAGS - - + General options that are passed to the C and C++ compilers. CCPCHFLAGS - - + Options added to the compiler command line to support building with precompiled headers. The default value expands expands to the appropriate Microsoft Visual C++ command-line options -when the $PCH construction variable is set. +when the $PCH construction variable is set. CCPDBFLAGS - - + Options added to the compiler command line to support storing debugging information in a Microsoft Visual C++ PDB file. The default value expands expands to appropriate Microsoft Visual C++ command-line options -when the $PDB construction variable is set. +when the $PDB construction variable is set. - + The Visual C++ compiler option that SCons uses by default to generate PDB information is . This works correctly with parallel () builds @@ -412,31 +381,30 @@ link-time performance, although parallel builds will no longer work. - + You can generate PDB files with the -switch by overriding the default $CCPDBFLAGS variable as follows: +switch by overriding the default $CCPDBFLAGS variable as follows: - + env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'] - + An alternative would be to use the to put the debugging information in a separate .pdb file for each object file by overriding -the $CCPDBFLAGS variable as follows: +the $CCPDBFLAGS variable as follows: - + env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb' CCVERSION - - + The version number of the C compiler. This may or may not be set, depending on the specific C compiler being used. @@ -445,8 +413,7 @@ depending on the specific C compiler being used. CFILESUFFIX - - + The suffix for C source files. This is used by the internal CFile builder when generating C files from Lex (.l) or YACC (.y) input files. @@ -463,16 +430,14 @@ as C files. CFLAGS - - + General options that are passed to the C compiler (C only; not C++). CHANGE_SPECFILE - - + A hook for modifying the file that controls the packaging build (the .spec for RPM, the control for Ipkg, @@ -484,8 +449,7 @@ after the SCons template for the file has been written. CHANGED_SOURCES - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -494,8 +458,7 @@ that may not be set or used in a construction environment. CHANGED_TARGETS - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -504,8 +467,7 @@ that may not be set or used in a construction environment. CHANGELOG - - + The name of a file containing the change log text to be included in the package. This is included as the @@ -517,9 +479,8 @@ section of the RPM _concat - - -A function used to produce variables like $_CPPINCFLAGS. It takes + +A function used to produce variables like $_CPPINCFLAGS. It takes four or five arguments: a prefix to concatenate onto each element, a list of elements, a suffix to concatenate onto each element, an environment @@ -527,15 +488,14 @@ for variable interpolation, and an optional function that will be called to transform the list before concatenation. - + env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)', CONFIGUREDIR - - + The name of the directory in which Configure context test files are written. The default is @@ -549,8 +509,7 @@ file. CONFIGURELOG - - + The name of the Configure context log file. The default is config.log @@ -563,50 +522,48 @@ file. _CPPDEFFLAGS - - + An automatically-generated construction variable containing the C preprocessor command-line options to define values. -The value of $_CPPDEFFLAGS is created +The value of $_CPPDEFFLAGS is created by respectively prepending and appending -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX to the beginning and end -of each definition in $CPPDEFINES. +of each definition in $CPPDEFINES. CPPDEFINES - - + A platform independent specification of C preprocessor definitions. The definitions will be added to command lines through the automatically-generated -$_CPPDEFFLAGS construction variable (see above), +$_CPPDEFFLAGS construction variable (see above), which is constructed according to -the type of value of $CPPDEFINES: +the type of value of $CPPDEFINES: - -If $CPPDEFINES is a string, + +If $CPPDEFINES is a string, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end -of each definition in $CPPDEFINES. +of each definition in $CPPDEFINES. - + # Will add -Dxyz to POSIX compiler command lines, # and /Dxyz to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES='xyz') - -If $CPPDEFINES is a list, + +If $CPPDEFINES is a list, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end of each element in the list. @@ -615,16 +572,16 @@ then the first item is the name being defined and the second item is its value: - + # Will add -DB=2 -DA to POSIX compiler command lines, # and /DB=2 /DA to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES=[('B', 2), 'A']) - -If $CPPDEFINES is a dictionary, + +If $CPPDEFINES is a dictionary, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end of each item from the dictionary. @@ -637,11 +594,11 @@ then the name is defined without an explicit value. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time -scons +scons is run. - + # Will add -DA -DB=2 to POSIX compiler command lines, # and /DA /DB=2 to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES={'B':2, 'A':None}) @@ -650,45 +607,42 @@ env = Environment(CPPDEFINES={'B':2, 'A':None}) CPPDEFPREFIX - - + The prefix used to specify preprocessor definitions on the C compiler command line. This will be prepended to the beginning of each definition -in the $CPPDEFINES construction variable -when the $_CPPDEFFLAGS variable is automatically generated. +in the $CPPDEFINES construction variable +when the $_CPPDEFFLAGS variable is automatically generated. CPPDEFSUFFIX - - + The suffix used to specify preprocessor definitions on the C compiler command line. This will be appended to the end of each definition -in the $CPPDEFINES construction variable -when the $_CPPDEFFLAGS variable is automatically generated. +in the $CPPDEFINES construction variable +when the $_CPPDEFFLAGS variable is automatically generated. CPPFLAGS - - + User-specified C preprocessor options. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files -via the $CCCOM, -$SHCCCOM, -$CXXCOM and -$SHCXXCOM command lines, -but also the $FORTRANPPCOM, -$SHFORTRANPPCOM, -$F77PPCOM and -$SHF77PPCOM command lines +via the $CCCOM, +$SHCCCOM, +$CXXCOM and +$SHCXXCOM command lines, +but also the $FORTRANPPCOM, +$SHFORTRANPPCOM, +$F77PPCOM and +$SHF77PPCOM command lines used to compile a Fortran source file, -and the $ASPPCOM command line +and the $ASPPCOM command line used to assemble an assembly language source file, after first running each file through the C preprocessor. Note that this variable does @@ -696,30 +650,28 @@ Note that this variable does contain (or similar) include search path options -that scons generates automatically from $CPPPATH. -See $_CPPINCFLAGS, below, +that scons generates automatically from $CPPPATH. +See $_CPPINCFLAGS, below, for the variable that expands to those options. _CPPINCFLAGS - - + An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. -The value of $_CPPINCFLAGS is created -by respectively prepending and appending $INCPREFIX and $INCSUFFIX +The value of $_CPPINCFLAGS is created +by respectively prepending and appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. CPPPATH - - + The list of directories that the C preprocessor will search for include directories. The C/C++ implicit dependency scanner will search these directories for include files. Don't explicitly put include directory @@ -727,57 +679,56 @@ arguments in CCFLAGS or CXXFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in CPPPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(CPPPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(CPPPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_CPPINCFLAGS +$_CPPINCFLAGS construction variable, which is constructed by respectively prepending and appending the value of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. Any command lines you define that need the CPPPATH directory list should -include $_CPPINCFLAGS: +include $_CPPINCFLAGS: - + env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE") CPPSUFFIXES - - + The list of suffixes of files that will be scanned for C preprocessor implicit dependencies (#include lines). The default list is: - + [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", @@ -788,41 +739,37 @@ The default list is: CXX - - + The C++ compiler. CXXCOM - - + The command line used to compile a C++ source file to an object file. -Any options specified in the $CXXFLAGS and -$CPPFLAGS construction variables +Any options specified in the $CXXFLAGS and +$CPPFLAGS construction variables are included on this command line. CXXCOMSTR - - + The string displayed when a C++ source file is compiled to a (static) object file. -If this is not set, then $CXXCOM (the command line) is displayed. +If this is not set, then $CXXCOM (the command line) is displayed. - + env = Environment(CXXCOMSTR = "Compiling static object $TARGET") CXXFILESUFFIX - - + The suffix for C++ source files. This is used by the internal CXXFile builder when generating C++ files from Lex (.ll) or YACC (.yy) input files. @@ -848,20 +795,18 @@ as C++ files. CXXFLAGS - - + General options that are passed to the C++ compiler. -By default, this includes the value of $CCFLAGS, -so that setting $CCFLAGS affects both C and C++ compilation. +By default, this includes the value of $CCFLAGS, +so that setting $CCFLAGS affects both C and C++ compilation. If you want to add C++-specific flags, -you must set or override the value of $CXXFLAGS. +you must set or override the value of $CXXFLAGS. CXXVERSION - - + The version number of the C++ compiler. This may or may not be set, depending on the specific C++ compiler being used. @@ -870,94 +815,78 @@ depending on the specific C++ compiler being used. DC - - + The D compiler to use. - - + The D compiler to use. - - + The D compiler to use. DCOM - - + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. - - + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. - - + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. DDEBUG - - + List of debug tags to enable when compiling. - - + List of debug tags to enable when compiling. - - + List of debug tags to enable when compiling. DDEBUGPREFIX - - + DDEBUGPREFIX. - - + DDEBUGPREFIX. - - + DDEBUGPREFIX. DDEBUGSUFFIX - - + DDEBUGSUFFIX. - - + DDEBUGSUFFIX. - - + DDEBUGSUFFIX. DESCRIPTION - - + A long description of the project being packaged. This is included in the relevant section of the file that controls the packaging build. @@ -966,8 +895,7 @@ of the file that controls the packaging build. DESCRIPTION_lang - - + A language-specific long description for the specified lang. This is used to populate a @@ -979,109 +907,89 @@ section of an RPM DFILESUFFIX - - + DFILESUFFIX. - - + DFILESUFFIX. - - + DFILESUFFIX. DFLAGPREFIX - - + DFLAGPREFIX. - - + DFLAGPREFIX. - - + DFLAGPREFIX. DFLAGS - - + General options that are passed to the D compiler. - - + General options that are passed to the D compiler. - - + General options that are passed to the D compiler. DFLAGSUFFIX - - + DFLAGSUFFIX. - - + DFLAGSUFFIX. - - + DFLAGSUFFIX. DINCPREFIX - - + DINCPREFIX. - - + DINCPREFIX. - - + DINCPREFIX. DINCSUFFIX - - + DLIBFLAGSUFFIX. - - + DLIBFLAGSUFFIX. - - + DLIBFLAGSUFFIX. Dir - - + A function that converts a string into a Dir instance relative to the target being built. - - + A function that converts a string into a Dir instance relative to the target being built. @@ -1089,8 +997,7 @@ into a Dir instance relative to the target being built. Dirs - - + A function that converts a list of strings into a list of Dir instances relative to the target being built. @@ -1098,288 +1005,240 @@ into a list of Dir instances relative to the target being built. DLIB - - + Name of the lib tool to use for D codes. - - + Name of the lib tool to use for D codes. - - + Name of the lib tool to use for D codes. DLIBCOM - - + The command line to use when creating libraries. - - + The command line to use when creating libraries. - - + The command line to use when creating libraries. DLIBDIRPREFIX - - + DLIBLINKPREFIX. - - + DLIBLINKPREFIX. - - + DLIBLINKPREFIX. DLIBDIRSUFFIX - - + DLIBLINKSUFFIX. - - + DLIBLINKSUFFIX. - - + DLIBLINKSUFFIX. DLIBFLAGPREFIX - - + DLIBFLAGPREFIX. - - + DLIBFLAGPREFIX. - - + DLIBFLAGPREFIX. DLIBFLAGSUFFIX - - + DLIBFLAGSUFFIX. - - + DLIBFLAGSUFFIX. - - + DLIBFLAGSUFFIX. DLIBLINKPREFIX - - + DLIBLINKPREFIX. - - + DLIBLINKPREFIX. - - + DLIBLINKPREFIX. DLIBLINKSUFFIX - - + DLIBLINKSUFFIX. - - + DLIBLINKSUFFIX. - - + DLIBLINKSUFFIX. DLINK - - + Name of the linker to use for linking systems including D sources. - - + Name of the linker to use for linking systems including D sources. - - + Name of the linker to use for linking systems including D sources. DLINKCOM - - + The command line to use when linking systems including D sources. - - + The command line to use when linking systems including D sources. - - + The command line to use when linking systems including D sources. DLINKFLAGPREFIX - - + DLINKFLAGPREFIX. - - + DLINKFLAGPREFIX. - - + DLINKFLAGPREFIX. DLINKFLAGS - - + List of linker flags. - - + List of linker flags. - - + List of linker flags. DLINKFLAGSUFFIX - - + DLINKFLAGSUFFIX. - - + DLINKFLAGSUFFIX. - - + DLINKFLAGSUFFIX. DOCBOOK_DEFAULT_XSL_EPUB - - -The default XSLT file for the DocbookEpub builder within the + +The default XSLT file for the DocbookEpub builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTML - - -The default XSLT file for the DocbookHtml builder within the + +The default XSLT file for the DocbookHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLCHUNKED - - -The default XSLT file for the DocbookHtmlChunked builder within the + +The default XSLT file for the DocbookHtmlChunked builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLHELP - - -The default XSLT file for the DocbookHtmlhelp builder within the + +The default XSLT file for the DocbookHtmlhelp builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_MAN - - -The default XSLT file for the DocbookMan builder within the + +The default XSLT file for the DocbookMan builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_PDF - - -The default XSLT file for the DocbookPdf builder within the + +The default XSLT file for the DocbookPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESHTML - - -The default XSLT file for the DocbookSlidesHtml builder within the + +The default XSLT file for the DocbookSlidesHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESPDF - - -The default XSLT file for the DocbookSlidesPdf builder within the + +The default XSLT file for the DocbookSlidesPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_FOP - - + The path to the PDF renderer fop or xep, if one of them is installed (fop gets checked first). @@ -1387,8 +1246,7 @@ if one of them is installed (fop gets checked first). DOCBOOK_FOPCOM - - + The full command-line for the PDF renderer fop or xep. @@ -1396,8 +1254,7 @@ PDF renderer fop or xep. DOCBOOK_FOPCOMSTR - - + The string displayed when a renderer like fop or xep is used to create PDF output from an XML file. @@ -1405,8 +1262,7 @@ The string displayed when a renderer like fop or DOCBOOK_FOPFLAGS - - + Additonal command-line flags for the PDF renderer fop or xep. @@ -1414,8 +1270,7 @@ PDF renderer fop or xep. DOCBOOK_XMLLINT - - + The path to the external executable xmllint, if it's installed. Note, that this is only used as last fallback for resolving XIncludes, if no libxml2 or lxml Python binding can be imported @@ -1425,8 +1280,7 @@ in the current system. DOCBOOK_XMLLINTCOM - - + The full command-line for the external executable xmllint. @@ -1434,8 +1288,7 @@ The full command-line for the external executable DOCBOOK_XMLLINTCOMSTR - - + The string displayed when xmllint is used to resolve XIncludes for a given XML file. @@ -1443,8 +1296,7 @@ XIncludes for a given XML file. DOCBOOK_XMLLINTFLAGS - - + Additonal command-line flags for the external executable xmllint. @@ -1452,8 +1304,7 @@ Additonal command-line flags for the external executable DOCBOOK_XSLTPROC - - + The path to the external executable xsltproc (or saxon, xalan), if one of them is installed. @@ -1464,8 +1315,7 @@ no libxml2 or lxml Python binding can be imported in the current system. DOCBOOK_XSLTPROCCOM - - + The full command-line for the external executable xsltproc (or saxon, xalan). @@ -1474,8 +1324,7 @@ The full command-line for the external executable DOCBOOK_XSLTPROCCOMSTR - - + The string displayed when xsltproc is used to transform an XML file via a given XSLT stylesheet. @@ -1483,8 +1332,7 @@ an XML file via a given XSLT stylesheet. DOCBOOK_XSLTPROCFLAGS - - + Additonal command-line flags for the external executable xsltproc (or saxon, xalan). @@ -1493,8 +1341,7 @@ Additonal command-line flags for the external executable DOCBOOK_XSLTPROCPARAMS - - + Additonal parameters that are not intended for the XSLT processor executable, but the XSL processing itself. By default, they get appended at the end of the command line for saxon and saxon-xslt, respectively. @@ -1503,181 +1350,158 @@ for saxon and saxon-xslt, respectively. DPATH - - + List of paths to search for import modules. - - + List of paths to search for import modules. - - + List of paths to search for import modules. DRPATHPREFIX - - + DRPATHPREFIX. DRPATHSUFFIX - - + DRPATHSUFFIX. DShLibSonameGenerator - - + DShLibSonameGenerator. DSUFFIXES - - + The list of suffixes of files that will be scanned for imported D package files. The default list is: - + ['.d'] DVERPREFIX - - + DVERPREFIX. - - + DVERPREFIX. - - + DVERPREFIX. DVERSIONS - - + List of version tags to enable when compiling. - - + List of version tags to enable when compiling. - - + List of version tags to enable when compiling. DVERSUFFIX - - + DVERSUFFIX. - - + DVERSUFFIX. - - + DVERSUFFIX. DVIPDF - - + The TeX DVI file to PDF file converter. DVIPDFCOM - - + The command line used to convert TeX DVI files into a PDF file. DVIPDFCOMSTR - - + The string displayed when a TeX DVI file is converted into a PDF file. -If this is not set, then $DVIPDFCOM (the command line) is displayed. +If this is not set, then $DVIPDFCOM (the command line) is displayed. DVIPDFFLAGS - - + General options passed to the TeX DVI file to PDF file converter. DVIPS - - + The TeX DVI file to PostScript converter. DVIPSFLAGS - - + General options passed to the TeX DVI file to PostScript converter. ENV - - + A dictionary of environment variables to use when invoking commands. When -$ENV is used in a command all list +$ENV is used in a command all list values will be joined using the path separator and any other non-string values will simply be coerced to a string. Note that, by default, -scons +scons does not propagate the environment in force when you execute -scons +scons to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time -scons +scons is invoked. - + If you want to propagate your environment variables to the commands executed @@ -1685,12 +1509,12 @@ to build target files, you must do so explicitly: - + import os env = Environment(ENV = os.environ) - + Note that you can choose only to propagate certain environment variables. A common example is @@ -1698,12 +1522,12 @@ the system PATH environment variable, so that -scons +scons uses the same utilities as the invoking shell (or other process): - + import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) @@ -1711,8 +1535,7 @@ env = Environment(ENV = {'PATH' : os.environ['PATH']}) ESCAPE - - + A function that will be called to escape shell special characters in command lines. The function should take one argument: the command line string to escape; and should return the escaped command line. @@ -1721,25 +1544,23 @@ string to escape; and should return the escaped command line. F03 - - + The Fortran 03 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F03 if you need to use a specific compiler +You only need to set $F03 if you need to use a specific compiler or compiler version for Fortran 03 files. F03COM - - + The command line used to compile a Fortran 03 source file to an object file. -You only need to set $F03COM if you need to use a specific +You only need to set $F03COM if you need to use a specific command line for Fortran 03 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -1747,19 +1568,17 @@ for all Fortran versions. F03COMSTR - - + The string displayed when a Fortran 03 source file is compiled to an object file. -If this is not set, then $F03COM or $FORTRANCOM +If this is not set, then $F03COM or $FORTRANCOM (the command line) is displayed. F03FILESUFFIXES - - + The list of file extensions for which the F03 dialect will be used. By default, this is ['.f03'] @@ -1767,22 +1586,21 @@ default, this is ['.f03'] F03FLAGS - - + General user-specified options that are passed to the Fortran 03 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F03PATH. +that scons generates automatically from $F03PATH. See -$_F03INCFLAGS +$_F03INCFLAGS below, for the variable that expands to those options. -You only need to set $F03FLAGS if you need to define specific +You only need to set $F03FLAGS if you need to define specific user options for Fortran 03 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -1791,86 +1609,83 @@ for all Fortran versions. _F03INCFLAGS - - + An automatically-generated construction variable containing the Fortran 03 compiler command-line options for specifying directories to be searched for include files. -The value of $_F03INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F03INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F03PATH. +of each directory in $F03PATH. F03PATH - - + The list of directories that the Fortran 03 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F03FLAGS because the result will be non-portable +arguments in $F03FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F03PATH will be looked-up relative to the SConscript +directory names in $F03PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F03PATH if you need to define a specific +You only need to set $F03PATH if you need to define a specific include path for Fortran 03 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F03PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F03PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F03INCFLAGS +$_F03INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F03PATH. +of each directory in $F03PATH. Any command lines you define that need the F03PATH directory list should -include $_F03INCFLAGS: +include $_F03INCFLAGS: - + env = Environment(F03COM="my_compiler $_F03INCFLAGS -c -o $TARGET $SOURCE") F03PPCOM - - + The command line used to compile a Fortran 03 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F03FLAGS and $CPPFLAGS construction variables +Any options specified in the $F03FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F03PPCOM if you need to use a specific +You only need to set $F03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -1878,20 +1693,18 @@ for all Fortran versions. F03PPCOMSTR - - + 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 $F03PPCOM or $FORTRANPPCOM +If this is not set, then $F03PPCOM or $FORTRANPPCOM (the command line) is displayed. F03PPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for F03 dialect will be used. By default, this is empty @@ -1899,25 +1712,23 @@ F03 dialect will be used. By default, this is empty F08 - - + The Fortran 08 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F08 if you need to use a specific compiler +You only need to set $F08 if you need to use a specific compiler or compiler version for Fortran 08 files. F08COM - - + The command line used to compile a Fortran 08 source file to an object file. -You only need to set $F08COM if you need to use a specific +You only need to set $F08COM if you need to use a specific command line for Fortran 08 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -1925,19 +1736,17 @@ for all Fortran versions. F08COMSTR - - + The string displayed when a Fortran 08 source file is compiled to an object file. -If this is not set, then $F08COM or $FORTRANCOM +If this is not set, then $F08COM or $FORTRANCOM (the command line) is displayed. F08FILESUFFIXES - - + The list of file extensions for which the F08 dialect will be used. By default, this is ['.f08'] @@ -1945,22 +1754,21 @@ default, this is ['.f08'] F08FLAGS - - + General user-specified options that are passed to the Fortran 08 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F08PATH. +that scons generates automatically from $F08PATH. See -$_F08INCFLAGS +$_F08INCFLAGS below, for the variable that expands to those options. -You only need to set $F08FLAGS if you need to define specific +You only need to set $F08FLAGS if you need to define specific user options for Fortran 08 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -1969,86 +1777,83 @@ for all Fortran versions. _F08INCFLAGS - - + An automatically-generated construction variable containing the Fortran 08 compiler command-line options for specifying directories to be searched for include files. -The value of $_F08INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F08INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F08PATH. +of each directory in $F08PATH. F08PATH - - + The list of directories that the Fortran 08 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F08FLAGS because the result will be non-portable +arguments in $F08FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F08PATH will be looked-up relative to the SConscript +directory names in $F08PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F08PATH if you need to define a specific +You only need to set $F08PATH if you need to define a specific include path for Fortran 08 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F08PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F08PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F08INCFLAGS +$_F08INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F08PATH. +of each directory in $F08PATH. Any command lines you define that need the F08PATH directory list should -include $_F08INCFLAGS: +include $_F08INCFLAGS: - + env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE") F08PPCOM - - + The command line used to compile a Fortran 08 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F08FLAGS and $CPPFLAGS construction variables +Any options specified in the $F08FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F08PPCOM if you need to use a specific +You only need to set $F08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2056,20 +1861,18 @@ for all Fortran versions. F08PPCOMSTR - - + 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 $F08PPCOM or $FORTRANPPCOM +If this is not set, then $F08PPCOM or $FORTRANPPCOM (the command line) is displayed. F08PPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for F08 dialect will be used. By default, this is empty @@ -2077,25 +1880,23 @@ F08 dialect will be used. By default, this is empty F77 - - + The Fortran 77 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F77 if you need to use a specific compiler +You only need to set $F77 if you need to use a specific compiler or compiler version for Fortran 77 files. F77COM - - + The command line used to compile a Fortran 77 source file to an object file. -You only need to set $F77COM if you need to use a specific +You only need to set $F77COM if you need to use a specific command line for Fortran 77 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -2103,19 +1904,17 @@ for all Fortran versions. F77COMSTR - - + The string displayed when a Fortran 77 source file is compiled to an object file. -If this is not set, then $F77COM or $FORTRANCOM +If this is not set, then $F77COM or $FORTRANCOM (the command line) is displayed. F77FILESUFFIXES - - + The list of file extensions for which the F77 dialect will be used. By default, this is ['.f77'] @@ -2123,22 +1922,21 @@ default, this is ['.f77'] F77FLAGS - - + General user-specified options that are passed to the Fortran 77 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F77PATH. +that scons generates automatically from $F77PATH. See -$_F77INCFLAGS +$_F77INCFLAGS below, for the variable that expands to those options. -You only need to set $F77FLAGS if you need to define specific +You only need to set $F77FLAGS if you need to define specific user options for Fortran 77 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -2147,86 +1945,83 @@ for all Fortran versions. _F77INCFLAGS - - + An automatically-generated construction variable containing the Fortran 77 compiler command-line options for specifying directories to be searched for include files. -The value of $_F77INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F77INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F77PATH. +of each directory in $F77PATH. F77PATH - - + The list of directories that the Fortran 77 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F77FLAGS because the result will be non-portable +arguments in $F77FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F77PATH will be looked-up relative to the SConscript +directory names in $F77PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F77PATH if you need to define a specific +You only need to set $F77PATH if you need to define a specific include path for Fortran 77 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F77PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F77PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F77INCFLAGS +$_F77INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F77PATH. +of each directory in $F77PATH. Any command lines you define that need the F77PATH directory list should -include $_F77INCFLAGS: +include $_F77INCFLAGS: - + env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE") F77PPCOM - - + The command line used to compile a Fortran 77 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F77FLAGS and $CPPFLAGS construction variables +Any options specified in the $F77FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F77PPCOM if you need to use a specific +You only need to set $F77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2234,20 +2029,18 @@ for all Fortran versions. F77PPCOMSTR - - + 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 $F77PPCOM or $FORTRANPPCOM +If this is not set, then $F77PPCOM or $FORTRANPPCOM (the command line) is displayed. F77PPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for F77 dialect will be used. By default, this is empty @@ -2255,25 +2048,23 @@ F77 dialect will be used. By default, this is empty F90 - - + The Fortran 90 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F90 if you need to use a specific compiler +You only need to set $F90 if you need to use a specific compiler or compiler version for Fortran 90 files. F90COM - - + The command line used to compile a Fortran 90 source file to an object file. -You only need to set $F90COM if you need to use a specific +You only need to set $F90COM if you need to use a specific command line for Fortran 90 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -2281,19 +2072,17 @@ for all Fortran versions. F90COMSTR - - + The string displayed when a Fortran 90 source file is compiled to an object file. -If this is not set, then $F90COM or $FORTRANCOM +If this is not set, then $F90COM or $FORTRANCOM (the command line) is displayed. F90FILESUFFIXES - - + The list of file extensions for which the F90 dialect will be used. By default, this is ['.f90'] @@ -2301,22 +2090,21 @@ default, this is ['.f90'] F90FLAGS - - + General user-specified options that are passed to the Fortran 90 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F90PATH. +that scons generates automatically from $F90PATH. See -$_F90INCFLAGS +$_F90INCFLAGS below, for the variable that expands to those options. -You only need to set $F90FLAGS if you need to define specific +You only need to set $F90FLAGS if you need to define specific user options for Fortran 90 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -2325,86 +2113,83 @@ for all Fortran versions. _F90INCFLAGS - - + An automatically-generated construction variable containing the Fortran 90 compiler command-line options for specifying directories to be searched for include files. -The value of $_F90INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F90INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F90PATH. +of each directory in $F90PATH. F90PATH - - + The list of directories that the Fortran 90 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F90FLAGS because the result will be non-portable +arguments in $F90FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F90PATH will be looked-up relative to the SConscript +directory names in $F90PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F90PATH if you need to define a specific +You only need to set $F90PATH if you need to define a specific include path for Fortran 90 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F90PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F90PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F90INCFLAGS +$_F90INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F90PATH. +of each directory in $F90PATH. Any command lines you define that need the F90PATH directory list should -include $_F90INCFLAGS: +include $_F90INCFLAGS: - + env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE") F90PPCOM - - + The command line used to compile a Fortran 90 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F90FLAGS and $CPPFLAGS construction variables +Any options specified in the $F90FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F90PPCOM if you need to use a specific +You only need to set $F90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2412,19 +2197,17 @@ for all Fortran versions. F90PPCOMSTR - - + 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 $F90PPCOM or $FORTRANPPCOM +If this is not set, then $F90PPCOM or $FORTRANPPCOM (the command line) is displayed. F90PPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for F90 dialect will be used. By default, this is empty @@ -2432,25 +2215,23 @@ F90 dialect will be used. By default, this is empty F95 - - + The Fortran 95 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F95 if you need to use a specific compiler +You only need to set $F95 if you need to use a specific compiler or compiler version for Fortran 95 files. F95COM - - + The command line used to compile a Fortran 95 source file to an object file. -You only need to set $F95COM if you need to use a specific +You only need to set $F95COM if you need to use a specific command line for Fortran 95 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -2458,19 +2239,17 @@ for all Fortran versions. F95COMSTR - - + The string displayed when a Fortran 95 source file is compiled to an object file. -If this is not set, then $F95COM or $FORTRANCOM +If this is not set, then $F95COM or $FORTRANCOM (the command line) is displayed. F95FILESUFFIXES - - + The list of file extensions for which the F95 dialect will be used. By default, this is ['.f95'] @@ -2478,22 +2257,21 @@ default, this is ['.f95'] F95FLAGS - - + General user-specified options that are passed to the Fortran 95 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F95PATH. +that scons generates automatically from $F95PATH. See -$_F95INCFLAGS +$_F95INCFLAGS below, for the variable that expands to those options. -You only need to set $F95FLAGS if you need to define specific +You only need to set $F95FLAGS if you need to define specific user options for Fortran 95 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -2502,86 +2280,83 @@ for all Fortran versions. _F95INCFLAGS - - + An automatically-generated construction variable containing the Fortran 95 compiler command-line options for specifying directories to be searched for include files. -The value of $_F95INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F95INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F95PATH. +of each directory in $F95PATH. F95PATH - - + The list of directories that the Fortran 95 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F95FLAGS because the result will be non-portable +arguments in $F95FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F95PATH will be looked-up relative to the SConscript +directory names in $F95PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F95PATH if you need to define a specific +You only need to set $F95PATH if you need to define a specific include path for Fortran 95 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F95PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F95PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F95INCFLAGS +$_F95INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F95PATH. +of each directory in $F95PATH. Any command lines you define that need the F95PATH directory list should -include $_F95INCFLAGS: +include $_F95INCFLAGS: - + env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE") F95PPCOM - - + The command line used to compile a Fortran 95 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F95FLAGS and $CPPFLAGS construction variables +Any options specified in the $F95FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F95PPCOM if you need to use a specific +You only need to set $F95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2589,20 +2364,18 @@ for all Fortran versions. F95PPCOMSTR - - + 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 $F95PPCOM or $FORTRANPPCOM +If this is not set, then $F95PPCOM or $FORTRANPPCOM (the command line) is displayed. F95PPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for F95 dialect will be used. By default, this is empty @@ -2610,13 +2383,11 @@ F95 dialect will be used. By default, this is empty File - - + A function that converts a string into a File instance relative to the target being built. - - + A function that converts a string into a File instance relative to the target being built. @@ -2624,8 +2395,7 @@ target being built. FORTRAN - - + The default Fortran compiler for all versions of Fortran. @@ -2633,34 +2403,31 @@ for all versions of Fortran. FORTRANCOM - - + The command line used to compile a Fortran source file to an object file. By default, any options specified -in the $FORTRANFLAGS, -$CPPFLAGS, -$_CPPDEFFLAGS, -$_FORTRANMODFLAG, and -$_FORTRANINCFLAGS construction variables +in the $FORTRANFLAGS, +$CPPFLAGS, +$_CPPDEFFLAGS, +$_FORTRANMODFLAG, and +$_FORTRANINCFLAGS construction variables are included on this command line. FORTRANCOMSTR - - + The string displayed when a Fortran source file is compiled to an object file. -If this is not set, then $FORTRANCOM +If this is not set, then $FORTRANCOM (the command line) is displayed. FORTRANFILESUFFIXES - - + The list of file extensions for which the FORTRAN dialect will be used. By default, this is ['.f', '.for', '.ftn'] @@ -2668,17 +2435,16 @@ default, this is ['.f', '.for', '.ftn'] FORTRANFLAGS - - + General user-specified options that are passed to the Fortran compiler. Note that this variable does not contain (or similar) include or module search path options -that scons generates automatically from $FORTRANPATH. +that scons generates automatically from $FORTRANPATH. See -$_FORTRANINCFLAGS and $_FORTRANMODFLAG, +$_FORTRANINCFLAGS and $_FORTRANMODFLAG, below, for the variables that expand those options. @@ -2686,24 +2452,22 @@ for the variables that expand those options. _FORTRANINCFLAGS - - + An automatically-generated construction variable containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. -The value of $_FORTRANINCFLAGS is created +The value of $_FORTRANINCFLAGS is created by respectively prepending and appending -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $FORTRANPATH. +of each directory in $FORTRANPATH. FORTRANMODDIR - - + Directory location where the Fortran compiler should place any module files it generates. This variable is empty, by default. Some Fortran compilers will internally append this directory in the search path @@ -2713,48 +2477,44 @@ for module files, as well. FORTRANMODDIRPREFIX - - + The prefix used to specify a module directory on the Fortran compiler command line. This will be prepended to the beginning of the directory -in the $FORTRANMODDIR construction variables -when the $_FORTRANMODFLAG variables is automatically generated. +in the $FORTRANMODDIR construction variables +when the $_FORTRANMODFLAG variables is automatically generated. FORTRANMODDIRSUFFIX - - + The suffix used to specify a module directory on the Fortran compiler command line. This will be appended to the end of the directory -in the $FORTRANMODDIR construction variables -when the $_FORTRANMODFLAG variables is automatically generated. +in the $FORTRANMODDIR construction variables +when the $_FORTRANMODFLAG variables is automatically generated. _FORTRANMODFLAG - - + An automatically-generated construction variable containing the Fortran compiler command-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. -The value of $_FORTRANMODFLAG is created +The value of $_FORTRANMODFLAG is created by respectively prepending and appending -$FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX -to the beginning and end of the directory in $FORTRANMODDIR. +$FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX +to the beginning and end of the directory in $FORTRANMODDIR. FORTRANMODPREFIX - - + The module file prefix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of @@ -2768,8 +2528,7 @@ module file name as scons attempts to resolve dependencies. FORTRANMODSUFFIX - - + The module file suffix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of @@ -2783,8 +2542,7 @@ module file name as scons attempts to resolve dependencies. FORTRANPATH - - + The list of directories that the Fortran compiler will search for include files and (for some compilers) module files. The Fortran implicit dependency scanner will search these directories for include files (but @@ -2794,77 +2552,74 @@ include directory arguments in FORTRANFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in FORTRANPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(FORTRANPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(FORTRANPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_FORTRANINCFLAGS +$_FORTRANINCFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $FORTRANPATH. +of each directory in $FORTRANPATH. Any command lines you define that need the FORTRANPATH directory list should -include $_FORTRANINCFLAGS: +include $_FORTRANINCFLAGS: - + env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE") FORTRANPPCOM - - + The command line used to compile a Fortran source file to an object file after first running the file through the C preprocessor. -By default, any options specified in the $FORTRANFLAGS, -$CPPFLAGS, -$_CPPDEFFLAGS, -$_FORTRANMODFLAG, and -$_FORTRANINCFLAGS +By default, any options specified in the $FORTRANFLAGS, +$CPPFLAGS, +$_CPPDEFFLAGS, +$_FORTRANMODFLAG, and +$_FORTRANINCFLAGS construction variables are included on this command line. FORTRANPPCOMSTR - - + 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 $FORTRANPPCOM +If this is not set, then $FORTRANPPCOM (the command line) is displayed. FORTRANPPFILESUFFIXES - - + The list of file extensions for which the compilation + preprocessor pass for FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] @@ -2872,15 +2627,14 @@ FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] FORTRANSUFFIXES - - + The list of suffixes of files that will be scanned for Fortran implicit dependencies (INCLUDE lines and USE statements). The default list is: - + [".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP", ".f77", ".F77", ".f90", ".F90", ".f95", ".F95"] @@ -2888,50 +2642,47 @@ The default list is: FRAMEWORKPATH - - + On Mac OS X with gcc, a list containing the paths to search for frameworks. Used by the compiler to find framework-style includes like #include <Fmwk/Header.h>. Used by the linker to find user-specified frameworks when linking (see - $FRAMEWORKS). + $FRAMEWORKS). For example: - + env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') - + will add - + ... -Fmyframeworkdir - + to the compiler and linker command lines. _FRAMEWORKPATH - - + On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options corresponding to - $FRAMEWORKPATH. + $FRAMEWORKPATH. FRAMEWORKPATHPREFIX - - + On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. - (see $FRAMEWORKPATH). + (see $FRAMEWORKPATH). The default value is . @@ -2939,11 +2690,10 @@ The default list is: FRAMEWORKPREFIX - - + On Mac OS X with gcc, the prefix to be used for linking in frameworks - (see $FRAMEWORKS). + (see $FRAMEWORKS). The default value is . @@ -2951,8 +2701,7 @@ The default list is: _FRAMEWORKS - - + On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options @@ -2962,15 +2711,14 @@ The default list is: FRAMEWORKS - - + On Mac OS X with gcc, a list of the framework names to be linked into a program or shared library or bundle. The default value is the empty list. For example: - + env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) @@ -2978,31 +2726,28 @@ The default list is: FRAMEWORKSFLAGS - - + On Mac OS X with gcc, general user-supplied frameworks options to be added at the end of a command line building a loadable module. (This has been largely superseded by - the $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX, - $FRAMEWORKPREFIX and $FRAMEWORKS variables + the $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX, + $FRAMEWORKPREFIX and $FRAMEWORKS variables described above.) GS - - + The Ghostscript program used, e.g. to convert PostScript to PDF files. GSCOM - - + The full Ghostscript command line used for the conversion process. Its default value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES. @@ -3010,18 +2755,16 @@ value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES GSCOMSTR - - + The string displayed when Ghostscript is called for the conversion process. -If this is not set (the default), then $GSCOM (the command line) is displayed. +If this is not set (the default), then $GSCOM (the command line) is displayed. GSFLAGS - - + General options passed to the Ghostscript program, when converting PostScript to PDF files for example. Its default value is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite @@ -3030,8 +2773,7 @@ is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite HOST_ARCH - - + The name of the host hardware architecture used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. @@ -3039,8 +2781,7 @@ is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite the Environment is initialized. Currently only set for Win32. - - + Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. @@ -3048,11 +2789,11 @@ This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - -Valid values are the same as for $TARGET_ARCH. + +Valid values are the same as for $TARGET_ARCH. - + This is currently only used on Windows, but in the future it will be used on other OSes as well. @@ -3060,8 +2801,7 @@ used on other OSes as well. HOST_OS - - + The name of the host operating system used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. @@ -3073,75 +2813,69 @@ used on other OSes as well. IDLSUFFIXES - - + The list of suffixes of files that will be scanned for IDL implicit dependencies (#include or import lines). The default list is: - + [".idl", ".IDL"] IMPLIBNOVERSIONSYMLINKS - - -Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS when + +Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS when creating versioned import library for a shared library/loadable module. If not defined, -then $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS is used to determine +then $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS is used to determine whether to disable symlink generation or not. IMPLIBPREFIX - - + The prefix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries -(cygfoo.dll). The cyglink linker sets -$IMPLIBPREFIX to 'lib' and $SHLIBPREFIX +(cygfoo.dll). The cyglink linker sets +$IMPLIBPREFIX to 'lib' and $SHLIBPREFIX to 'cyg'. IMPLIBSUFFIX - - + The suffix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries -(cygfoo.dll). The cyglink linker sets -$IMPLIBSUFFIX to '.dll.a' and $SHLIBSUFFIX +(cygfoo.dll). The cyglink linker sets +$IMPLIBSUFFIX to '.dll.a' and $SHLIBSUFFIX to '.dll'. IMPLIBVERSION - - -Used to override $SHLIBVERSION/$LDMODULEVERSION when + +Used to override $SHLIBVERSION/$LDMODULEVERSION when generating versioned import library for a shared library/loadable module. If -undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to +undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to determine the version of versioned import library. IMPLICIT_COMMAND_DEPENDENCIES - - + Controls whether or not SCons will add implicit dependencies for the commands executed to build targets. - + By default, SCons will add to each target an implicit dependency on the command @@ -3155,9 +2889,9 @@ variable in the environment used to execute the command. - + If the construction variable -$IMPLICIT_COMMAND_DEPENDENCIES +$IMPLICIT_COMMAND_DEPENDENCIES is set to a false value (None, False, @@ -3168,41 +2902,38 @@ not be added to the targets built with that construction environment. - + env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) INCPREFIX - - + The prefix used to specify an include directory on the C compiler command line. This will be prepended to the beginning of each directory -in the $CPPPATH and $FORTRANPATH construction variables -when the $_CPPINCFLAGS and $_FORTRANINCFLAGS +in the $CPPPATH and $FORTRANPATH construction variables +when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INCSUFFIX - - + The suffix used to specify an include directory on the C compiler command line. This will be appended to the end of each directory -in the $CPPPATH and $FORTRANPATH construction variables -when the $_CPPINCFLAGS and $_FORTRANINCFLAGS +in the $CPPPATH and $FORTRANPATH construction variables +when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INSTALL - - + A function to be called to install a file into a destination file name. The default function copies the file into the destination @@ -3211,11 +2942,11 @@ to match the source file's). The function takes the following arguments: - + def install(dest, source, env): - + dest is the path name of the destination file. source @@ -3229,21 +2960,19 @@ in force for this file installation. INSTALLSTR - - + The string displayed when a file is installed into a destination file name. The default is: - + Install file: "$SOURCE" as "$TARGET" INTEL_C_COMPILER_VERSION - - + Set by the "intelc" Tool to the major version number of the Intel C compiler selected for use. @@ -3252,27 +2981,23 @@ selected for use. JAR - - + The Java archive tool. - - + The Java archive tool. JARCHDIR - - + The directory to which the Java archive tool should change (using the option). - - + The directory to which the Java archive tool should change (using the @@ -3282,44 +3007,39 @@ option). JARCOM - - + The command line used to call the Java archive tool. - - + The command line used to call the Java archive tool. JARCOMSTR - - + The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. - + env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") - - + The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. - + env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") JARFLAGS - - + General options passed to the Java archive tool. By default this is set to @@ -3327,8 +3047,7 @@ to create the necessary jar file. - - + General options passed to the Java archive tool. By default this is set to @@ -3340,14 +3059,12 @@ file. JARSUFFIX - - + The suffix for Java archives: .jar by default. - - + The suffix for Java archives: .jar by default. @@ -3356,11 +3073,10 @@ by default. JAVABOOTCLASSPATH - - + Specifies the list of directories that will be added to the - javac command line + javac command line via the option. The individual directory names will be separated by the operating system's path separate character @@ -3372,51 +3088,46 @@ by default. JAVAC - - + The Java compiler. JAVACCOM - - + The command line used to compile a directory tree containing Java source files to corresponding Java class files. - Any options specified in the $JAVACFLAGS construction variable + Any options specified in the $JAVACFLAGS construction variable are included on this command line. JAVACCOMSTR - - + The string displayed when compiling a directory tree of Java source files to corresponding Java class files. - If this is not set, then $JAVACCOM (the command line) is displayed. + If this is not set, then $JAVACCOM (the command line) is displayed. - + env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") JAVACFLAGS - - + General options that are passed to the Java compiler. JAVACLASSDIR - - + The directory in which Java class files may be found. This is stripped from the beginning of any Java .class file names supplied to the @@ -3427,14 +3138,13 @@ by default. JAVACLASSPATH - - + Specifies the list of directories that will be searched for Java .class file. The directories in this list will be added to the - javac and javah command lines + javac and javah command lines via the option. The individual directory names will be separated by the operating system's path separate character @@ -3443,11 +3153,11 @@ by default. on Windows). - + Note that this currently just adds the specified directory via the option. - SCons does not currently search the - $JAVACLASSPATH directories for dependency + SCons does not currently search the + $JAVACLASSPATH directories for dependency .class files. @@ -3455,8 +3165,7 @@ by default. JAVACLASSSUFFIX - - + The suffix for Java class files; .class by default. @@ -3465,41 +3174,37 @@ by default. JAVAH - - + The Java generator for C header and stub files. JAVAHCOM - - + The command line used to generate C header and stub files from Java classes. -Any options specified in the $JAVAHFLAGS construction variable +Any options specified in the $JAVAHFLAGS construction variable are included on this command line. JAVAHCOMSTR - - + The string displayed when C header and stub files are generated from Java classes. -If this is not set, then $JAVAHCOM (the command line) is displayed. +If this is not set, then $JAVAHCOM (the command line) is displayed. - + env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES") JAVAHFLAGS - - + General options passed to the C header and stub file generator for Java classes. @@ -3507,22 +3212,20 @@ for Java classes. JAVAINCLUDES - - + Include path for Java header files (such as jni.h) JAVASOURCEPATH - - + Specifies the list of directories that will be searched for input .java file. The directories in this list will be added to the - javac command line + javac command line via the option. The individual directory names will be separated by the operating system's path separate character @@ -3531,11 +3234,11 @@ for Java classes. on Windows). - + Note that this currently just adds the specified directory via the option. - SCons does not currently search the - $JAVASOURCEPATH directories for dependency + SCons does not currently search the + $JAVASOURCEPATH directories for dependency .java files. @@ -3543,8 +3246,7 @@ for Java classes. JAVASUFFIX - - + The suffix for Java files; .java by default. @@ -3553,76 +3255,70 @@ for Java classes. JAVAVERSION - - - Specifies the Java version being used by the Java builder. + + Specifies the Java version being used by the Java builder. This is not currently used to select one version of the Java compiler vs. another. Instead, you should set this to specify the version of Java - supported by your javac compiler. + supported by your javac compiler. The default is 1.4. - + This is sometimes necessary because Java 1.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files - that SCons expects will be generated by the javac compiler. - Setting $JAVAVERSION to + that SCons expects will be generated by the javac compiler. + Setting $JAVAVERSION to 1.5 (or 1.6, as appropriate) - can make SCons realize that a Java 1.5 or 1.6 + can make SCons realize that a Java 1.5 or 1.6 build is actually up to date. LATEX - - + The LaTeX structured formatter and typesetter. LATEXCOM - - + The command line used to call the LaTeX structured formatter and typesetter. LATEXCOMSTR - - + The string displayed when calling the LaTeX structured formatter and typesetter. -If this is not set, then $LATEXCOM (the command line) is displayed. +If this is not set, then $LATEXCOM (the command line) is displayed. - + env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES") LATEXFLAGS - - + General options passed to the LaTeX structured formatter and typesetter. LATEXRETRIES - - + The maximum number of times that LaTeX will be re-run if the .log -generated by the $LATEXCOM command +generated by the $LATEXCOM command indicates that there are undefined references. The default is to try to resolve undefined references by re-running LaTeX up to three times. @@ -3631,91 +3327,82 @@ by re-running LaTeX up to three times. LATEXSUFFIXES - - + The list of suffixes of files that will be scanned for LaTeX implicit dependencies (\include or \import files). The default list is: - + [".tex", ".ltx", ".latex"] LDMODULE - - + The linker for building loadable modules. -By default, this is the same as $SHLINK. +By default, this is the same as $SHLINK. LDMODULECOM - - + The command line for building loadable modules. -On Mac OS X, this uses the $LDMODULE, -$LDMODULEFLAGS and -$FRAMEWORKSFLAGS variables. -On other systems, this is the same as $SHLINK. +On Mac OS X, this uses the $LDMODULE, +$LDMODULEFLAGS and +$FRAMEWORKSFLAGS variables. +On other systems, this is the same as $SHLINK. LDMODULECOMSTR - - + The string displayed when building loadable modules. -If this is not set, then $LDMODULECOM (the command line) is displayed. +If this is not set, then $LDMODULECOM (the command line) is displayed. LDMODULEFLAGS - - + General user options passed to the linker for building loadable modules. LDMODULENOVERSIONSYMLINKS - - -Instructs the LoadableModule builder to not automatically create symlinks + +Instructs the LoadableModule builder to not automatically create symlinks for versioned modules. Defaults to $SHLIBNOVERSIONSYMLINKS LDMODULEPREFIX - - + The prefix used for loadable module file names. On Mac OS X, this is null; on other systems, this is -the same as $SHLIBPREFIX. +the same as $SHLIBPREFIX. _LDMODULESONAME - - + A macro that automatically generates loadable module's SONAME based on $TARGET, -$LDMODULEVERSION and $LDMODULESUFFIX. Used by LoadableModule builder -when the linker tool supports SONAME (e.g. gnulink). +$LDMODULEVERSION and $LDMODULESUFFIX. Used by LoadableModule builder +when the linker tool supports SONAME (e.g. gnulink). LDMODULESUFFIX - - + The suffix used for loadable module file names. On Mac OS X, this is null; on other systems, this is @@ -3725,35 +3412,32 @@ the same as $SHLIBSUFFIX. LDMODULEVERSION - - + When this construction variable is defined, a versioned loadable module -is created by LoadableModule builder. This activates the -$_LDMODULEVERSIONFLAGS and thus modifies the $LDMODULECOM as +is created by LoadableModule builder. This activates the +$_LDMODULEVERSIONFLAGS and thus modifies the $LDMODULECOM as required, adds the version number to the library name, and creates the symlinks -that are needed. $LDMODULEVERSION versions should exist in the same -format as $SHLIBVERSION. +that are needed. $LDMODULEVERSION versions should exist in the same +format as $SHLIBVERSION. LDMODULEVERSIONFLAGS - - -Extra flags added to $LDMODULECOM when building versioned -LoadableModule. These flags are only used when $LDMODULEVERSION is + +Extra flags added to $LDMODULECOM when building versioned +LoadableModule. These flags are only used when $LDMODULEVERSION is set. _LDMODULEVERSIONFLAGS - - -This macro automatically introduces extra flags to $LDMODULECOM when -building versioned LoadableModule (that is when -$LDMODULEVERSION is set). _LDMODULEVERSIONFLAGS -usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated + +This macro automatically introduces extra flags to $LDMODULECOM when +building versioned LoadableModule (that is when +$LDMODULEVERSION is set). _LDMODULEVERSIONFLAGS +usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_LDMODULESONAME). It is unused by plain (unversioned) loadable modules. @@ -3761,16 +3445,14 @@ by plain (unversioned) loadable modules. LEX - - + The lexical analyzer generator. LEXCOM - - + The command line used to call the lexical analyzer generator to generate a source file. @@ -3778,170 +3460,158 @@ to generate a source file. LEXCOMSTR - - + The string displayed when generating a source file using the lexical analyzer generator. -If this is not set, then $LEXCOM (the command line) is displayed. +If this is not set, then $LEXCOM (the command line) is displayed. - + env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES") LEXFLAGS - - + General options passed to the lexical analyzer generator. LEXUNISTD - - + Used only on windows environments to set a lex flag to prevent 'unistd.h' from being included. The default value is '--nounistd'. _LIBDIRFLAGS - - + An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. -The value of $_LIBDIRFLAGS is created -by respectively prepending and appending $LIBDIRPREFIX and $LIBDIRSUFFIX +The value of $_LIBDIRFLAGS is created +by respectively prepending and appending $LIBDIRPREFIX and $LIBDIRSUFFIX to the beginning and end -of each directory in $LIBPATH. +of each directory in $LIBPATH. LIBDIRPREFIX - - + The prefix used to specify a library directory on the linker command line. This will be prepended to the beginning of each directory -in the $LIBPATH construction variable -when the $_LIBDIRFLAGS variable is automatically generated. +in the $LIBPATH construction variable +when the $_LIBDIRFLAGS variable is automatically generated. LIBDIRSUFFIX - - + The suffix used to specify a library directory on the linker command line. This will be appended to the end of each directory -in the $LIBPATH construction variable -when the $_LIBDIRFLAGS variable is automatically generated. +in the $LIBPATH construction variable +when the $_LIBDIRFLAGS variable is automatically generated. LIBEMITTER - - + TODO _LIBFLAGS - - + An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. -The value of $_LIBFLAGS is created -by respectively prepending and appending $LIBLINKPREFIX and $LIBLINKSUFFIX +The value of $_LIBFLAGS is created +by respectively prepending and appending $LIBLINKPREFIX and $LIBLINKSUFFIX to the beginning and end -of each filename in $LIBS. +of each filename in $LIBS. LIBLINKPREFIX - - + The prefix used to specify a library to link on the linker command line. This will be prepended to the beginning of each library -in the $LIBS construction variable -when the $_LIBFLAGS variable is automatically generated. +in the $LIBS construction variable +when the $_LIBFLAGS variable is automatically generated. LIBLINKSUFFIX - - + The suffix used to specify a library to link on the linker command line. This will be appended to the end of each library -in the $LIBS construction variable -when the $_LIBFLAGS variable is automatically generated. +in the $LIBS construction variable +when the $_LIBFLAGS variable is automatically generated. LIBPATH - - + The list of directories that will be searched for libraries. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $LINKFLAGS or $SHLINKFLAGS +arguments in $LINKFLAGS or $SHLINKFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in LIBPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(LIBPATH='#/libs') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + libs = Dir('libs') env = Environment(LIBPATH=libs) - + The directory list will be added to command lines through the automatically-generated -$_LIBDIRFLAGS +$_LIBDIRFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$LIBDIRPREFIX and $LIBDIRSUFFIX +$LIBDIRPREFIX and $LIBDIRSUFFIX construction variables to the beginning and end -of each directory in $LIBPATH. +of each directory in $LIBPATH. Any command lines you define that need the LIBPATH directory list should -include $_LIBDIRFLAGS: +include $_LIBDIRFLAGS: - + env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") LIBPREFIX - - + The prefix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), @@ -3953,65 +3623,63 @@ to reflect the names of the libraries they create. LIBPREFIXES - - + A list of all legal prefixes for library file names. When searching for library dependencies, SCons will look for files with these prefixes, the base library name, -and suffixes in the $LIBSUFFIXES list. +and suffixes in the $LIBSUFFIXES list. LIBS - - + A list of one or more libraries that will be linked with any executable programs created by this environment. - + The library list will be added to command lines through the automatically-generated -$_LIBFLAGS +$_LIBFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$LIBLINKPREFIX and $LIBLINKSUFFIX +$LIBLINKPREFIX and $LIBLINKSUFFIX construction variables to the beginning and end -of each filename in $LIBS. +of each filename in $LIBS. Any command lines you define that need the LIBS library list should -include $_LIBFLAGS: +include $_LIBFLAGS: - + env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") - + If you add a File object to the -$LIBS +$LIBS list, the name of that file will be added to -$_LIBFLAGS, +$_LIBFLAGS, and thus the link line, as is, without -$LIBLINKPREFIX +$LIBLINKPREFIX or -$LIBLINKSUFFIX. +$LIBLINKSUFFIX. For example: - + env.Append(LIBS=File('/tmp/mylib.so')) - + In all cases, scons will add dependencies from the executable program to all the libraries in this list. @@ -4019,8 +3687,7 @@ all the libraries in this list. LIBSUFFIX - - + The suffix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), @@ -4032,11 +3699,10 @@ to reflect the names of the libraries they create. LIBSUFFIXES - - + A list of all legal suffixes for library file names. When searching for library dependencies, -SCons will look for files with prefixes, in the $LIBPREFIXES list, +SCons will look for files with prefixes, in the $LIBPREFIXES list, the base library name, and these suffixes. @@ -4044,8 +3710,7 @@ and these suffixes. LICENSE - - + The abbreviated name, preferably the SPDX code, of the license under which this project is released (GPL-3.0, LGPL-2.1, BSD-2-Clause etc.). See http://www.opensource.org/licenses/alphabetical @@ -4055,9 +3720,8 @@ for a list of license names and SPDX codes. LINESEPARATOR - - -The separator used by the Substfile and Textfile builders. + +The separator used by the Substfile and Textfile builders. This value is used between sources when constructing the target. It defaults to the current system line separator. @@ -4065,13 +3729,12 @@ It defaults to the current system line separator. LINGUAS_FILE - - -The $LINGUAS_FILE defines file(s) containing list of additional linguas -to be processed by POInit, POUpdate or MOFiles -builders. It also affects Translate builder. If the variable contains -a string, it defines name of the list file. The $LINGUAS_FILE may be a -list of file names as well. If $LINGUAS_FILE is set to + +The $LINGUAS_FILE defines file(s) containing list of additional linguas +to be processed by POInit, POUpdate or MOFiles +builders. It also affects Translate builder. If the variable contains +a string, it defines name of the list file. The $LINGUAS_FILE may be a +list of file names as well. If $LINGUAS_FILE is set to True (or non-zero numeric value), the list will be read from default file named LINGUAS. @@ -4081,54 +3744,50 @@ default file named LINK - - + The linker. LINKCOM - - + The command line used to link object files into an executable. LINKCOMSTR - - + The string displayed when object files are linked into an executable. -If this is not set, then $LINKCOM (the command line) is displayed. +If this is not set, then $LINKCOM (the command line) is displayed. - + env = Environment(LINKCOMSTR = "Linking $TARGET") LINKFLAGS - - + General user options passed to the linker. Note that this variable should not contain -(or similar) options for linking with the libraries listed in $LIBS, +(or similar) options for linking with the libraries listed in $LIBS, nor (or similar) library search path options -that scons generates automatically from $LIBPATH. +that scons generates automatically from $LIBPATH. See -$_LIBFLAGS +$_LIBFLAGS above, for the variable that expands to library-link options, and -$_LIBDIRFLAGS +$_LIBDIRFLAGS above, for the variable that expands to library search path options. @@ -4136,42 +3795,37 @@ for the variable that expands to library search path options. M4 - - + The M4 macro preprocessor. M4COM - - + The command line used to pass files through the M4 macro preprocessor. M4COMSTR - - + The string displayed when a file is passed through the M4 macro preprocessor. -If this is not set, then $M4COM (the command line) is displayed. +If this is not set, then $M4COM (the command line) is displayed. M4FLAGS - - + General options passed to the M4 macro preprocessor. MAKEINDEX - - + The makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -4179,8 +3833,7 @@ LaTeX structured formatter and typesetter. MAKEINDEXCOM - - + The command line used to call the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -4189,19 +3842,17 @@ typesetter. MAKEINDEXCOMSTR - - + The string displayed when calling the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. -If this is not set, then $MAKEINDEXCOM (the command line) is displayed. +If this is not set, then $MAKEINDEXCOM (the command line) is displayed. MAKEINDEXFLAGS - - + General options passed to the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -4209,8 +3860,7 @@ and typesetter and the LaTeX structured formatter and typesetter. MAXLINELENGTH - - + The maximum number of characters allowed on an external command line. On Win32 systems, link lines longer than this many characters @@ -4220,178 +3870,159 @@ are linked via a temporary file name. MIDL - - + The Microsoft IDL compiler. MIDLCOM - - + The command line used to pass files to the Microsoft IDL compiler. MIDLCOMSTR - - + The string displayed when the Microsoft IDL copmiler is called. -If this is not set, then $MIDLCOM (the command line) is displayed. +If this is not set, then $MIDLCOM (the command line) is displayed. MIDLFLAGS - - + General options passed to the Microsoft IDL compiler. MOSUFFIX - - + Suffix used for MO files (default: '.mo'). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMT - - + Absolute path to msgfmt(1) binary, found by Detect(). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMTCOM - - + Complete command line to run msgfmt(1) program. -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMTCOMSTR - - + String to display when msgfmt(1) is invoked -(default: '', which means ``print $MSGFMTCOM''). -See msgfmt tool and MOFiles builder. +(default: '', which means ``print $MSGFMTCOM''). +See msgfmt tool and MOFiles builder. MSGFMTFLAGS - - + Additional flags to msgfmt(1). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGINIT - - + Path to msginit(1) program (found via Detect()). -See msginit tool and POInit builder. +See msginit tool and POInit builder. MSGINITCOM - - + Complete command line to run msginit(1) program. -See msginit tool and POInit builder. +See msginit tool and POInit builder. MSGINITCOMSTR - - + String to display when msginit(1) is invoked -(default: '', which means ``print $MSGINITCOM''). -See msginit tool and POInit builder. +(default: '', which means ``print $MSGINITCOM''). +See msginit tool and POInit builder. MSGINITFLAGS - - + List of additional flags to msginit(1) (default: []). -See msginit tool and POInit builder. +See msginit tool and POInit builder. _MSGINITLOCALE - - + Internal ``macro''. Computes locale (language) name based on target filename (default: '${TARGET.filebase}' ). - -See msginit tool and POInit builder. + +See msginit tool and POInit builder. MSGMERGE - - + Absolute path to msgmerge(1) binary as found by Detect(). -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSGMERGECOM - - + Complete command line to run msgmerge(1) command. -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSGMERGECOMSTR - - + String to be displayed when msgmerge(1) is invoked -(default: '', which means ``print $MSGMERGECOM''). -See msgmerge tool and POUpdate builder. +(default: '', which means ``print $MSGMERGECOM''). +See msgmerge tool and POUpdate builder. MSGMERGEFLAGS - - + Additional flags to msgmerge(1) command. -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSSDK_DIR - - + The directory containing the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. @@ -4400,8 +4031,7 @@ to be used for compilation. MSSDK_VERSION - - + The version string of the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. @@ -4417,8 +4047,7 @@ and MSVC_BATCH - - + When set to any true value, specifies that SCons should batch compilation of object files @@ -4429,7 +4058,7 @@ and were configured in SCons using the same construction environment will be built in a single call to the compiler. Only source files that have changed since their object files were built will be passed to each compiler invocation -(via the $CHANGED_SOURCES construction variable). +(via the $CHANGED_SOURCES construction variable). Any compilations where the object (target) file base name (minus the .obj) does not match the source file base name @@ -4439,13 +4068,12 @@ will be compiled separately. MSVC_USE_SCRIPT - - + Use a batch script to set up Microsoft Visual Studio compiler - -$MSVC_USE_SCRIPT overrides $MSVC_VERSION and $TARGET_ARCH. + +$MSVC_USE_SCRIPT overrides $MSVC_VERSION and $TARGET_ARCH. If set to the name of a Visual Studio .bat file (e.g. vcvars.bat), SCons will run that bat file and extract the relevant variables from the result (typically %INCLUDE%, %LIB%, and %PATH%). Setting @@ -4457,13 +4085,12 @@ window and importing the shell's environment variables. MSVC_UWP_APP - - + Build libraries for a Universal Windows Platform (UWP) Application. - -If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point + +If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, any libraries that are built will be able to be used in a UWP App and published to the Windows Store. @@ -4472,7 +4099,7 @@ This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - + Valid values are '1' or '0' @@ -4480,20 +4107,19 @@ Valid values are '1' or '0' MSVC_VERSION - - + Sets the preferred version of Microsoft Visual C/C++ to use. - -If $MSVC_VERSION is not set, SCons will (by default) select the + +If $MSVC_VERSION is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - + Valid values for Windows are 14.1, 14.0, @@ -4519,16 +4145,15 @@ Versions ending in Exp refer to "Express" or MSVS - - + When the Microsoft Visual Studio tools are initialized, they set up this dictionary with the following keys: - + VERSION the version of MSVS being used (can be set via - $MSVS_VERSION) + $MSVS_VERSION) VERSIONS @@ -4584,20 +4209,19 @@ Versions ending in Exp refer to "Express" or - If a value is not set, it was not available in the registry. + If a value is not set, it was not available in the registry. MSVS_ARCH - - Sets the architecture for which the generated project(s) should build. - + Sets the architecture for which the generated project(s) should build. + The default value is x86. - amd64 is also supported by SCons for + amd64 is also supported by SCons for most Visual Studio versions. Since Visual Studio 2015 arm is supported, and since Visual Studio 2017 arm64 is supported. - Trying to set $MSVS_ARCH + Trying to set $MSVS_ARCH to an architecture that's not supported for a given Visual Studio version will generate an error. @@ -4605,8 +4229,7 @@ Versions ending in Exp refer to "Express" or MSVS_PROJECT_GUID - - + The string placed in a generated Microsoft Visual Studio project file as the value of the ProjectGUID attribute. There is no default @@ -4618,8 +4241,7 @@ defined, a new GUID is generated. MSVS_SCC_AUX_PATH - - + The path name placed in a generated Microsoft Visual Studio project file as the value of the SccAuxPath attribute if the @@ -4632,8 +4254,7 @@ no default value. MSVS_SCC_CONNECTION_ROOT - - + The root path of projects in your SCC workspace, i.e the path under which all project and solution files will be generated. It is used as a reference path from which the @@ -4657,8 +4278,7 @@ no default value. MSVS_SCC_PROJECT_NAME - - + The project name placed in a generated Microsoft Visual Studio project file as the value of the SccProjectName attribute if the @@ -4673,8 +4293,7 @@ no default value. MSVS_SCC_PROVIDER - - + The string placed in a generated Microsoft Visual Studio project file as the value of the SccProvider attribute. The string is @@ -4687,10 +4306,9 @@ no default value. MSVS_VERSION - - Sets the preferred version of Microsoft Visual Studio to use. - - If $MSVS_VERSION is not set, SCons will (by default) + Sets the preferred version of Microsoft Visual Studio to use. + + If $MSVS_VERSION is not set, SCons will (by default) select the latest version of Visual Studio installed on your system. So, if you have version 6 and version 7 (MSVS .NET) installed, it will prefer version 7. You can override this by @@ -4699,19 +4317,18 @@ no default value. version ('6.0' or '7.0', for example). If the specified version isn't installed, tool initialization will fail. - - This is obsolete: use $MSVC_VERSION instead. If - $MSVS_VERSION is set and $MSVC_VERSION is - not, $MSVC_VERSION will be set automatically to - $MSVS_VERSION. If both are set to different values, + + This is obsolete: use $MSVC_VERSION instead. If + $MSVS_VERSION is set and $MSVC_VERSION is + not, $MSVC_VERSION will be set automatically to + $MSVS_VERSION. If both are set to different values, scons will raise an error. MSVSBUILDCOM - - + The build command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified build targets. @@ -4720,8 +4337,7 @@ no default value. MSVSCLEANCOM - - + The clean command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with the -c option to remove any specified @@ -4731,8 +4347,7 @@ no default value. MSVSENCODING - - + The encoding string placed in a generated Microsoft Visual Studio project file. The default is encoding Windows-1252. @@ -4741,14 +4356,12 @@ no default value. MSVSPROJECTCOM - - The action used to generate Microsoft Visual Studio project files. + The action used to generate Microsoft Visual Studio project files. MSVSPROJECTSUFFIX - - + The suffix used for Microsoft Visual Studio project (DSP) files. The default value is .vcproj when using Visual Studio version 7.x (.NET) or later version, @@ -4759,8 +4372,7 @@ no default value. MSVSREBUILDCOM - - + The rebuild command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified rebuild targets. @@ -4770,8 +4382,7 @@ no default value. MSVSSCONS - - + The SCons used in generated Microsoft Visual Studio project files. The default is the version of SCons being used to generate the project file. @@ -4780,8 +4391,7 @@ no default value. MSVSSCONSCOM - - + The default SCons command used in generated Microsoft Visual Studio project files. @@ -4789,34 +4399,30 @@ no default value. MSVSSCONSCRIPT - - - The sconscript file (that is, SConstruct or SConscript + + The sconscript file (that is, SConstruct or SConscript file) that will be invoked by Visual Studio project files - (through the $MSVSSCONSCOM variable). The default + (through the $MSVSSCONSCOM variable). The default is the same sconscript file that contains the call to - MSVSProject to build the project file. + MSVSProject to build the project file. MSVSSCONSFLAGS - - + The SCons flags used in generated Microsoft Visual Studio project files. MSVSSOLUTIONCOM - - The action used to generate Microsoft Visual Studio solution files. + The action used to generate Microsoft Visual Studio solution files. MSVSSOLUTIONSUFFIX - - + The suffix used for Microsoft Visual Studio solution (DSW) files. The default value is .sln when using Visual Studio version 7.x (.NET), and @@ -4827,43 +4433,38 @@ no default value. MT - - + The program used on Windows systems to embed manifests into DLLs and EXEs. -See also $WINDOWS_EMBED_MANIFEST. +See also $WINDOWS_EMBED_MANIFEST. MTEXECOM - - + The Windows command line used to embed manifests into executables. -See also $MTSHLIBCOM. +See also $MTSHLIBCOM. MTFLAGS - - -Flags passed to the $MT manifest embedding program (Windows only). + +Flags passed to the $MT manifest embedding program (Windows only). MTSHLIBCOM - - + The Windows command line used to embed manifests into shared libraries (DLLs). -See also $MTEXECOM. +See also $MTEXECOM. MWCW_VERSION - - + The version number of the MetroWerks CodeWarrior C compiler to be used. @@ -4871,8 +4472,7 @@ to be used. MWCW_VERSIONS - - + A list of installed versions of the MetroWerks CodeWarrior C compiler on this system. @@ -4880,16 +4480,14 @@ on this system. NAME - - + Specfies the name of the project to package. no_import_lib - - + When set to non-zero, suppresses creation of a corresponding Windows static import lib by the SharedLibrary @@ -4903,24 +4501,21 @@ when using Microsoft Visual Studio. OBJPREFIX - - + The prefix used for (static) object file names. OBJSUFFIX - - + The suffix used for (static) object file names. PACKAGEROOT - - + Specifies the directory where all files in resulting archive will be placed if applicable. The default value is "$NAME-$VERSION". @@ -4928,12 +4523,11 @@ placed if applicable. The default value is "$NAME-$VERSION". PACKAGETYPE - - + Selects the package type to build. Currently these are available: - + * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System @@ -4945,15 +4539,14 @@ Selects the package type to build. Currently these are available: * src_zip - zip file source - + This may be overridden with the "package_type" command line option. PACKAGEVERSION - - + The version of the package (not the underlying project). This is currently only used by the rpm packager and should reflect changes in the packaging, @@ -4963,8 +4556,7 @@ not the underlying project code itself. PCH - - + The Microsoft Visual C++ precompiled header that will be used when compiling object files. This variable is ignored by tools other than Microsoft Visual C++. When this variable is @@ -4974,44 +4566,40 @@ dependencies for the PCH file. Example: - + env['PCH'] = 'StdAfx.pch' PCHCOM - - + The command line used by the -PCH +PCH builder to generated a precompiled header. PCHCOMSTR - - + The string displayed when generating a precompiled header. -If this is not set, then $PCHCOM (the command line) is displayed. +If this is not set, then $PCHCOM (the command line) is displayed. PCHPDBFLAGS - - + A construction variable that, when expanded, adds the /yD flag to the command line -only if the $PDB construction variable is set. +only if the $PDB construction variable is set. PCHSTOP - - + This variable specifies how much of a source file is precompiled. This variable is ignored by tools other than Microsoft Visual C++, or when the PCH variable is not being used. When this variable is define it @@ -5020,15 +4608,14 @@ is included at the end of the precompiled portion of the source files, or the empty string if the "#pragma hrdstop" construct is being used: - + env['PCHSTOP'] = 'StdAfx.h' PDB - - + The Microsoft Visual C++ PDB file that will store debugging information for object files, shared libraries, and programs. This variable is ignored by tools other than Microsoft Visual C++. @@ -5039,11 +4626,11 @@ dependencies for the PDB file. Example: - + env['PDB'] = 'hello.pdb' - + The Visual C++ compiler switch that SCons uses by default to generate PDB information is . This works correctly with parallel () builds @@ -5055,116 +4642,104 @@ Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the -switch by overriding the default $CCPDBFLAGS variable; +switch by overriding the default $CCPDBFLAGS variable; see the entry for that variable for specific examples. PDFCOM - - -A deprecated synonym for $DVIPDFCOM. + +A deprecated synonym for $DVIPDFCOM. PDFLATEX - - -The pdflatex utility. + +The pdflatex utility. PDFLATEXCOM - - -The command line used to call the pdflatex utility. + +The command line used to call the pdflatex utility. PDFLATEXCOMSTR - - -The string displayed when calling the pdflatex utility. -If this is not set, then $PDFLATEXCOM (the command line) is displayed. + +The string displayed when calling the pdflatex utility. +If this is not set, then $PDFLATEXCOM (the command line) is displayed. - + env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES") PDFLATEXFLAGS - - -General options passed to the pdflatex utility. + +General options passed to the pdflatex utility. PDFPREFIX - - + The prefix used for PDF file names. PDFSUFFIX - - + The suffix used for PDF file names. PDFTEX - - -The pdftex utility. + +The pdftex utility. PDFTEXCOM - - -The command line used to call the pdftex utility. + +The command line used to call the pdftex utility. PDFTEXCOMSTR - - -The string displayed when calling the pdftex utility. -If this is not set, then $PDFTEXCOM (the command line) is displayed. + +The string displayed when calling the pdftex utility. +If this is not set, then $PDFTEXCOM (the command line) is displayed. - + env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES") PDFTEXFLAGS - - -General options passed to the pdftex utility. + +General options passed to the pdftex utility. PKGCHK - - + On Solaris systems, the package-checking program that will -be used (along with $PKGINFO) +be used (along with $PKGINFO) to look for installed versions of the Sun PRO C++ compiler. The default is @@ -5174,11 +4749,10 @@ The default is PKGINFO - - + On Solaris systems, the package information program that will -be used (along with $PKGCHK) +be used (along with $PKGCHK) to look for installed versions of the Sun PRO C++ compiler. The default is @@ -5188,15 +4762,14 @@ The default is PLATFORM - - + The name of the platform used to create the Environment. If no platform is specified when the Environment is created, -scons +scons autodetects the platform. - + env = Environment(tools = []) if env['PLATFORM'] == 'cygwin': Tool('mingw')(env) @@ -5207,45 +4780,41 @@ else: POAUTOINIT - - -The $POAUTOINIT variable, if set to True (on non-zero -numeric value), let the msginit tool to automatically initialize + +The $POAUTOINIT variable, if set to True (on non-zero +numeric value), let the msginit tool to automatically initialize missing PO files with msginit(1). This applies to both, -POInit and POUpdate builders (and others that use any of +POInit and POUpdate builders (and others that use any of them). POCREATE_ALIAS - - -Common alias for all PO files created with POInit + +Common alias for all PO files created with POInit builder (default: 'po-create'). -See msginit tool and POInit builder. +See msginit tool and POInit builder. POSUFFIX - - + Suffix used for PO files (default: '.po') -See msginit tool and POInit builder. +See msginit tool and POInit builder. POTDOMAIN - - -The $POTDOMAIN defines default domain, used to generate -POT filename as $POTDOMAIN.pot when + +The $POTDOMAIN defines default domain, used to generate +POT filename as $POTDOMAIN.pot when no POT file name is provided by the user. This applies to -POTUpdate, POInit and POUpdate builders (and -builders, that use them, e.g. Translate). Normally (if $POTDOMAIN is +POTUpdate, POInit and POUpdate builders (and +builders, that use them, e.g. Translate). Normally (if $POTDOMAIN is not defined), the builders use messages.pot as default POT file name. @@ -5253,37 +4822,33 @@ not defined), the builders use messages.pot as default POTSUFFIX - - + Suffix used for PO Template files (default: '.pot'). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. POTUPDATE_ALIAS - - + Name of the common phony target for all PO Templates created with -POUpdate (default: 'pot-update'). -See xgettext tool and POTUpdate builder. +POUpdate (default: 'pot-update'). +See xgettext tool and POTUpdate builder. POUPDATE_ALIAS - - + Common alias for all PO files being defined with -POUpdate builder (default: 'po-update'). -See msgmerge tool and POUpdate builder. +POUpdate builder (default: 'po-update'). +See msgmerge tool and POUpdate builder. PRINT_CMD_LINE_FUNC - - + A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the @@ -5301,20 +4866,20 @@ the source(s) used (file node, list, or string name(s)), and the environment being used. - + The function must do the printing itself. The default implementation, used if this variable is not set or is None, is: - + def print_cmd_line(s, target, source, env): sys.stdout.write(s + "\n") - + Here's an example of a more interesting function: - + def print_cmd_line(s, target, source, env): sys.stdout.write("Building %s -> %s...\n" % (' and '.join([str(x) for x in source]), @@ -5323,7 +4888,7 @@ env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env.Program('foo', 'foo.c') - + This just prints "Building targetname from sourcename..." instead of the actual commands. Such a function could also log the actual commands to a log file, @@ -5333,66 +4898,58 @@ for example. PROGEMITTER - - + TODO PROGPREFIX - - + The prefix used for executable file names. PROGSUFFIX - - + The suffix used for executable file names. PSCOM - - + The command line used to convert TeX DVI files into a PostScript file. PSCOMSTR - - + The string displayed when a TeX DVI file is converted into a PostScript file. -If this is not set, then $PSCOM (the command line) is displayed. +If this is not set, then $PSCOM (the command line) is displayed. PSPREFIX - - + The prefix used for PostScript file names. PSSUFFIX - - + The prefix used for PostScript file names. QT_AUTOSCAN - - + Turn off scanning for mocable files. Use the Moc Builder to explicitly specify files to run moc on. @@ -5400,74 +4957,66 @@ specify files to run moc on. QT_BINPATH - - + The path where the qt binaries are installed. -The default value is '$QTDIR/bin'. +The default value is '$QTDIR/bin'. QT_CPPPATH - - + The path where the qt header files are installed. -The default value is '$QTDIR/include'. +The default value is '$QTDIR/include'. Note: If you set this variable to None, -the tool won't change the $CPPPATH +the tool won't change the $CPPPATH construction variable. QT_DEBUG - - + Prints lots of debugging information while scanning for moc files. QT_LIB - - + Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set -this variable to None, the tool won't change the $LIBS variable. +this variable to None, the tool won't change the $LIBS variable. QT_LIBPATH - - + The path where the qt libraries are installed. -The default value is '$QTDIR/lib'. +The default value is '$QTDIR/lib'. Note: If you set this variable to None, -the tool won't change the $LIBPATH +the tool won't change the $LIBPATH construction variable. QT_MOC - - -Default value is '$QT_BINPATH/moc'. + +Default value is '$QT_BINPATH/moc'. QT_MOCCXXPREFIX - - + Default value is ''. Prefix for moc output files, when source is a cxx file. QT_MOCCXXSUFFIX - - + Default value is '.moc'. Suffix for moc output files, when source is a cxx file. @@ -5475,25 +5024,22 @@ file. QT_MOCFROMCXXCOM - - + Command to generate a moc file from a cpp file. QT_MOCFROMCXXCOMSTR - - + The string displayed when generating a moc file from a cpp file. -If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. +If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. QT_MOCFROMCXXFLAGS - - + Default value is '-i'. These flags are passed to moc, when moccing a C++ file. @@ -5501,25 +5047,22 @@ C++ file. QT_MOCFROMHCOM - - + Command to generate a moc file from a header. QT_MOCFROMHCOMSTR - - + The string displayed when generating a moc file from a cpp file. -If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. +If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. QT_MOCFROMHFLAGS - - + Default value is ''. These flags are passed to moc, when moccing a header file. @@ -5527,50 +5070,44 @@ file. QT_MOCHPREFIX - - + Default value is 'moc_'. Prefix for moc output files, when source is a header. QT_MOCHSUFFIX - - -Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is + +Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is a header. QT_UIC - - -Default value is '$QT_BINPATH/uic'. + +Default value is '$QT_BINPATH/uic'. QT_UICCOM - - + Command to generate header files from .ui files. QT_UICCOMSTR - - + The string displayed when generating header files from .ui files. -If this is not set, then $QT_UICCOM (the command line) is displayed. +If this is not set, then $QT_UICCOM (the command line) is displayed. QT_UICDECLFLAGS - - + Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. @@ -5578,24 +5115,21 @@ file from a .ui file. QT_UICDECLPREFIX - - + Default value is ''. Prefix for uic generated header files. QT_UICDECLSUFFIX - - + Default value is '.h'. Suffix for uic generated header files. QT_UICIMPLFLAGS - - + Default value is ''. These flags are passed to uic, when creating a cxx file from a .ui file. @@ -5603,33 +5137,29 @@ file from a .ui file. QT_UICIMPLPREFIX - - + Default value is 'uic_'. Prefix for uic generated implementation files. QT_UICIMPLSUFFIX - - -Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation + +Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation files. QT_UISUFFIX - - + Default value is '.ui'. Suffix of designer input files. QTDIR - - + The qt tool tries to take this from os.environ. It also initializes all QT_* construction variables listed below. @@ -5638,24 +5168,24 @@ with python's os.path.join() method, but are listed here with the '/' separator for easier reading.) In addition, the construction environment -variables $CPPPATH, -$LIBPATH and -$LIBS may be modified +variables $CPPPATH, +$LIBPATH and +$LIBS may be modified and the variables -$PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER +$PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER are modified. Because the build-performance is affected when using this tool, you have to explicitly specify it at Environment creation: - + Environment(tools=['default','qt']) - + The qt tool supports the following operations: - + Automatic moc file generation from header files. You do not have to specify moc files explicitly, the tool does it for you. However, there are a few preconditions to do so: Your header file must have @@ -5663,11 +5193,11 @@ the same filebase as your implementation file and must stay in the same directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding -Moc() +Moc() builder method. - + Automatic moc file generation from cxx files. As stated in the qt documentation, include the moc file at the end of the cxx file. Note that you have to include the file, which is generated @@ -5676,11 +5206,11 @@ by the transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by d do not include the correct file. If you are using VariantDir, you may need to specify duplicate=1. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding -Moc +Moc builder method. - + Automatic handling of .ui files. The implementation files generated from .ui files are handled much the same as yacc or lex files. Each .ui file given as a source of Program, Library or @@ -5688,52 +5218,47 @@ SharedLibrary will generate three files, the declaration file, the implementation file and a moc file. Because there are also generated headers, you may need to specify duplicate=1 in calls to VariantDir. See also the corresponding -Uic +Uic builder method. RANLIB - - + The archive indexer. RANLIBCOM - - + The command line used to index a static library archive. RANLIBCOMSTR - - + The string displayed when a static library archive is indexed. -If this is not set, then $RANLIBCOM (the command line) is displayed. +If this is not set, then $RANLIBCOM (the command line) is displayed. - + env = Environment(RANLIBCOMSTR = "Indexing $TARGET") RANLIBFLAGS - - + General options passed to the archive indexer. RC - - + The resource compiler used to build a Microsoft Visual C++ resource file. @@ -5741,8 +5266,7 @@ a Microsoft Visual C++ resource file. RCCOM - - + The command line used to build a Microsoft Visual C++ resource file. @@ -5750,66 +5274,60 @@ a Microsoft Visual C++ resource file. RCCOMSTR - - + The string displayed when invoking the resource compiler to build a Microsoft Visual C++ resource file. -If this is not set, then $RCCOM (the command line) is displayed. +If this is not set, then $RCCOM (the command line) is displayed. RCFLAGS - - + The flags passed to the resource compiler by the RES builder. RCINCFLAGS - - + An automatically-generated construction variable containing the command-line options for specifying directories to be searched by the resource compiler. -The value of $RCINCFLAGS is created +The value of $RCINCFLAGS is created by respectively prepending and appending -$RCINCPREFIX and $RCINCSUFFIX +$RCINCPREFIX and $RCINCSUFFIX to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. RCINCPREFIX - - + The prefix (flag) used to specify an include directory on the resource compiler command line. This will be prepended to the beginning of each directory -in the $CPPPATH construction variable -when the $RCINCFLAGS variable is expanded. +in the $CPPPATH construction variable +when the $RCINCFLAGS variable is expanded. RCINCSUFFIX - - + The suffix used to specify an include directory on the resource compiler command line. This will be appended to the end of each directory -in the $CPPPATH construction variable -when the $RCINCFLAGS variable is expanded. +in the $CPPPATH construction variable +when the $RCINCFLAGS variable is expanded. RDirs - - + A function that converts a string into a list of Dir instances by searching the repositories. @@ -5817,39 +5335,35 @@ searching the repositories. REGSVR - - + The program used on Windows systems to register a newly-built DLL library -whenever the SharedLibrary builder +whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOM - - + The command line used on Windows systems to register a newly-built DLL library -whenever the SharedLibrary builder +whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOMSTR - - + The string displayed when registering a newly-built DLL file. -If this is not set, then $REGSVRCOM (the command line) is displayed. +If this is not set, then $REGSVRCOM (the command line) is displayed. REGSVRFLAGS - - + Flags passed to the DLL registration program on Windows systems when a newly-built DLL library is registered. By default, @@ -5861,72 +5375,66 @@ and requiring user attention. RMIC - - + The Java RMI stub compiler. RMICCOM - - + The command line used to compile stub and skeleton class files from Java classes that contain RMI implementations. -Any options specified in the $RMICFLAGS construction variable +Any options specified in the $RMICFLAGS construction variable are included on this command line. RMICCOMSTR - - + The string displayed when compiling stub and skeleton class files from Java classes that contain RMI implementations. -If this is not set, then $RMICCOM (the command line) is displayed. +If this is not set, then $RMICCOM (the command line) is displayed. - + env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES") RMICFLAGS - - + General options passed to the Java RMI stub compiler. _RPATH - - + An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. -The value of $_RPATH is created -by respectively prepending $RPATHPREFIX and appending $RPATHSUFFIX +The value of $_RPATH is created +by respectively prepending $RPATHPREFIX and appending $RPATHSUFFIX to the beginning and end -of each directory in $RPATH. +of each directory in $RPATH. RPATH - - + A list of paths to search for shared libraries when running programs. Currently only used in the GNU (gnulink), IRIX (sgilink) and Sun (sunlink) linkers. Ignored on platforms and toolchains that don't support it. Note that the paths added to RPATH are not transformed by -scons +scons in any way: if you want an absolute path, you must make it absolute yourself. @@ -5934,96 +5442,87 @@ path, you must make it absolute yourself. RPATHPREFIX - - + The prefix used to specify a directory to be searched for shared libraries when running programs. This will be prepended to the beginning of each directory -in the $RPATH construction variable -when the $_RPATH variable is automatically generated. +in the $RPATH construction variable +when the $_RPATH variable is automatically generated. RPATHSUFFIX - - + The suffix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the end of each directory -in the $RPATH construction variable -when the $_RPATH variable is automatically generated. +in the $RPATH construction variable +when the $_RPATH variable is automatically generated. RPCGEN - - + The RPC protocol compiler. RPCGENCLIENTFLAGS - - + Options passed to the RPC protocol compiler when generating client side stubs. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENFLAGS - - + General options passed to the RPC protocol compiler. RPCGENHEADERFLAGS - - + Options passed to the RPC protocol compiler when generating a header file. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENSERVICEFLAGS - - + Options passed to the RPC protocol compiler when generating server side stubs. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENXDRFLAGS - - + Options passed to the RPC protocol compiler when generating XDR routines. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. SCANNERS - - + A list of the available implicit dependency scanners. New file scanners may be added by appending to this list, @@ -6038,55 +5537,50 @@ below, for more information. SCONS_HOME - - + The (optional) path to the SCons library directory, initialized from the external environment. If set, this is used to construct a shorter and more efficient search path in - the $MSVSSCONS command line executed from Microsoft + the $MSVSSCONS command line executed from Microsoft Visual Studio project files. SHCC - - + The C compiler used for generating shared-library objects. SHCCCOM - - + The command line used to compile a C source file to a shared-library object file. -Any options specified in the $SHCFLAGS, -$SHCCFLAGS and -$CPPFLAGS construction variables +Any options specified in the $SHCFLAGS, +$SHCCFLAGS and +$CPPFLAGS construction variables are included on this command line. SHCCCOMSTR - - + The string displayed when a C source file is compiled to a shared object file. -If this is not set, then $SHCCCOM (the command line) is displayed. +If this is not set, then $SHCCCOM (the command line) is displayed. - + env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") SHCCFLAGS - - + Options that are passed to the C and C++ compilers to generate shared-library objects. @@ -6094,8 +5588,7 @@ to generate shared-library objects. SHCFLAGS - - + Options that are passed to the C compiler (only; not C++) to generate shared-library objects. @@ -6103,42 +5596,38 @@ to generate shared-library objects. SHCXX - - + The C++ compiler used for generating shared-library objects. SHCXXCOM - - + The command line used to compile a C++ source file to a shared-library object file. -Any options specified in the $SHCXXFLAGS and -$CPPFLAGS construction variables +Any options specified in the $SHCXXFLAGS and +$CPPFLAGS construction variables are included on this command line. SHCXXCOMSTR - - + The string displayed when a C++ source file is compiled to a shared object file. -If this is not set, then $SHCXXCOM (the command line) is displayed. +If this is not set, then $SHCXXCOM (the command line) is displayed. - + env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET") SHCXXFLAGS - - + Options that are passed to the C++ compiler to generate shared-library objects. @@ -6146,18 +5635,15 @@ to generate shared-library objects. SHDC - - + The name of the compiler to use when compiling D source destined to be in a shared objects. - - + The name of the compiler to use when compiling D source destined to be in a shared objects. - - + The name of the compiler to use when compiling D source destined to be in a shared objects. @@ -6165,50 +5651,42 @@ to generate shared-library objects. SHDCOM - - + The command line to use when compiling code to be part of shared objects. - - + The command line to use when compiling code to be part of shared objects. - - + The command line to use when compiling code to be part of shared objects. SHDLIBVERSION - - + SHDLIBVERSION. SHDLIBVERSIONFLAGS - - + SHDLIBVERSIONFLAGS. SHDLINK - - + The linker to use when creating shared objects for code bases include D sources. - - + The linker to use when creating shared objects for code bases include D sources. - - + The linker to use when creating shared objects for code bases include D sources. @@ -6216,71 +5694,62 @@ to generate shared-library objects. SHDLINKCOM - - + The command line to use when generating shared objects. - - + The command line to use when generating shared objects. - - + The command line to use when generating shared objects. SHDLINKFLAGS - - + The list of flags to use when generating a shared object. - - + The list of flags to use when generating a shared object. - - + The list of flags to use when generating a shared object. SHELL - - + A string naming the shell program that will be passed to the -$SPAWN +$SPAWN function. See the -$SPAWN +$SPAWN construction variable for more information. SHF03 - - + The Fortran 03 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF03 if you need to use a specific compiler +You only need to set $SHF03 if you need to use a specific compiler or compiler version for Fortran 03 files. SHF03COM - - + The command line used to compile a Fortran 03 source file to a shared-library object file. -You only need to set $SHF03COM if you need to use a specific +You only need to set $SHF03COM if you need to use a specific command line for Fortran 03 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6288,24 +5757,22 @@ for all Fortran versions. SHF03COMSTR - - + The string displayed when a Fortran 03 source file is compiled to a shared-library object file. -If this is not set, then $SHF03COM or $SHFORTRANCOM +If this is not set, then $SHF03COM or $SHFORTRANCOM (the command line) is displayed. SHF03FLAGS - - + Options that are passed to the Fortran 03 compiler to generated shared-library objects. -You only need to set $SHF03FLAGS if you need to define specific +You only need to set $SHF03FLAGS if you need to define specific user options for Fortran 03 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6314,16 +5781,15 @@ for all Fortran versions. SHF03PPCOM - - + The command line used to compile a Fortran 03 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF03FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF03FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF03PPCOM if you need to use a specific +You only need to set $SHF03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6331,38 +5797,35 @@ for all Fortran versions. SHF03PPCOMSTR - - + 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 $SHF03PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF03PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF08 - - + The Fortran 08 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF08 if you need to use a specific compiler +You only need to set $SHF08 if you need to use a specific compiler or compiler version for Fortran 08 files. SHF08COM - - + The command line used to compile a Fortran 08 source file to a shared-library object file. -You only need to set $SHF08COM if you need to use a specific +You only need to set $SHF08COM if you need to use a specific command line for Fortran 08 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6370,24 +5833,22 @@ for all Fortran versions. SHF08COMSTR - - + The string displayed when a Fortran 08 source file is compiled to a shared-library object file. -If this is not set, then $SHF08COM or $SHFORTRANCOM +If this is not set, then $SHF08COM or $SHFORTRANCOM (the command line) is displayed. SHF08FLAGS - - + Options that are passed to the Fortran 08 compiler to generated shared-library objects. -You only need to set $SHF08FLAGS if you need to define specific +You only need to set $SHF08FLAGS if you need to define specific user options for Fortran 08 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6396,16 +5857,15 @@ for all Fortran versions. SHF08PPCOM - - + The command line used to compile a Fortran 08 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF08FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF08FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF08PPCOM if you need to use a specific +You only need to set $SHF08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6413,38 +5873,35 @@ for all Fortran versions. SHF08PPCOMSTR - - + 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 $SHF08PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF08PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF77 - - + The Fortran 77 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF77 if you need to use a specific compiler +You only need to set $SHF77 if you need to use a specific compiler or compiler version for Fortran 77 files. SHF77COM - - + The command line used to compile a Fortran 77 source file to a shared-library object file. -You only need to set $SHF77COM if you need to use a specific +You only need to set $SHF77COM if you need to use a specific command line for Fortran 77 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6452,24 +5909,22 @@ for all Fortran versions. SHF77COMSTR - - + The string displayed when a Fortran 77 source file is compiled to a shared-library object file. -If this is not set, then $SHF77COM or $SHFORTRANCOM +If this is not set, then $SHF77COM or $SHFORTRANCOM (the command line) is displayed. SHF77FLAGS - - + Options that are passed to the Fortran 77 compiler to generated shared-library objects. -You only need to set $SHF77FLAGS if you need to define specific +You only need to set $SHF77FLAGS if you need to define specific user options for Fortran 77 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6478,16 +5933,15 @@ for all Fortran versions. SHF77PPCOM - - + The command line used to compile a Fortran 77 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF77PPCOM if you need to use a specific +You only need to set $SHF77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6495,38 +5949,35 @@ for all Fortran versions. SHF77PPCOMSTR - - + 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 $SHF77PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF77PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF90 - - + The Fortran 90 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF90 if you need to use a specific compiler +You only need to set $SHF90 if you need to use a specific compiler or compiler version for Fortran 90 files. SHF90COM - - + The command line used to compile a Fortran 90 source file to a shared-library object file. -You only need to set $SHF90COM if you need to use a specific +You only need to set $SHF90COM if you need to use a specific command line for Fortran 90 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6534,24 +5985,22 @@ for all Fortran versions. SHF90COMSTR - - + The string displayed when a Fortran 90 source file is compiled to a shared-library object file. -If this is not set, then $SHF90COM or $SHFORTRANCOM +If this is not set, then $SHF90COM or $SHFORTRANCOM (the command line) is displayed. SHF90FLAGS - - + Options that are passed to the Fortran 90 compiler to generated shared-library objects. -You only need to set $SHF90FLAGS if you need to define specific +You only need to set $SHF90FLAGS if you need to define specific user options for Fortran 90 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6560,16 +6009,15 @@ for all Fortran versions. SHF90PPCOM - - + The command line used to compile a Fortran 90 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF90PPCOM if you need to use a specific +You only need to set $SHF90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6577,38 +6025,35 @@ for all Fortran versions. SHF90PPCOMSTR - - + 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 $SHF90PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF90PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF95 - - + The Fortran 95 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF95 if you need to use a specific compiler +You only need to set $SHF95 if you need to use a specific compiler or compiler version for Fortran 95 files. SHF95COM - - + The command line used to compile a Fortran 95 source file to a shared-library object file. -You only need to set $SHF95COM if you need to use a specific +You only need to set $SHF95COM if you need to use a specific command line for Fortran 95 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6616,24 +6061,22 @@ for all Fortran versions. SHF95COMSTR - - + The string displayed when a Fortran 95 source file is compiled to a shared-library object file. -If this is not set, then $SHF95COM or $SHFORTRANCOM +If this is not set, then $SHF95COM or $SHFORTRANCOM (the command line) is displayed. SHF95FLAGS - - + Options that are passed to the Fortran 95 compiler to generated shared-library objects. -You only need to set $SHF95FLAGS if you need to define specific +You only need to set $SHF95FLAGS if you need to define specific user options for Fortran 95 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6642,16 +6085,15 @@ for all Fortran versions. SHF95PPCOM - - + The command line used to compile a Fortran 95 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF95PPCOM if you need to use a specific +You only need to set $SHF95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6659,28 +6101,25 @@ for all Fortran versions. SHF95PPCOMSTR - - + 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 $SHF95PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF95PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHFORTRAN - - + The default Fortran compiler used for generating shared-library objects. SHFORTRANCOM - - + The command line used to compile a Fortran source file to a shared-library object file. @@ -6688,19 +6127,17 @@ to a shared-library object file. SHFORTRANCOMSTR - - + The string displayed when a Fortran source file is compiled to a shared-library object file. -If this is not set, then $SHFORTRANCOM +If this is not set, then $SHFORTRANCOM (the command line) is displayed. SHFORTRANFLAGS - - + Options that are passed to the Fortran compiler to generate shared-library objects. @@ -6708,94 +6145,85 @@ to generate shared-library objects. SHFORTRANPPCOM - - + The command line used to compile a Fortran source file to a shared-library object file after first running the file through the C preprocessor. Any options specified -in the $SHFORTRANFLAGS and -$CPPFLAGS construction variables +in the $SHFORTRANFLAGS and +$CPPFLAGS construction variables are included on this command line. SHFORTRANPPCOMSTR - - + 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 $SHFORTRANPPCOM +If this is not set, then $SHFORTRANPPCOM (the command line) is displayed. SHLIBEMITTER - - + TODO SHLIBNOVERSIONSYMLINKS - - -Instructs the SharedLibrary builder to not create symlinks for versioned + +Instructs the SharedLibrary builder to not create symlinks for versioned shared libraries. SHLIBPREFIX - - + The prefix used for shared library file names. _SHLIBSONAME - - + A macro that automatically generates shared library's SONAME based on $TARGET, -$SHLIBVERSION and $SHLIBSUFFIX. Used by SharedLibrary builder when -the linker tool supports SONAME (e.g. gnulink). +$SHLIBVERSION and $SHLIBSUFFIX. Used by SharedLibrary builder when +the linker tool supports SONAME (e.g. gnulink). SHLIBSUFFIX - - + The suffix used for shared library file names. SHLIBVERSION - - + When this construction variable is defined, a versioned shared library -is created by SharedLibrary builder. This activates the -$_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as +is created by SharedLibrary builder. This activates the +$_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as required, adds the version number to the library name, and creates the symlinks -that are needed. $SHLIBVERSION versions should exist as alpha-numeric, +that are needed. $SHLIBVERSION versions should exist as alpha-numeric, decimal-delimited values as defined by the regular expression "\w+[\.\w+]*". -Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. +Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. _SHLIBVERSIONFLAGS - - -This macro automatically introduces extra flags to $SHLINKCOM when -building versioned SharedLibrary (that is when $SHLIBVERSION -is set). _SHLIBVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS + +This macro automatically introduces extra flags to $SHLINKCOM when +building versioned SharedLibrary (that is when $SHLIBVERSION +is set). _SHLIBVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_SHLIBSONAME. It is unused by "plain" (unversioned) shared libraries. @@ -6804,63 +6232,58 @@ and some extra dynamically generated options (such as SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is set. SHLINK - - + The linker for programs that use shared libraries. SHLINKCOM - - + The command line used to link programs using shared libraries. SHLINKCOMSTR - - + The string displayed when programs using shared libraries are linked. -If this is not set, then $SHLINKCOM (the command line) is displayed. +If this is not set, then $SHLINKCOM (the command line) is displayed. - + env = Environment(SHLINKCOMSTR = "Linking shared $TARGET") SHLINKFLAGS - - + General user options passed to the linker for programs using shared libraries. Note that this variable should not contain -(or similar) options for linking with the libraries listed in $LIBS, +(or similar) options for linking with the libraries listed in $LIBS, nor (or similar) include search path options -that scons generates automatically from $LIBPATH. +that scons generates automatically from $LIBPATH. See -$_LIBFLAGS +$_LIBFLAGS above, for the variable that expands to library-link options, and -$_LIBDIRFLAGS +$_LIBDIRFLAGS above, for the variable that expands to library search path options. @@ -6868,36 +6291,32 @@ for the variable that expands to library search path options. SHOBJPREFIX - - + The prefix used for shared object file names. SHOBJSUFFIX - - + The suffix used for shared object file names. SONAME - - + Variable used to hard-code SONAME for versioned shared library/loadable module. env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2') -The variable is used, for example, by gnulink linker tool. +The variable is used, for example, by gnulink linker tool. SOURCE - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6906,8 +6325,7 @@ that may not be set or used in a construction environment. SOURCE_URL - - + The URL (web address) of the location from which the project was retrieved. @@ -6919,8 +6337,7 @@ field in the controlling information for Ipkg and RPM packages. SOURCES - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6929,17 +6346,16 @@ that may not be set or used in a construction environment. SPAWN - - + A command interpreter function that will be called to execute command line strings. The function must expect the following arguments: - + def spawn(shell, escape, cmd, args, env): - + sh is a string naming the shell program to use. escape @@ -6957,17 +6373,15 @@ in which the command should be executed. STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME - - + When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library. SUBST_DICT - - -The dictionary used by the Substfile or Textfile builders + +The dictionary used by the Substfile or Textfile builders for substitution values. It can be anything acceptable to the dict() constructor, so in addition to a dictionary, @@ -6977,26 +6391,23 @@ lists of tuples are also acceptable. SUBSTFILEPREFIX - - -The prefix used for Substfile file names, + +The prefix used for Substfile file names, the null string by default. SUBSTFILESUFFIX - - -The suffix used for Substfile file names, + +The suffix used for Substfile file names, the null string by default. SUMMARY - - + A short summary of what the project is about. This is used to fill in the Summary: @@ -7009,35 +6420,32 @@ field in MSI packages. SWIG - - + The scripting language wrapper and interface generator. SWIGCFILESUFFIX - - + The suffix that will be used for intermediate C source files generated by the scripting language wrapper and interface generator. The default value is -_wrap$CFILESUFFIX. +_wrap$CFILESUFFIX. By default, this value is used whenever the option is not specified as part of the -$SWIGFLAGS +$SWIGFLAGS construction variable. SWIGCOM - - + The command line used to call the scripting language wrapper and interface generator. @@ -7045,35 +6453,32 @@ the scripting language wrapper and interface generator. SWIGCOMSTR - - + The string displayed when calling the scripting language wrapper and interface generator. -If this is not set, then $SWIGCOM (the command line) is displayed. +If this is not set, then $SWIGCOM (the command line) is displayed. SWIGCXXFILESUFFIX - - + The suffix that will be used for intermediate C++ source files generated by the scripting language wrapper and interface generator. The default value is -_wrap$CFILESUFFIX. +_wrap$CFILESUFFIX. By default, this value is used whenever the -c++ option is specified as part of the -$SWIGFLAGS +$SWIGFLAGS construction variable. SWIGDIRECTORSUFFIX - - + The suffix that will be used for intermediate C++ header files generated by the scripting language wrapper and interface generator. These are only generated for C++ code when the SWIG 'directors' feature is @@ -7085,8 +6490,7 @@ The default value is SWIGFLAGS - - + General options passed to the scripting language wrapper and interface generator. This is where you should set @@ -7097,61 +6501,57 @@ or whatever other options you want to specify to SWIG. If you set the option in this variable, -scons +scons will, by default, generate a C++ intermediate source file with the extension that is specified as the -$CXXFILESUFFIX +$CXXFILESUFFIX variable. _SWIGINCFLAGS - - + An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. -The value of $_SWIGINCFLAGS is created +The value of $_SWIGINCFLAGS is created by respectively prepending and appending -$SWIGINCPREFIX and $SWIGINCSUFFIX +$SWIGINCPREFIX and $SWIGINCSUFFIX to the beginning and end -of each directory in $SWIGPATH. +of each directory in $SWIGPATH. SWIGINCPREFIX - - + The prefix used to specify an include directory on the SWIG command line. This will be prepended to the beginning of each directory -in the $SWIGPATH construction variable -when the $_SWIGINCFLAGS variable is automatically generated. +in the $SWIGPATH construction variable +when the $_SWIGINCFLAGS variable is automatically generated. SWIGINCSUFFIX - - + The suffix used to specify an include directory on the SWIG command line. This will be appended to the end of each directory -in the $SWIGPATH construction variable -when the $_SWIGINCFLAGS variable is automatically generated. +in the $SWIGPATH construction variable +when the $_SWIGINCFLAGS variable is automatically generated. SWIGOUTDIR - - + Specifies the output directory in which the scripting language wrapper and interface generator should place generated language-specific files. This will be used by SCons to identify -the files that will be generated by the swig call, +the files that will be generated by the swig call, and translated into the swig -outdir option on the command line. @@ -7159,15 +6559,14 @@ and translated into the SWIGPATH - - + The list of directories that the scripting language wrapper and interface generate will search for included files. The SWIG implicit dependency scanner will search these directories for include files. The default value is an empty list. - + Don't explicitly put include directory arguments in SWIGFLAGS; the result will be non-portable @@ -7175,96 +6574,90 @@ and the directories will not be searched by the dependency scanner. Note: directory names in SWIGPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(SWIGPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(SWIGPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_SWIGINCFLAGS +$_SWIGINCFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$SWIGINCPREFIX and $SWIGINCSUFFIX +$SWIGINCPREFIX and $SWIGINCSUFFIX construction variables to the beginning and end -of each directory in $SWIGPATH. +of each directory in $SWIGPATH. Any command lines you define that need the SWIGPATH directory list should -include $_SWIGINCFLAGS: +include $_SWIGINCFLAGS: - + env = Environment(SWIGCOM="my_swig -o $TARGET $_SWIGINCFLAGS $SOURCES") SWIGVERSION - - + The version number of the SWIG tool. TAR - - + The tar archiver. TARCOM - - + The command line used to call the tar archiver. TARCOMSTR - - + The string displayed when archiving files using the tar archiver. -If this is not set, then $TARCOM (the command line) is displayed. +If this is not set, then $TARCOM (the command line) is displayed. - + env = Environment(TARCOMSTR = "Archiving $TARGET") TARFLAGS - - + General options passed to the tar archiver. TARGET - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -7273,18 +6666,16 @@ that may not be set or used in a construction environment. TARGET_ARCH - - + The name of the target hardware architecture for the compiled objects created by this Environment. This defaults to the value of HOST_ARCH, and the user can override it. Currently only set for Win32. - - + Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to -$HOST_ARCH, or, if that is unset, to the architecture of the +$HOST_ARCH, or, if that is unset, to the architecture of the running machine's OS (note that the python build or architecture has no effect). This variable must be passed as an argument to the Environment() @@ -7296,7 +6687,7 @@ all installed MSVC's that support the TARGET_ARCH, selecting the latest version for use. - + Valid values for Windows are x86, arm, @@ -7316,8 +6707,7 @@ For example, if you want to compile 64-bit binaries, you would set TARGET_OS - - + The name of the target operating system for the compiled objects created by this Environment. This defaults to the value of HOST_OS, and the user can override it. @@ -7327,8 +6717,7 @@ For example, if you want to compile 64-bit binaries, you would set TARGETS - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -7337,17 +6726,15 @@ that may not be set or used in a construction environment. TARSUFFIX - - + The suffix used for tar file names. TEMPFILEARGJOIN - - -The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by $MAXLINELENGTH. + +The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by $MAXLINELENGTH. The default value is a space. However for MSVC, MSLINK the default is a line seperator characters as defined by os.linesep. Note this value is used literally and not expanded by the subst logic. @@ -7355,8 +6742,7 @@ Note this value is used literally and not expanded by the subst logic. TEMPFILEPREFIX - - + The prefix for a temporary file used to store lines lines longer than $MAXLINELENGTH as operations which call out to a shell will fail @@ -7372,8 +6758,7 @@ or '-via' for ARM toolchain. TEMPFILESUFFIX - - + The suffix used for the temporary file name used for long command lines. The name should include the dot ('.') if one is wanted as @@ -7384,46 +6769,41 @@ The default is '.lnk'. TEX - - + The TeX formatter and typesetter. TEXCOM - - + The command line used to call the TeX formatter and typesetter. TEXCOMSTR - - + The string displayed when calling the TeX formatter and typesetter. -If this is not set, then $TEXCOM (the command line) is displayed. +If this is not set, then $TEXCOM (the command line) is displayed. - + env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES") TEXFLAGS - - + General options passed to the TeX formatter and typesetter. TEXINPUTS - - + List of directories that the LaTeX program will search for include directories. The LaTeX implicit dependency scanner will search these @@ -7433,26 +6813,23 @@ directories for \include and \import files. TEXTFILEPREFIX - - -The prefix used for Textfile file names, + +The prefix used for Textfile file names, the null string by default. TEXTFILESUFFIX - - -The suffix used for Textfile file names; + +The suffix used for Textfile file names; .txt by default. TOOLS - - + A list of the names of the Tool specifications that are part of this construction environment. @@ -7460,8 +6837,7 @@ that are part of this construction environment. UNCHANGED_SOURCES - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -7470,8 +6846,7 @@ that may not be set or used in a construction environment. UNCHANGED_TARGETS - - + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -7480,8 +6855,7 @@ that may not be set or used in a construction environment. VENDOR - - + The person or organization who supply the packaged software. This is used to fill in the Vendor: @@ -7494,68 +6868,60 @@ field in the controlling information for MSI packages. VERSION - - + The version of the project, specified as a string. WIN32_INSERT_DEF - - -A deprecated synonym for $WINDOWS_INSERT_DEF. + +A deprecated synonym for $WINDOWS_INSERT_DEF. WIN32DEFPREFIX - - -A deprecated synonym for $WINDOWSDEFPREFIX. + +A deprecated synonym for $WINDOWSDEFPREFIX. WIN32DEFSUFFIX - - -A deprecated synonym for $WINDOWSDEFSUFFIX. + +A deprecated synonym for $WINDOWSDEFSUFFIX. WIN32EXPPREFIX - - -A deprecated synonym for $WINDOWSEXPSUFFIX. + +A deprecated synonym for $WINDOWSEXPSUFFIX. WIN32EXPSUFFIX - - -A deprecated synonym for $WINDOWSEXPSUFFIX. + +A deprecated synonym for $WINDOWSEXPSUFFIX. WINDOWS_EMBED_MANIFEST - - + Set this variable to True or 1 to embed the compiler-generated manifest (normally ${TARGET}.manifest) into all Windows exes and DLLs built with this environment, as a resource during their link step. -This is done using $MT and $MTEXECOM and $MTSHLIBCOM. +This is done using $MT and $MTEXECOM and $MTSHLIBCOM. WINDOWS_INSERT_DEF - - + When this is set to true, a library build of a Windows shared library (.dll file) @@ -7569,10 +6935,9 @@ The default is 0 (do not build a .def file). WINDOWS_INSERT_MANIFEST - - + When this is set to true, -scons +scons will be aware of the .manifest files generated by Microsoft Visua C/C++ 8. @@ -7581,40 +6946,35 @@ files generated by Microsoft Visua C/C++ 8. WINDOWSDEFPREFIX - - + The prefix used for Windows .def file names. WINDOWSDEFSUFFIX - - + The suffix used for Windows .def file names. WINDOWSEXPPREFIX - - + The prefix used for Windows .exp file names. WINDOWSEXPSUFFIX - - + The suffix used for Windows .exp file names. WINDOWSPROGMANIFESTPREFIX - - + The prefix used for executable program .manifest files generated by Microsoft Visual C/C++. @@ -7622,8 +6982,7 @@ generated by Microsoft Visual C/C++. WINDOWSPROGMANIFESTSUFFIX - - + The suffix used for executable program .manifest files generated by Microsoft Visual C/C++. @@ -7631,8 +6990,7 @@ generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTPREFIX - - + The prefix used for shared library .manifest files generated by Microsoft Visual C/C++. @@ -7640,8 +6998,7 @@ generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTSUFFIX - - + The suffix used for shared library .manifest files generated by Microsoft Visual C/C++. @@ -7649,8 +7006,7 @@ generated by Microsoft Visual C/C++. X_IPK_DEPENDS - - + This is used to fill in the Depends: field in the controlling information for Ipkg packages. @@ -7659,8 +7015,7 @@ field in the controlling information for Ipkg packages. X_IPK_DESCRIPTION - - + This is used to fill in the Description: field in the controlling information for Ipkg packages. @@ -7671,8 +7026,7 @@ The default value is X_IPK_MAINTAINER - - + This is used to fill in the Maintainer: field in the controlling information for Ipkg packages. @@ -7681,8 +7035,7 @@ field in the controlling information for Ipkg packages. X_IPK_PRIORITY - - + This is used to fill in the Priority: field in the controlling information for Ipkg packages. @@ -7691,8 +7044,7 @@ field in the controlling information for Ipkg packages. X_IPK_SECTION - - + This is used to fill in the Section: field in the controlling information for Ipkg packages. @@ -7701,8 +7053,7 @@ field in the controlling information for Ipkg packages. X_MSI_LANGUAGE - - + This is used to fill in the Language: attribute in the controlling information for MSI packages. @@ -7711,8 +7062,7 @@ attribute in the controlling information for MSI packages. X_MSI_LICENSE_TEXT - - + The text of the software license in RTF format. Carriage return characters will be replaced with the RTF equivalent \\par. @@ -7721,16 +7071,14 @@ replaced with the RTF equivalent \\par. X_MSI_UPGRADE_CODE - - + TODO X_RPM_AUTOREQPROV - - + This is used to fill in the AutoReqProv: field in the RPM @@ -7740,16 +7088,14 @@ field in the RPM X_RPM_BUILD - - + internal, but overridable X_RPM_BUILDREQUIRES - - + This is used to fill in the BuildRequires: field in the RPM @@ -7760,24 +7106,21 @@ Note this should only be used on a host managed by rpm as the dependencies will X_RPM_BUILDROOT - - + internal, but overridable X_RPM_CLEAN - - + internal, but overridable X_RPM_CONFLICTS - - + This is used to fill in the Conflicts: field in the RPM @@ -7787,8 +7130,7 @@ field in the RPM X_RPM_DEFATTR - - + This value is used as the default attributes for the files in the RPM package. The default value is @@ -7798,8 +7140,7 @@ The default value is X_RPM_DISTRIBUTION - - + This is used to fill in the Distribution: field in the RPM @@ -7809,8 +7150,7 @@ field in the RPM X_RPM_EPOCH - - + This is used to fill in the Epoch: field in the RPM @@ -7820,8 +7160,7 @@ field in the RPM X_RPM_EXCLUDEARCH - - + This is used to fill in the ExcludeArch: field in the RPM @@ -7831,8 +7170,7 @@ field in the RPM X_RPM_EXLUSIVEARCH - - + This is used to fill in the ExclusiveArch: field in the RPM @@ -7842,8 +7180,7 @@ field in the RPM X_RPM_EXTRADEFS - - + A list used to supply extra defintions or flags to be added to the RPM .spec file. Each item is added as-is with a carriage return appended. @@ -7859,7 +7196,7 @@ list that does not include the default line. Added in version 3.1. - + env.Package( NAME = 'foo', ... @@ -7874,8 +7211,7 @@ env.Package( X_RPM_GROUP - - + This is used to fill in the Group: field in the RPM @@ -7885,8 +7221,7 @@ field in the RPM X_RPM_GROUP_lang - - + This is used to fill in the Group(lang): field in the RPM @@ -7901,8 +7236,7 @@ the appropriate language code. X_RPM_ICON - - + This is used to fill in the Icon: field in the RPM @@ -7912,16 +7246,14 @@ field in the RPM X_RPM_INSTALL - - + internal, but overridable X_RPM_PACKAGER - - + This is used to fill in the Packager: field in the RPM @@ -7931,8 +7263,7 @@ field in the RPM X_RPM_POSTINSTALL - - + This is used to fill in the %post: section in the RPM @@ -7942,8 +7273,7 @@ section in the RPM X_RPM_POSTUNINSTALL - - + This is used to fill in the %postun: section in the RPM @@ -7953,8 +7283,7 @@ section in the RPM X_RPM_PREFIX - - + This is used to fill in the Prefix: field in the RPM @@ -7964,8 +7293,7 @@ field in the RPM X_RPM_PREINSTALL - - + This is used to fill in the %pre: section in the RPM @@ -7975,16 +7303,14 @@ section in the RPM X_RPM_PREP - - + internal, but overridable X_RPM_PREUNINSTALL - - + This is used to fill in the %preun: section in the RPM @@ -7994,8 +7320,7 @@ section in the RPM X_RPM_PROVIDES - - + This is used to fill in the Provides: field in the RPM @@ -8005,8 +7330,7 @@ field in the RPM X_RPM_REQUIRES - - + This is used to fill in the Requires: field in the RPM @@ -8016,8 +7340,7 @@ field in the RPM X_RPM_SERIAL - - + This is used to fill in the Serial: field in the RPM @@ -8027,8 +7350,7 @@ field in the RPM X_RPM_URL - - + This is used to fill in the Url: field in the RPM @@ -8038,37 +7360,33 @@ field in the RPM XGETTEXT - - + Path to xgettext(1) program (found via Detect()). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTCOM - - + Complete xgettext command line. -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTCOMSTR - - + A string that is shown when xgettext(1) command is invoked -(default: '', which means "print $XGETTEXTCOM"). -See xgettext tool and POTUpdate builder. +(default: '', which means "print $XGETTEXTCOM"). +See xgettext tool and POTUpdate builder. _XGETTEXTDOMAIN - - + Internal "macro". Generates xgettext domain name form source and target (default: '${TARGET.filebase}'). @@ -8076,40 +7394,36 @@ form source and target (default: '${TARGET.filebase}'). XGETTEXTFLAGS - - + Additional flags to xgettext(1). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTFROM - - + Name of file containing list of xgettext(1)'s source files. Autotools' users know this as POTFILES.in so they will in most cases set XGETTEXTFROM="POTFILES.in" here. -The $XGETTEXTFROM files have same syntax and semantics as the well known +The $XGETTEXTFROM files have same syntax and semantics as the well known GNU POTFILES.in. -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. _XGETTEXTFROMFLAGS - - + Internal "macro". Genrates list of -D<dir> flags -from the $XGETTEXTPATH list. +from the $XGETTEXTPATH list. XGETTEXTFROMPREFIX - - -This flag is used to add single $XGETTEXTFROM file to + +This flag is used to add single $XGETTEXTFROM file to xgettext(1)'s commandline (default: '-f'). @@ -8117,38 +7431,34 @@ This flag is used to add single XGETTEXTFROMSUFFIX - - + (default: '') XGETTEXTPATH - - + List of directories, there xgettext(1) will look for source files (default: []). -This variable works only together with $XGETTEXTFROM +This variable works only together with $XGETTEXTFROM -See also xgettext tool and POTUpdate builder. +See also xgettext tool and POTUpdate builder. _XGETTEXTPATHFLAGS - - + Internal "macro". Generates list of -f<file> flags -from $XGETTEXTFROM. +from $XGETTEXTFROM. XGETTEXTPATHPREFIX - - + This flag is used to add single search path to xgettext(1)'s commandline (default: '-D'). @@ -8157,24 +7467,21 @@ This flag is used to add single search path to XGETTEXTPATHSUFFIX - - + (default: '') YACC - - + The parser generator. YACCCOM - - + The command line used to call the parser generator to generate a source file. @@ -8182,24 +7489,22 @@ to generate a source file. YACCCOMSTR - - + The string displayed when generating a source file using the parser generator. -If this is not set, then $YACCCOM (the command line) is displayed. +If this is not set, then $YACCCOM (the command line) is displayed. - + env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES") YACCFLAGS - - + General options passed to the parser generator. -If $YACCFLAGS contains a option, +If $YACCFLAGS contains a option, SCons assumes that the call will also create a .h file (if the yacc source file ends in a .y suffix) or a .hpp file @@ -8209,8 +7514,7 @@ or a .hpp file YACCHFILESUFFIX - - + The suffix of the C header file generated by the parser generator when the @@ -8228,8 +7532,7 @@ The default value is YACCHXXFILESUFFIX - - + The suffix of the C++ header file generated by the parser generator when the @@ -8245,7 +7548,7 @@ The default value is except on Mac OS X, where the default is ${TARGET.suffix}.h. -because the default bison parser generator just +because the default bison parser generator just appends .h to the name of the generated C++ file. @@ -8253,8 +7556,7 @@ to the name of the generated C++ file. YACCVCGFILESUFFIX - - + The suffix of the file containing the VCG grammar automaton definition when the @@ -8272,16 +7574,14 @@ The default value is ZIP - - + The zip compression and file packaging utility. ZIPCOM - - + The command line used to call the zip utility, or the internal Python function used to create a zip archive. @@ -8290,8 +7590,7 @@ zip archive. ZIPCOMPRESSION - - + The compression flag @@ -8311,42 +7610,39 @@ module is unavailable. ZIPCOMSTR - - + The string displayed when archiving files using the zip utility. -If this is not set, then $ZIPCOM +If this is not set, then $ZIPCOM (the command line or internal Python function) is displayed. - + env = Environment(ZIPCOMSTR = "Zipping $TARGET") ZIPFLAGS - - + General options passed to the zip utility. ZIPROOT - - + An optional zip root directory (default empty). The filenames stored in the zip file will be relative to this directory, if given. Otherwise the filenames are relative to the current directory of the command. For instance: - + env = Environment() env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') - + will produce a zip file foo.zip containing a file with the name subdir2/file1 rather than @@ -8356,8 +7652,7 @@ containing a file with the name ZIPSUFFIX - - + The suffix used for zip file names. diff --git a/src/engine/SCons/Tool/msvs.xml b/src/engine/SCons/Tool/msvs.xml index 6e622a7..3a9fdf0 100644 --- a/src/engine/SCons/Tool/msvs.xml +++ b/src/engine/SCons/Tool/msvs.xml @@ -140,7 +140,7 @@ See its __doc__ string for a discussion of the format. only one, it will automatically be propagated to all variants. If you don't give this parameter, SCons will use the invoking environment's - CPPDEFINES entry for all variants. + CPPDEFINES entry for all variants. @@ -155,7 +155,7 @@ See its __doc__ string for a discussion of the format. only one, it will automatically be propagated to all variants. If you don't give this parameter, SCons will use the invoking environment's - CPPPATH entry for all variants. + CPPPATH entry for all variants. -- cgit v0.12 From 9f49d9c9b11bd3aa69fef5944838f52f49b804ae Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Fri, 19 Jul 2019 16:59:35 -0400 Subject: [ci skip] Revert bad changes to generated files Trying to regenerate the documentation went very poorly, so I'm reverting them. --- doc/generated/builders.gen | 926 ++--- doc/generated/examples/buildersbuiltin_libs_1.xml | 34 +- doc/generated/examples/buildersbuiltin_libs_2.xml | 6 +- doc/generated/examples/commandline_Default1_1.xml | 90 +- doc/generated/examples/commandline_Default1_2.xml | 35 +- doc/generated/examples/commandline_Default2_1.xml | 64 +- doc/generated/examples/commandline_Default3_1.xml | 92 +- doc/generated/examples/commandline_Default4_1.xml | 64 +- .../examples/commandline_PackageVariable_1.xml | 116 +- .../environments_Replace-nonexistent_1.xml | 33 +- doc/generated/examples/environments_missing2_1.xml | 34 +- doc/generated/examples/environments_missing3_1.xml | 33 +- doc/generated/examples/sideeffect_parallel_1.xml | 33 +- doc/generated/examples/simple_clean_1.xml | 68 +- doc/generated/examples/simple_clean_2.xml | 4 +- doc/generated/examples/sourcecode_cvs_1.xml | 34 +- doc/generated/functions.gen | 1221 ++++--- doc/generated/tools.gen | 633 ++-- doc/generated/variables.gen | 3659 ++++++++++++-------- 19 files changed, 3763 insertions(+), 3416 deletions(-) diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 17bfa21..dc05443 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,7 +12,7 @@ %variables-mod; ]> - + CFile() @@ -20,17 +20,18 @@ env.CFile() - + + Builds a C source file given a lex (.l) or yacc (.y) input file. -The suffix specified by the $CFILESUFFIX construction variable +The suffix specified by the $CFILESUFFIX construction variable (.c by default) is automatically added to the target if it is not already present. Example: - + # builds foo.c env.CFile(target = 'foo.c', source = 'foo.l') # builds bar.c @@ -45,12 +46,13 @@ env.CFile(target = 'bar', source = 'bar.y') env.Command() - -The Command "Builder" is actually implemented + + +The Command "Builder" is actually implemented as a function that looks like a Builder, but actually takes an additional argument of the action from which the Builder should be made. -See the Command function description +See the Command function description for the calling syntax and details. @@ -62,18 +64,19 @@ for the calling syntax and details. env.CXXFile() - + + Builds a C++ source file given a lex (.ll) or yacc (.yy) input file. -The suffix specified by the $CXXFILESUFFIX construction variable +The suffix specified by the $CXXFILESUFFIX construction variable (.cc by default) is automatically added to the target if it is not already present. Example: - + # builds foo.cc env.CXXFile(target = 'foo.cc', source = 'foo.ll') # builds bar.cc @@ -88,19 +91,20 @@ env.CXXFile(target = 'bar', source = 'bar.yy') env.DocbookEpub() - + + A pseudo-Builder, providing a Docbook toolchain for EPUB output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookEpub('manual.epub', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookEpub('manual') @@ -113,16 +117,17 @@ env.DocbookEpub('manual') env.DocbookHtml() - + + A pseudo-Builder, providing a Docbook toolchain for HTML output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual') @@ -134,34 +139,35 @@ env.DocbookHtml('manual') env.DocbookHtmlChunked() - + + A pseudo-Builder, providing a Docbook toolchain for chunked HTML output. It supports the base.dir parameter. The chunkfast.xsl file (requires "EXSLT") is used as the default stylesheet. Basic syntax: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual') - + where manual.xml is the input file. -If you use the root.filename +If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('mymanual.html', 'manual', xsl='htmlchunk.xsl') -Some basic support for the base.dir is provided. You +Some basic support for the base.dir is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlChunked('manual', xsl='htmlchunk.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -173,34 +179,35 @@ your files get renamed only! env.DocbookHtmlhelp() - + + A pseudo-Builder, providing a Docbook toolchain for HTMLHELP output. Its basic syntax is: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') - + where manual.xml is the input file. -If you use the root.filename +If you use the root.filename parameter in your own stylesheets you have to specify the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('mymanual.html', 'manual', xsl='htmlhelp.xsl') -Some basic support for the base.dir parameter +Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual', xsl='htmlhelp.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -213,15 +220,16 @@ your files get renamed only! env.DocbookMan() - + + A pseudo-Builder, providing a Docbook toolchain for Man page output. Its basic syntax is: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookMan('manual') - + where manual.xml is the input file. Note, that you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. @@ -235,19 +243,20 @@ set from the refname entries in your XML source. env.DocbookPdf() - + + A pseudo-Builder, providing a Docbook toolchain for PDF output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookPdf('manual.pdf', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookPdf('manual') @@ -260,32 +269,33 @@ env.DocbookPdf('manual') env.DocbookSlidesHtml() - + + A pseudo-Builder, providing a Docbook toolchain for HTML slides output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual') -If you use the titlefoil.html parameter in +If you use the titlefoil.html parameter in your own stylesheets you have to give the new target name. This ensures that the dependencies get correct, especially for the cleanup via scons -c: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('mymanual.html','manual', xsl='slideshtml.xsl') -Some basic support for the base.dir parameter +Some basic support for the base.dir parameter is provided. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesHtml('manual', xsl='slideshtml.xsl', base_dir='output/') -Make sure that you don't forget the trailing slash for the base folder, else +Make sure that you don't forget the trailing slash for the base folder, else your files get renamed only! @@ -298,19 +308,20 @@ your files get renamed only! env.DocbookSlidesPdf() - + + A pseudo-Builder, providing a Docbook toolchain for PDF slides output. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual.pdf', 'manual.xml') - + or simply -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookSlidesPdf('manual') @@ -322,11 +333,12 @@ env.DocbookSlidesPdf('manual') env.DocbookXInclude() - + + A pseudo-Builder, for resolving XIncludes in a separate processing step. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') @@ -338,15 +350,16 @@ env.DocbookXInclude('manual_xincluded.xml', 'manual.xml') env.DocbookXslt() - + + A pseudo-Builder, applying a given XSL transformation to the input file. -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookXslt('manual_transformed.xml', 'manual.xml', xsl='transform.xslt') -Note, that this builder requires the xsl parameter +Note, that this builder requires the xsl parameter to be set. @@ -358,40 +371,41 @@ to be set. env.DVI() - + + Builds a .dvi file from a .tex, .ltx or .latex input file. If the source file suffix is .tex, -scons +scons will examine the contents of the file; if the string \documentclass or \documentstyle is found, the file is assumed to be a LaTeX file and -the target is built by invoking the $LATEXCOM command line; -otherwise, the $TEXCOM command line is used. +the target is built by invoking the $LATEXCOM command line; +otherwise, the $TEXCOM command line is used. If the file is a LaTeX file, the -DVI +DVI builder method will also examine the contents of the .aux -file and invoke the $BIBTEX command line +file and invoke the $BIBTEX command line if the string bibdata is found, -start $MAKEINDEX to generate an index if a +start $MAKEINDEX to generate an index if a .ind file is found and will examine the contents .log -file and re-run the $LATEXCOM command +file and re-run the $LATEXCOM command if the log file says it is necessary. - + The suffix .dvi (hard-coded within TeX itself) is automatically added to the target @@ -399,7 +413,7 @@ if it is not already present. Examples: - + # builds from aaa.tex env.DVI(target = 'aaa.dvi', source = 'aaa.tex') # builds bbb.dvi @@ -416,13 +430,14 @@ env.DVI(target = 'ccc.dvi', source = 'ccc.latex') env.Gs() - + + A Builder for explicitly calling the gs executable. Depending on the underlying OS, the different names gs, gsos2 and gswin32c are tried. -env = Environment(tools=['gs']) +env = Environment(tools=['gs']) env.Gs('cover.jpg','scons-scons.pdf', GSFLAGS='-dNOPAUSE -dBATCH -sDEVICE=jpeg -dFirstPage=1 -dLastPage=1 -q') ) @@ -436,7 +451,8 @@ env.Gs('cover.jpg','scons-scons.pdf', env.Install() - + + Installs one or more source files or directories in the specified target, which must be a directory. @@ -446,7 +462,7 @@ sources may be given as a string or as a node returned by a builder. - + env.Install('/usr/local/bin', source = ['foo', 'bar']) @@ -458,7 +474,8 @@ env.Install('/usr/local/bin', source = ['foo', 'bar']) env.InstallAs() - + + Installs one or more source files or directories to specific names, allowing changing a file or directory name @@ -470,7 +487,7 @@ source arguments list different numbers of files or directories. - + env.InstallAs(target = '/usr/local/bin/foo', source = 'foo_debug') env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], @@ -486,12 +503,13 @@ env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'], env.InstallVersionedLib() - + + Installs a versioned shared library. The symlinks appropriate to the architecture will be generated based on symlinks of the source library. - + env.InstallVersionedLib(target = '/usr/local/bin/foo', source = 'libxyz.1.5.2.so') @@ -504,40 +522,41 @@ env.InstallVersionedLib(target = '/usr/local/bin/foo', env.Jar() - + + Builds a Java archive (.jar) file from the specified list of sources. Any directories in the source list will be searched for .class files). Any .java files in the source list will be compiled to .class files -by calling the Java Builder. +by calling the Java Builder. - -If the $JARCHDIR value is set, the -jar + +If the $JARCHDIR value is set, the +jar command will change to the specified directory using the option. -If $JARCHDIR is not set explicitly, -SCons will use the top of any subdirectory tree +If $JARCHDIR is not set explicitly, +SCons will use the top of any subdirectory tree in which Java .class -were built by the Java Builder. +were built by the Java Builder. - + If the contents any of the source files begin with the string Manifest-Version, the file is assumed to be a manifest and is passed to the -jar +jar command with the option set. - + env.Jar(target = 'foo.jar', source = 'classes') env.Jar(target = 'bar.jar', @@ -552,7 +571,8 @@ env.Jar(target = 'bar.jar', env.Java() - + + Builds one or more Java class files. The sources may be any combination of explicit .java @@ -561,7 +581,7 @@ env.Jar(target = 'bar.jar', for .java files. - + SCons will parse each source .java file to find the classes (including inner classes) @@ -572,7 +592,7 @@ env.Jar(target = 'bar.jar', the specified target directory. - + SCons will also search each Java file for the Java package name, which it assumes can be found on a line @@ -595,17 +615,17 @@ env.Jar(target = 'bar.jar', class file. - + Examples: - + env.Java(target = 'classes', source = 'src') env.Java(target = 'classes', source = ['src1', 'src2']) env.Java(target = 'classes', source = ['File1.java', 'File2.java']) - + Java source files can use the native encoding for the underlying OS. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, @@ -618,7 +638,7 @@ env.Jar(target = 'bar.jar', with a different encoding. - + env = Environment() env['ENV']['LANG'] = 'en_GB.UTF-8' @@ -631,7 +651,8 @@ env.Jar(target = 'bar.jar', env.JavaH() - + + Builds C header and source files for implementing Java native methods. The target can be either a directory @@ -641,29 +662,29 @@ will contain all of the definitions. The source can be the names of .class files, the names of .java files to be compiled into .class files -by calling the Java builder method, +by calling the Java builder method, or the objects returned from the -Java +Java builder method. - + If the construction variable -$JAVACLASSDIR +$JAVACLASSDIR is set, either in the environment or in the call to the -JavaH +JavaH builder method itself, then the value of the variable will be stripped from the beginning of any .class file names. - + Examples: - + # builds java_native.h classes = env.Java(target = 'classdir', source = 'src') env.JavaH(target = 'java_native.h', source = classes) @@ -686,9 +707,10 @@ env.JavaH(target = 'export', env.Library() - + + A synonym for the -StaticLibrary +StaticLibrary builder method. @@ -700,10 +722,11 @@ builder method. env.LoadableModule() - + + On most systems, this is the same as -SharedLibrary. +SharedLibrary. On Mac OS X (Darwin) platforms, this creates a loadable module bundle. @@ -716,9 +739,10 @@ this creates a loadable module bundle. env.M4() - + + Builds an output file from an M4 input file. -This uses a default $M4FLAGS value of +This uses a default $M4FLAGS value of , which considers all warnings to be fatal and stops on the first warning @@ -726,7 +750,7 @@ when using the GNU version of m4. Example: - + env.M4(target = 'foo.c', source = 'foo.c.m4') @@ -738,14 +762,15 @@ env.M4(target = 'foo.c', source = 'foo.c.m4') env.Moc() - + + Builds an output file from a moc input file. Moc input files are either header files or cxx files. This builder is only available after using the -tool 'qt'. See the $QTDIR variable for more information. +tool 'qt'. See the $QTDIR variable for more information. Example: - + env.Moc('foo.h') # generates moc_foo.cc env.Moc('foo.cpp') # generates foo.moc @@ -758,47 +783,48 @@ env.Moc('foo.cpp') # generates foo.moc env.MOFiles() - -This builder belongs to msgfmt tool. The builder compiles + + +This builder belongs to msgfmt tool. The builder compiles PO files to MO files. - + Example 1. Create pl.mo and en.mo by compiling pl.po and en.po: - + # ... env.MOFiles(['pl', 'en']) - + Example 2. Compile files for languages defined in LINGUAS file: - + # ... env.MOFiles(LINGUAS_FILE = 1) - + Example 3. Create pl.mo and en.mo by compiling pl.po and en.po plus files for languages defined in LINGUAS file: - + # ... env.MOFiles(['pl', 'en'], LINGUAS_FILE = 1) - + Example 4. Compile files for languages defined in LINGUAS file (another version): - + # ... env['LINGUAS_FILE'] = 1 env.MOFiles() @@ -812,53 +838,52 @@ Compile files for languages defined in LINGUAS file env.MSVSProject() - + + Builds a Microsoft Visual Studio project file, and by default builds a solution file as well. - + This builds a Visual Studio project file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by - $MSVS_VERSION in the Environment constructor). For + $MSVS_VERSION in the Environment constructor). For Visual Studio 6, it will generate a .dsp - file. For Visual Studio 7, 8, and 9, it will - generate a .vcproj file. For Visual - Studio 10 and later, it will generate a - .vcxproj file. + file. For Visual Studio 7 (.NET) and later versions, it will + generate a .vcproj file. - + By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for - Visual Studio 7 and later. This behavior may be disabled by + Visual Studio 7 (.NET). This behavior may be disabled by specifying auto_build_solution=0 when you - call MSVSProject, in which case you presumably want to - build the solution file(s) by calling the MSVSSolution + call MSVSProject, in which case you presumably want to + build the solution file(s) by calling the MSVSSolution Builder (see below). - - The MSVSProject builder takes several lists of filenames + + The MSVSProject builder takes several lists of filenames to be placed into the project file. These are currently limited to srcs, incs, localincs, resources, and misc. These are pretty self-explanatory, but it should be noted that these lists are added to the - $SOURCES construction variable as strings, NOT as + $SOURCES construction variable as strings, NOT as SCons File Nodes. This is because they represent file names to be added to the project file, not the source files used to build the project file. - + The above filename lists are all optional, although at least one must be specified for the resulting project file to be non-empty. - + In addition to the above lists of values, the following values may be specified: - + target @@ -866,7 +891,7 @@ Compile files for languages defined in LINGUAS file The name of the target .dsp or .vcproj file. The correct suffix for the version of Visual Studio - must be used, but the $MSVSPROJECTSUFFIX + must be used, but the $MSVSPROJECTSUFFIX construction variable will be defined to the correct value (see example below). @@ -884,7 +909,7 @@ Compile files for languages defined in LINGUAS file separated from the variant name by a | (vertical pipe) character: Debug|Xbox. The default target platform is Win32. Multiple calls - to MSVSProject with different variants are allowed; + to MSVSProject with different variants are allowed; all variants will be added to the project file with their appropriate build targets and sources. @@ -904,36 +929,6 @@ Compile files for languages defined in LINGUAS file - cppdefines - - - Preprocessor definitions for the different variants. - The number of cppdefines entries - must match the number of variant - entries, or be empty (not specified). If you give - only one, it will automatically be propagated to all - variants. If you don't give this parameter, SCons - will use the invoking environment's - CPPDEFINES entry for all variants. - - - - - cpppaths - - - Compiler include paths for the different variants. - The number of cpppaths entries - must match the number of variant - entries, or be empty (not specified). If you give - only one, it will automatically be propagated to all - variants. If you don't give this parameter, SCons - will use the invoking environment's - CPPPATH entry for all variants. - - - - buildtarget @@ -960,20 +955,20 @@ Compile files for languages defined in LINGUAS file - - Note that because SCons always executes its build commands - from the directory in which the SConstruct file is located, + + Note that because SCons always executes its build commands + from the directory in which the SConstruct file is located, if you generate a project file in a different directory - than the SConstruct directory, users will not be able to + than the SConstruct directory, users will not be able to double-click on the file name in compilation error messages displayed in the Visual Studio console output window. This can be remedied by adding the Visual C/C++ /FC - compiler option to the $CCFLAGS variable so that + compiler option to the $CCFLAGS variable so that the compiler will print the full path name of any files that cause compilation errors. - Example usage: - + Example usage: + barsrcs = ['bar.cpp'] barincs = ['bar.h'] barlocalincs = ['StdAfx.h'] @@ -992,13 +987,13 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], buildtarget=buildtarget, variant='Release') - + Starting with version 2.4 of SCons it is also possible to specify the optional argument DebugSettings, which creates files for debugging under Visual Studio: - + DebugSettings @@ -1014,7 +1009,7 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], - + Currently, only Visual Studio v9.0 and Visual Studio version v11 are implemented, for other versions no file is generated. To generate the user file, you just need to @@ -1023,11 +1018,11 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], the dictionary is empty, or does not contain any good value, no file will be generated. - + Following is a more contrived example, involving the setup of a project for variants and DebugSettings: - + # Assuming you store your defaults in a file vars = Variables('variables.py') msvcver = vars.args.get('vc', '9') @@ -1151,25 +1146,26 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], env.MSVSSolution() - Builds a Microsoft Visual Studio solution file. - + + Builds a Microsoft Visual Studio solution file. + This builds a Visual Studio solution file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by - $MSVS_VERSION in the construction environment). For + $MSVS_VERSION in the construction environment). For Visual Studio 6, it will generate a .dsw file. For Visual Studio 7 (.NET), it will generate a .sln file. - The following values must be specified: - + The following values must be specified: + target The name of the target .dsw or .sln file. The correct suffix for the version of Visual Studio must be used, - but the value $MSVSSOLUTIONSUFFIX will be + but the value $MSVSSOLUTIONSUFFIX will be defined to the correct value (see example below). @@ -1188,7 +1184,7 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], projects A list of project file names, or Project nodes returned - by calls to the MSVSProject Builder, to be placed + by calls to the MSVSProject Builder, to be placed into the solution file. It should be noted that these file names are NOT added to the $SOURCES environment variable in form of files, but rather as strings. @@ -1199,8 +1195,8 @@ env.MSVSProject(target='Bar' + env['MSVSPROJECTSUFFIX'], - Example Usage: - + Example Usage: + env.MSVSSolution(target='Bar' + env['MSVSSOLUTIONSUFFIX'], projects=['bar' + env['MSVSPROJECTSUFFIX']], variant='Release') @@ -1212,9 +1208,10 @@ env.MSVSSolution(target='Bar' + env['MSVSSOLUTIONSUFFIX'], projects=['bar' + env env.Object() - + + A synonym for the -StaticObject +StaticObject builder method. @@ -1226,39 +1223,41 @@ builder method. env.Package() - + + Builds a Binary Package of the given source files. - + env.Package(source = FindInstalledFiles()) - + + Builds software distribution packages. Packages consist of files to install and packaging information. -The former may be specified with the source parameter and may be left out, -in which case the FindInstalledFiles function will collect -all files that have an Install or InstallAs Builder attached. -If the target is not specified +The former may be specified with the source parameter and may be left out, +in which case the FindInstalledFiles function will collect +all files that have an Install or InstallAs Builder attached. +If the target is not specified it will be deduced from additional information given to this Builder. - + The packaging information is specified with the help of construction variables documented below. This information is called a tag to stress that -some of them can also be attached to files with the Tag function. +some of them can also be attached to files with the Tag function. The mandatory ones will complain if they were not specified. They vary depending on chosen target packager. - + The target packager may be selected with the "PACKAGETYPE" command line -option or with the $PACKAGETYPE construction variable. Currently +option or with the $PACKAGETYPE construction variable. Currently the following packagers available: - + * msi - Microsoft Installer * rpm - RPM Package Manger * ipkg - Itsy Package Management System @@ -1272,11 +1271,11 @@ the following packagers available: * src_zip - zip file source - + An updated list is always available under the "package_type" option when running "scons --help" on a project that has packaging activated. - + env = Environment(tools=['default', 'packaging']) env.Install('/bin/', 'my_program') env.Package( NAME = 'foo', @@ -1299,7 +1298,8 @@ env.Package( NAME = 'foo', env.PCH() - + + Builds a Microsoft Visual C++ precompiled header. Calling this builder method returns a list of two targets: the PCH as the first element, and the object @@ -1311,7 +1311,7 @@ conjunction with the PCH construction variable to force object files to use the precompiled header: - + env['PCH'] = env.PCH('StdAfx.cpp')[0] @@ -1323,20 +1323,21 @@ env['PCH'] = env.PCH('StdAfx.cpp')[0] env.PDF() - + + Builds a .pdf file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). -The suffix specified by the $PDFSUFFIX construction variable +The suffix specified by the $PDFSUFFIX construction variable (.pdf by default) is added automatically to the target if it is not already present. Example: - + # builds from aaa.tex env.PDF(target = 'aaa.pdf', source = 'aaa.tex') # builds bbb.pdf from bbb.dvi @@ -1351,99 +1352,100 @@ env.PDF(target = 'bbb', source = 'bbb.dvi') env.POInit() - -This builder belongs to msginit tool. The builder initializes missing -PO file(s) if $POAUTOINIT is set. If -$POAUTOINIT is not set (default), POInit prints instruction for + + +This builder belongs to msginit tool. The builder initializes missing +PO file(s) if $POAUTOINIT is set. If +$POAUTOINIT is not set (default), POInit prints instruction for user (that is supposed to be a translator), telling how the PO file should be initialized. In normal projects -you should not use POInit and use POUpdate -instead. POUpdate chooses intelligently between -msgmerge(1) and msginit(1). POInit +you should not use POInit and use POUpdate +instead. POUpdate chooses intelligently between +msgmerge(1) and msginit(1). POInit always uses msginit(1) and should be regarded as builder for special purposes or for temporary use (e.g. for quick, one time initialization of a bunch of PO files) or for tests. - -Target nodes defined through POInit are not built by default (they're + +Target nodes defined through POInit are not built by default (they're Ignored from '.' node) but are added to special Alias ('po-create' by default). -The alias name may be changed through the $POCREATE_ALIAS +The alias name may be changed through the $POCREATE_ALIAS construction variable. All PO files defined through -POInit may be easily initialized by scons po-create. +POInit may be easily initialized by scons po-create. - + Example 1. Initialize en.po and pl.po from messages.pot: - + # ... env.POInit(['en', 'pl']) # messages.pot --> [en.po, pl.po] - + Example 2. Initialize en.po and pl.po from foo.pot: - + # ... env.POInit(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.po] - + Example 3. Initialize en.po and pl.po from -foo.pot but using $POTDOMAIN construction +foo.pot but using $POTDOMAIN construction variable: - + # ... env.POInit(['en', 'pl'], POTDOMAIN='foo') # foo.pot --> [en.po, pl.po] - + Example 4. Initialize PO files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: - + # ... env.POInit(LINGUAS_FILE = 1) # needs 'LINGUAS' file - + Example 5. Initialize en.po and pl.pl PO files plus files for languages defined in LINGUAS file. The files will be initialized from template messages.pot: - + # ... env.POInit(['en', 'pl'], LINGUAS_FILE = 1) - + Example 6. You may preconfigure your environment first, and then initialize PO files: - + # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 env['POTDOMAIN'] = 'foo' env.POInit() - + which has same efect as: - + # ... env.POInit(POAUTOINIT = 1, LINGUAS_FILE = 1, POTDOMAIN = 'foo') @@ -1456,20 +1458,21 @@ which has same efect as: env.PostScript() - + + Builds a .ps file from a .dvi input file (or, by extension, a .tex, .ltx, or .latex input file). -The suffix specified by the $PSSUFFIX construction variable +The suffix specified by the $PSSUFFIX construction variable (.ps by default) is added automatically to the target if it is not already present. Example: - + # builds from aaa.tex env.PostScript(target = 'aaa.ps', source = 'aaa.tex') # builds bbb.ps from bbb.dvi @@ -1484,23 +1487,24 @@ env.PostScript(target = 'bbb', source = 'bbb.dvi') env.POTUpdate() - -The builder belongs to xgettext tool. The builder updates target + + +The builder belongs to xgettext tool. The builder updates target POT file if exists or creates one if it doesn't. The node is not built by default (i.e. it is Ignored from '.'), but only on demand (i.e. when given POT file is required or when special alias is invoked). This builder adds its targe node (messages.pot, say) to a special alias (pot-update by default, see -$POTUPDATE_ALIAS) so you can update/create them easily with +$POTUPDATE_ALIAS) so you can update/create them easily with scons pot-update. The file is not written until there is no real change in internationalized messages (or in comments that enter POT file). - + You may see xgettext(1) being invoked by the -xgettext tool even if there is no real change in internationalized +xgettext tool even if there is no real change in internationalized messages (so the POT file is not being updated). This happens every time a source file has changed. In such case we invoke xgettext(1) and compare its output with the content of @@ -1508,38 +1512,38 @@ happens every time a source file has changed. In such case we invoke not. - + Example 1. Let's create po/ directory and place following SConstruct script there: - + # SConstruct in 'po/' subdir env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(['foo'], ['../a.cpp', '../b.cpp']) env.POTUpdate(['bar'], ['../c.cpp', '../d.cpp']) - + Then invoke scons few times: - + user@host:$ scons # Does not create foo.pot nor bar.pot user@host:$ scons foo.pot # Updates or creates foo.pot user@host:$ scons pot-update # Updates or creates foo.pot and bar.pot user@host:$ scons -c # Does not clean foo.pot nor bar.pot. - + the results shall be as the comments above say. - + Example 2. -The POTUpdate builder may be used with no target specified, in which +The POTUpdate builder may be used with no target specified, in which case default target messages.pot will be used. The -default target may also be overridden by setting $POTDOMAIN construction -variable or providing it as an override to POTUpdate builder: +default target may also be overridden by setting $POTDOMAIN construction +variable or providing it as an override to POTUpdate builder: - + # SConstruct script env = Environment( tools = ['default', 'xgettext'] ) env['POTDOMAIN'] = "foo" @@ -1547,49 +1551,49 @@ variable or providing it as an override to POTUpdate builde env.POTUpdate(POTDOMAIN = "bar", source = ["c.cpp", "d.cpp"]) # and bar.pot - + Example 3. The sources may be specified within separate file, for example POTFILES.in: - + # POTFILES.in in 'po/' subdirectory ../a.cpp ../b.cpp # end of file - + The name of the file (POTFILES.in) containing the list of -sources is provided via $XGETTEXTFROM: +sources is provided via $XGETTEXTFROM: - + # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in') - + Example 4. -You may use $XGETTEXTPATH to define source search path. Assume, for +You may use $XGETTEXTPATH to define source search path. Assume, for example, that you have files a.cpp, b.cpp, po/SConstruct, po/POTFILES.in. Then your POT-related files could look as below: - + # POTFILES.in in 'po/' subdirectory a.cpp b.cpp # end of file - + # SConstruct file in 'po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH='../') - + Example 5. Multiple search directories may be defined within a list, i.e. XGETTEXTPATH = ['dir1', 'dir2', ...]. The order in the list @@ -1597,48 +1601,48 @@ determines the search order of source files. The path to the first file found is used. - + Let's create 0/1/po/SConstruct script: - + # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../', '../../']) - + and 0/1/po/POTFILES.in: - + # POTFILES.in in '0/1/po/' subdirectory a.cpp # end of file - + Write two *.cpp files, the first one is 0/a.cpp: - + /* 0/a.cpp */ gettext("Hello from ../../a.cpp") - + and the second is 0/1/a.cpp: - + /* 0/1/a.cpp */ gettext("Hello from ../a.cpp") - + then run scons. You'll obtain 0/1/po/messages.pot with the message "Hello from ../a.cpp". When you reverse order in $XGETTEXTFOM, i.e. when you write SConscript as - + # SConstruct file in '0/1/po/' subdirectory env = Environment( tools = ['default', 'xgettext'] ) env.POTUpdate(XGETTEXTFROM = 'POTFILES.in', XGETTEXTPATH=['../../', '../']) - + then the messages.pot will contain msgid "Hello from ../../a.cpp" line and not msgid "Hello from ../a.cpp". @@ -1653,106 +1657,107 @@ then the messages.pot will contain env.POUpdate() - -The builder belongs to msgmerge tool. The builder updates + + +The builder belongs to msgmerge tool. The builder updates PO files with msgmerge(1), or initializes missing PO files as described in documentation of -msginit tool and POInit builder (see also -$POAUTOINIT). Note, that POUpdate does not add its -targets to po-create alias as POInit +msginit tool and POInit builder (see also +$POAUTOINIT). Note, that POUpdate does not add its +targets to po-create alias as POInit does. - -Target nodes defined through POUpdate are not built by default + +Target nodes defined through POUpdate are not built by default (they're Ignored from '.' node). Instead, they are added automatically to special Alias ('po-update' by default). The alias name may be changed -through the $POUPDATE_ALIAS construction variable. You can easily +through the $POUPDATE_ALIAS construction variable. You can easily update PO files in your project by scons po-update. - + Example 1. Update en.po and pl.po from -messages.pot template (see also $POTDOMAIN), +messages.pot template (see also $POTDOMAIN), assuming that the later one exists or there is rule to build it (see -POTUpdate): +POTUpdate): - + # ... env.POUpdate(['en','pl']) # messages.pot --> [en.po, pl.po] - + Example 2. Update en.po and pl.po from foo.pot template: - + # ... env.POUpdate(['en', 'pl'], ['foo']) # foo.pot --> [en.po, pl.pl] - + Example 3. Update en.po and pl.po from foo.pot (another version): - + # ... env.POUpdate(['en', 'pl'], POTDOMAIN='foo') # foo.pot -- > [en.po, pl.pl] - + Example 4. Update files for languages defined in LINGUAS file. The files are updated from messages.pot template: - + # ... env.POUpdate(LINGUAS_FILE = 1) # needs 'LINGUAS' file - + Example 5. Same as above, but update from foo.pot template: - + # ... env.POUpdate(LINGUAS_FILE = 1, source = ['foo']) - + Example 6. Update en.po and pl.po plus files for languages defined in LINGUAS file. The files are updated from messages.pot template: - + # produce 'en.po', 'pl.po' + files defined in 'LINGUAS': env.POUpdate(['en', 'pl' ], LINGUAS_FILE = 1) - + Example 7. -Use $POAUTOINIT to automatically initialize PO file +Use $POAUTOINIT to automatically initialize PO file if it doesn't exist: - + # ... env.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1) - + Example 8. Update PO files for languages defined in LINGUAS file. The files are updated from foo.pot template. All necessary settings are pre-configured via environment. - + # ... env['POAUTOINIT'] = 1 env['LINGUAS_FILE'] = 1 @@ -1769,28 +1774,29 @@ pre-configured via environment. env.Program() - + + Builds an executable given one or more object files or C, C++, D, or Fortran source files. If any C, C++, D or Fortran source files are specified, then they will be automatically compiled to object files using the -Object +Object builder method; see that builder method's description for a list of legal source file suffixes and how they are interpreted. The target executable file prefix -(specified by the $PROGPREFIX construction variable; nothing by default) +(specified by the $PROGPREFIX construction variable; nothing by default) and suffix -(specified by the $PROGSUFFIX construction variable; +(specified by the $PROGSUFFIX construction variable; by default, .exe on Windows systems, nothing on POSIX systems) are automatically added to the target if not already present. Example: - + env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) @@ -1802,64 +1808,67 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) env.ProgramAllAtOnce() - + + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. - + + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others will not. - + + Builds an executable from D sources without first creating individual objects for each file. - + D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for + D is integrated into the scons Object and Program builders for this model of build. D codes can though do whole source meta-programming (some of the testing frameworks do this). For this it is imperative that all sources are compiled and linked in a single call of the D compiler. This builder serves that purpose. - + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - + This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules. Some of the D compilers will create executable.o others @@ -1874,7 +1883,8 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) env.RES() - + + Builds a Microsoft Visual C++ resource file. This builder method is only provided when Microsoft Visual C++ or MinGW is being used as the compiler. The @@ -1887,7 +1897,7 @@ file is scanned for implicit dependencies as though it were a C file. Example: - + env.RES('resource.rc') @@ -1899,7 +1909,8 @@ env.RES('resource.rc') env.RMIC() - + + Builds stub and skeleton class files for remote objects from Java .class files. @@ -1908,16 +1919,16 @@ relative to which the stub and skeleton class files will be written. The source can be the names of .class files, or the objects return from the -Java +Java builder method. - + If the construction variable -$JAVACLASSDIR +$JAVACLASSDIR is set, either in the environment or in the call to the -RMIC +RMIC builder method itself, then the value of the variable will be stripped from the @@ -1925,7 +1936,7 @@ beginning of any .class file names. - + classes = env.Java(target = 'classdir', source = 'src') env.RMIC(target = 'outdir1', source = classes) @@ -1945,7 +1956,8 @@ env.RMIC(target = 'outdir3', env.RPCGenClient() - + + Generates an RPC client stub (_clnt.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -1954,7 +1966,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_clnt.c env.RPCGenClient('src/rpcif.x') @@ -1967,7 +1979,8 @@ env.RPCGenClient('src/rpcif.x') env.RPCGenHeader() - + + Generates an RPC header (.h) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -1976,7 +1989,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif.h env.RPCGenHeader('src/rpcif.x') @@ -1989,7 +2002,8 @@ env.RPCGenHeader('src/rpcif.x') env.RPCGenService() - + + Generates an RPC server-skeleton (_svc.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -1998,7 +2012,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_svc.c env.RPCGenClient('src/rpcif.x') @@ -2011,7 +2025,8 @@ env.RPCGenClient('src/rpcif.x') env.RPCGenXDR() - + + Generates an RPC XDR routine (_xdr.c) file from a specified RPC (.x) source file. Because rpcgen only builds output files @@ -2020,7 +2035,7 @@ the command will be executed in the source file's directory by default. - + # Builds src/rpcif_xdr.c env.RPCGenClient('src/rpcif.x') @@ -2033,7 +2048,8 @@ env.RPCGenClient('src/rpcif.x') env.SharedLibrary() - + + Builds a shared library (.so on a POSIX system, .dll on Windows) @@ -2045,24 +2061,24 @@ compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix -(specified by the $SHLIBPREFIX construction variable; +(specified by the $SHLIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix -(specified by the $SHLIBSUFFIX construction variable; +(specified by the $SHLIBSUFFIX construction variable; by default, .dll on Windows systems, .so on POSIX systems) are automatically added to the target if not already present. Example: - + env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o']) - + On Windows systems, the -SharedLibrary +SharedLibrary builder method will always build an import (.lib) library in addition to the shared (.dll) library, @@ -2071,9 +2087,9 @@ if there is not already a .lib file explicitly listed in the targets. - + On Cygwin systems, the -SharedLibrary +SharedLibrary builder method will always build an import (.dll.a) library in addition to the shared (.dll) library, @@ -2082,36 +2098,36 @@ if there is not already a .dll.a file explicitly listed in the targets. - + Any object files listed in the source must have been built for a shared library (that is, using the -SharedObject +SharedObject builder method). -scons +scons will raise an error if there is any mismatch. - + On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action). -For maximum portability, use the LoadableModule builder for the latter. +For maximum portability, use the LoadableModule builder for the latter. - -When the $SHLIBVERSION construction variable is defined a versioned -shared library is created. This modifies the $SHLINKFLAGS as required, + +When the $SHLIBVERSION construction variable is defined a versioned +shared library is created. This modifies the $SHLINKFLAGS as required, adds the version number to the library name, and creates the symlinks that are needed. - + env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') - + On a POSIX system, versions with a single token create exactly one symlink: libbar.so.6 would have symlinks libbar.so only. On a POSIX system, versions with two or more @@ -2120,28 +2136,28 @@ libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be libbar.2.3.1.dylib and the link would be libbar.dylib. - + On Windows systems, specifying register=1 will cause the .dll to be registered after it is built using REGSVR32. The command that is run -("regsvr32" by default) is determined by $REGSVR construction -variable, and the flags passed are determined by $REGSVRFLAGS. By -default, $REGSVRFLAGS includes the option, +("regsvr32" by default) is determined by $REGSVR construction +variable, and the flags passed are determined by $REGSVRFLAGS. By +default, $REGSVRFLAGS includes the option, to prevent dialogs from popping up and requiring user attention when it is run. If you change -$REGSVRFLAGS, be sure to include the option. +$REGSVRFLAGS, be sure to include the option. For example, - + env.SharedLibrary(target = 'bar', source = ['bar.cxx', 'foo.obj'], register=1) - + will register bar.dll as a COM object when it is done linking it. @@ -2154,12 +2170,13 @@ when it is done linking it. env.SharedObject() - + + Builds an object file for inclusion in a shared library. Source files must have one of the same set of extensions specified above for the -StaticObject +StaticObject builder method. On some platforms building a shared object requires additional compiler option @@ -2174,21 +2191,21 @@ and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects. The target object file prefix -(specified by the $SHOBJPREFIX construction variable; -by default, the same as $OBJPREFIX) +(specified by the $SHOBJPREFIX construction variable; +by default, the same as $OBJPREFIX) and suffix -(specified by the $SHOBJSUFFIX construction variable) +(specified by the $SHOBJSUFFIX construction variable) are automatically added to the target if not already present. Examples: - + env.SharedObject(target = 'ddd', source = 'ddd.c') env.SharedObject(target = 'eee.o', source = 'eee.cpp') env.SharedObject(target = 'fff.obj', source = 'fff.for') - + Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner @@ -2205,7 +2222,8 @@ below, for more information. env.StaticLibrary() - + + Builds a static library given one or more object files or C, C++, D or Fortran source files. If any source files are given, @@ -2214,29 +2232,29 @@ compiled to object files. The static library prefix and suffix (if any) are automatically added to the target. The target library file prefix -(specified by the $LIBPREFIX construction variable; +(specified by the $LIBPREFIX construction variable; by default, lib on POSIX systems, nothing on Windows systems) and suffix -(specified by the $LIBSUFFIX construction variable; +(specified by the $LIBSUFFIX construction variable; by default, .lib on Windows systems, .a on POSIX systems) are automatically added to the target if not already present. Example: - + env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o']) - + Any object files listed in the source must have been built for a static library (that is, using the -StaticObject +StaticObject builder method). -scons +scons will raise an error if there is any mismatch. @@ -2248,13 +2266,14 @@ will raise an error if there is any mismatch. env.StaticObject() - + + Builds a static object file from one or more C, C++, D, or Fortran source files. Source files must have one of the following extensions: - + .asm assembly language file .ASM assembly language file .c C file @@ -2285,24 +2304,24 @@ Source files must have one of the following extensions: .SPP assembly language file + C pre-processor - + The target object file prefix -(specified by the $OBJPREFIX construction variable; nothing by default) +(specified by the $OBJPREFIX construction variable; nothing by default) and suffix -(specified by the $OBJSUFFIX construction variable; +(specified by the $OBJSUFFIX construction variable; .obj on Windows systems, .o on POSIX systems) are automatically added to the target if not already present. Examples: - + env.StaticObject(target = 'aaa', source = 'aaa.c') env.StaticObject(target = 'bbb.o', source = 'bbb.c++') env.StaticObject(target = 'ccc.obj', source = 'ccc.f') - + Note that the source files will be scanned according to the suffix mappings in SourceFileScanner @@ -2319,27 +2338,28 @@ below, for more information. env.Substfile() - -The Substfile builder creates a single text file from another file or set of -files by concatenating them with $LINESEPARATOR and replacing text -using the $SUBST_DICT construction variable. Nested lists of source files -are flattened. See also Textfile. + + +The Substfile builder creates a single text file from another file or set of +files by concatenating them with $LINESEPARATOR and replacing text +using the $SUBST_DICT construction variable. Nested lists of source files +are flattened. See also Textfile. - + If a single source file is present with an .in suffix, the suffix is stripped and the remainder is used as the default target name. - -The prefix and suffix specified by the $SUBSTFILEPREFIX -and $SUBSTFILESUFFIX construction variables + +The prefix and suffix specified by the $SUBSTFILEPREFIX +and $SUBSTFILESUFFIX construction variables (the null string by default in both cases) are automatically added to the target if they are not already present. - -If a construction variable named $SUBST_DICT is present, + +If a construction variable named $SUBST_DICT is present, it may be either a Python dictionary or a sequence of (key,value) tuples. If it is a dictionary it is converted into a list of tuples in an arbitrary order, so if one key is a prefix of another key @@ -2347,7 +2367,7 @@ or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur. - + Any occurrences of a key in the source are replaced by the corresponding value, which may be a Python callable function or a string. @@ -2356,7 +2376,7 @@ Strings are subst-expanded and the result replaces the key. - + env = Environment(tools=['default']) env['prefix'] = '/usr/bin' @@ -2408,12 +2428,13 @@ subst.Substfile('pgm2.c', [Value('#include "@foo@.h"'), env.Tar() - + + Builds a tar archive of the specified files and/or directories. Unlike most builder methods, the -Tar +Tar builder method may be called multiple times for a given target; each additional call @@ -2423,11 +2444,11 @@ Any source directories will be scanned for changes to any on-disk files, regardless of whether or not -scons +scons knows about them from other Builder or function calls. - + env.Tar('src.tar', 'src') # Create the stuff.tar file. @@ -2453,28 +2474,29 @@ env.Tar('foo') env.Textfile() - -The Textfile builder generates a single text file. + + +The Textfile builder generates a single text file. The source strings constitute the lines; nested lists of sources are flattened. -$LINESEPARATOR is used to separate the strings. +$LINESEPARATOR is used to separate the strings. - -If present, the $SUBST_DICT construction variable + +If present, the $SUBST_DICT construction variable is used to modify the strings before they are written; -see the Substfile description for details. +see the Substfile description for details. - -The prefix and suffix specified by the $TEXTFILEPREFIX -and $TEXTFILESUFFIX construction variables + +The prefix and suffix specified by the $TEXTFILEPREFIX +and $TEXTFILESUFFIX construction variables (the null string and .txt by default, respectively) are automatically added to the target if they are not already present. Examples: - + # builds/writes foo.txt env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) @@ -2523,49 +2545,50 @@ blob.txt env.Translate() - -This pseudo-builder belongs to gettext toolset. The builder extracts + + +This pseudo-builder belongs to gettext toolset. The builder extracts internationalized messages from source files, updates POT template (if necessary) and then updates PO translations (if -necessary). If $POAUTOINIT is set, missing PO files +necessary). If $POAUTOINIT is set, missing PO files will be automatically created (i.e. without translator person intervention). -The variables $LINGUAS_FILE and $POTDOMAIN are taken into -acount too. All other construction variables used by POTUpdate, and -POUpdate work here too. +The variables $LINGUAS_FILE and $POTDOMAIN are taken into +acount too. All other construction variables used by POTUpdate, and +POUpdate work here too. - + Example 1. The simplest way is to specify input files and output languages inline in -a SCons script when invoking Translate +a SCons script when invoking Translate - + # SConscript in 'po/' directory env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 env.Translate(['en','pl'], ['../a.cpp','../b.cpp']) - + Example 2. If you wish, you may also stick to conventional style known from autotools, i.e. using POTFILES.in and LINGUAS files - + # LINGUAS en pl #end - + # POTFILES.in a.cpp b.cpp # end - + # SConscript env = Environment( tools = ["default", "gettext"] ) env['POAUTOINIT'] = 1 @@ -2573,7 +2596,7 @@ env['XGETTEXTPATH'] = ['../'] env.Translate(LINGUAS_FILE = 1, XGETTEXTFROM = 'POTFILES.in') - + The last approach is perhaps the recommended one. It allows easily split internationalization/localization onto separate SCons scripts, where a script in source tree is responsible for translations (from sources to @@ -2590,11 +2613,11 @@ so the source tree looks familiar to translators, and they may work with the project in their usual way. - + Example 3. Let's prepare a development tree as below - + project/ + SConstruct + build/ @@ -2605,11 +2628,11 @@ Let's prepare a development tree as below + POTFILES.in + LINGUAS - + with build being variant directory. Write the top-level SConstruct script as follows - + # SConstruct env = Environment( tools = ["default", "gettext"] ) VariantDir('build', 'src', duplicate = 0) @@ -2617,23 +2640,23 @@ with build being variant directory. Write the top-level SConscript('src/po/SConscript.i18n', exports = 'env') SConscript('build/po/SConscript', exports = 'env') - + the src/po/SConscript.i18n as - + # src/po/SConscript.i18n Import('env') env.Translate(LINGUAS_FILE=1, XGETTEXTFROM='POTFILES.in', XGETTEXTPATH=['../']) - + and the src/po/SConscript - + # src/po/SConscript Import('env') env.MOFiles(LINGUAS_FILE = 1) - + Such setup produces POT and PO files under source tree in src/po/ and binary MO files under variant tree in @@ -2643,7 +2666,7 @@ not be committed back to source repositories (e.g. MO files). - + In above example, the PO files are not updated, nor created automatically when you issue scons '.' command. The files must be updated (created) by hand via scons @@ -2660,7 +2683,8 @@ running scons '.'. env.TypeLibrary() - + + Builds a Windows type library (.tlb) file from an input IDL file (.idl). In addition, it will build the associated interface stub and @@ -2669,11 +2693,11 @@ naming them according to the base name of the .idl file. For example, - + env.TypeLibrary(source="foo.idl") - + Will create foo.tlb, foo.h, foo_i.c, @@ -2691,21 +2715,22 @@ files. env.Uic() - + + Builds a header file, an implementation file and a moc file from an ui file. and returns the corresponding nodes in the above order. This builder is only available after using the tool 'qt'. Note: you can specify .ui files directly as source -files to the Program, -Library and SharedLibrary builders +files to the Program, +Library and SharedLibrary builders without using this builder. Using this builder lets you override the standard naming conventions (be careful: prefixes are always prepended to names of built files; if you don't want prefixes, you may set them to ``). -See the $QTDIR variable for more information. +See the $QTDIR variable for more information. Example: - + env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc'] env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc'] @@ -2719,12 +2744,13 @@ env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'), env.Zip() - + + Builds a zip archive of the specified files and/or directories. Unlike most builder methods, the -Zip +Zip builder method may be called multiple times for a given target; each additional call @@ -2734,11 +2760,11 @@ Any source directories will be scanned for changes to any on-disk files, regardless of whether or not -scons +scons knows about them from other Builder or function calls. - + env.Zip('src.zip', 'src') # Create the stuff.zip file. diff --git a/doc/generated/examples/buildersbuiltin_libs_1.xml b/doc/generated/examples/buildersbuiltin_libs_1.xml index 8b44352..8e1ee49 100644 --- a/doc/generated/examples/buildersbuiltin_libs_1.xml +++ b/doc/generated/examples/buildersbuiltin_libs_1.xml @@ -1,30 +1,6 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +cc -o goodbye.o -c goodbye.c +cc -o hello.o -c hello.c +cc -o hello hello.o goodbye.o -L/usr/dir1 -Ldir2 -lfoo1 -lfoo2 diff --git a/doc/generated/examples/buildersbuiltin_libs_2.xml b/doc/generated/examples/buildersbuiltin_libs_2.xml index c2c263e..41a9c1e 100644 --- a/doc/generated/examples/buildersbuiltin_libs_2.xml +++ b/doc/generated/examples/buildersbuiltin_libs_2.xml @@ -1,7 +1,7 @@ - -C:\>scons -Q + +C:\>scons -Q cl /Fogoodbye.obj /c goodbye.c /nologo cl /Fohello.obj /c hello.c /nologo -link /nologo /OUT:hello.exe /LIBPATH:C:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj +link /nologo /OUT:hello.exe /LIBPATH:\usr\dir1 /LIBPATH:dir2 foo1.lib foo2.lib hello.obj goodbye.obj embedManifestExeCheck(target, source, env) diff --git a/doc/generated/examples/commandline_Default1_1.xml b/doc/generated/examples/commandline_Default1_1.xml index 0e5dbd9..18008d8 100644 --- a/doc/generated/examples/commandline_Default1_1.xml +++ b/doc/generated/examples/commandline_Default1_1.xml @@ -1,86 +1,10 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +cc -o hello.o -c hello.c +cc -o hello hello.o % scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +scons: `hello' is up to date. % scons -Q goodbye -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o goodbye.o -c goodbye.c +cc -o goodbye goodbye.o diff --git a/doc/generated/examples/commandline_Default1_2.xml b/doc/generated/examples/commandline_Default1_2.xml index fdbbb91..0f1a93e 100644 --- a/doc/generated/examples/commandline_Default1_2.xml +++ b/doc/generated/examples/commandline_Default1_2.xml @@ -1,30 +1,7 @@ - -% scons -Q . -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q . +cc -o goodbye.o -c goodbye.c +cc -o goodbye goodbye.o +cc -o hello.o -c hello.c +cc -o hello hello.o diff --git a/doc/generated/examples/commandline_Default2_1.xml b/doc/generated/examples/commandline_Default2_1.xml index 8e27885..606ed67 100644 --- a/doc/generated/examples/commandline_Default2_1.xml +++ b/doc/generated/examples/commandline_Default2_1.xml @@ -1,58 +1,10 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +cc -o prog1.o -c prog1.c +cc -o prog1 prog1.o +cc -o prog3.o -c prog3.c +cc -o prog3 prog3.o % scons -Q . -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o prog2.o -c prog2.c +cc -o prog2 prog2.o diff --git a/doc/generated/examples/commandline_Default3_1.xml b/doc/generated/examples/commandline_Default3_1.xml index fe3d1e0..d18575c 100644 --- a/doc/generated/examples/commandline_Default3_1.xml +++ b/doc/generated/examples/commandline_Default3_1.xml @@ -1,86 +1,12 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +cc -o prog1/foo.o -c prog1/foo.c +cc -o prog1/main.o -c prog1/main.c +cc -o prog1/main prog1/main.o prog1/foo.o % scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +scons: `prog1' is up to date. % scons -Q . -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o prog2/bar.o -c prog2/bar.c +cc -o prog2/main.o -c prog2/main.c +cc -o prog2/main prog2/main.o prog2/bar.o diff --git a/doc/generated/examples/commandline_Default4_1.xml b/doc/generated/examples/commandline_Default4_1.xml index 8e27885..35e0b10 100644 --- a/doc/generated/examples/commandline_Default4_1.xml +++ b/doc/generated/examples/commandline_Default4_1.xml @@ -1,58 +1,10 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +scons: *** No targets specified and no Default() targets found. Stop. +Found nothing to build % scons -Q . -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o prog1.o -c prog1.c +cc -o prog1 prog1.o +cc -o prog2.o -c prog2.c +cc -o prog2 prog2.o diff --git a/doc/generated/examples/commandline_PackageVariable_1.xml b/doc/generated/examples/commandline_PackageVariable_1.xml index 3dd9724..b83fd80 100644 --- a/doc/generated/examples/commandline_PackageVariable_1.xml +++ b/doc/generated/examples/commandline_PackageVariable_1.xml @@ -1,114 +1,10 @@ - -% scons -Q foo.o -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q foo.o +cc -o foo.o -c -DPACKAGE="/opt/location" foo.c % scons -Q PACKAGE=/usr/local/location foo.o -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o foo.o -c -DPACKAGE="/usr/local/location" foo.c % scons -Q PACKAGE=yes foo.o -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o foo.o -c -DPACKAGE="True" foo.c % scons -Q PACKAGE=no foo.o -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +cc -o foo.o -c -DPACKAGE="False" foo.c diff --git a/doc/generated/examples/environments_Replace-nonexistent_1.xml b/doc/generated/examples/environments_Replace-nonexistent_1.xml index 8b44352..c4480b5 100644 --- a/doc/generated/examples/environments_Replace-nonexistent_1.xml +++ b/doc/generated/examples/environments_Replace-nonexistent_1.xml @@ -1,30 +1,5 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +NEW_VARIABLE = xyzzy +scons: `.' is up to date. diff --git a/doc/generated/examples/environments_missing2_1.xml b/doc/generated/examples/environments_missing2_1.xml index 8b44352..ffb308c 100644 --- a/doc/generated/examples/environments_missing2_1.xml +++ b/doc/generated/examples/environments_missing2_1.xml @@ -1,30 +1,6 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q + +scons: *** NameError `MISSING' trying to evaluate `$MISSING' +File "/home/my/project/SConstruct", line 3, in <module> diff --git a/doc/generated/examples/environments_missing3_1.xml b/doc/generated/examples/environments_missing3_1.xml index 8b44352..edf136f 100644 --- a/doc/generated/examples/environments_missing3_1.xml +++ b/doc/generated/examples/environments_missing3_1.xml @@ -1,30 +1,5 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +value is: -><- +scons: `.' is up to date. diff --git a/doc/generated/examples/sideeffect_parallel_1.xml b/doc/generated/examples/sideeffect_parallel_1.xml index 2e000a1..9478c52 100644 --- a/doc/generated/examples/sideeffect_parallel_1.xml +++ b/doc/generated/examples/sideeffect_parallel_1.xml @@ -1,30 +1,5 @@ - -% scons -Q --jobs=2 -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q --jobs=2 +echo > file1.out data1 +echo > file2.out data2 diff --git a/doc/generated/examples/simple_clean_1.xml b/doc/generated/examples/simple_clean_1.xml index e90f1f2..21adbe7 100644 --- a/doc/generated/examples/simple_clean_1.xml +++ b/doc/generated/examples/simple_clean_1.xml @@ -1,60 +1,16 @@ - -% scons + +% scons scons: Reading SConscript files ... -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +scons: done reading SConscript files. +scons: Building targets ... +cc -o hello.o -c hello.c +cc -o hello hello.o +scons: done building targets. % scons -c scons: Reading SConscript files ... -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] +scons: done reading SConscript files. +scons: Cleaning targets ... +Removed hello.o +Removed hello +scons: done cleaning targets. diff --git a/doc/generated/examples/simple_clean_2.xml b/doc/generated/examples/simple_clean_2.xml index 6e50fe9..26f3c37 100644 --- a/doc/generated/examples/simple_clean_2.xml +++ b/doc/generated/examples/simple_clean_2.xml @@ -1,5 +1,5 @@ - -C:\>scons + +C:\>scons scons: Reading SConscript files ... scons: done reading SConscript files. scons: Building targets ... diff --git a/doc/generated/examples/sourcecode_cvs_1.xml b/doc/generated/examples/sourcecode_cvs_1.xml index 8b44352..01ddb6b 100644 --- a/doc/generated/examples/sourcecode_cvs_1.xml +++ b/doc/generated/examples/sourcecode_cvs_1.xml @@ -1,30 +1,6 @@ - -% scons -Q -KeyError: 'RANLIBCOM': - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1374: - _exec_main(parser, values) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1337: - _main(parser) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\Main.py", line 1015: - SCons.Script._SConscript._SConscript(fs, script) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 198: - exec(sys.stdin.read(), call_stack[-1].globals) - File "<string>", line 206: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 666: - env = self.factory() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Script\SConscript.py", line 646: - default_env = SCons.Defaults.DefaultEnvironment() - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Defaults.py", line 88: - _default_env = SCons.Environment.Environment(*args, **kw) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 988: - apply_tools(self, tools, toolpath) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 107: - env.Tool(tool) - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 1795: - tool(self) - File "<string>", line 67: - None - File "C:\dev\scons-fork\bootstrap\src\engine\SCons\Environment.py", line 410: - return self._dict[key] + +% scons -Q +AttributeError: 'SConsEnvironment' object has no attribute 'CVS': + File "/home/my/project/SConstruct", line 2: + env.SourceCode('.', env.CVS('/usr/local/CVS')) diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 63f9f8c..953d374 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,7 +12,7 @@ %variables-mod; ]> - + Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) @@ -20,7 +20,8 @@ env.Action(action, [cmd/str/fun, [var, ...]] [option=value, ...]) - + + Creates an Action object for the specified action. @@ -28,7 +29,7 @@ See the section "Action Objects," below, for a complete explanation of the arguments and behavior. - + Note that the env.Action() form of the invocation will expand @@ -55,7 +56,8 @@ until the Action object is actually used. env.AddMethod(function, [name]) - + + When called with the AddMethod() form, @@ -84,11 +86,11 @@ specified itself is used for the method name. - + Examples: - + # Note that the first argument to the function to # be attached as a method must be the object through # which the method will be called; the Python @@ -114,7 +116,8 @@ env.other_method_name('another arg') AddOption(arguments) - + + This function adds a new command-line option to be recognized. The specified arguments @@ -126,12 +129,12 @@ see the documentation for for a thorough discussion of its option-processing capabities. - + In addition to the arguments and values supported by the optparse.add_option() method, the SCons -AddOption +AddOption function allows you to set the nargs keyword value to @@ -143,7 +146,7 @@ argument. When nargs = '?' is passed to the -AddOption +AddOption function, the const keyword argument @@ -153,28 +156,28 @@ option is specified on the command line without an explicit argument. - + If no default= keyword argument is supplied when calling -AddOption, +AddOption, the option will have a default value of None. - + Once a new command-line option has been added with -AddOption, +AddOption, the option value may be accessed using -GetOption +GetOption or env.GetOption(). The value may also be set, using -SetOption +SetOption or env.SetOption(), if conditions in a -SConscript +SConscript require overriding any default value. Note, however, that a value specified on the command line will @@ -182,7 +185,7 @@ value specified on the command line will override a value set by any SConscript file. - + Any specified help= strings for the new option(s) @@ -194,22 +197,22 @@ options (the latter only if no other help text is specified in the SConscript files). The help text for the local options specified by -AddOption +AddOption will appear below the SCons options themselves, under a separate Local Options heading. The options will appear in the help text in the order in which the -AddOption +AddOption calls occur. - + Example: - + AddOption('--prefix', dest='prefix', nargs=1, type='string', @@ -227,7 +230,8 @@ env = Environment(PREFIX = GetOption('prefix')) env.AddPostAction(target, action) - + + Arranges for the specified action to be performed @@ -240,7 +244,7 @@ can be converted into an Action object (see below). - + When multiple targets are supplied, the action may be called multiple times, once after each action that generates @@ -255,7 +259,8 @@ one or more targets in the list. env.AddPreAction(target, action) - + + Arranges for the specified action to be performed @@ -268,14 +273,14 @@ can be converted into an Action object (see below). - + When multiple targets are specified, the action(s) may be called multiple times, once before each action that generates one or more targets in the list. - + Note that if any of the targets are built in multiple steps, the action will be invoked just before the "final" action that specifically @@ -286,16 +291,16 @@ from a specified source file via an intermediate object file: - + foo = Program('foo.c') AddPreAction(foo, 'pre_action') - + The specified pre_action would be executed before -scons +scons calls the link command that actually generates the executable program binary foo, @@ -312,7 +317,8 @@ file into an object file. env.Alias(alias, [targets, [action]]) - + + Creates one or more phony targets that expand to one or more other targets. An optional @@ -326,17 +332,17 @@ which exists outside of any file system. This Node object, or the alias name, may be used as a dependency of any other target, including another alias. -Alias +Alias can be called multiple times for the same alias to add additional targets to the alias, or additional actions to the list for this alias. - + Examples: - + Alias('install') Alias('install', '/usr/bin') Alias(['install', 'install-lib'], '/usr/local/lib') @@ -352,7 +358,8 @@ env.Alias('update', ['file1', 'file2'], "update_database $SOURCES") AllowSubstExceptions([exception, ...]) - + + Specifies the exceptions that will be allowed when expanding construction variables. By default, @@ -368,19 +375,19 @@ will generate an error message and terminate processing. - + If -AllowSubstExceptions +AllowSubstExceptions is called multiple times, each call completely overwrites the previous list of allowed exceptions. - + Example: - + # Requires that all construction variable names exist. # (You may wish to do this if you want to enforce strictly # that all construction variables must be defined before use.) @@ -399,13 +406,14 @@ AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) env.AlwaysBuild(target, ...) - + + Marks each given target so that it is always assumed to be out of date, and will always be rebuilt if needed. Note, however, that -AlwaysBuild +AlwaysBuild does not add its target(s) to the default target list, so the targets will only be built if they are specified on the command line, @@ -414,7 +422,7 @@ they will always be built if so specified. Multiple targets can be passed in to a single call to -AlwaysBuild. +AlwaysBuild. @@ -422,7 +430,8 @@ Multiple targets can be passed in to a single call to env.Append(key=val, [...]) - + + Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have @@ -438,11 +447,11 @@ and the lists are added together. (See also the Prepend method, below.) - + Example: - + env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) @@ -451,7 +460,8 @@ env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy']) env.AppendENVPath(name, newpath, [envname, sep, delete_existing]) - + + This appends new path elements to the given path in the specified external environment (ENV @@ -469,18 +479,18 @@ case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. - + If delete_existing is 0, then adding a path that already exists will not move it to the end; it will stay where it is in the list. - + Example: - + print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.AppendENVPath('INCLUDE', include_path) @@ -496,7 +506,8 @@ after: /biz:/foo/bar:/foo env.AppendUnique(key=val, [...], delete_existing=0) - + + Appends the specified keyword arguments to the end of construction variables in the environment. If the Environment does not have @@ -512,11 +523,11 @@ existing matching values are removed first, so existing values in the arg list move to the end of the list. - + Example: - + env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) @@ -528,9 +539,10 @@ env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) env.BuildDir(build_dir, src_dir, [duplicate]) - + + Deprecated synonyms for -VariantDir +VariantDir and env.VariantDir(). The @@ -538,7 +550,7 @@ The argument becomes the variant_dir argument of -VariantDir +VariantDir or env.VariantDir(). @@ -551,7 +563,8 @@ or env.Builder(action, [arguments]) - + + Creates a Builder object for the specified action. @@ -559,7 +572,7 @@ See the section "Builder Objects," below, for a complete explanation of the arguments and behavior. - + Note that the env.Builder() form of the invocation will expand @@ -574,7 +587,7 @@ construction environment through which env.Builder() was called. The -Builder +Builder form delays all variable expansion until after the Builder object is actually called. @@ -587,14 +600,15 @@ until after the Builder object is actually called. env.CacheDir(cache_dir) - + + Specifies that -scons +scons will maintain a cache of derived files in cache_dir. The derived files in the cache will be shared among all the builds using the same -CacheDir +CacheDir call. Specifying a cache_dir @@ -603,13 +617,13 @@ of disables derived file caching. - + Calling env.CacheDir() will only affect targets built through the specified construction environment. Calling -CacheDir +CacheDir sets a global default that will be used by all targets built through construction environments @@ -620,21 +634,21 @@ have an specified. - + When a CacheDir() is being used and -scons +scons finds a derived file that needs to be rebuilt, it will first look in the cache to see if a derived file has already been built from identical input files and an identical build action (as incorporated into the MD5 build signature). If so, -scons +scons will retrieve the file from the cache. If the derived file is not present in the cache, -scons +scons will rebuild it and then place a copy of the built file in the cache (identified by its MD5 build signature), @@ -643,20 +657,20 @@ builds that need to build the same derived file from identical inputs. - + Use of a specified -CacheDir +CacheDir may be disabled for any invocation by using the option. - + If the option is used, -scons +scons will place a copy of all derived files in the cache, @@ -664,17 +678,17 @@ even if they already existed and were not built by this invocation. This is useful to populate a cache the first time -CacheDir +CacheDir is added to a build, or after using the option. - + When using -CacheDir, -scons +CacheDir, +scons will report, "Retrieved `file' from cache," unless the @@ -683,7 +697,7 @@ option is being used. When the option is used, -scons +scons will print the action that would have been used to build the file, @@ -695,9 +709,9 @@ a given derived file has been built in-place or retrieved from the cache. - + The -NoCache +NoCache method can be used to disable caching of specific files. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large. @@ -711,7 +725,8 @@ predict or prohibitively large. env.Clean(targets, files_or_dirs) - + + This specifies a list of files or directories which should be removed whenever the targets are specified with the @@ -719,28 +734,28 @@ command line option. The specified targets may be a list or an individual target. Multiple calls to -Clean +Clean are legal, and create new targets or add files and directories to the clean list for the specified targets. - + Multiple files or directories should be specified either as separate arguments to the -Clean +Clean method, or as a list. -Clean +Clean will also accept the return value of any of the construction environment Builder methods. Examples: - + The related -NoClean +NoClean function overrides calling -Clean +Clean for the same target, and any targets passed to both functions will not @@ -749,23 +764,23 @@ be removed by the option. - + Examples: - + Clean('foo', ['bar', 'baz']) Clean('dist', env.Program('hello', 'hello.c')) Clean(['foo', 'bar'], 'something_else_to_clean') - + In this example, installing the project creates a subdirectory for the documentation. This statement causes the subdirectory to be removed if the project is deinstalled. - + Clean(docdir, os.path.join(docdir, projectname)) @@ -774,7 +789,8 @@ Clean(docdir, os.path.join(docdir, projectname)) env.Clone([key=val, ...]) - + + Returns a separate copy of a construction environment. If there are any keyword arguments specified, they are added to the returned copy, @@ -782,34 +798,34 @@ overwriting any existing values for the keywords. - + Example: - + env2 = env.Clone() env3 = env.Clone(CCFLAGS = '-g') - + Additionally, a list of tools and a toolpath may be specified, as in the Environment constructor: - + def MyTool(env): env['FOO'] = 'bar' env4 = env.Clone(tools = ['msvc', MyTool]) - + The parse_flags keyword argument is also recognized to allow merging command-line style arguments into the appropriate construction -variables (see env.MergeFlags). +variables (see env.MergeFlags). - + # create an environment for compiling programs that use wxWidgets wx_env = env.Clone(parse_flags='!wx-config --cflags --cxxflags') @@ -822,7 +838,8 @@ wx_env = env.Clone(parse_flags='!wx-config --cflags --cxxflags') env.Command(target, source, action, [key=val, ...]) - + + Executes a specific action (or list of actions) to build a target file or files. @@ -831,7 +848,7 @@ than defining a separate Builder object for a single special-case build. - + As a special case, the source_scanner keyword argument can @@ -847,12 +864,12 @@ changes to files that aren't already specified in other Builder of function calls.) - + Any other keyword arguments specified override any same-named existing construction variables. - + An action can be an external command, specified as a string, or a callable Python object; @@ -869,11 +886,11 @@ or by a to ignore the exit status of the external command. - + Examples: - + env.Command('foo.out', 'foo.in', "$FOO_BUILD < $SOURCES > $TARGET") @@ -891,9 +908,9 @@ env.Command('baz.out', 'baz.in', rename ]) - + Note that the -Command +Command function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration @@ -902,24 +919,24 @@ If necessary, you can explicitly specify that targets or source nodes should be treated as directoriese by using the -Dir +Dir or env.Dir() functions. - + Examples: - + env.Command('ddd.list', Dir('ddd'), 'ls -l $SOURCE > $TARGET') env['DISTDIR'] = 'destination/directory' env.Command(env.Dir('$DISTDIR')), None, make_distdir) - + (Also note that SCons will usually automatically create any directory necessary to hold a target file, so you normally don't need to create directories by hand.) @@ -933,7 +950,8 @@ so you normally don't need to create directories by hand.) env.Configure([custom_tests, conf_dir, log_file, config_h]) - + + Creates a Configure object for integrated functionality similar to GNU autoconf. See the section "Configure Contexts," @@ -945,7 +963,8 @@ below, for a complete explanation of the arguments and behavior. env.Copy([key=val, ...]) - + + A now-deprecated synonym for env.Clone(). @@ -958,7 +977,8 @@ A now-deprecated synonym for env.Decider(function) - + + Specifies that all up-to-date decisions for targets built through this construction environment will be handled by the specified @@ -970,7 +990,7 @@ that specify the type of decision function to be performed: - + timestamp-newer @@ -1053,11 +1073,11 @@ all within a single second. - + Examples: - + # Use exact timestamp matches by default. Decider('timestamp-match') @@ -1066,7 +1086,7 @@ Decider('timestamp-match') env.Decider('content') - + In addition to the above already-available functions, the function @@ -1074,7 +1094,7 @@ argument may be an actual Python function that takes the following three arguments: - + dependency @@ -1122,7 +1142,7 @@ size, or content signature. - + The function should return a @@ -1150,11 +1170,11 @@ Ignoring some or all of the function arguments is perfectly normal. - + Example: - + def my_decider(dependency, target, prev_ni): return not os.path.exists(str(target)) @@ -1169,13 +1189,14 @@ env.Decider(my_decider) env.Default(targets) - + + This specifies a list of default targets, which will be built by -scons +scons if no explicit targets are given on the command line. Multiple calls to -Default +Default are legal, and add to the list of default targets. As noted above, both forms of this call affect the @@ -1184,43 +1205,43 @@ construction environment method applies construction variable expansion to the targets. - + Multiple targets should be specified as separate arguments to the -Default +Default method, or as a list. -Default +Default will also accept the Node returned by any of a construction environment's builder methods. - + Examples: - + Default('foo', 'bar', 'baz') env.Default(['a', 'b', 'c']) hello = env.Program('hello', 'hello.c') env.Default(hello) - + An argument to -Default +Default of None will clear all default targets. Later calls to -Default +Default will add to the (now empty) default-target list like normal. - + The current list of targets added using the -Default +Default function or method is available in the DEFAULT_TARGETS list; @@ -1232,7 +1253,8 @@ see below. DefaultEnvironment([args]) - + + Creates and returns a default construction environment object. This construction environment is used internally by SCons in order to execute many of the global functions in this list, @@ -1248,7 +1270,8 @@ from source code management systems. env.Depends(target, dependency) - + + Specifies an explicit dependency; the target @@ -1271,11 +1294,11 @@ is not caught by a Scanner for the file. - + Example: - + env.Depends('foo', 'other-input-file-for-foo') mylib = env.Library('mylib.c') @@ -1296,7 +1319,8 @@ env.Depends(bar, installed_lib) env.Dictionary([vars]) - + + Returns a dictionary object containing copies of all of the construction variables in the environment. @@ -1305,11 +1329,11 @@ only the specified construction variables are returned in the dictionary. - + Example: - + dict = env.Dictionary() cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') @@ -1322,7 +1346,8 @@ cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') env.Dir(name, [directory]) - + + This returns a Directory Node, an object that represents the specified directory name. @@ -1335,7 +1360,7 @@ If no is specified, the current script's directory is used as the parent. - + If name is a list, SCons returns a list of Dir nodes. @@ -1343,7 +1368,7 @@ Construction variables are expanded in name. - + Directory Nodes can be used anywhere you would supply a string as a directory name to a Builder method or function. @@ -1357,7 +1382,8 @@ see "File and Directory Nodes," below. env.Dump([key]) - + + Returns a pretty printable representation of the environment. key, if not @@ -1365,36 +1391,36 @@ if not should be a string containing the name of the variable of interest. - + This SConstruct: - + env=Environment() print env.Dump('CCCOM') - + will print: - + '$CC -c -o $TARGET $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES' - + While this SConstruct: - + env=Environment() print env.Dump() - + will print: - + { 'AR': 'ar', 'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES\n$RANLIB $RANLIBFLAGS $TARGET', 'ARFLAGS': ['r'], @@ -1412,7 +1438,8 @@ will print: env.EnsurePythonVersion(major, minor) - + + Ensure that the Python version is at least major.minor. This function will @@ -1420,11 +1447,11 @@ print out an error message and exit SCons with a non-zero exit code if the actual Python version is not late enough. - + Example: - + EnsurePythonVersion(2,2) @@ -1436,7 +1463,8 @@ EnsurePythonVersion(2,2) env.EnsureSConsVersion(major, minor, [revision]) - + + Ensure that the SCons version is at least major.minor, or @@ -1449,11 +1477,11 @@ print out an error message and exit SCons with a non-zero exit code if the actual SCons version is not late enough. - + Examples: - + EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) @@ -1467,7 +1495,8 @@ EnsureSConsVersion(0,96,90) env.Environment([key=value, ...]) - + + Return a new construction environment initialized with the specified key=value @@ -1482,7 +1511,8 @@ pairs. env.Execute(action, [strfunction, varlist]) - + + Executes an Action object. The specified action @@ -1500,14 +1530,14 @@ or return value of the Python function will be returned. - + Note that -scons +scons will print an error message if the executed action fails--that is, exits with or returns a non-zero value. -scons +scons will not, however, @@ -1516,12 +1546,12 @@ if the specified action fails. If you want the build to stop in response to a failed -Execute +Execute call, you must explicitly check for a non-zero return value: - + Execute(Copy('file.out', 'file.in')) if Execute("mkdir sub/dir/ectory"): @@ -1537,9 +1567,10 @@ if Execute("mkdir sub/dir/ectory"): env.Exit([value]) - + + This tells -scons +scons to exit immediately with the specified value. @@ -1557,28 +1588,29 @@ is used if no value is specified. env.Export(vars) - + + This tells -scons +scons to export a list of variables from the current SConscript file to all other SConscript files. The exported variables are kept in a global collection, so subsequent calls to -Export +Export will over-write previous exports that have the same name. Multiple variable names can be passed to -Export +Export as separate arguments or as a list. Keyword arguments can be used to provide names and their values. A dictionary can be used to map variables to a different name when exported. Both local variables and global variables can be exported. - + Examples: - + env = Environment() # Make env available for all SConscript files to Import(). Export("env") @@ -1597,15 +1629,15 @@ Export(debug = env) Export({"debug":env}) - + Note that the -SConscript +SConscript function supports an exports argument that makes it easier to to export a variable or set of variables to a single SConscript file. See the description of the -SConscript +SConscript function, below. @@ -1617,7 +1649,8 @@ function, below. env.File(name, [directory]) - + + This returns a File Node, an object that represents the specified file @@ -1628,7 +1661,7 @@ can be a relative or absolute path. is an optional directory that will be used as the parent directory. - + If name is a list, SCons returns a list of File nodes. @@ -1636,7 +1669,7 @@ Construction variables are expanded in name. - + File Nodes can be used anywhere you would supply a string as a file name to a Builder method or function. @@ -1653,7 +1686,8 @@ see "File and Directory Nodes," below. env.FindFile(file, dirs) - + + Search for file in the path specified by @@ -1665,11 +1699,11 @@ this function also searches for derived files that have not yet been built. - + Example: - + foo = env.FindFile('foo', ['dir1', 'dir2']) @@ -1681,24 +1715,25 @@ foo = env.FindFile('foo', ['dir1', 'dir2']) env.FindInstalledFiles() - + + Returns the list of targets set up by the -Install +Install or -InstallAs +InstallAs builders. - + This function serves as a convenient method to select the contents of a binary package. - + Example: - + Install( '/bin', [ 'executable_a', 'executable_b' ] ) # will return the file node list @@ -1717,7 +1752,8 @@ FindInstalledFiles() FindPathDirs(variable) - + + Returns a function (actually a callable Python object) intended to be used as the @@ -1729,14 +1765,14 @@ in a construction environment and treat the construction variable's value as a list of directory paths that should be searched (like -$CPPPATH, -$LIBPATH, +$CPPPATH, +$LIBPATH, etc.). - + Note that use of -FindPathDirs +FindPathDirs is generally preferable to writing your own path_function @@ -1744,11 +1780,11 @@ for the following reasons: 1) The returned list will contain all appropriate directories found in source trees (when -VariantDir +VariantDir is used) or in code repositories (when -Repository +Repository or the option are used). @@ -1760,11 +1796,11 @@ and avoid re-scanning the directories for files, when possible. - + Example: - + def my_scan(node, env, path, arg): # Code to scan file contents goes here... return include_files @@ -1782,7 +1818,8 @@ scanner = Scanner(name = 'myscanner', env.FindSourceFiles(node='"."') - + + Returns the list of nodes which serve as the source of the built files. It does so by inspecting the dependency tree starting at the optional argument @@ -1792,16 +1829,16 @@ which defaults to the '"."'-node. It will then return all leaves of These are all children which have no further children. - + This function is a convenient method to select the contents of a Source Package. - + Example: - + Program( 'src/main_a.c' ) Program( 'src/main_b.c' ) Program( 'main_c.c' ) @@ -1813,7 +1850,7 @@ FindSourceFiles() FindSourceFiles( 'src' ) - + As you can see build support files (SConstruct in the above example) will also be returned by this function. @@ -1826,7 +1863,8 @@ will also be returned by this function. env.Flatten(sequence) - + + Takes a sequence (that is, a Python list or tuple) that may contain nested sequences and returns a flattened list containing @@ -1839,11 +1877,11 @@ but direct Python manipulation of these lists does not. - + Examples: - + foo = Object('foo.c') bar = Object('bar.c') @@ -1866,7 +1904,8 @@ for object in Flatten(objects): GetBuildFailures() - + + Returns a list of exceptions for the actions that failed while attempting to build targets. @@ -1878,13 +1917,13 @@ that record various aspects of the build failure: - + .node The node that was being built when the build failure occurred. - + .status The numeric exit status returned by the command or Python function @@ -1892,7 +1931,7 @@ that failed when trying to build the specified Node. - + .errstr The SCons error string describing the build failure. @@ -1902,7 +1941,7 @@ to indicate that an executed command exited with a status of 2.) - + .filename The name of the file or directory that actually caused the failure. @@ -1925,7 +1964,7 @@ attribute will be sub/dir. - + .executor The SCons Executor object for the target Node @@ -1935,7 +1974,7 @@ the construction environment used for the failed action. - + .action The actual SCons Action object that failed. This will be one specific action @@ -1944,26 +1983,26 @@ actions that would have been executed to build the target. - + .command The actual expanded command that was executed and failed, after expansion of -$TARGET, -$SOURCE, +$TARGET, +$SOURCE, and other construction variables. - + Note that the -GetBuildFailures +GetBuildFailures function will always return an empty list until any build failure has occurred, which means that -GetBuildFailures +GetBuildFailures will always return an empty list while the -SConscript +SConscript files are being read. Its primary intended use is for functions that will be @@ -1975,7 +2014,7 @@ function. Example: - + import atexit def print_build_failures(): @@ -1994,9 +2033,10 @@ atexit.register(print_build_failures) env.GetBuildPath(file, [...]) - + + Returns the -scons +scons path name (or names) for the specified file (or files). @@ -2004,7 +2044,7 @@ The specified file or files may be -scons +scons Nodes or strings representing path names. @@ -2016,9 +2056,10 @@ Nodes or strings representing path names. env.GetLaunchDir() - + + Returns the absolute path name of the directory from which -scons +scons was initially invoked. This can be useful when using the , @@ -2027,7 +2068,7 @@ or options, which internally change to the directory in which the -SConstruct +SConstruct file is found. @@ -2039,16 +2080,17 @@ file is found. env.GetOption(name) - + + This function provides a way to query the value of SCons options set on scons command line (or set using the -SetOption +SetOption function). The options supported are: - + cache_debug @@ -2293,7 +2335,7 @@ which corresponds to --warn and --warning. - + See the documentation for the corresponding command line object for information about each specific option. @@ -2307,11 +2349,12 @@ option. env.Glob(pattern, [ondisk, source, strings, exclude]) - + + Returns Nodes (or strings) that match the specified pattern, relative to the directory of the current -SConscript +SConscript file. The env.Glob() @@ -2321,20 +2364,20 @@ and returns whatever matches the resulting expanded pattern. - + The specified pattern uses Unix shell style metacharacters for matching: - + * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq - + If the first character of a filename is a dot, it must be matched explicitly. Character matches do @@ -2342,17 +2385,17 @@ Character matches do span directory separators. - + The -Glob +Glob knows about repositories (see the -Repository +Repository function) and source directories (see the -VariantDir +VariantDir function) and returns a Node (or string, if so configured) @@ -2362,7 +2405,7 @@ anywhere in a corresponding repository or source directory. - + The ondisk argument may be set to @@ -2376,7 +2419,7 @@ return corresponding Nodes for any on-disk matches found. - + The source argument may be set to @@ -2384,20 +2427,20 @@ argument may be set to (or any equivalent value) to specify that, when the local directory is a -VariantDir, +VariantDir, the returned Nodes should be from the corresponding source directory, not the local directory. - + The strings argument may be set to True (or any equivalent value) to have the -Glob +Glob function return strings, not Nodes, that represent the matched files or directories. The returned strings will be relative to @@ -2406,18 +2449,18 @@ the local (SConscript) directory. arbitrary manipulation of file names, but if the returned strings are passed to a different -SConscript +SConscript file, any Node translation will be relative to the other -SConscript +SConscript directory, not the original -SConscript +SConscript directory.) - + The exclude argument may be set to a pattern or a list of patterns @@ -2427,11 +2470,11 @@ Elements matching a least one pattern of this list will be excluded. - + Examples: - + Program('foo', Glob('*.c')) Zip('/tmp/everything', Glob('.??*') + Glob('*')) sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_*.cpp'%currentOS) @@ -2445,19 +2488,20 @@ sources = Glob('*.cpp', exclude=['os_*_specific_*.cpp']) + Glob('os_%s_specific_ env.Help(text, append=False) - + + This specifies help text to be printed if the argument is given to -scons. +scons. If -Help +Help is called multiple times, the text is appended together in the order that -Help +Help is called. With append set to False, any -Help +Help text generated with -AddOption +AddOption is clobbered. If append is True, the AddOption help is prepended to the help string, thus preserving the @@ -2472,33 +2516,34 @@ message. env.Ignore(target, dependency) - + + The specified dependency file(s) will be ignored when deciding if the target file(s) need to be rebuilt. - + You can also use -Ignore +Ignore to remove a target from the default build. In order to do this you must specify the directory the target will be built in as the target, and the file you want to skip building as the dependency. - + Note that this will only remove the dependencies listed from the files built by default. It will still be built if that dependency is needed by another object being built. See the third and forth examples below. - + Examples: - + env.Ignore('foo', 'foo.c') env.Ignore('bar', ['bar1.h', 'bar2.h']) env.Ignore('.','foobar.obj') @@ -2513,30 +2558,31 @@ env.Ignore('bar','bar/foobar.obj') env.Import(vars) - + + This tells -scons +scons to import a list of variables into the current SConscript file. This will import variables that were exported with -Export +Export or in the exports argument to -SConscript. +SConscript. Variables exported by -SConscript +SConscript have precedence. Multiple variable names can be passed to -Import +Import as separate arguments or as a list. The variable "*" can be used to import all variables. - + Examples: - + Import("env") Import("env", "variable") Import(["env", "variable"]) @@ -2551,7 +2597,8 @@ Import("*") env.Literal(string) - + + The specified string will be preserved as-is @@ -2566,7 +2613,8 @@ and not have construction variables expanded. env.Local(targets) - + + The specified targets will have copies made in the local tree, @@ -2580,7 +2628,8 @@ Returns a list of the target Node or Nodes. env.MergeFlags(arg, [unique]) - + + Merges the specified arg values to the construction environment's construction variables. @@ -2588,7 +2637,7 @@ If the arg argument is not a dictionary, it is converted to one by calling -env.ParseFlags +env.ParseFlags on the argument before the values are merged. Note that @@ -2597,10 +2646,10 @@ must be a single value, so multiple strings must be passed in as a list, not as separate arguments to -env.MergeFlags. +env.MergeFlags. - + By default, duplicate values are eliminated; you can, however, specify @@ -2616,11 +2665,11 @@ All other construction variables keep the right-most unique value. - + Examples: - + # Add an optimization flag to $CCFLAGS. env.MergeFlags('-O3') @@ -2643,38 +2692,39 @@ env.MergeFlags(['-O3', env.NoCache(target, ...) - + + Specifies a list of files which should not be cached whenever the -CacheDir +CacheDir method has been activated. The specified targets may be a list or an individual target. - + Multiple files should be specified either as separate arguments to the -NoCache +NoCache method, or as a list. -NoCache +NoCache will also accept the return value of any of the construction environment Builder methods. - + Calling -NoCache +NoCache on directories and other non-File Node types has no effect because only File Nodes are cached. - + Examples: - + NoCache('foo.elf') NoCache(env.Program('hello', 'hello.c')) @@ -2687,7 +2737,8 @@ NoCache(env.Program('hello', 'hello.c')) env.NoClean(target, ...) - + + Specifies a list of files or directories which should not be removed whenever the targets (or their dependencies) @@ -2697,7 +2748,7 @@ command line option. The specified targets may be a list or an individual target. Multiple calls to -NoClean +NoClean are legal, and prevent each specified target from being removed by calls to the @@ -2705,21 +2756,21 @@ from being removed by calls to the option. - + Multiple files or directories should be specified either as separate arguments to the -NoClean +NoClean method, or as a list. -NoClean +NoClean will also accept the return value of any of the construction environment Builder methods. - + Calling -NoClean +NoClean for a target overrides calling -Clean +Clean for the same target, and any targets passed to both functions will not @@ -2728,11 +2779,11 @@ be removed by the option. - + Examples: - + NoClean('foo.elf') NoClean(env.Program('hello', 'hello.c')) @@ -2742,7 +2793,8 @@ NoClean(env.Program('hello', 'hello.c')) env.ParseConfig(command, [function, unique]) - + + Calls the specified function to modify the environment as specified by the output of @@ -2750,7 +2802,7 @@ to modify the environment as specified by the output of The default function is -env.MergeFlags, +env.MergeFlags, which expects the output of a typical *-config command @@ -2767,11 +2819,11 @@ to allow duplicate values to be added. - + Interpreted options and the construction variables they affect are as specified for the -env.ParseFlags +env.ParseFlags method (which this method calls). See that method's description, below, for a table of options and construction variables. @@ -2785,17 +2837,18 @@ for a table of options and construction variables. env.ParseDepends(filename, [must_exist, only_one]) - + + Parses the contents of the specified filename as a list of dependencies in the style of -Make +Make or mkdep, and explicitly establishes all of the listed dependencies. - + By default, it is not an error if the specified @@ -2811,7 +2864,7 @@ generate an error if the file does not exist, or is otherwise inaccessible. - + The optional only_one argument may be set to a non-zero @@ -2833,15 +2886,15 @@ one output file into a corresponding file. - + The filename and all of the files listed therein will be interpreted relative to the directory of the -SConscript +SConscript file which calls the -ParseDepends +ParseDepends function. @@ -2850,25 +2903,26 @@ function. env.ParseFlags(flags, ...) - + + Parses one or more strings containing typical command-line flags for GCC tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables. This is intended as a companion to the -env.MergeFlags +env.MergeFlags method, but allows for the values in the returned dictionary to be modified, if necessary, before merging them into the construction environment. (Note that -env.MergeFlags +env.MergeFlags will call this method if its argument is not a dictionary, so it is usually not necessary to call -env.ParseFlags +env.ParseFlags directly unless you want to manipulate the values.) - + If the first character in any string is an exclamation mark (!), the rest of the string is executed as a command, @@ -2877,12 +2931,12 @@ parsed as GCC tool chain command-line flags and added to the resulting dictionary. - + Flag values are translated accordig to the prefix found, and added to the following construction variables: - + -arch CCFLAGS, LINKFLAGS -D CPPDEFINES -framework FRAMEWORKS @@ -2909,19 +2963,19 @@ and added to the following construction variables: + CCFLAGS, LINKFLAGS - + Any other strings not associated with options are assumed to be the names of libraries and added to the -$LIBS +$LIBS construction variable. - + Examples (all of which produce the same result): - + dict = env.ParseFlags('-O2 -Dfoo -Dbar=1') dict = env.ParseFlags('-O2', '-Dfoo', '-Dbar=1') dict = env.ParseFlags(['-O2', '-Dfoo -Dbar=1']) @@ -2933,38 +2987,39 @@ dict = env.ParseFlags('-O2', '!echo -Dfoo -Dbar=1') Platform(string) - + + The -Platform +Platform form returns a callable object that can be used to initialize a construction environment using the platform keyword of the -Environment +Environment function. - + Example: - + env = Environment(platform = Platform('win32')) - + The -env.Platform +env.Platform form applies the callable object for the specified platform string to the environment through which the method was called. - + env.Platform('posix') - + Note that the win32 platform adds the @@ -2973,7 +3028,7 @@ and SystemRoot variables from the user's external environment to the construction environment's -$ENV +$ENV dictionary. This is so that any executed commands that use sockets to connect with other systems @@ -2991,14 +3046,15 @@ will work on Windows systems. env.Precious(target, ...) - + + Marks each given target as precious so it is not deleted before it is rebuilt. Normally -scons +scons deletes a target before building it. Multiple targets can be passed in to a single call to -Precious. +Precious. @@ -3006,7 +3062,8 @@ Multiple targets can be passed in to a single call to env.Prepend(key=val, [...]) - + + Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have @@ -3022,11 +3079,11 @@ and the lists are added together. (See also the Append method, above.) - + Example: - + env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) @@ -3035,10 +3092,11 @@ env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy']) env.PrependENVPath(name, newpath, [envname, sep, delete_existing]) - + + This appends new path elements to the given path in the specified external environment -($ENV +($ENV by default). This will only add any particular path once (leaving the first one it encounters and @@ -3053,7 +3111,7 @@ case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string. - + If delete_existing is 0, then adding a path that already exists @@ -3061,22 +3119,22 @@ will not move it to the beginning; it will stay where it is in the list. - + Example: - + print 'before:',env['ENV']['INCLUDE'] include_path = '/foo/bar:/foo' env.PrependENVPath('INCLUDE', include_path) print 'after:',env['ENV']['INCLUDE'] - + The above example will print: - + before: /biz:/foo after: /foo/bar:/foo:/biz @@ -3086,7 +3144,8 @@ after: /foo/bar:/foo:/biz env.PrependUnique(key=val, delete_existing=0, [...]) - + + Appends the specified keyword arguments to the beginning of construction variables in the environment. If the Environment does not have @@ -3102,11 +3161,11 @@ existing matching values are removed first, so existing values in the arg list move to the front of the list. - + Example: - + env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) @@ -3121,13 +3180,14 @@ env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) Progress(list_of_strings, [interval, file, overwrite]) - + + Allows SCons to show progress made during the build by displaying a string or calling a function while evaluating Nodes (e.g. files). - + If the first specified argument is a Python callable (a function or an object that has a __call__() @@ -3149,19 +3209,19 @@ if SCons ever changes the interface to call the function with additional arguments in the future.) - + An example of a simple custom progress function that prints a string containing the Node name every 10 Nodes: - + def my_progress_function(node, *args, **kw): print('Evaluating node %s!' % node) Progress(my_progress_function, interval=10) - + A more complicated example of a custom progress display object that prints a string containing a count every 100 evaluated Nodes. @@ -3172,7 +3232,7 @@ at the end so that the string will overwrite itself on a display: - + import sys class ProgressCounter(object): count = 0 @@ -3182,9 +3242,9 @@ class ProgressCounter(object): Progress(ProgressCounter(), interval=100) - + If the first argument -Progress +Progress is a string, the string will be displayed every @@ -3200,14 +3260,14 @@ on the error output, one dot for every 100 evaluated Nodes: - + import sys Progress('.', interval=100, file=sys.stderr) - + If the string contains the verbatim substring -$TARGET, +$TARGET, it will be replaced with the Node. Note that, for performance reasons, this is not @@ -3225,14 +3285,14 @@ keyword argument to make sure the previously-printed file name is overwritten with blank spaces: - + import sys Progress('$TARGET\r', overwrite=True) - + If the first argument to -Progress +Progress is a list of strings, then each string in the list will be displayed in rotating fashion every @@ -3242,7 +3302,7 @@ This can be used to implement a "spinner" on the user's screen as follows: - + Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) @@ -3254,17 +3314,18 @@ Progress(['-\r', '\\\r', '|\r', '/\r'], interval=5) env.Pseudo(target, ...) - + + This indicates that each given target should not be created by the build rule, and if the target is created, an error will be generated. This is similar to the gnu make .PHONY target. However, in the vast majority of cases, an -Alias +Alias is more appropriate. Multiple targets can be passed in to a single call to -Pseudo. +Pseudo. @@ -3275,7 +3336,8 @@ Multiple targets can be passed in to a single call to env.PyPackageDir(modulename) - + + This returns a Directory Node similar to Dir. The python module / package is looked up and if located the directory is returned for the location. @@ -3283,7 +3345,7 @@ the directory is returned for the location. Is a named python package / module to lookup the directory for it's location. - + If modulename is a list, SCons returns a list of Dir nodes. @@ -3296,16 +3358,17 @@ Construction variables are expanded in env.Replace(key=val, [...]) - + + Replaces construction variables in the Environment with the specified keyword arguments. - + Example: - + env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') @@ -3317,20 +3380,21 @@ env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx') env.Repository(directory) - + + Specifies that directory is a repository to be searched for files. Multiple calls to -Repository +Repository are legal, and each one adds to the list of repositories that will be searched. - + To -scons, +scons, a repository is a copy of the source tree, from the top-level directory on down, which may contain @@ -3341,26 +3405,26 @@ The canonical example would be an official source tree maintained by an integrator. If the repository contains derived files, then the derived files should have been built using -scons, +scons, so that the repository contains the necessary signature information to allow -scons +scons to figure out when it is appropriate to use the repository copy of a derived file, instead of building one locally. - + Note that if an up-to-date derived file already exists in a repository, -scons +scons will not make a copy in the local directory tree. In order to guarantee that a local copy will be made, use the -Local +Local method. @@ -3372,7 +3436,8 @@ method. env.Requires(target, prerequisite) - + + Specifies an order-only relationship between the specified target file(s) and the specified prerequisite file(s). @@ -3386,11 +3451,11 @@ and will not be rebuilt simply because the prerequisite file(s) change. - + Example: - + env.Requires('foo', 'file-that-must-be-built-before-foo') @@ -3399,7 +3464,8 @@ env.Requires('foo', 'file-that-must-be-built-before-foo') Return([vars..., stop=]) - + + By default, this stops processing the current SConscript file and returns to the calling SConscript file @@ -3407,32 +3473,32 @@ the values of the variables named in the vars string arguments. Multiple strings contaning variable names may be passed to -Return. +Return. Any strings that contain white space - + The optional stop= keyword argument may be set to a false value to continue processing the rest of the SConscript file after the -Return +Return call. This was the default behavior prior to SCons 0.98. However, the values returned are still the values of the variables in the named vars at the point -Return +Return is called. - + Examples: - + # Returns without returning a value. Return() @@ -3454,7 +3520,8 @@ Return('val1 val2') env.Scanner(function, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]) - + + Creates a Scanner object for the specified function. @@ -3476,23 +3543,24 @@ below, for a complete explanation of the arguments and behavior. env.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) - + + This tells -scons +scons to execute one or more subsidiary SConscript (configuration) files. Any variables returned by a called script using -Return +Return will be returned by the call to -SConscript. +SConscript. There are two ways to call the -SConscript +SConscript function. - + The first way you can call -SConscript +SConscript is to explicitly specify one or more scripts as the first argument. @@ -3500,45 +3568,45 @@ A single script may be specified as a string; multiple scripts must be specified as a list (either explicitly or as created by a function like -Split). +Split). Examples: - + SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') - + The second way you can call -SConscript +SConscript is to specify a list of (sub)directory names as a dirs=subdirs keyword argument. In this case, -scons +scons will, by default, execute a subsidiary configuration file named -SConscript +SConscript in each of the specified directories. You may specify a name other than -SConscript +SConscript by supplying an optional name=script keyword argument. The first three examples below have the same effect as the first three examples above: - + SConscript(dirs='.') # run SConscript in the current directory SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') - + The optional exports argument provides a list of variable names or a dictionary of @@ -3547,28 +3615,28 @@ named values to export to the These variables are locally exported only to the specified script(s), and do not affect the global pool of variables used by the -Export +Export function. The subsidiary script(s) must use the -Import +Import function to import the variables. Examples: - + foo = SConscript('sub/SConscript', exports='env') SConscript('dir/SConscript', exports=['env', 'variable']) SConscript(dirs='subdir', exports='env variable') SConscript(dirs=['one', 'two', 'three'], exports='shared_info') - + If the optional variant_dir argument is present, it causes an effect equivalent to the -VariantDir +VariantDir method described below. (If variant_dir @@ -3585,14 +3653,14 @@ and arguments are interpreted relative to the directory of the calling --> argument is interpreted relative to the directory of the calling -SConscript +SConscript file. See the description of the -VariantDir +VariantDir function below for additional details and restrictions. - + If variant_dir is present, @@ -3602,46 +3670,46 @@ but is not, --> the source directory is the directory in which the -SConscript +SConscript file resides and the -SConscript +SConscript file is evaluated as if it were in the variant_dir directory: - + SConscript('src/SConscript', variant_dir = 'build') - + is equivalent to - + VariantDir('build', 'src') SConscript('build/SConscript') - + This later paradigm is often used when the sources are in the same directory as the -SConstruct: +SConstruct: - + SConscript('SConscript', variant_dir = 'build') - + is equivalent to - + VariantDir('build', '.') SConscript('build/SConscript') - + - + The optional must_exist argument, if true, causes an exception to be raised if a requested -SConscript file is not found. The current default is false, +SConscript file is not found. The current default is false, causing only a warning to be omitted, but this behavior is deprecated. For scripts which truly intend to be optional, transition to explicty supplying must_exist=False to the call. - + Here are some composite examples: - + # collect the configuration information and use it to build src and doc shared_info = SConscript('MyConfig.py') SConscript('src/SConscript', exports='shared_info') SConscript('doc/SConscript', exports='shared_info') - + # build debugging and production versions. SConscript # can use Dir('.').path to determine variant. SConscript('SConscript', variant_dir='debug', duplicate=0) SConscript('SConscript', variant_dir='prod', duplicate=0) - + # build debugging and production versions. SConscript # is passed flags to use. opts = { 'CPPDEFINES' : ['DEBUG'], 'CCFLAGS' : '-pgdb' } @@ -3712,7 +3780,7 @@ opts = { 'CPPDEFINES' : ['NODEBUG'], 'CCFLAGS' : '-O' } SConscript('SConscript', variant_dir='prod', duplicate=0, exports=opts) - + # build common documentation and compile for different architectures SConscript('doc/SConscript', variant_dir='build/doc', duplicate=0) SConscript('src/SConscript', variant_dir='build/x86', duplicate=0) @@ -3727,9 +3795,10 @@ SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0) env.SConscriptChdir(value) - + + By default, -scons +scons changes its working directory to the directory in which each subsidiary SConscript file lives. @@ -3737,14 +3806,14 @@ This behavior may be disabled by specifying either: - + SConscriptChdir(0) env.SConscriptChdir(0) - + in which case -scons +scons will stay in the top-level directory while reading all SConscript files. (This may be necessary when building from repositories, @@ -3756,11 +3825,11 @@ SConscriptChdir() multiple times. - + Example: - + env = Environment() SConscriptChdir(0) SConscript('foo/SConscript') # will not chdir to foo @@ -3776,9 +3845,10 @@ SConscript('bar/SConscript') # will chdir to bar env.SConsignFile([file, dbm_module]) - + + This tells -scons +scons to store all file signatures in the specified database file. @@ -3795,17 +3865,17 @@ If file is not an absolute path name, the file is placed in the same directory as the top-level -SConstruct +SConstruct file. - + If file is None, then -scons +scons will store file signatures in a separate .sconsign @@ -3815,7 +3885,7 @@ not in one global database file. prior to SCons 0.96.91 and 0.97.) - + The optional dbm_module argument can be used to specify @@ -3827,11 +3897,11 @@ Python data structures, and which works on all Python versions. - + Examples: - + # Explicitly stores signatures in ".sconsign.dblite" # in the top-level SConstruct directory (the # default behavior). @@ -3854,13 +3924,14 @@ SConsignFile(None) env.SetDefault(key=val, [...]) - + + Sets construction variables to default values specified with the keyword arguments if (and only if) the variables are not already set. The following statements are equivalent: - + env.SetDefault(FOO = 'foo') if 'FOO' not in env: env['FOO'] = 'foo' @@ -3874,12 +3945,13 @@ if 'FOO' not in env: env['FOO'] = 'foo' env.SetOption(name, value) - + + This function provides a way to set a select subset of the scons command line options from a SConscript file. The options supported are: - + clean @@ -3964,17 +4036,17 @@ which corresponds to --stack-size. - + See the documentation for the corresponding command line object for information about each specific option. - + Example: - + SetOption('max_drift', 1) @@ -3986,7 +4058,8 @@ SetOption('max_drift', 1) env.SideEffect(side_effect, target) - + + Declares side_effect as a side effect of building @@ -4004,7 +4077,7 @@ files for a static library, and various log files are created updated as side effects of various TeX commands. If a target is a side effect of multiple build commands, -scons +scons will ensure that only one set of commands is executed at a time. Consequently, you only need to use this method @@ -4012,7 +4085,7 @@ for side-effect targets that are built as a result of multiple build commands. - + Because multiple build commands may update the same side effect file, by default the @@ -4036,9 +4109,9 @@ is cleaned whenever a specific is cleaned, you must specify this explicitly with the -Clean +Clean or -env.Clean +env.Clean function. @@ -4050,16 +4123,17 @@ function. env.SourceCode(entries, builder) - + + This function and its associate factory functions are deprecated. There is no replacement. The intended use was to keep a local tree in sync with an archive, but in actuality the function only causes the archive to be fetched on the first run. -Synchronizing with the archive is best done external to SCons. +Synchronizing with the archive is best done external to SCons. - + Arrange for non-existent source files to be fetched from a source code management system using the specified @@ -4072,30 +4146,30 @@ source files or directories in which source files can be found. - + For any non-existent source files, -scons +scons will search up the directory tree and use the first -SourceCode +SourceCode builder it finds. The specified builder may be None, in which case -scons +scons will not use a builder to fetch source files for the specified entries, even if a -SourceCode +SourceCode builder has been specified for a directory higher up the tree. - -scons + +scons will, by default, fetch files from SCCS or RCS subdirectories without explicit configuration. @@ -4107,11 +4181,11 @@ and speed up your build a little by disabling these searches as follows: - + env.SourceCode('.', None) - + Note that if the specified builder is one you create by hand, @@ -4120,8 +4194,8 @@ construction environment to use when fetching a source file. - -scons + +scons provides a set of canned factory functions that return appropriate Builders for various popular @@ -4129,14 +4203,14 @@ source code management systems. Canonical examples of invocation include: - + env.SourceCode('.', env.BitKeeper('/usr/local/BKsources')) env.SourceCode('src', env.CVS('/usr/local/CVSROOT')) env.SourceCode('/', env.RCS()) env.SourceCode(['f1.c', 'f2.c'], env.SCCS()) env.SourceCode('no_source.c', None) - + @@ -4148,20 +4222,21 @@ env.SourceCode('no_source.c', None) env.SourceSignatures(type) - + + Note: Although it is not yet officially deprecated, use of this function is discouraged. See the -Decider +Decider function for a more flexible and straightforward way to configure SCons' decision-making. - + The -SourceSignatures +SourceSignatures function tells -scons +scons how to decide if a source file (a file that is not built from any other files) has changed since the last time it @@ -4172,7 +4247,7 @@ or timestamp. - + If the environment method is used, the specified type of source signature is only used when deciding whether targets @@ -4183,19 +4258,19 @@ used for all decisions about whether targets are up-to-date. - + MD5 means -scons +scons decides that a source file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild a particular target file. - + timestamp means -scons +scons decides that a source file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild a particular target file. @@ -4205,14 +4280,14 @@ by default it will also rebuild if the dependency is than the last time it was used to rebuild the target file.) - + There is no different between the two behaviors for Python -Value +Value node objects. - + MD5 signatures take longer to compute, but are more accurate than @@ -4222,21 +4297,21 @@ The default value is MD5. - + Note that the default -TargetSignatures +TargetSignatures setting (see below) is to use this -SourceSignatures +SourceSignatures setting for any target files that are used to build other target files. Consequently, changing the value of -SourceSignatures +SourceSignatures will, by default, affect the up-to-date decision for all files in the build (or all files built with a specific construction environment when -env.SourceSignatures +env.SourceSignatures is used). @@ -4248,7 +4323,8 @@ is used). env.Split(arg) - + + Returns a list of file names or other objects. If arg is a string, it will be split on strings of white-space characters @@ -4261,11 +4337,11 @@ it will be returned as a list containing just the object. - + Example: - + files = Split("f1.c f2.c f3.c") files = env.Split("f4.c f5.c f6.c") files = Split(""" @@ -4280,13 +4356,14 @@ files = Split(""" env.subst(input, [raw, target, source, conv]) - + + Performs construction variable interpolation on the specified string or sequence argument input. - + By default, leading or trailing white space will be removed from the result. @@ -4318,7 +4395,7 @@ pairs (as is done for signature calculation). - + If the input is a sequence (list or tuple), the individual elements of @@ -4326,7 +4403,7 @@ the sequence will be expanded, and the results will be returned as a list. - + The optional target and @@ -4335,20 +4412,20 @@ keyword arguments must be set to lists of target and source nodes, respectively, if you want the -$TARGET, -$TARGETS, -$SOURCE +$TARGET, +$TARGETS, +$SOURCE and -$SOURCES +$SOURCES to be available for expansion. This is usually necessary if you are calling -env.subst +env.subst from within a Python function used as an SCons action. - + Returned string values or sequence elements are converted to their string representation by default. The optional @@ -4366,11 +4443,11 @@ idiom to pass in an unnamed function that simply returns its unconverted argument. - + Example: - + print env.subst("The C compiler is: $CC") def compile(target, source, env): @@ -4387,19 +4464,20 @@ source_nodes = env.subst('$EXPAND_TO_NODELIST', Tag(node, tags) - + + Annotates file or directory Nodes with information about how the -Package +Package Builder should package those files or directories. All tags are optional. - + Examples: - + # makes sure the built library will be installed with 0644 file # access mode Tag( Library( 'lib.c' ), UNIX_ATTR="0644" ) @@ -4416,20 +4494,21 @@ Tag( 'file2.txt', DOC ) env.TargetSignatures(type) - + + Note: Although it is not yet officially deprecated, use of this function is discouraged. See the -Decider +Decider function for a more flexible and straightforward way to configure SCons' decision-making. - + The -TargetSignatures +TargetSignatures function tells -scons +scons how to decide if a target file (a file that is @@ -4446,7 +4525,7 @@ or "source". - + If the environment method is used, the specified type of target signature is only used for targets built with that environment. @@ -4457,17 +4536,17 @@ don't have an explicit target signature type specified for their environments. - + "content" (or its synonym "MD5") means -scons +scons decides that a target file has changed if the MD5 checksum of its contents has changed since the last time it was used to rebuild some other target file. This means -scons +scons will open up MD5 sum the contents of target files after they're built, @@ -4476,10 +4555,10 @@ and may decide that it does not need to rebuild rebuilt with exactly the same contents as the last time. - + "timestamp" means -scons +scons decides that a target file has changed if its timestamp (modification time) has changed since the last time it was used to rebuild some other target file. @@ -4489,33 +4568,33 @@ by default it will also rebuild if the dependency is than the last time it was used to rebuild the target file.) - + "source" means -scons +scons decides that a target file has changed as specified by the corresponding -SourceSignatures +SourceSignatures setting ("MD5" or "timestamp"). This means that -scons +scons will treat all input files to a target the same way, regardless of whether they are source files or have been built from other files. - + "build" means -scons +scons decides that a target file has changed if it has been rebuilt in this invocation or if its content or timestamp have changed as specified by the corresponding -SourceSignatures +SourceSignatures setting. This "propagates" the status of a rebuilt file so that other "downstream" target files @@ -4524,7 +4603,7 @@ even if the contents or the timestamp have not changed. - + "build" signatures are fastest because "content" @@ -4546,18 +4625,18 @@ The default value is "source". - + Because the default setting is "source", using -SourceSignatures +SourceSignatures is generally preferable to -TargetSignatures, +TargetSignatures, so that the up-to-date decision will be consistent for all files (or all files built with a specific construction environment). Use of -TargetSignatures +TargetSignatures provides specific control for how built target files affect their "downstream" dependencies. @@ -4570,9 +4649,10 @@ affect their "downstream" dependencies. env.Tool(string, [toolpath, **kw]) - + + The -Tool +Tool form of the function returns a callable object that can be used to initialize @@ -4584,21 +4664,21 @@ in which case the object will add the necessary variables to the construction environment and the name of the tool will be added to the -$TOOLS +$TOOLS construction variable. - + Additional keyword arguments are passed to the tool's generate() method. - + Examples: - + env = Environment(tools = [ Tool('msvc') ]) env = Environment() @@ -4608,22 +4688,22 @@ u = Tool('opengl', toolpath = ['tools']) u(env) # adds 'opengl' to the TOOLS variable - + The -env.Tool +env.Tool form of the function applies the callable object for the specified tool string to the environment through which the method was called. - + Additional keyword arguments are passed to the tool's generate() method. - + env.Tool('gcc') env.Tool('opengl', toolpath = ['build/tools']) @@ -4636,7 +4716,8 @@ env.Tool('opengl', toolpath = ['build/tools']) env.Value(value, [built_value]) - + + Returns a Node object representing the specified Python value. Value Nodes can be used as dependencies of targets. If the result of calling @@ -4650,7 +4731,7 @@ When using timestamp source signatures, Value Nodes' timestamps are equal to the system time when the Node is created. - + The returned Value Node object has a write() method that can be used to "build" a Value Node @@ -4666,11 +4747,11 @@ There is a corresponding method that will return the built value of the Node. - + Examples: - + env = Environment() def create(target, source, env): @@ -4712,9 +4793,10 @@ env.UpdateValue(target = Value(output), source = Value(input)) env.VariantDir(variant_dir, src_dir, [duplicate]) - + + Use the -VariantDir +VariantDir function to create a copy of your sources in another location: if a name under variant_dir @@ -4727,8 +4809,8 @@ than the original sources by simply refering to the sources (and targets) within the variant tree. - -VariantDir + +VariantDir can be called multiple times with the same src_dir to set up multiple builds with different options @@ -4746,9 +4828,9 @@ TODO: src_dir = '.' works fine with a build dir under it. --> - + The default behavior is for -scons +scons to physically duplicate the source files in the variant tree. Thus, a build performed in the variant tree is guaranteed to be identical to a build performed in the source tree even if @@ -4759,7 +4841,7 @@ or individual compilers or other invoked tools are hard-coded to put derived files in the same directory as source files. - + If possible on the platform, the duplication is performed by linking rather than copying; see also the @@ -4770,14 +4852,14 @@ files and directories that are not used are not present in variant_dir. - + Duplicating the source tree may be disabled by setting the duplicate argument to 0 (zero). This will cause -scons +scons to invoke Builders using the path names of source files in src_dir and the path names of derived files within @@ -4788,9 +4870,9 @@ and is usually safe for most builds (but see above for cases that may cause problems). - + Note that -VariantDir +VariantDir works most naturally with a subsidiary SConscript file. However, you would then call the subsidiary SConscript file not in the source directory, but in the @@ -4798,11 +4880,11 @@ not in the source directory, but in the regardless of the value of duplicate. This is how you tell -scons +scons which variant of a source tree to build: - + # run src/SConscript in two variant directories VariantDir('build/variant1', 'src') SConscript('build/variant1/SConscript') @@ -4810,31 +4892,31 @@ VariantDir('build/variant2', 'src') SConscript('build/variant2/SConscript') - + See also the -SConscript +SConscript function, described above, for another way to specify a variant directory in conjunction with calling a subsidiary SConscript file. - + Examples: - + # use names in the build directory, not the source directory VariantDir('build', 'src', duplicate=0) Program('build/prog', 'build/source.c') - + # this builds both the source and docs in a separate subtree VariantDir('build', '.', duplicate=0) SConscript(dirs=['build/src','build/doc']) - + # same as previous example, but only uses SConscript SConscript(dirs='src', variant_dir='build/src', duplicate=0) SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) @@ -4848,7 +4930,8 @@ SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) env.WhereIs(program, [path, pathext, reject]) - + + Searches for the specified executable program, returning the full path name to the program diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index be96ed5..be717e3 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,117 +12,133 @@ %variables-mod; ]> - + 386asm - + + Sets construction variables for the 386ASM assembler for the Phar Lap ETS embedded operating system. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. aixc++ - + + Sets construction variables for the IMB xlc / Visual Age C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. aixcc - + + Sets construction variables for the IBM xlc / Visual Age C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCC;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCC;. aixf77 - + + Sets construction variables for the IBM Visual Age f77 Fortran compiler. -Sets: &cv-link-F77;, &cv-link-SHF77;. +Sets: &cv-link-F77;, &cv-link-SHF77;. aixlink - + + Sets construction variables for the IBM Visual Age linker. -Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. applelink - + + Sets construction variables for the Apple linker (similar to the GNU linker). - Sets: &cv-link-APPLELINK_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_CURRENT_VERSION;, &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_NO_CURRENT_VERSION;, &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LINKCOM;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_APPLELINK_COMPATIBILITY_VERSION;, &cv-link-_APPLELINK_CURRENT_VERSION;, &cv-link-_FRAMEWORKPATH;, &cv-link-_FRAMEWORKS;.Uses: &cv-link-FRAMEWORKSFLAGS;. + Sets: &cv-link-APPLELINK_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_CURRENT_VERSION;, &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION;, &cv-link-APPLELINK_NO_CURRENT_VERSION;, &cv-link-FRAMEWORKPATHPREFIX;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LINKCOM;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_APPLELINK_COMPATIBILITY_VERSION;, &cv-link-_APPLELINK_CURRENT_VERSION;, &cv-link-_FRAMEWORKPATH;, &cv-link-_FRAMEWORKS;.Uses: &cv-link-FRAMEWORKSFLAGS;. ar - -Sets construction variables for the ar library archiver. + + +Sets construction variables for the ar library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-RANLIB;, &cv-link-RANLIBCOM;, &cv-link-RANLIBFLAGS;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-RANLIB;, &cv-link-RANLIBCOM;, &cv-link-RANLIBFLAGS;. as - -Sets construction variables for the as assembler. + + +Sets construction variables for the as assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-CC;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. bcc32 - + + Sets construction variables for the bcc32 compiler. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. cc - + + Sets construction variables for generic POSIX C copmilers. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. clang - + + Set construction variables for the Clang C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. clangxx - + + Set construction variables for the Clang C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME;. cvf - + + Sets construction variables for the Compaq Visual Fortran compiler. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANMODDIR;, &cv-link-FORTRANMODDIRPREFIX;, &cv-link-FORTRANMODDIRSUFFIX;, &cv-link-FORTRANPPCOM;, &cv-link-OBJSUFFIX;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;, &cv-link-_FORTRANMODFLAG;. cXX - + + Sets construction variables for generic POSIX C++ compilers. -Sets: &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CXXCOMSTR;. +Sets: &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CXXCOMSTR;. cyglink - + + Set construction variables for cygwin linker/loader. -Sets: &cv-link-IMPLIBPREFIX;, &cv-link-IMPLIBSUFFIX;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LINKFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBPREFIX;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULEVERSIONFLAGS;, &cv-link-_SHLIBVERSIONFLAGS;. +Sets: &cv-link-IMPLIBPREFIX;, &cv-link-IMPLIBSUFFIX;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LINKFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBPREFIX;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULEVERSIONFLAGS;, &cv-link-_SHLIBVERSIONFLAGS;. default - + + Sets variables by calling a default list of Tool modules for the platform on which SCons is running. @@ -130,14 +146,16 @@ for the platform on which SCons is running. dmd - + + Sets construction variables for D language compiler DMD. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. docbook - This tool tries to make working with Docbook in SCons a little easier. + +This tool tries to make working with Docbook in SCons a little easier. It provides several toolchains for creating different output formats, like HTML or PDF. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1.76.1. @@ -145,27 +163,27 @@ As long as you don't specify your own stylesheets for customization, these official versions are picked as default...which should reduce the inevitable setup hassles for you. -Implicit dependencies to images and XIncludes are detected automatically +Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements. The additional stylesheet utils/xmldepend.xsl by Paul DuBois is used for this purpose. -Note, that there is no support for XML catalog resolving offered! This tool calls +Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that's it. The rest lies in your hands and you still have to know what you're doing when resolving names via a catalog. -For activating the tool "docbook", you have to add its name to the Environment constructor, +For activating the tool "docbook", you have to add its name to the Environment constructor, like this -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) -On its startup, the Docbook tool tries to find a required xsltproc processor, and +On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e.g. fop. So make sure that these are added to your system's environment PATH and can be called directly, without specifying their full path. -For the most basic processing of Docbook to HTML, you need to have installed +For the most basic processing of Docbook to HTML, you need to have installed -the Python lxml binding to libxml2, or +the Python lxml binding to libxml2, or the direct Python bindings for libxml2/libxslt, or @@ -176,49 +194,49 @@ and xalan. -Rendering to PDF requires you to have one of the applications +Rendering to PDF requires you to have one of the applications fop or xep installed. -Creating a HTML or PDF document is very simple and straightforward. Say +Creating a HTML or PDF document is very simple and straightforward. Say -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual.html', 'manual.xml') env.DocbookPdf('manual.pdf', 'manual.xml') -to get both outputs from your XML source manual.xml. As a shortcut, you can +to get both outputs from your XML source manual.xml. As a shortcut, you can give the stem of the filenames alone, like this: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml('manual') env.DocbookPdf('manual') -and get the same result. Target and source lists are also supported: +and get the same result. Target and source lists are also supported: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml(['manual.html','reference.html'], ['manual.xml','reference.xml']) -or even +or even -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtml(['manual','reference']) -Whenever you leave out the list of sources, you may not specify a file extension! The +Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly. -The rules given above are valid for the Builders DocbookHtml, -DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the -DocbookMan transformation you +The rules given above are valid for the Builders DocbookHtml, +DocbookPdf, DocbookEpub, DocbookSlidesPdf and DocbookXInclude. For the +DocbookMan transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source. -The Builders DocbookHtmlChunked, DocbookHtmlhelp and -DocbookSlidesHtml are special, in that: +The Builders DocbookHtmlChunked, DocbookHtmlhelp and +DocbookSlidesHtml are special, in that: -they create a large set of files, where the exact names and their number depend +they create a large set of files, where the exact names and their number depend on the content of the source file, and @@ -227,24 +245,24 @@ XSL transformation is not picked up by the stylesheets. -As a result, there is simply no use in specifying a target HTML name. +As a result, there is simply no use in specifying a target HTML name. So the basic syntax for these builders is always: -env = Environment(tools=['docbook']) +env = Environment(tools=['docbook']) env.DocbookHtmlhelp('manual') -If you want to use a specific XSL file, you can set the +If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: -env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') +env.DocbookHtml('other.html', 'manual.xml', xsl='html.xsl') -Since this may get tedious if you always use the same local naming for your customized XSL files, +Since this may get tedious if you always use the same local naming for your customized XSL files, e.g. html.xsl for HTML and pdf.xsl for PDF output, a set of variables for setting the default XSL name is provided. These are: -DOCBOOK_DEFAULT_XSL_HTML +DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF @@ -253,654 +271,733 @@ DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML -and you can set them when constructing your environment: +and you can set them when constructing your environment: -env = Environment(tools=['docbook'], +env = Environment(tools=['docbook'], DOCBOOK_DEFAULT_XSL_HTML='html.xsl', DOCBOOK_DEFAULT_XSL_PDF='pdf.xsl') env.DocbookHtml('manual') # now uses html.xsl -Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. +Sets: &cv-link-DOCBOOK_DEFAULT_XSL_EPUB;, &cv-link-DOCBOOK_DEFAULT_XSL_HTML;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLCHUNKED;, &cv-link-DOCBOOK_DEFAULT_XSL_HTMLHELP;, &cv-link-DOCBOOK_DEFAULT_XSL_MAN;, &cv-link-DOCBOOK_DEFAULT_XSL_PDF;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESHTML;, &cv-link-DOCBOOK_DEFAULT_XSL_SLIDESPDF;, &cv-link-DOCBOOK_FOP;, &cv-link-DOCBOOK_FOPCOM;, &cv-link-DOCBOOK_FOPFLAGS;, &cv-link-DOCBOOK_XMLLINT;, &cv-link-DOCBOOK_XMLLINTCOM;, &cv-link-DOCBOOK_XMLLINTFLAGS;, &cv-link-DOCBOOK_XSLTPROC;, &cv-link-DOCBOOK_XSLTPROCCOM;, &cv-link-DOCBOOK_XSLTPROCFLAGS;, &cv-link-DOCBOOK_XSLTPROCPARAMS;.Uses: &cv-link-DOCBOOK_FOPCOMSTR;, &cv-link-DOCBOOK_XMLLINTCOMSTR;, &cv-link-DOCBOOK_XSLTPROCCOMSTR;. dvi - -Attaches the DVI builder to the + + +Attaches the DVI builder to the construction environment. dvipdf - + + Sets construction variables for the dvipdf utility. -Sets: &cv-link-DVIPDF;, &cv-link-DVIPDFCOM;, &cv-link-DVIPDFFLAGS;.Uses: &cv-link-DVIPDFCOMSTR;. +Sets: &cv-link-DVIPDF;, &cv-link-DVIPDFCOM;, &cv-link-DVIPDFFLAGS;.Uses: &cv-link-DVIPDFCOMSTR;. dvips - + + Sets construction variables for the dvips utility. -Sets: &cv-link-DVIPS;, &cv-link-DVIPSFLAGS;, &cv-link-PSCOM;, &cv-link-PSPREFIX;, &cv-link-PSSUFFIX;.Uses: &cv-link-PSCOMSTR;. +Sets: &cv-link-DVIPS;, &cv-link-DVIPSFLAGS;, &cv-link-PSCOM;, &cv-link-PSPREFIX;, &cv-link-PSSUFFIX;.Uses: &cv-link-PSCOMSTR;. f03 - + + Set construction variables for generic POSIX Fortran 03 compilers. -Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;. +Sets: &cv-link-F03;, &cv-link-F03COM;, &cv-link-F03FLAGS;, &cv-link-F03PPCOM;, &cv-link-SHF03;, &cv-link-SHF03COM;, &cv-link-SHF03FLAGS;, &cv-link-SHF03PPCOM;, &cv-link-_F03INCFLAGS;.Uses: &cv-link-F03COMSTR;, &cv-link-F03PPCOMSTR;, &cv-link-SHF03COMSTR;, &cv-link-SHF03PPCOMSTR;. f08 - + + Set construction variables for generic POSIX Fortran 08 compilers. -Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;. +Sets: &cv-link-F08;, &cv-link-F08COM;, &cv-link-F08FLAGS;, &cv-link-F08PPCOM;, &cv-link-SHF08;, &cv-link-SHF08COM;, &cv-link-SHF08FLAGS;, &cv-link-SHF08PPCOM;, &cv-link-_F08INCFLAGS;.Uses: &cv-link-F08COMSTR;, &cv-link-F08PPCOMSTR;, &cv-link-SHF08COMSTR;, &cv-link-SHF08PPCOMSTR;. f77 - + + Set construction variables for generic POSIX Fortran 77 compilers. -Sets: &cv-link-F77;, &cv-link-F77COM;, &cv-link-F77FILESUFFIXES;, &cv-link-F77FLAGS;, &cv-link-F77PPCOM;, &cv-link-F77PPFILESUFFIXES;, &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHF77;, &cv-link-SHF77COM;, &cv-link-SHF77FLAGS;, &cv-link-SHF77PPCOM;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;, &cv-link-_F77INCFLAGS;.Uses: &cv-link-F77COMSTR;, &cv-link-F77PPCOMSTR;, &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHF77COMSTR;, &cv-link-SHF77PPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. +Sets: &cv-link-F77;, &cv-link-F77COM;, &cv-link-F77FILESUFFIXES;, &cv-link-F77FLAGS;, &cv-link-F77PPCOM;, &cv-link-F77PPFILESUFFIXES;, &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHF77;, &cv-link-SHF77COM;, &cv-link-SHF77FLAGS;, &cv-link-SHF77PPCOM;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;, &cv-link-_F77INCFLAGS;.Uses: &cv-link-F77COMSTR;, &cv-link-F77PPCOMSTR;, &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHF77COMSTR;, &cv-link-SHF77PPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. f90 - + + Set construction variables for generic POSIX Fortran 90 compilers. -Sets: &cv-link-F90;, &cv-link-F90COM;, &cv-link-F90FLAGS;, &cv-link-F90PPCOM;, &cv-link-SHF90;, &cv-link-SHF90COM;, &cv-link-SHF90FLAGS;, &cv-link-SHF90PPCOM;, &cv-link-_F90INCFLAGS;.Uses: &cv-link-F90COMSTR;, &cv-link-F90PPCOMSTR;, &cv-link-SHF90COMSTR;, &cv-link-SHF90PPCOMSTR;. +Sets: &cv-link-F90;, &cv-link-F90COM;, &cv-link-F90FLAGS;, &cv-link-F90PPCOM;, &cv-link-SHF90;, &cv-link-SHF90COM;, &cv-link-SHF90FLAGS;, &cv-link-SHF90PPCOM;, &cv-link-_F90INCFLAGS;.Uses: &cv-link-F90COMSTR;, &cv-link-F90PPCOMSTR;, &cv-link-SHF90COMSTR;, &cv-link-SHF90PPCOMSTR;. f95 - + + Set construction variables for generic POSIX Fortran 95 compilers. -Sets: &cv-link-F95;, &cv-link-F95COM;, &cv-link-F95FLAGS;, &cv-link-F95PPCOM;, &cv-link-SHF95;, &cv-link-SHF95COM;, &cv-link-SHF95FLAGS;, &cv-link-SHF95PPCOM;, &cv-link-_F95INCFLAGS;.Uses: &cv-link-F95COMSTR;, &cv-link-F95PPCOMSTR;, &cv-link-SHF95COMSTR;, &cv-link-SHF95PPCOMSTR;. +Sets: &cv-link-F95;, &cv-link-F95COM;, &cv-link-F95FLAGS;, &cv-link-F95PPCOM;, &cv-link-SHF95;, &cv-link-SHF95COM;, &cv-link-SHF95FLAGS;, &cv-link-SHF95PPCOM;, &cv-link-_F95INCFLAGS;.Uses: &cv-link-F95COMSTR;, &cv-link-F95PPCOMSTR;, &cv-link-SHF95COMSTR;, &cv-link-SHF95PPCOMSTR;. fortran - + + Set construction variables for generic POSIX Fortran compilers. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANFLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANFLAGS;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-FORTRANCOMSTR;, &cv-link-FORTRANPPCOMSTR;, &cv-link-SHFORTRANCOMSTR;, &cv-link-SHFORTRANPPCOMSTR;. g++ - -Set construction variables for the gXX C++ compiler. + + +Set construction variables for the gXX C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJSUFFIX;. g77 - -Set construction variables for the g77 Fortran compiler. -Calls the f77 Tool module + + +Set construction variables for the g77 Fortran compiler. +Calls the f77 Tool module to set variables. gas - -Sets construction variables for the gas assembler. -Calls the as module. + + +Sets construction variables for the gas assembler. +Calls the as module. -Sets: &cv-link-AS;. +Sets: &cv-link-AS;. gcc - -Set construction variables for the gcc C compiler. + + +Set construction variables for the gcc C compiler. -Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCVERSION;, &cv-link-SHCCFLAGS;. gdc - + + Sets construction variables for the D language compiler GDC. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. gettext - + + This is actually a toolset, which supports internationalization and localization of software being constructed with SCons. The toolset loads following tools: - + - xgettext - to extract internationalized messages from source code to + xgettext - to extract internationalized messages from source code to POT file(s), - msginit - may be optionally used to initialize PO + msginit - may be optionally used to initialize PO files, - msgmerge - to update PO files, that already contain + msgmerge - to update PO files, that already contain translated messages, - msgfmt - to compile textual PO file to binary + msgfmt - to compile textual PO file to binary installable MO file. - -When you enable gettext, it internally loads all abovementioned tools, + +When you enable gettext, it internally loads all abovementioned tools, so you're encouraged to see their individual documentation. - + Each of the above tools provides its own builder(s) which may be used to perform particular activities related to software internationalization. You may be however interested in top-level builder -Translate described few paragraphs later. +Translate described few paragraphs later. - -To use gettext tools add 'gettext' tool to your + +To use gettext tools add 'gettext' tool to your environment: - + env = Environment( tools = ['default', 'gettext'] ) gfortran - + + Sets construction variables for the GNU F95/F2003 GNU compiler. -Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. gnulink - + + Set construction variables for GNU linker/loader. -Sets: &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULESONAME;, &cv-link-_SHLIBSONAME;. +Sets: &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLIBVERSIONFLAGS;, &cv-link-SHLINKFLAGS;, &cv-link-_LDMODULESONAME;, &cv-link-_SHLIBSONAME;. gs - + + This Tool sets the required construction variables for working with the Ghostscript command. It also registers an appropriate Action -with the PDF Builder (PDF), such that the conversion from +with the PDF Builder (PDF), such that the conversion from PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain. -Finally, it adds an explicit Ghostscript Builder (Gs) to the +Finally, it adds an explicit Ghostscript Builder (Gs) to the environment. -Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. +Sets: &cv-link-GS;, &cv-link-GSCOM;, &cv-link-GSFLAGS;.Uses: &cv-link-GSCOMSTR;. hpc++ - + + Set construction variables for the compilers aCC on HP/UX systems. hpcc - + + Set construction variables for the aCC on HP/UX systems. -Calls the cXX tool for additional variables. +Calls the cXX tool for additional variables. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXXFLAGS;. hplink - + + Sets construction variables for the linker on HP/UX systems. -Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINKFLAGS;. icc - + + Sets construction variables for the icc compiler on OS/2 systems. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;.Uses: &cv-link-CCFLAGS;, &cv-link-CFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;.Uses: &cv-link-CCFLAGS;, &cv-link-CFLAGS;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. icl - + + Sets construction variables for the Intel C/C++ compiler. -Calls the intelc Tool module to set its variables. +Calls the intelc Tool module to set its variables. ifl - + + Sets construction variables for the Intel Fortran compiler. -Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;. +Sets: &cv-link-FORTRAN;, &cv-link-FORTRANCOM;, &cv-link-FORTRANPPCOM;, &cv-link-SHFORTRANCOM;, &cv-link-SHFORTRANPPCOM;.Uses: &cv-link-CPPFLAGS;, &cv-link-FORTRANFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_FORTRANINCFLAGS;. ifort - + + Sets construction variables for newer versions of the Intel Fortran compiler for Linux. -Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-F90;, &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. ilink - + + Sets construction variables for the ilink linker on OS/2 systems. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. ilink32 - + + Sets construction variables for the Borland ilink32 linker. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;. install - + + Sets construction variables for file and directory installation. -Sets: &cv-link-INSTALL;, &cv-link-INSTALLSTR;. +Sets: &cv-link-INSTALL;, &cv-link-INSTALLSTR;. intelc - + + Sets construction variables for the Intel C/C++ compiler (Linux and Windows, version 7 and later). -Calls the gcc or msvc +Calls the gcc or msvc (on Linux and Windows, respectively) to set underlying variables. -Sets: &cv-link-AR;, &cv-link-CC;, &cv-link-CXX;, &cv-link-INTEL_C_COMPILER_VERSION;, &cv-link-LINK;. +Sets: &cv-link-AR;, &cv-link-CC;, &cv-link-CXX;, &cv-link-INTEL_C_COMPILER_VERSION;, &cv-link-LINK;. jar - -Sets construction variables for the jar utility. + + +Sets construction variables for the jar utility. -Sets: &cv-link-JAR;, &cv-link-JARCOM;, &cv-link-JARFLAGS;, &cv-link-JARSUFFIX;.Uses: &cv-link-JARCOMSTR;. +Sets: &cv-link-JAR;, &cv-link-JARCOM;, &cv-link-JARFLAGS;, &cv-link-JARSUFFIX;.Uses: &cv-link-JARCOMSTR;. javac - - Sets construction variables for the javac compiler. + + + Sets construction variables for the javac compiler. - Sets: &cv-link-JAVABOOTCLASSPATH;, &cv-link-JAVAC;, &cv-link-JAVACCOM;, &cv-link-JAVACFLAGS;, &cv-link-JAVACLASSPATH;, &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAINCLUDES;, &cv-link-JAVASOURCEPATH;, &cv-link-JAVASUFFIX;.Uses: &cv-link-JAVACCOMSTR;. + Sets: &cv-link-JAVABOOTCLASSPATH;, &cv-link-JAVAC;, &cv-link-JAVACCOM;, &cv-link-JAVACFLAGS;, &cv-link-JAVACLASSPATH;, &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAINCLUDES;, &cv-link-JAVASOURCEPATH;, &cv-link-JAVASUFFIX;.Uses: &cv-link-JAVACCOMSTR;. javah - -Sets construction variables for the javah tool. + + +Sets construction variables for the javah tool. -Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAH;, &cv-link-JAVAHCOM;, &cv-link-JAVAHFLAGS;.Uses: &cv-link-JAVACLASSPATH;, &cv-link-JAVAHCOMSTR;. +Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-JAVAH;, &cv-link-JAVAHCOM;, &cv-link-JAVAHFLAGS;.Uses: &cv-link-JAVACLASSPATH;, &cv-link-JAVAHCOMSTR;. latex - -Sets construction variables for the latex utility. + + +Sets construction variables for the latex utility. -Sets: &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;.Uses: &cv-link-LATEXCOMSTR;. +Sets: &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;.Uses: &cv-link-LATEXCOMSTR;. ldc - + + Sets construction variables for the D language compiler LDC2. -Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. +Sets: &cv-link-DC;, &cv-link-DCOM;, &cv-link-DDEBUG;, &cv-link-DDEBUGPREFIX;, &cv-link-DDEBUGSUFFIX;, &cv-link-DFILESUFFIX;, &cv-link-DFLAGPREFIX;, &cv-link-DFLAGS;, &cv-link-DFLAGSUFFIX;, &cv-link-DINCPREFIX;, &cv-link-DINCSUFFIX;, &cv-link-DLIB;, &cv-link-DLIBCOM;, &cv-link-DLIBDIRPREFIX;, &cv-link-DLIBDIRSUFFIX;, &cv-link-DLIBFLAGPREFIX;, &cv-link-DLIBFLAGSUFFIX;, &cv-link-DLIBLINKPREFIX;, &cv-link-DLIBLINKSUFFIX;, &cv-link-DLINK;, &cv-link-DLINKCOM;, &cv-link-DLINKFLAGPREFIX;, &cv-link-DLINKFLAGS;, &cv-link-DLINKFLAGSUFFIX;, &cv-link-DPATH;, &cv-link-DRPATHPREFIX;, &cv-link-DRPATHSUFFIX;, &cv-link-DShLibSonameGenerator;, &cv-link-DVERPREFIX;, &cv-link-DVERSIONS;, &cv-link-DVERSUFFIX;, &cv-link-SHDC;, &cv-link-SHDCOM;, &cv-link-SHDLIBVERSION;, &cv-link-SHDLIBVERSIONFLAGS;, &cv-link-SHDLINK;, &cv-link-SHDLINKCOM;, &cv-link-SHDLINKFLAGS;. lex - -Sets construction variables for the lex lexical analyser. + + +Sets construction variables for the lex lexical analyser. -Sets: &cv-link-LEX;, &cv-link-LEXCOM;, &cv-link-LEXFLAGS;, &cv-link-LEXUNISTD;.Uses: &cv-link-LEXCOMSTR;. +Sets: &cv-link-LEX;, &cv-link-LEXCOM;, &cv-link-LEXFLAGS;, &cv-link-LEXUNISTD;.Uses: &cv-link-LEXCOMSTR;. link - + + Sets construction variables for generic POSIX linkers. -Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. linkloc - + + Sets construction variables for the LinkLoc linker for the Phar Lap ETS embedded operating system. -Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. m4 - -Sets construction variables for the m4 macro processor. + + +Sets construction variables for the m4 macro processor. -Sets: &cv-link-M4;, &cv-link-M4COM;, &cv-link-M4FLAGS;.Uses: &cv-link-M4COMSTR;. +Sets: &cv-link-M4;, &cv-link-M4COM;, &cv-link-M4FLAGS;.Uses: &cv-link-M4COMSTR;. masm - + + Sets construction variables for the Microsoft assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;, &cv-link-CPPFLAGS;, &cv-link-_CPPDEFFLAGS;, &cv-link-_CPPINCFLAGS;. midl - + + Sets construction variables for the Microsoft IDL compiler. -Sets: &cv-link-MIDL;, &cv-link-MIDLCOM;, &cv-link-MIDLFLAGS;.Uses: &cv-link-MIDLCOMSTR;. +Sets: &cv-link-MIDL;, &cv-link-MIDLCOM;, &cv-link-MIDLFLAGS;.Uses: &cv-link-MIDLCOMSTR;. mingw - + + Sets construction variables for MinGW (Minimal Gnu on Windows). -Sets: &cv-link-AS;, &cv-link-CC;, &cv-link-CXX;, &cv-link-LDMODULECOM;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-RCINCFLAGS;, &cv-link-RCINCPREFIX;, &cv-link-RCINCSUFFIX;, &cv-link-SHCCFLAGS;, &cv-link-SHCXXFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;.Uses: &cv-link-RCCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-AS;, &cv-link-CC;, &cv-link-CXX;, &cv-link-LDMODULECOM;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-OBJSUFFIX;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-RCINCFLAGS;, &cv-link-RCINCPREFIX;, &cv-link-RCINCSUFFIX;, &cv-link-SHCCFLAGS;, &cv-link-SHCXXFLAGS;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-SHOBJSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;.Uses: &cv-link-RCCOMSTR;, &cv-link-SHLINKCOMSTR;. msgfmt - -This scons tool is a part of scons gettext toolset. It provides scons + + +This scons tool is a part of scons gettext toolset. It provides scons interface to msgfmt(1) command, which generates binary message catalog (MO) from a textual translation description (PO). -Sets: &cv-link-MOSUFFIX;, &cv-link-MSGFMT;, &cv-link-MSGFMTCOM;, &cv-link-MSGFMTCOMSTR;, &cv-link-MSGFMTFLAGS;, &cv-link-POSUFFIX;.Uses: &cv-link-LINGUAS_FILE;. +Sets: &cv-link-MOSUFFIX;, &cv-link-MSGFMT;, &cv-link-MSGFMTCOM;, &cv-link-MSGFMTCOMSTR;, &cv-link-MSGFMTFLAGS;, &cv-link-POSUFFIX;.Uses: &cv-link-LINGUAS_FILE;. msginit - -This scons tool is a part of scons gettext toolset. It provides + + +This scons tool is a part of scons gettext toolset. It provides scons interface to msginit(1) program, which creates new PO file, initializing the meta information with values from user's environment (or options). -Sets: &cv-link-MSGINIT;, &cv-link-MSGINITCOM;, &cv-link-MSGINITCOMSTR;, &cv-link-MSGINITFLAGS;, &cv-link-POAUTOINIT;, &cv-link-POCREATE_ALIAS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-_MSGINITLOCALE;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. +Sets: &cv-link-MSGINIT;, &cv-link-MSGINITCOM;, &cv-link-MSGINITCOMSTR;, &cv-link-MSGINITFLAGS;, &cv-link-POAUTOINIT;, &cv-link-POCREATE_ALIAS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-_MSGINITLOCALE;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. msgmerge - -This scons tool is a part of scons gettext toolset. It provides + + +This scons tool is a part of scons gettext toolset. It provides scons interface to msgmerge(1) command, which merges two Uniform style .po files together. -Sets: &cv-link-MSGMERGE;, &cv-link-MSGMERGECOM;, &cv-link-MSGMERGECOMSTR;, &cv-link-MSGMERGEFLAGS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-POUPDATE_ALIAS;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. +Sets: &cv-link-MSGMERGE;, &cv-link-MSGMERGECOM;, &cv-link-MSGMERGECOMSTR;, &cv-link-MSGMERGEFLAGS;, &cv-link-POSUFFIX;, &cv-link-POTSUFFIX;, &cv-link-POUPDATE_ALIAS;.Uses: &cv-link-LINGUAS_FILE;, &cv-link-POAUTOINIT;, &cv-link-POTDOMAIN;. mslib - + + Sets construction variables for the Microsoft mslib library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. mslink - + + Sets construction variables for the Microsoft linker. -Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-REGSVR;, &cv-link-REGSVRCOM;, &cv-link-REGSVRFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-WIN32DEFPREFIX;, &cv-link-WIN32DEFSUFFIX;, &cv-link-WIN32EXPPREFIX;, &cv-link-WIN32EXPSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;, &cv-link-WINDOWSEXPPREFIX;, &cv-link-WINDOWSEXPSUFFIX;, &cv-link-WINDOWSPROGMANIFESTPREFIX;, &cv-link-WINDOWSPROGMANIFESTSUFFIX;, &cv-link-WINDOWSSHLIBMANIFESTPREFIX;, &cv-link-WINDOWSSHLIBMANIFESTSUFFIX;, &cv-link-WINDOWS_INSERT_DEF;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-REGSVRCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-REGSVR;, &cv-link-REGSVRCOM;, &cv-link-REGSVRFLAGS;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-WIN32DEFPREFIX;, &cv-link-WIN32DEFSUFFIX;, &cv-link-WIN32EXPPREFIX;, &cv-link-WIN32EXPSUFFIX;, &cv-link-WINDOWSDEFPREFIX;, &cv-link-WINDOWSDEFSUFFIX;, &cv-link-WINDOWSEXPPREFIX;, &cv-link-WINDOWSEXPSUFFIX;, &cv-link-WINDOWSPROGMANIFESTPREFIX;, &cv-link-WINDOWSPROGMANIFESTSUFFIX;, &cv-link-WINDOWSSHLIBMANIFESTPREFIX;, &cv-link-WINDOWSSHLIBMANIFESTSUFFIX;, &cv-link-WINDOWS_INSERT_DEF;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-REGSVRCOMSTR;, &cv-link-SHLINKCOMSTR;. mssdk - + + Sets variables for Microsoft Platform SDK and/or Windows SDK. Note that unlike most other Tool modules, mssdk does not set construction variables, but sets the environment variables -in the environment SCons uses to execute +in the environment SCons uses to execute the Microsoft toolchain: %INCLUDE%, %LIB%, %LIBPATH% and %PATH%. -Uses: &cv-link-MSSDK_DIR;, &cv-link-MSSDK_VERSION;, &cv-link-MSVS_VERSION;. +Uses: &cv-link-MSSDK_DIR;, &cv-link-MSSDK_VERSION;, &cv-link-MSVS_VERSION;. msvc - + + Sets construction variables for the Microsoft Visual C/C++ compiler. -Sets: &cv-link-BUILDERS;, &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CCPCHFLAGS;, &cv-link-CCPDBFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJPREFIX;, &cv-link-OBJSUFFIX;, &cv-link-PCHCOM;, &cv-link-PCHPDBFLAGS;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-PCH;, &cv-link-PCHSTOP;, &cv-link-PDB;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. +Sets: &cv-link-BUILDERS;, &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CCPCHFLAGS;, &cv-link-CCPDBFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-CXXFLAGS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-OBJPREFIX;, &cv-link-OBJSUFFIX;, &cv-link-PCHCOM;, &cv-link-PCHPDBFLAGS;, &cv-link-RC;, &cv-link-RCCOM;, &cv-link-RCFLAGS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-PCH;, &cv-link-PCHSTOP;, &cv-link-PDB;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. msvs - Sets construction variables for Microsoft Visual Studio. - Sets: &cv-link-MSVSBUILDCOM;, &cv-link-MSVSCLEANCOM;, &cv-link-MSVSENCODING;, &cv-link-MSVSPROJECTCOM;, &cv-link-MSVSREBUILDCOM;, &cv-link-MSVSSCONS;, &cv-link-MSVSSCONSCOM;, &cv-link-MSVSSCONSCRIPT;, &cv-link-MSVSSCONSFLAGS;, &cv-link-MSVSSOLUTIONCOM;. + + Sets construction variables for Microsoft Visual Studio. + Sets: &cv-link-MSVSBUILDCOM;, &cv-link-MSVSCLEANCOM;, &cv-link-MSVSENCODING;, &cv-link-MSVSPROJECTCOM;, &cv-link-MSVSREBUILDCOM;, &cv-link-MSVSSCONS;, &cv-link-MSVSSCONSCOM;, &cv-link-MSVSSCONSCRIPT;, &cv-link-MSVSSCONSFLAGS;, &cv-link-MSVSSOLUTIONCOM;. mwcc - + + Sets construction variables for the Metrowerks CodeWarrior compiler. -Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-MWCW_VERSION;, &cv-link-MWCW_VERSIONS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. +Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CFILESUFFIX;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-CXX;, &cv-link-CXXCOM;, &cv-link-CXXFILESUFFIX;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-MWCW_VERSION;, &cv-link-MWCW_VERSIONS;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHCXX;, &cv-link-SHCXXCOM;, &cv-link-SHCXXFLAGS;.Uses: &cv-link-CCCOMSTR;, &cv-link-CXXCOMSTR;, &cv-link-SHCCCOMSTR;, &cv-link-SHCXXCOMSTR;. mwld - + + Sets construction variables for the Metrowerks CodeWarrior linker. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;. nasm - + + Sets construction variables for the nasm Netwide Assembler. -Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. +Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. packaging - + + A framework for building binary and source packages. Packaging - -Sets construction variables for the Package Builder. + + +Sets construction variables for the Package Builder. pdf - + + Sets construction variables for the Portable Document Format builder. -Sets: &cv-link-PDFPREFIX;, &cv-link-PDFSUFFIX;. +Sets: &cv-link-PDFPREFIX;, &cv-link-PDFSUFFIX;. pdflatex - -Sets construction variables for the pdflatex utility. + + +Sets construction variables for the pdflatex utility. -Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;. +Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;. pdftex - -Sets construction variables for the pdftex utility. + + +Sets construction variables for the pdftex utility. -Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;. +Sets: &cv-link-LATEXRETRIES;, &cv-link-PDFLATEX;, &cv-link-PDFLATEXCOM;, &cv-link-PDFLATEXFLAGS;, &cv-link-PDFTEX;, &cv-link-PDFTEXCOM;, &cv-link-PDFTEXFLAGS;.Uses: &cv-link-PDFLATEXCOMSTR;, &cv-link-PDFTEXCOMSTR;. qt - + + Sets construction variables for building Qt applications. -Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;. +Sets: &cv-link-QTDIR;, &cv-link-QT_AUTOSCAN;, &cv-link-QT_BINPATH;, &cv-link-QT_CPPPATH;, &cv-link-QT_LIB;, &cv-link-QT_LIBPATH;, &cv-link-QT_MOC;, &cv-link-QT_MOCCXXPREFIX;, &cv-link-QT_MOCCXXSUFFIX;, &cv-link-QT_MOCFROMCXXCOM;, &cv-link-QT_MOCFROMCXXFLAGS;, &cv-link-QT_MOCFROMHCOM;, &cv-link-QT_MOCFROMHFLAGS;, &cv-link-QT_MOCHPREFIX;, &cv-link-QT_MOCHSUFFIX;, &cv-link-QT_UIC;, &cv-link-QT_UICCOM;, &cv-link-QT_UICDECLFLAGS;, &cv-link-QT_UICDECLPREFIX;, &cv-link-QT_UICDECLSUFFIX;, &cv-link-QT_UICIMPLFLAGS;, &cv-link-QT_UICIMPLPREFIX;, &cv-link-QT_UICIMPLSUFFIX;, &cv-link-QT_UISUFFIX;. rmic - -Sets construction variables for the rmic utility. + + +Sets construction variables for the rmic utility. -Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-RMIC;, &cv-link-RMICCOM;, &cv-link-RMICFLAGS;.Uses: &cv-link-RMICCOMSTR;. +Sets: &cv-link-JAVACLASSSUFFIX;, &cv-link-RMIC;, &cv-link-RMICCOM;, &cv-link-RMICFLAGS;.Uses: &cv-link-RMICCOMSTR;. rpcgen - + + Sets construction variables for building with RPCGEN. -Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;. +Sets: &cv-link-RPCGEN;, &cv-link-RPCGENCLIENTFLAGS;, &cv-link-RPCGENFLAGS;, &cv-link-RPCGENHEADERFLAGS;, &cv-link-RPCGENSERVICEFLAGS;, &cv-link-RPCGENXDRFLAGS;. sgiar - + + Sets construction variables for the SGI library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOMSTR;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-ARCOMSTR;, &cv-link-SHLINKCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOMSTR;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKFLAGS;.Uses: &cv-link-ARCOMSTR;, &cv-link-SHLINKCOMSTR;. sgic++ - + + Sets construction variables for the SGI C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXFLAGS;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXFLAGS;, &cv-link-SHCXX;, &cv-link-SHOBJSUFFIX;. sgicc - + + Sets construction variables for the SGI C compiler. -Sets: &cv-link-CXX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-SHOBJSUFFIX;. sgilink - + + Sets construction variables for the SGI linker. -Sets: &cv-link-LINK;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-LINK;, &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. sunar - + + Sets construction variables for the Sun library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. sunc++ - + + Sets construction variables for the Sun C++ compiler. -Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-CXXVERSION;, &cv-link-SHCXX;, &cv-link-SHCXXFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. suncc - + + Sets construction variables for the Sun C compiler. -Sets: &cv-link-CXX;, &cv-link-SHCCFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. +Sets: &cv-link-CXX;, &cv-link-SHCCFLAGS;, &cv-link-SHOBJPREFIX;, &cv-link-SHOBJSUFFIX;. sunf77 - -Set construction variables for the Sun f77 Fortran compiler. + + +Set construction variables for the Sun f77 Fortran compiler. -Sets: &cv-link-F77;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F77;, &cv-link-FORTRAN;, &cv-link-SHF77;, &cv-link-SHF77FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf90 - -Set construction variables for the Sun f90 Fortran compiler. + + +Set construction variables for the Sun f90 Fortran compiler. -Sets: &cv-link-F90;, &cv-link-FORTRAN;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F90;, &cv-link-FORTRAN;, &cv-link-SHF90;, &cv-link-SHF90FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunf95 - -Set construction variables for the Sun f95 Fortran compiler. + + +Set construction variables for the Sun f95 Fortran compiler. -Sets: &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. +Sets: &cv-link-F95;, &cv-link-FORTRAN;, &cv-link-SHF95;, &cv-link-SHF95FLAGS;, &cv-link-SHFORTRAN;, &cv-link-SHFORTRANFLAGS;. sunlink - + + Sets construction variables for the Sun linker. -Sets: &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. +Sets: &cv-link-RPATHPREFIX;, &cv-link-RPATHSUFFIX;, &cv-link-SHLINKFLAGS;. swig - + + Sets construction variables for the SWIG interface generator. -Sets: &cv-link-SWIG;, &cv-link-SWIGCFILESUFFIX;, &cv-link-SWIGCOM;, &cv-link-SWIGCXXFILESUFFIX;, &cv-link-SWIGDIRECTORSUFFIX;, &cv-link-SWIGFLAGS;, &cv-link-SWIGINCPREFIX;, &cv-link-SWIGINCSUFFIX;, &cv-link-SWIGPATH;, &cv-link-SWIGVERSION;, &cv-link-_SWIGINCFLAGS;.Uses: &cv-link-SWIGCOMSTR;. +Sets: &cv-link-SWIG;, &cv-link-SWIGCFILESUFFIX;, &cv-link-SWIGCOM;, &cv-link-SWIGCXXFILESUFFIX;, &cv-link-SWIGDIRECTORSUFFIX;, &cv-link-SWIGFLAGS;, &cv-link-SWIGINCPREFIX;, &cv-link-SWIGINCSUFFIX;, &cv-link-SWIGPATH;, &cv-link-SWIGVERSION;, &cv-link-_SWIGINCFLAGS;.Uses: &cv-link-SWIGCOMSTR;. tar - -Sets construction variables for the tar archiver. + + +Sets construction variables for the tar archiver. -Sets: &cv-link-TAR;, &cv-link-TARCOM;, &cv-link-TARFLAGS;, &cv-link-TARSUFFIX;.Uses: &cv-link-TARCOMSTR;. +Sets: &cv-link-TAR;, &cv-link-TARCOM;, &cv-link-TARFLAGS;, &cv-link-TARSUFFIX;.Uses: &cv-link-TARCOMSTR;. tex - + + Sets construction variables for the TeX formatter and typesetter. -Sets: &cv-link-BIBTEX;, &cv-link-BIBTEXCOM;, &cv-link-BIBTEXFLAGS;, &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;, &cv-link-MAKEINDEX;, &cv-link-MAKEINDEXCOM;, &cv-link-MAKEINDEXFLAGS;, &cv-link-TEX;, &cv-link-TEXCOM;, &cv-link-TEXFLAGS;.Uses: &cv-link-BIBTEXCOMSTR;, &cv-link-LATEXCOMSTR;, &cv-link-MAKEINDEXCOMSTR;, &cv-link-TEXCOMSTR;. +Sets: &cv-link-BIBTEX;, &cv-link-BIBTEXCOM;, &cv-link-BIBTEXFLAGS;, &cv-link-LATEX;, &cv-link-LATEXCOM;, &cv-link-LATEXFLAGS;, &cv-link-MAKEINDEX;, &cv-link-MAKEINDEXCOM;, &cv-link-MAKEINDEXFLAGS;, &cv-link-TEX;, &cv-link-TEXCOM;, &cv-link-TEXFLAGS;.Uses: &cv-link-BIBTEXCOMSTR;, &cv-link-LATEXCOMSTR;, &cv-link-MAKEINDEXCOMSTR;, &cv-link-TEXCOMSTR;. textfile - -Set construction variables for the Textfile and Substfile builders. + + +Set construction variables for the Textfile and Substfile builders. -Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.Uses: &cv-link-SUBST_DICT;. +Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.Uses: &cv-link-SUBST_DICT;. tlib - + + Sets construction variables for the Borlan tib library archiver. -Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. +Sets: &cv-link-AR;, &cv-link-ARCOM;, &cv-link-ARFLAGS;, &cv-link-LIBPREFIX;, &cv-link-LIBSUFFIX;.Uses: &cv-link-ARCOMSTR;. xgettext - -This scons tool is a part of scons gettext toolset. It provides + + +This scons tool is a part of scons gettext toolset. It provides scons interface to xgettext(1) program, which extracts internationalized messages from source code. The tool -provides POTUpdate builder to make PO +provides POTUpdate builder to make PO Template files. -Sets: &cv-link-POTSUFFIX;, &cv-link-POTUPDATE_ALIAS;, &cv-link-XGETTEXTCOM;, &cv-link-XGETTEXTCOMSTR;, &cv-link-XGETTEXTFLAGS;, &cv-link-XGETTEXTFROM;, &cv-link-XGETTEXTFROMPREFIX;, &cv-link-XGETTEXTFROMSUFFIX;, &cv-link-XGETTEXTPATH;, &cv-link-XGETTEXTPATHPREFIX;, &cv-link-XGETTEXTPATHSUFFIX;, &cv-link-_XGETTEXTDOMAIN;, &cv-link-_XGETTEXTFROMFLAGS;, &cv-link-_XGETTEXTPATHFLAGS;.Uses: &cv-link-POTDOMAIN;. +Sets: &cv-link-POTSUFFIX;, &cv-link-POTUPDATE_ALIAS;, &cv-link-XGETTEXTCOM;, &cv-link-XGETTEXTCOMSTR;, &cv-link-XGETTEXTFLAGS;, &cv-link-XGETTEXTFROM;, &cv-link-XGETTEXTFROMPREFIX;, &cv-link-XGETTEXTFROMSUFFIX;, &cv-link-XGETTEXTPATH;, &cv-link-XGETTEXTPATHPREFIX;, &cv-link-XGETTEXTPATHSUFFIX;, &cv-link-_XGETTEXTDOMAIN;, &cv-link-_XGETTEXTFROMFLAGS;, &cv-link-_XGETTEXTPATHFLAGS;.Uses: &cv-link-POTDOMAIN;. yacc - -Sets construction variables for the yacc parse generator. + + +Sets construction variables for the yacc parse generator. -Sets: &cv-link-YACC;, &cv-link-YACCCOM;, &cv-link-YACCFLAGS;, &cv-link-YACCHFILESUFFIX;, &cv-link-YACCHXXFILESUFFIX;, &cv-link-YACCVCGFILESUFFIX;.Uses: &cv-link-YACCCOMSTR;. +Sets: &cv-link-YACC;, &cv-link-YACCCOM;, &cv-link-YACCFLAGS;, &cv-link-YACCHFILESUFFIX;, &cv-link-YACCHXXFILESUFFIX;, &cv-link-YACCVCGFILESUFFIX;.Uses: &cv-link-YACCCOMSTR;. zip - -Sets construction variables for the zip archiver. + + +Sets construction variables for the zip archiver. -Sets: &cv-link-ZIP;, &cv-link-ZIPCOM;, &cv-link-ZIPCOMPRESSION;, &cv-link-ZIPFLAGS;, &cv-link-ZIPSUFFIX;.Uses: &cv-link-ZIPCOMSTR;. +Sets: &cv-link-ZIP;, &cv-link-ZIPCOM;, &cv-link-ZIPCOMPRESSION;, &cv-link-ZIPFLAGS;, &cv-link-ZIPSUFFIX;.Uses: &cv-link-ZIPCOMSTR;. diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 9b4173a..ad64b70 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -1,4 +1,4 @@ - + %scons; @@ -12,115 +12,125 @@ %variables-mod; ]> - + __LDMODULEVERSIONFLAGS - -This construction variable automatically introduces $_LDMODULEVERSIONFLAGS -if $LDMODULEVERSION is set. Othervise it evaluates to an empty string. + + +This construction variable automatically introduces $_LDMODULEVERSIONFLAGS +if $LDMODULEVERSION is set. Othervise it evaluates to an empty string. __SHLIBVERSIONFLAGS - -This construction variable automatically introduces $_SHLIBVERSIONFLAGS -if $SHLIBVERSION is set. Othervise it evaluates to an empty string. + + +This construction variable automatically introduces $_SHLIBVERSIONFLAGS +if $SHLIBVERSION is set. Othervise it evaluates to an empty string. _APPLELINK_COMPATIBILITY_VERSION - + + A macro (by default a generator function) used to create the linker flags to specify apple's linker's -compatibility_version flag. - The default generator uses $APPLELINK_COMPATIBILITY_VERSION - and $APPLELINK_NO_COMPATIBILITY_VERSION and $SHLIBVERSION + The default generator uses $APPLELINK_COMPATIBILITY_VERSION + and $APPLELINK_NO_COMPATIBILITY_VERSION and $SHLIBVERSION to determine the correct flag. APPLELINK_COMPATIBILITY_VERSION - + + On Mac OS X this is used to set the linker flag: -compatibility_version - + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and - 255, Z can be omitted or between 1 and 255. This value will be derived from $SHLIBVERSION if + 255, Z can be omitted or between 1 and 255. This value will be derived from $SHLIBVERSION if not specified. The lowest digit will be dropped and replaced by a 0. - - If the $APPLELINK_NO_COMPATIBILITY_VERSION is set then no -compatibility_version will be + + If the $APPLELINK_NO_COMPATIBILITY_VERSION is set then no -compatibility_version will be output. - See MacOS's ld manpage for more details + See MacOS's ld manpage for more details _APPLELINK_CURRENT_VERSION - + + A macro (by default a generator function) used to create the linker flags to specify apple's linker's - -current_version flag. The default generator uses $APPLELINK_CURRENT_VERSION and - $APPLELINK_NO_CURRENT_VERSION and $SHLIBVERSION to determine the correct flag. + -current_version flag. The default generator uses $APPLELINK_CURRENT_VERSION and + $APPLELINK_NO_CURRENT_VERSION and $SHLIBVERSION to determine the correct flag. APPLELINK_CURRENT_VERSION - + + On Mac OS X this is used to set the linker flag: -current_version - + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and - 255, Z can be omitted or between 1 and 255. This value will be set to $SHLIBVERSION if not + 255, Z can be omitted or between 1 and 255. This value will be set to $SHLIBVERSION if not specified. - - If the $APPLELINK_NO_CURRENT_VERSION is set then no -current_version will be + + If the $APPLELINK_NO_CURRENT_VERSION is set then no -current_version will be output. - See MacOS's ld manpage for more details + See MacOS's ld manpage for more details APPLELINK_NO_COMPATIBILITY_VERSION - + + Set this to any True (1|True|non-empty string) value to disable adding -compatibility_version flag when generating versioned shared libraries. - - This overrides $APPLELINK_COMPATIBILITY_VERSION. + + This overrides $APPLELINK_COMPATIBILITY_VERSION. APPLELINK_NO_CURRENT_VERSION - + + Set this to any True (1|True|non-empty string) value to disable adding -current_version flag when generating versioned shared libraries. - - This overrides $APPLELINK_CURRENT_VERSION. + + This overrides $APPLELINK_CURRENT_VERSION. AR - + + The static library archiver. ARCHITECTURE - + + Specifies the system architecture for which the package is being built. The default is the system architecture @@ -137,41 +147,46 @@ as well as forming part of the name of a generated RPM package file. ARCOM - + + The command line used to generate a static library from object files. ARCOMSTR - + + The string displayed when an object file is generated from an assembly-language source file. -If this is not set, then $ARCOM (the command line) is displayed. +If this is not set, then $ARCOM (the command line) is displayed. - + env = Environment(ARCOMSTR = "Archiving $TARGET") ARFLAGS - + + General options passed to the static library archiver. AS - + + The assembler. ASCOM - + + The command line used to generate an object file from an assembly-language source file. @@ -179,63 +194,69 @@ from an assembly-language source file. ASCOMSTR - + + The string displayed when an object file is generated from an assembly-language source file. -If this is not set, then $ASCOM (the command line) is displayed. +If this is not set, then $ASCOM (the command line) is displayed. - + env = Environment(ASCOMSTR = "Assembling $TARGET") ASFLAGS - + + General options passed to the assembler. ASPPCOM - + + The command line used to assemble an assembly-language source file into an object file after first running the file through the C preprocessor. Any options specified -in the $ASFLAGS and $CPPFLAGS construction variables +in the $ASFLAGS and $CPPFLAGS construction variables are included on this command line. ASPPCOMSTR - + + The string displayed when an object file is generated from an assembly-language source file after first running the file through the C preprocessor. -If this is not set, then $ASPPCOM (the command line) is displayed. +If this is not set, then $ASPPCOM (the command line) is displayed. - + env = Environment(ASPPCOMSTR = "Assembling $TARGET") ASPPFLAGS - + + General options when an assembling an assembly-language source file into an object file after first running the file through the C preprocessor. -The default is to use the value of $ASFLAGS. +The default is to use the value of $ASFLAGS. BIBTEX - + + The bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -243,7 +264,8 @@ LaTeX structured formatter and typesetter. BIBTEXCOM - + + The command line used to call the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -252,20 +274,22 @@ typesetter. BIBTEXCOMSTR - + + The string displayed when generating a bibliography for TeX or LaTeX. -If this is not set, then $BIBTEXCOM (the command line) is displayed. +If this is not set, then $BIBTEXCOM (the command line) is displayed. - + env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET") BIBTEXFLAGS - + + General options passed to the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -273,7 +297,8 @@ and typesetter and the LaTeX structured formatter and typesetter. BUILDERS - + + A dictionary mapping the names of the builders available through this environment to underlying Builder objects. @@ -284,26 +309,26 @@ If you initialize this variable when an Environment is created: - + env = Environment(BUILDERS = {'NewBuilder' : foo}) - + the default Builders will no longer be available. To use a new Builder object in addition to the default Builders, add your new Builder object like this: - + env = Environment() env.Append(BUILDERS = {'NewBuilder' : foo}) - + or this: - + env = Environment() env['BUILDERS']['NewBuilder'] = foo @@ -311,64 +336,70 @@ env['BUILDERS']['NewBuilder'] = foo CC - + + The C compiler. CCCOM - + + The command line used to compile a C source file to a (static) object -file. Any options specified in the $CFLAGS, $CCFLAGS and -$CPPFLAGS construction variables are included on this command +file. Any options specified in the $CFLAGS, $CCFLAGS and +$CPPFLAGS construction variables are included on this command line. CCCOMSTR - + + The string displayed when a C source file is compiled to a (static) object file. -If this is not set, then $CCCOM (the command line) is displayed. +If this is not set, then $CCCOM (the command line) is displayed. - + env = Environment(CCCOMSTR = "Compiling static object $TARGET") CCFLAGS - + + General options that are passed to the C and C++ compilers. CCPCHFLAGS - + + Options added to the compiler command line to support building with precompiled headers. The default value expands expands to the appropriate Microsoft Visual C++ command-line options -when the $PCH construction variable is set. +when the $PCH construction variable is set. CCPDBFLAGS - + + Options added to the compiler command line to support storing debugging information in a Microsoft Visual C++ PDB file. The default value expands expands to appropriate Microsoft Visual C++ command-line options -when the $PDB construction variable is set. +when the $PDB construction variable is set. - + The Visual C++ compiler option that SCons uses by default to generate PDB information is . This works correctly with parallel () builds @@ -381,30 +412,31 @@ link-time performance, although parallel builds will no longer work. - + You can generate PDB files with the -switch by overriding the default $CCPDBFLAGS variable as follows: +switch by overriding the default $CCPDBFLAGS variable as follows: - + env['CCPDBFLAGS'] = ['${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}'] - + An alternative would be to use the to put the debugging information in a separate .pdb file for each object file by overriding -the $CCPDBFLAGS variable as follows: +the $CCPDBFLAGS variable as follows: - + env['CCPDBFLAGS'] = '/Zi /Fd${TARGET}.pdb' CCVERSION - + + The version number of the C compiler. This may or may not be set, depending on the specific C compiler being used. @@ -413,7 +445,8 @@ depending on the specific C compiler being used. CFILESUFFIX - + + The suffix for C source files. This is used by the internal CFile builder when generating C files from Lex (.l) or YACC (.y) input files. @@ -430,14 +463,16 @@ as C files. CFLAGS - + + General options that are passed to the C compiler (C only; not C++). CHANGE_SPECFILE - + + A hook for modifying the file that controls the packaging build (the .spec for RPM, the control for Ipkg, @@ -449,7 +484,8 @@ after the SCons template for the file has been written. CHANGED_SOURCES - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -458,7 +494,8 @@ that may not be set or used in a construction environment. CHANGED_TARGETS - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -467,7 +504,8 @@ that may not be set or used in a construction environment. CHANGELOG - + + The name of a file containing the change log text to be included in the package. This is included as the @@ -479,8 +517,9 @@ section of the RPM _concat - -A function used to produce variables like $_CPPINCFLAGS. It takes + + +A function used to produce variables like $_CPPINCFLAGS. It takes four or five arguments: a prefix to concatenate onto each element, a list of elements, a suffix to concatenate onto each element, an environment @@ -488,14 +527,15 @@ for variable interpolation, and an optional function that will be called to transform the list before concatenation. - + env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)', CONFIGUREDIR - + + The name of the directory in which Configure context test files are written. The default is @@ -509,7 +549,8 @@ file. CONFIGURELOG - + + The name of the Configure context log file. The default is config.log @@ -522,48 +563,50 @@ file. _CPPDEFFLAGS - + + An automatically-generated construction variable containing the C preprocessor command-line options to define values. -The value of $_CPPDEFFLAGS is created +The value of $_CPPDEFFLAGS is created by respectively prepending and appending -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX to the beginning and end -of each definition in $CPPDEFINES. +of each definition in $CPPDEFINES. CPPDEFINES - + + A platform independent specification of C preprocessor definitions. The definitions will be added to command lines through the automatically-generated -$_CPPDEFFLAGS construction variable (see above), +$_CPPDEFFLAGS construction variable (see above), which is constructed according to -the type of value of $CPPDEFINES: +the type of value of $CPPDEFINES: - -If $CPPDEFINES is a string, + +If $CPPDEFINES is a string, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end -of each definition in $CPPDEFINES. +of each definition in $CPPDEFINES. - + # Will add -Dxyz to POSIX compiler command lines, # and /Dxyz to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES='xyz') - -If $CPPDEFINES is a list, + +If $CPPDEFINES is a list, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end of each element in the list. @@ -572,16 +615,16 @@ then the first item is the name being defined and the second item is its value: - + # Will add -DB=2 -DA to POSIX compiler command lines, # and /DB=2 /DA to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES=[('B', 2), 'A']) - -If $CPPDEFINES is a dictionary, + +If $CPPDEFINES is a dictionary, the values of the -$CPPDEFPREFIX and $CPPDEFSUFFIX +$CPPDEFPREFIX and $CPPDEFSUFFIX construction variables will be respectively prepended and appended to the beginning and end of each item from the dictionary. @@ -594,11 +637,11 @@ then the name is defined without an explicit value. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time -scons +scons is run. - + # Will add -DA -DB=2 to POSIX compiler command lines, # and /DA /DB=2 to Microsoft Visual C++ command lines. env = Environment(CPPDEFINES={'B':2, 'A':None}) @@ -607,42 +650,45 @@ env = Environment(CPPDEFINES={'B':2, 'A':None}) CPPDEFPREFIX - + + The prefix used to specify preprocessor definitions on the C compiler command line. This will be prepended to the beginning of each definition -in the $CPPDEFINES construction variable -when the $_CPPDEFFLAGS variable is automatically generated. +in the $CPPDEFINES construction variable +when the $_CPPDEFFLAGS variable is automatically generated. CPPDEFSUFFIX - + + The suffix used to specify preprocessor definitions on the C compiler command line. This will be appended to the end of each definition -in the $CPPDEFINES construction variable -when the $_CPPDEFFLAGS variable is automatically generated. +in the $CPPDEFINES construction variable +when the $_CPPDEFFLAGS variable is automatically generated. CPPFLAGS - + + User-specified C preprocessor options. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files -via the $CCCOM, -$SHCCCOM, -$CXXCOM and -$SHCXXCOM command lines, -but also the $FORTRANPPCOM, -$SHFORTRANPPCOM, -$F77PPCOM and -$SHF77PPCOM command lines +via the $CCCOM, +$SHCCCOM, +$CXXCOM and +$SHCXXCOM command lines, +but also the $FORTRANPPCOM, +$SHFORTRANPPCOM, +$F77PPCOM and +$SHF77PPCOM command lines used to compile a Fortran source file, -and the $ASPPCOM command line +and the $ASPPCOM command line used to assemble an assembly language source file, after first running each file through the C preprocessor. Note that this variable does @@ -650,28 +696,30 @@ Note that this variable does contain (or similar) include search path options -that scons generates automatically from $CPPPATH. -See $_CPPINCFLAGS, below, +that scons generates automatically from $CPPPATH. +See $_CPPINCFLAGS, below, for the variable that expands to those options. _CPPINCFLAGS - + + An automatically-generated construction variable containing the C preprocessor command-line options for specifying directories to be searched for include files. -The value of $_CPPINCFLAGS is created -by respectively prepending and appending $INCPREFIX and $INCSUFFIX +The value of $_CPPINCFLAGS is created +by respectively prepending and appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. CPPPATH - + + The list of directories that the C preprocessor will search for include directories. The C/C++ implicit dependency scanner will search these directories for include files. Don't explicitly put include directory @@ -679,56 +727,57 @@ arguments in CCFLAGS or CXXFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in CPPPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(CPPPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(CPPPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_CPPINCFLAGS +$_CPPINCFLAGS construction variable, which is constructed by respectively prepending and appending the value of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. Any command lines you define that need the CPPPATH directory list should -include $_CPPINCFLAGS: +include $_CPPINCFLAGS: - + env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE") CPPSUFFIXES - + + The list of suffixes of files that will be scanned for C preprocessor implicit dependencies (#include lines). The default list is: - + [".c", ".C", ".cxx", ".cpp", ".c++", ".cc", ".h", ".H", ".hxx", ".hpp", ".hh", ".F", ".fpp", ".FPP", @@ -739,37 +788,41 @@ The default list is: CXX - + + The C++ compiler. CXXCOM - + + The command line used to compile a C++ source file to an object file. -Any options specified in the $CXXFLAGS and -$CPPFLAGS construction variables +Any options specified in the $CXXFLAGS and +$CPPFLAGS construction variables are included on this command line. CXXCOMSTR - + + The string displayed when a C++ source file is compiled to a (static) object file. -If this is not set, then $CXXCOM (the command line) is displayed. +If this is not set, then $CXXCOM (the command line) is displayed. - + env = Environment(CXXCOMSTR = "Compiling static object $TARGET") CXXFILESUFFIX - + + The suffix for C++ source files. This is used by the internal CXXFile builder when generating C++ files from Lex (.ll) or YACC (.yy) input files. @@ -795,18 +848,20 @@ as C++ files. CXXFLAGS - + + General options that are passed to the C++ compiler. -By default, this includes the value of $CCFLAGS, -so that setting $CCFLAGS affects both C and C++ compilation. +By default, this includes the value of $CCFLAGS, +so that setting $CCFLAGS affects both C and C++ compilation. If you want to add C++-specific flags, -you must set or override the value of $CXXFLAGS. +you must set or override the value of $CXXFLAGS. CXXVERSION - + + The version number of the C++ compiler. This may or may not be set, depending on the specific C++ compiler being used. @@ -815,78 +870,94 @@ depending on the specific C++ compiler being used. DC - + + The D compiler to use. - + + The D compiler to use. - + + The D compiler to use. DCOM - + + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. - + + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. - + + The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable + Any options specified in the $DFLAGS construction variable is included on this command line. DDEBUG - + + List of debug tags to enable when compiling. - + + List of debug tags to enable when compiling. - + + List of debug tags to enable when compiling. DDEBUGPREFIX - + + DDEBUGPREFIX. - + + DDEBUGPREFIX. - + + DDEBUGPREFIX. DDEBUGSUFFIX - + + DDEBUGSUFFIX. - + + DDEBUGSUFFIX. - + + DDEBUGSUFFIX. DESCRIPTION - + + A long description of the project being packaged. This is included in the relevant section of the file that controls the packaging build. @@ -895,7 +966,8 @@ of the file that controls the packaging build. DESCRIPTION_lang - + + A language-specific long description for the specified lang. This is used to populate a @@ -907,89 +979,109 @@ section of an RPM DFILESUFFIX - + + DFILESUFFIX. - + + DFILESUFFIX. - + + DFILESUFFIX. DFLAGPREFIX - + + DFLAGPREFIX. - + + DFLAGPREFIX. - + + DFLAGPREFIX. DFLAGS - + + General options that are passed to the D compiler. - + + General options that are passed to the D compiler. - + + General options that are passed to the D compiler. DFLAGSUFFIX - + + DFLAGSUFFIX. - + + DFLAGSUFFIX. - + + DFLAGSUFFIX. DINCPREFIX - + + DINCPREFIX. - + + DINCPREFIX. - + + DINCPREFIX. DINCSUFFIX - + + DLIBFLAGSUFFIX. - + + DLIBFLAGSUFFIX. - + + DLIBFLAGSUFFIX. Dir - + + A function that converts a string into a Dir instance relative to the target being built. - + + A function that converts a string into a Dir instance relative to the target being built. @@ -997,7 +1089,8 @@ into a Dir instance relative to the target being built. Dirs - + + A function that converts a list of strings into a list of Dir instances relative to the target being built. @@ -1005,240 +1098,288 @@ into a list of Dir instances relative to the target being built. DLIB - + + Name of the lib tool to use for D codes. - + + Name of the lib tool to use for D codes. - + + Name of the lib tool to use for D codes. DLIBCOM - + + The command line to use when creating libraries. - + + The command line to use when creating libraries. - + + The command line to use when creating libraries. DLIBDIRPREFIX - + + DLIBLINKPREFIX. - + + DLIBLINKPREFIX. - + + DLIBLINKPREFIX. DLIBDIRSUFFIX - + + DLIBLINKSUFFIX. - + + DLIBLINKSUFFIX. - + + DLIBLINKSUFFIX. DLIBFLAGPREFIX - + + DLIBFLAGPREFIX. - + + DLIBFLAGPREFIX. - + + DLIBFLAGPREFIX. DLIBFLAGSUFFIX - + + DLIBFLAGSUFFIX. - + + DLIBFLAGSUFFIX. - + + DLIBFLAGSUFFIX. DLIBLINKPREFIX - + + DLIBLINKPREFIX. - + + DLIBLINKPREFIX. - + + DLIBLINKPREFIX. DLIBLINKSUFFIX - + + DLIBLINKSUFFIX. - + + DLIBLINKSUFFIX. - + + DLIBLINKSUFFIX. DLINK - + + Name of the linker to use for linking systems including D sources. - + + Name of the linker to use for linking systems including D sources. - + + Name of the linker to use for linking systems including D sources. DLINKCOM - + + The command line to use when linking systems including D sources. - + + The command line to use when linking systems including D sources. - + + The command line to use when linking systems including D sources. DLINKFLAGPREFIX - + + DLINKFLAGPREFIX. - + + DLINKFLAGPREFIX. - + + DLINKFLAGPREFIX. DLINKFLAGS - + + List of linker flags. - + + List of linker flags. - + + List of linker flags. DLINKFLAGSUFFIX - + + DLINKFLAGSUFFIX. - + + DLINKFLAGSUFFIX. - + + DLINKFLAGSUFFIX. DOCBOOK_DEFAULT_XSL_EPUB - -The default XSLT file for the DocbookEpub builder within the + + +The default XSLT file for the DocbookEpub builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTML - -The default XSLT file for the DocbookHtml builder within the + + +The default XSLT file for the DocbookHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLCHUNKED - -The default XSLT file for the DocbookHtmlChunked builder within the + + +The default XSLT file for the DocbookHtmlChunked builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_HTMLHELP - -The default XSLT file for the DocbookHtmlhelp builder within the + + +The default XSLT file for the DocbookHtmlhelp builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_MAN - -The default XSLT file for the DocbookMan builder within the + + +The default XSLT file for the DocbookMan builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_PDF - -The default XSLT file for the DocbookPdf builder within the + + +The default XSLT file for the DocbookPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESHTML - -The default XSLT file for the DocbookSlidesHtml builder within the + + +The default XSLT file for the DocbookSlidesHtml builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_DEFAULT_XSL_SLIDESPDF - -The default XSLT file for the DocbookSlidesPdf builder within the + + +The default XSLT file for the DocbookSlidesPdf builder within the current environment, if no other XSLT gets specified via keyword. DOCBOOK_FOP - + + The path to the PDF renderer fop or xep, if one of them is installed (fop gets checked first). @@ -1246,7 +1387,8 @@ if one of them is installed (fop gets checked first). DOCBOOK_FOPCOM - + + The full command-line for the PDF renderer fop or xep. @@ -1254,7 +1396,8 @@ PDF renderer fop or xep. DOCBOOK_FOPCOMSTR - + + The string displayed when a renderer like fop or xep is used to create PDF output from an XML file. @@ -1262,7 +1405,8 @@ The string displayed when a renderer like fop or DOCBOOK_FOPFLAGS - + + Additonal command-line flags for the PDF renderer fop or xep. @@ -1270,7 +1414,8 @@ PDF renderer fop or xep. DOCBOOK_XMLLINT - + + The path to the external executable xmllint, if it's installed. Note, that this is only used as last fallback for resolving XIncludes, if no libxml2 or lxml Python binding can be imported @@ -1280,7 +1425,8 @@ in the current system. DOCBOOK_XMLLINTCOM - + + The full command-line for the external executable xmllint. @@ -1288,7 +1434,8 @@ The full command-line for the external executable DOCBOOK_XMLLINTCOMSTR - + + The string displayed when xmllint is used to resolve XIncludes for a given XML file. @@ -1296,7 +1443,8 @@ XIncludes for a given XML file. DOCBOOK_XMLLINTFLAGS - + + Additonal command-line flags for the external executable xmllint. @@ -1304,7 +1452,8 @@ Additonal command-line flags for the external executable DOCBOOK_XSLTPROC - + + The path to the external executable xsltproc (or saxon, xalan), if one of them is installed. @@ -1315,7 +1464,8 @@ no libxml2 or lxml Python binding can be imported in the current system. DOCBOOK_XSLTPROCCOM - + + The full command-line for the external executable xsltproc (or saxon, xalan). @@ -1324,7 +1474,8 @@ The full command-line for the external executable DOCBOOK_XSLTPROCCOMSTR - + + The string displayed when xsltproc is used to transform an XML file via a given XSLT stylesheet. @@ -1332,7 +1483,8 @@ an XML file via a given XSLT stylesheet. DOCBOOK_XSLTPROCFLAGS - + + Additonal command-line flags for the external executable xsltproc (or saxon, xalan). @@ -1341,7 +1493,8 @@ Additonal command-line flags for the external executable DOCBOOK_XSLTPROCPARAMS - + + Additonal parameters that are not intended for the XSLT processor executable, but the XSL processing itself. By default, they get appended at the end of the command line for saxon and saxon-xslt, respectively. @@ -1350,158 +1503,181 @@ for saxon and saxon-xslt, respectively. DPATH - + + List of paths to search for import modules. - + + List of paths to search for import modules. - + + List of paths to search for import modules. DRPATHPREFIX - + + DRPATHPREFIX. DRPATHSUFFIX - + + DRPATHSUFFIX. DShLibSonameGenerator - + + DShLibSonameGenerator. DSUFFIXES - + + The list of suffixes of files that will be scanned for imported D package files. The default list is: - + ['.d'] DVERPREFIX - + + DVERPREFIX. - + + DVERPREFIX. - + + DVERPREFIX. DVERSIONS - + + List of version tags to enable when compiling. - + + List of version tags to enable when compiling. - + + List of version tags to enable when compiling. DVERSUFFIX - + + DVERSUFFIX. - + + DVERSUFFIX. - + + DVERSUFFIX. DVIPDF - + + The TeX DVI file to PDF file converter. DVIPDFCOM - + + The command line used to convert TeX DVI files into a PDF file. DVIPDFCOMSTR - + + The string displayed when a TeX DVI file is converted into a PDF file. -If this is not set, then $DVIPDFCOM (the command line) is displayed. +If this is not set, then $DVIPDFCOM (the command line) is displayed. DVIPDFFLAGS - + + General options passed to the TeX DVI file to PDF file converter. DVIPS - + + The TeX DVI file to PostScript converter. DVIPSFLAGS - + + General options passed to the TeX DVI file to PostScript converter. ENV - + + A dictionary of environment variables to use when invoking commands. When -$ENV is used in a command all list +$ENV is used in a command all list values will be joined using the path separator and any other non-string values will simply be coerced to a string. Note that, by default, -scons +scons does not propagate the environment in force when you execute -scons +scons to the commands used to build target files. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time -scons +scons is invoked. - + If you want to propagate your environment variables to the commands executed @@ -1509,12 +1685,12 @@ to build target files, you must do so explicitly: - + import os env = Environment(ENV = os.environ) - + Note that you can choose only to propagate certain environment variables. A common example is @@ -1522,12 +1698,12 @@ the system PATH environment variable, so that -scons +scons uses the same utilities as the invoking shell (or other process): - + import os env = Environment(ENV = {'PATH' : os.environ['PATH']}) @@ -1535,7 +1711,8 @@ env = Environment(ENV = {'PATH' : os.environ['PATH']}) ESCAPE - + + A function that will be called to escape shell special characters in command lines. The function should take one argument: the command line string to escape; and should return the escaped command line. @@ -1544,23 +1721,25 @@ string to escape; and should return the escaped command line. F03 - + + The Fortran 03 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F03 if you need to use a specific compiler +You only need to set $F03 if you need to use a specific compiler or compiler version for Fortran 03 files. F03COM - + + The command line used to compile a Fortran 03 source file to an object file. -You only need to set $F03COM if you need to use a specific +You only need to set $F03COM if you need to use a specific command line for Fortran 03 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -1568,17 +1747,19 @@ for all Fortran versions. F03COMSTR - + + The string displayed when a Fortran 03 source file is compiled to an object file. -If this is not set, then $F03COM or $FORTRANCOM +If this is not set, then $F03COM or $FORTRANCOM (the command line) is displayed. F03FILESUFFIXES - + + The list of file extensions for which the F03 dialect will be used. By default, this is ['.f03'] @@ -1586,21 +1767,22 @@ default, this is ['.f03'] F03FLAGS - + + General user-specified options that are passed to the Fortran 03 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F03PATH. +that scons generates automatically from $F03PATH. See -$_F03INCFLAGS +$_F03INCFLAGS below, for the variable that expands to those options. -You only need to set $F03FLAGS if you need to define specific +You only need to set $F03FLAGS if you need to define specific user options for Fortran 03 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -1609,83 +1791,86 @@ for all Fortran versions. _F03INCFLAGS - + + An automatically-generated construction variable containing the Fortran 03 compiler command-line options for specifying directories to be searched for include files. -The value of $_F03INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F03INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F03PATH. +of each directory in $F03PATH. F03PATH - + + The list of directories that the Fortran 03 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F03FLAGS because the result will be non-portable +arguments in $F03FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F03PATH will be looked-up relative to the SConscript +directory names in $F03PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F03PATH if you need to define a specific +You only need to set $F03PATH if you need to define a specific include path for Fortran 03 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F03PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F03PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F03INCFLAGS +$_F03INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F03PATH. +of each directory in $F03PATH. Any command lines you define that need the F03PATH directory list should -include $_F03INCFLAGS: +include $_F03INCFLAGS: - + env = Environment(F03COM="my_compiler $_F03INCFLAGS -c -o $TARGET $SOURCE") F03PPCOM - + + The command line used to compile a Fortran 03 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F03FLAGS and $CPPFLAGS construction variables +Any options specified in the $F03FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F03PPCOM if you need to use a specific +You only need to set $F03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -1693,18 +1878,20 @@ for all Fortran versions. F03PPCOMSTR - + + 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 $F03PPCOM or $FORTRANPPCOM +If this is not set, then $F03PPCOM or $FORTRANPPCOM (the command line) is displayed. F03PPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for F03 dialect will be used. By default, this is empty @@ -1712,23 +1899,25 @@ F03 dialect will be used. By default, this is empty F08 - + + The Fortran 08 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F08 if you need to use a specific compiler +You only need to set $F08 if you need to use a specific compiler or compiler version for Fortran 08 files. F08COM - + + The command line used to compile a Fortran 08 source file to an object file. -You only need to set $F08COM if you need to use a specific +You only need to set $F08COM if you need to use a specific command line for Fortran 08 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -1736,17 +1925,19 @@ for all Fortran versions. F08COMSTR - + + The string displayed when a Fortran 08 source file is compiled to an object file. -If this is not set, then $F08COM or $FORTRANCOM +If this is not set, then $F08COM or $FORTRANCOM (the command line) is displayed. F08FILESUFFIXES - + + The list of file extensions for which the F08 dialect will be used. By default, this is ['.f08'] @@ -1754,21 +1945,22 @@ default, this is ['.f08'] F08FLAGS - + + General user-specified options that are passed to the Fortran 08 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F08PATH. +that scons generates automatically from $F08PATH. See -$_F08INCFLAGS +$_F08INCFLAGS below, for the variable that expands to those options. -You only need to set $F08FLAGS if you need to define specific +You only need to set $F08FLAGS if you need to define specific user options for Fortran 08 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -1777,83 +1969,86 @@ for all Fortran versions. _F08INCFLAGS - + + An automatically-generated construction variable containing the Fortran 08 compiler command-line options for specifying directories to be searched for include files. -The value of $_F08INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F08INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F08PATH. +of each directory in $F08PATH. F08PATH - + + The list of directories that the Fortran 08 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F08FLAGS because the result will be non-portable +arguments in $F08FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F08PATH will be looked-up relative to the SConscript +directory names in $F08PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F08PATH if you need to define a specific +You only need to set $F08PATH if you need to define a specific include path for Fortran 08 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F08PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F08PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F08INCFLAGS +$_F08INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F08PATH. +of each directory in $F08PATH. Any command lines you define that need the F08PATH directory list should -include $_F08INCFLAGS: +include $_F08INCFLAGS: - + env = Environment(F08COM="my_compiler $_F08INCFLAGS -c -o $TARGET $SOURCE") F08PPCOM - + + The command line used to compile a Fortran 08 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F08FLAGS and $CPPFLAGS construction variables +Any options specified in the $F08FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F08PPCOM if you need to use a specific +You only need to set $F08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -1861,18 +2056,20 @@ for all Fortran versions. F08PPCOMSTR - + + 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 $F08PPCOM or $FORTRANPPCOM +If this is not set, then $F08PPCOM or $FORTRANPPCOM (the command line) is displayed. F08PPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for F08 dialect will be used. By default, this is empty @@ -1880,23 +2077,25 @@ F08 dialect will be used. By default, this is empty F77 - + + The Fortran 77 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F77 if you need to use a specific compiler +You only need to set $F77 if you need to use a specific compiler or compiler version for Fortran 77 files. F77COM - + + The command line used to compile a Fortran 77 source file to an object file. -You only need to set $F77COM if you need to use a specific +You only need to set $F77COM if you need to use a specific command line for Fortran 77 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -1904,17 +2103,19 @@ for all Fortran versions. F77COMSTR - + + The string displayed when a Fortran 77 source file is compiled to an object file. -If this is not set, then $F77COM or $FORTRANCOM +If this is not set, then $F77COM or $FORTRANCOM (the command line) is displayed. F77FILESUFFIXES - + + The list of file extensions for which the F77 dialect will be used. By default, this is ['.f77'] @@ -1922,21 +2123,22 @@ default, this is ['.f77'] F77FLAGS - + + General user-specified options that are passed to the Fortran 77 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F77PATH. +that scons generates automatically from $F77PATH. See -$_F77INCFLAGS +$_F77INCFLAGS below, for the variable that expands to those options. -You only need to set $F77FLAGS if you need to define specific +You only need to set $F77FLAGS if you need to define specific user options for Fortran 77 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -1945,83 +2147,86 @@ for all Fortran versions. _F77INCFLAGS - + + An automatically-generated construction variable containing the Fortran 77 compiler command-line options for specifying directories to be searched for include files. -The value of $_F77INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F77INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F77PATH. +of each directory in $F77PATH. F77PATH - + + The list of directories that the Fortran 77 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F77FLAGS because the result will be non-portable +arguments in $F77FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F77PATH will be looked-up relative to the SConscript +directory names in $F77PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F77PATH if you need to define a specific +You only need to set $F77PATH if you need to define a specific include path for Fortran 77 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F77PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F77PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F77INCFLAGS +$_F77INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F77PATH. +of each directory in $F77PATH. Any command lines you define that need the F77PATH directory list should -include $_F77INCFLAGS: +include $_F77INCFLAGS: - + env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE") F77PPCOM - + + The command line used to compile a Fortran 77 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F77FLAGS and $CPPFLAGS construction variables +Any options specified in the $F77FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F77PPCOM if you need to use a specific +You only need to set $F77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2029,18 +2234,20 @@ for all Fortran versions. F77PPCOMSTR - + + 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 $F77PPCOM or $FORTRANPPCOM +If this is not set, then $F77PPCOM or $FORTRANPPCOM (the command line) is displayed. F77PPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for F77 dialect will be used. By default, this is empty @@ -2048,23 +2255,25 @@ F77 dialect will be used. By default, this is empty F90 - + + The Fortran 90 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F90 if you need to use a specific compiler +You only need to set $F90 if you need to use a specific compiler or compiler version for Fortran 90 files. F90COM - + + The command line used to compile a Fortran 90 source file to an object file. -You only need to set $F90COM if you need to use a specific +You only need to set $F90COM if you need to use a specific command line for Fortran 90 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -2072,17 +2281,19 @@ for all Fortran versions. F90COMSTR - + + The string displayed when a Fortran 90 source file is compiled to an object file. -If this is not set, then $F90COM or $FORTRANCOM +If this is not set, then $F90COM or $FORTRANCOM (the command line) is displayed. F90FILESUFFIXES - + + The list of file extensions for which the F90 dialect will be used. By default, this is ['.f90'] @@ -2090,21 +2301,22 @@ default, this is ['.f90'] F90FLAGS - + + General user-specified options that are passed to the Fortran 90 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F90PATH. +that scons generates automatically from $F90PATH. See -$_F90INCFLAGS +$_F90INCFLAGS below, for the variable that expands to those options. -You only need to set $F90FLAGS if you need to define specific +You only need to set $F90FLAGS if you need to define specific user options for Fortran 90 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -2113,83 +2325,86 @@ for all Fortran versions. _F90INCFLAGS - + + An automatically-generated construction variable containing the Fortran 90 compiler command-line options for specifying directories to be searched for include files. -The value of $_F90INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F90INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F90PATH. +of each directory in $F90PATH. F90PATH - + + The list of directories that the Fortran 90 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F90FLAGS because the result will be non-portable +arguments in $F90FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F90PATH will be looked-up relative to the SConscript +directory names in $F90PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F90PATH if you need to define a specific +You only need to set $F90PATH if you need to define a specific include path for Fortran 90 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F90PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F90PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F90INCFLAGS +$_F90INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F90PATH. +of each directory in $F90PATH. Any command lines you define that need the F90PATH directory list should -include $_F90INCFLAGS: +include $_F90INCFLAGS: - + env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE") F90PPCOM - + + The command line used to compile a Fortran 90 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F90FLAGS and $CPPFLAGS construction variables +Any options specified in the $F90FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F90PPCOM if you need to use a specific +You only need to set $F90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2197,17 +2412,19 @@ for all Fortran versions. F90PPCOMSTR - + + 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 $F90PPCOM or $FORTRANPPCOM +If this is not set, then $F90PPCOM or $FORTRANPPCOM (the command line) is displayed. F90PPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for F90 dialect will be used. By default, this is empty @@ -2215,23 +2432,25 @@ F90 dialect will be used. By default, this is empty F95 - + + The Fortran 95 compiler. -You should normally set the $FORTRAN variable, +You should normally set the $FORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $F95 if you need to use a specific compiler +You only need to set $F95 if you need to use a specific compiler or compiler version for Fortran 95 files. F95COM - + + The command line used to compile a Fortran 95 source file to an object file. -You only need to set $F95COM if you need to use a specific +You only need to set $F95COM if you need to use a specific command line for Fortran 95 files. -You should normally set the $FORTRANCOM variable, +You should normally set the $FORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -2239,17 +2458,19 @@ for all Fortran versions. F95COMSTR - + + The string displayed when a Fortran 95 source file is compiled to an object file. -If this is not set, then $F95COM or $FORTRANCOM +If this is not set, then $F95COM or $FORTRANCOM (the command line) is displayed. F95FILESUFFIXES - + + The list of file extensions for which the F95 dialect will be used. By default, this is ['.f95'] @@ -2257,21 +2478,22 @@ default, this is ['.f95'] F95FLAGS - + + General user-specified options that are passed to the Fortran 95 compiler. Note that this variable does not contain (or similar) include search path options -that scons generates automatically from $F95PATH. +that scons generates automatically from $F95PATH. See -$_F95INCFLAGS +$_F95INCFLAGS below, for the variable that expands to those options. -You only need to set $F95FLAGS if you need to define specific +You only need to set $F95FLAGS if you need to define specific user options for Fortran 95 files. -You should normally set the $FORTRANFLAGS variable, +You should normally set the $FORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -2280,83 +2502,86 @@ for all Fortran versions. _F95INCFLAGS - + + An automatically-generated construction variable containing the Fortran 95 compiler command-line options for specifying directories to be searched for include files. -The value of $_F95INCFLAGS is created -by appending $INCPREFIX and $INCSUFFIX +The value of $_F95INCFLAGS is created +by appending $INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $F95PATH. +of each directory in $F95PATH. F95PATH - + + The list of directories that the Fortran 95 compiler will search for include directories. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $F95FLAGS because the result will be non-portable +arguments in $F95FLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: -directory names in $F95PATH will be looked-up relative to the SConscript +directory names in $F95PATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: -You only need to set $F95PATH if you need to define a specific +You only need to set $F95PATH if you need to define a specific include path for Fortran 95 files. -You should normally set the $FORTRANPATH variable, +You should normally set the $FORTRANPATH variable, which specifies the include path for the default Fortran compiler for all Fortran versions. - + env = Environment(F95PATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(F95PATH=include) - + The directory list will be added to command lines through the automatically-generated -$_F95INCFLAGS +$_F95INCFLAGS construction variable, which is constructed by appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $F95PATH. +of each directory in $F95PATH. Any command lines you define that need the F95PATH directory list should -include $_F95INCFLAGS: +include $_F95INCFLAGS: - + env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE") F95PPCOM - + + The command line used to compile a Fortran 95 source file to an object file after first running the file through the C preprocessor. -Any options specified in the $F95FLAGS and $CPPFLAGS construction variables +Any options specified in the $F95FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $F95PPCOM if you need to use a specific +You only need to set $F95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. -You should normally set the $FORTRANPPCOM variable, +You should normally set the $FORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -2364,18 +2589,20 @@ for all Fortran versions. F95PPCOMSTR - + + 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 $F95PPCOM or $FORTRANPPCOM +If this is not set, then $F95PPCOM or $FORTRANPPCOM (the command line) is displayed. F95PPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for F95 dialect will be used. By default, this is empty @@ -2383,11 +2610,13 @@ F95 dialect will be used. By default, this is empty File - + + A function that converts a string into a File instance relative to the target being built. - + + A function that converts a string into a File instance relative to the target being built. @@ -2395,7 +2624,8 @@ target being built. FORTRAN - + + The default Fortran compiler for all versions of Fortran. @@ -2403,31 +2633,34 @@ for all versions of Fortran. FORTRANCOM - + + The command line used to compile a Fortran source file to an object file. By default, any options specified -in the $FORTRANFLAGS, -$CPPFLAGS, -$_CPPDEFFLAGS, -$_FORTRANMODFLAG, and -$_FORTRANINCFLAGS construction variables +in the $FORTRANFLAGS, +$CPPFLAGS, +$_CPPDEFFLAGS, +$_FORTRANMODFLAG, and +$_FORTRANINCFLAGS construction variables are included on this command line. FORTRANCOMSTR - + + The string displayed when a Fortran source file is compiled to an object file. -If this is not set, then $FORTRANCOM +If this is not set, then $FORTRANCOM (the command line) is displayed. FORTRANFILESUFFIXES - + + The list of file extensions for which the FORTRAN dialect will be used. By default, this is ['.f', '.for', '.ftn'] @@ -2435,16 +2668,17 @@ default, this is ['.f', '.for', '.ftn'] FORTRANFLAGS - + + General user-specified options that are passed to the Fortran compiler. Note that this variable does not contain (or similar) include or module search path options -that scons generates automatically from $FORTRANPATH. +that scons generates automatically from $FORTRANPATH. See -$_FORTRANINCFLAGS and $_FORTRANMODFLAG, +$_FORTRANINCFLAGS and $_FORTRANMODFLAG, below, for the variables that expand those options. @@ -2452,22 +2686,24 @@ for the variables that expand those options. _FORTRANINCFLAGS - + + An automatically-generated construction variable containing the Fortran compiler command-line options for specifying directories to be searched for include files and module files. -The value of $_FORTRANINCFLAGS is created +The value of $_FORTRANINCFLAGS is created by respectively prepending and appending -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX to the beginning and end -of each directory in $FORTRANPATH. +of each directory in $FORTRANPATH. FORTRANMODDIR - + + Directory location where the Fortran compiler should place any module files it generates. This variable is empty, by default. Some Fortran compilers will internally append this directory in the search path @@ -2477,44 +2713,48 @@ for module files, as well. FORTRANMODDIRPREFIX - + + The prefix used to specify a module directory on the Fortran compiler command line. This will be prepended to the beginning of the directory -in the $FORTRANMODDIR construction variables -when the $_FORTRANMODFLAG variables is automatically generated. +in the $FORTRANMODDIR construction variables +when the $_FORTRANMODFLAG variables is automatically generated. FORTRANMODDIRSUFFIX - + + The suffix used to specify a module directory on the Fortran compiler command line. This will be appended to the end of the directory -in the $FORTRANMODDIR construction variables -when the $_FORTRANMODFLAG variables is automatically generated. +in the $FORTRANMODDIR construction variables +when the $_FORTRANMODFLAG variables is automatically generated. _FORTRANMODFLAG - + + An automatically-generated construction variable containing the Fortran compiler command-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation. -The value of $_FORTRANMODFLAG is created +The value of $_FORTRANMODFLAG is created by respectively prepending and appending -$FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX -to the beginning and end of the directory in $FORTRANMODDIR. +$FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX +to the beginning and end of the directory in $FORTRANMODDIR. FORTRANMODPREFIX - + + The module file prefix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of @@ -2528,7 +2768,8 @@ module file name as scons attempts to resolve dependencies. FORTRANMODSUFFIX - + + The module file suffix used by the Fortran compiler. SCons assumes that the Fortran compiler follows the quasi-standard naming convention for module files of @@ -2542,7 +2783,8 @@ module file name as scons attempts to resolve dependencies. FORTRANPATH - + + The list of directories that the Fortran compiler will search for include files and (for some compilers) module files. The Fortran implicit dependency scanner will search these directories for include files (but @@ -2552,74 +2794,77 @@ include directory arguments in FORTRANFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in FORTRANPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(FORTRANPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(FORTRANPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_FORTRANINCFLAGS +$_FORTRANINCFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$INCPREFIX and $INCSUFFIX +$INCPREFIX and $INCSUFFIX construction variables to the beginning and end -of each directory in $FORTRANPATH. +of each directory in $FORTRANPATH. Any command lines you define that need the FORTRANPATH directory list should -include $_FORTRANINCFLAGS: +include $_FORTRANINCFLAGS: - + env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE") FORTRANPPCOM - + + The command line used to compile a Fortran source file to an object file after first running the file through the C preprocessor. -By default, any options specified in the $FORTRANFLAGS, -$CPPFLAGS, -$_CPPDEFFLAGS, -$_FORTRANMODFLAG, and -$_FORTRANINCFLAGS +By default, any options specified in the $FORTRANFLAGS, +$CPPFLAGS, +$_CPPDEFFLAGS, +$_FORTRANMODFLAG, and +$_FORTRANINCFLAGS construction variables are included on this command line. FORTRANPPCOMSTR - + + 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 $FORTRANPPCOM +If this is not set, then $FORTRANPPCOM (the command line) is displayed. FORTRANPPFILESUFFIXES - + + The list of file extensions for which the compilation + preprocessor pass for FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] @@ -2627,14 +2872,15 @@ FORTRAN dialect will be used. By default, this is ['.fpp', '.FPP'] FORTRANSUFFIXES - + + The list of suffixes of files that will be scanned for Fortran implicit dependencies (INCLUDE lines and USE statements). The default list is: - + [".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP", ".f77", ".F77", ".f90", ".F90", ".f95", ".F95"] @@ -2642,47 +2888,50 @@ The default list is: FRAMEWORKPATH - + + On Mac OS X with gcc, a list containing the paths to search for frameworks. Used by the compiler to find framework-style includes like #include <Fmwk/Header.h>. Used by the linker to find user-specified frameworks when linking (see - $FRAMEWORKS). + $FRAMEWORKS). For example: - + env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') - + will add - + ... -Fmyframeworkdir - + to the compiler and linker command lines. _FRAMEWORKPATH - + + On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options corresponding to - $FRAMEWORKPATH. + $FRAMEWORKPATH. FRAMEWORKPATHPREFIX - + + On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. - (see $FRAMEWORKPATH). + (see $FRAMEWORKPATH). The default value is . @@ -2690,10 +2939,11 @@ The default list is: FRAMEWORKPREFIX - + + On Mac OS X with gcc, the prefix to be used for linking in frameworks - (see $FRAMEWORKS). + (see $FRAMEWORKS). The default value is . @@ -2701,7 +2951,8 @@ The default list is: _FRAMEWORKS - + + On Mac OS X with gcc, an automatically-generated construction variable containing the linker command-line options @@ -2711,14 +2962,15 @@ The default list is: FRAMEWORKS - + + On Mac OS X with gcc, a list of the framework names to be linked into a program or shared library or bundle. The default value is the empty list. For example: - + env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) @@ -2726,28 +2978,31 @@ The default list is: FRAMEWORKSFLAGS - + + On Mac OS X with gcc, general user-supplied frameworks options to be added at the end of a command line building a loadable module. (This has been largely superseded by - the $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX, - $FRAMEWORKPREFIX and $FRAMEWORKS variables + the $FRAMEWORKPATH, $FRAMEWORKPATHPREFIX, + $FRAMEWORKPREFIX and $FRAMEWORKS variables described above.) GS - + + The Ghostscript program used, e.g. to convert PostScript to PDF files. GSCOM - + + The full Ghostscript command line used for the conversion process. Its default value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES. @@ -2755,16 +3010,18 @@ value is $GS $GSFLAGS -sOutputFile=$TARGET $SOURCES GSCOMSTR - + + The string displayed when Ghostscript is called for the conversion process. -If this is not set (the default), then $GSCOM (the command line) is displayed. +If this is not set (the default), then $GSCOM (the command line) is displayed. GSFLAGS - + + General options passed to the Ghostscript program, when converting PostScript to PDF files for example. Its default value is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite @@ -2773,7 +3030,8 @@ is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite HOST_ARCH - + + The name of the host hardware architecture used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. @@ -2781,7 +3039,8 @@ is -dNOPAUSE -dBATCH -sDEVICE=pdfwrite the Environment is initialized. Currently only set for Win32. - + + Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. @@ -2789,11 +3048,11 @@ This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - -Valid values are the same as for $TARGET_ARCH. + +Valid values are the same as for $TARGET_ARCH. - + This is currently only used on Windows, but in the future it will be used on other OSes as well. @@ -2801,7 +3060,8 @@ used on other OSes as well. HOST_OS - + + The name of the host operating system used to create the Environment. If a platform is specified when creating the Environment, then that Platform's logic will handle setting this value. @@ -2813,69 +3073,75 @@ used on other OSes as well. IDLSUFFIXES - + + The list of suffixes of files that will be scanned for IDL implicit dependencies (#include or import lines). The default list is: - + [".idl", ".IDL"] IMPLIBNOVERSIONSYMLINKS - -Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS when + + +Used to override $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS when creating versioned import library for a shared library/loadable module. If not defined, -then $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS is used to determine +then $SHLIBNOVERSIONSYMLINKS/$LDMODULENOVERSIONSYMLINKS is used to determine whether to disable symlink generation or not. IMPLIBPREFIX - + + The prefix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries -(cygfoo.dll). The cyglink linker sets -$IMPLIBPREFIX to 'lib' and $SHLIBPREFIX +(cygfoo.dll). The cyglink linker sets +$IMPLIBPREFIX to 'lib' and $SHLIBPREFIX to 'cyg'. IMPLIBSUFFIX - + + The suffix used for import library names. For example, cygwin uses import libraries (libfoo.dll.a) in pair with dynamic libraries -(cygfoo.dll). The cyglink linker sets -$IMPLIBSUFFIX to '.dll.a' and $SHLIBSUFFIX +(cygfoo.dll). The cyglink linker sets +$IMPLIBSUFFIX to '.dll.a' and $SHLIBSUFFIX to '.dll'. IMPLIBVERSION - -Used to override $SHLIBVERSION/$LDMODULEVERSION when + + +Used to override $SHLIBVERSION/$LDMODULEVERSION when generating versioned import library for a shared library/loadable module. If -undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to +undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to determine the version of versioned import library. IMPLICIT_COMMAND_DEPENDENCIES - + + Controls whether or not SCons will add implicit dependencies for the commands executed to build targets. - + By default, SCons will add to each target an implicit dependency on the command @@ -2889,9 +3155,9 @@ variable in the environment used to execute the command. - + If the construction variable -$IMPLICIT_COMMAND_DEPENDENCIES +$IMPLICIT_COMMAND_DEPENDENCIES is set to a false value (None, False, @@ -2902,38 +3168,41 @@ not be added to the targets built with that construction environment. - + env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) INCPREFIX - + + The prefix used to specify an include directory on the C compiler command line. This will be prepended to the beginning of each directory -in the $CPPPATH and $FORTRANPATH construction variables -when the $_CPPINCFLAGS and $_FORTRANINCFLAGS +in the $CPPPATH and $FORTRANPATH construction variables +when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INCSUFFIX - + + The suffix used to specify an include directory on the C compiler command line. This will be appended to the end of each directory -in the $CPPPATH and $FORTRANPATH construction variables -when the $_CPPINCFLAGS and $_FORTRANINCFLAGS +in the $CPPPATH and $FORTRANPATH construction variables +when the $_CPPINCFLAGS and $_FORTRANINCFLAGS variables are automatically generated. INSTALL - + + A function to be called to install a file into a destination file name. The default function copies the file into the destination @@ -2942,11 +3211,11 @@ to match the source file's). The function takes the following arguments: - + def install(dest, source, env): - + dest is the path name of the destination file. source @@ -2960,19 +3229,21 @@ in force for this file installation. INSTALLSTR - + + The string displayed when a file is installed into a destination file name. The default is: - + Install file: "$SOURCE" as "$TARGET" INTEL_C_COMPILER_VERSION - + + Set by the "intelc" Tool to the major version number of the Intel C compiler selected for use. @@ -2981,23 +3252,27 @@ selected for use. JAR - + + The Java archive tool. - + + The Java archive tool. JARCHDIR - + + The directory to which the Java archive tool should change (using the option). - + + The directory to which the Java archive tool should change (using the @@ -3007,39 +3282,44 @@ option). JARCOM - + + The command line used to call the Java archive tool. - + + The command line used to call the Java archive tool. JARCOMSTR - + + The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. - + env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") - + + The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. - + env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") JARFLAGS - + + General options passed to the Java archive tool. By default this is set to @@ -3047,7 +3327,8 @@ to create the necessary jar file. - + + General options passed to the Java archive tool. By default this is set to @@ -3059,12 +3340,14 @@ file. JARSUFFIX - + + The suffix for Java archives: .jar by default. - + + The suffix for Java archives: .jar by default. @@ -3073,10 +3356,11 @@ by default. JAVABOOTCLASSPATH - + + Specifies the list of directories that will be added to the - javac command line + javac command line via the option. The individual directory names will be separated by the operating system's path separate character @@ -3088,46 +3372,51 @@ by default. JAVAC - + + The Java compiler. JAVACCOM - + + The command line used to compile a directory tree containing Java source files to corresponding Java class files. - Any options specified in the $JAVACFLAGS construction variable + Any options specified in the $JAVACFLAGS construction variable are included on this command line. JAVACCOMSTR - + + The string displayed when compiling a directory tree of Java source files to corresponding Java class files. - If this is not set, then $JAVACCOM (the command line) is displayed. + If this is not set, then $JAVACCOM (the command line) is displayed. - + env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") JAVACFLAGS - + + General options that are passed to the Java compiler. JAVACLASSDIR - + + The directory in which Java class files may be found. This is stripped from the beginning of any Java .class file names supplied to the @@ -3138,13 +3427,14 @@ by default. JAVACLASSPATH - + + Specifies the list of directories that will be searched for Java .class file. The directories in this list will be added to the - javac and javah command lines + javac and javah command lines via the option. The individual directory names will be separated by the operating system's path separate character @@ -3153,11 +3443,11 @@ by default. on Windows). - + Note that this currently just adds the specified directory via the option. - SCons does not currently search the - $JAVACLASSPATH directories for dependency + SCons does not currently search the + $JAVACLASSPATH directories for dependency .class files. @@ -3165,7 +3455,8 @@ by default. JAVACLASSSUFFIX - + + The suffix for Java class files; .class by default. @@ -3174,37 +3465,41 @@ by default. JAVAH - + + The Java generator for C header and stub files. JAVAHCOM - + + The command line used to generate C header and stub files from Java classes. -Any options specified in the $JAVAHFLAGS construction variable +Any options specified in the $JAVAHFLAGS construction variable are included on this command line. JAVAHCOMSTR - + + The string displayed when C header and stub files are generated from Java classes. -If this is not set, then $JAVAHCOM (the command line) is displayed. +If this is not set, then $JAVAHCOM (the command line) is displayed. - + env = Environment(JAVAHCOMSTR = "Generating header/stub file(s) $TARGETS from $SOURCES") JAVAHFLAGS - + + General options passed to the C header and stub file generator for Java classes. @@ -3212,20 +3507,22 @@ for Java classes. JAVAINCLUDES - + + Include path for Java header files (such as jni.h) JAVASOURCEPATH - + + Specifies the list of directories that will be searched for input .java file. The directories in this list will be added to the - javac command line + javac command line via the option. The individual directory names will be separated by the operating system's path separate character @@ -3234,11 +3531,11 @@ for Java classes. on Windows). - + Note that this currently just adds the specified directory via the option. - SCons does not currently search the - $JAVASOURCEPATH directories for dependency + SCons does not currently search the + $JAVASOURCEPATH directories for dependency .java files. @@ -3246,7 +3543,8 @@ for Java classes. JAVASUFFIX - + + The suffix for Java files; .java by default. @@ -3255,70 +3553,76 @@ for Java classes. JAVAVERSION - - Specifies the Java version being used by the Java builder. + + + Specifies the Java version being used by the Java builder. This is not currently used to select one version of the Java compiler vs. another. Instead, you should set this to specify the version of Java - supported by your javac compiler. + supported by your javac compiler. The default is 1.4. - + This is sometimes necessary because Java 1.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files - that SCons expects will be generated by the javac compiler. - Setting $JAVAVERSION to + that SCons expects will be generated by the javac compiler. + Setting $JAVAVERSION to 1.5 (or 1.6, as appropriate) - can make SCons realize that a Java 1.5 or 1.6 + can make SCons realize that a Java 1.5 or 1.6 build is actually up to date. LATEX - + + The LaTeX structured formatter and typesetter. LATEXCOM - + + The command line used to call the LaTeX structured formatter and typesetter. LATEXCOMSTR - + + The string displayed when calling the LaTeX structured formatter and typesetter. -If this is not set, then $LATEXCOM (the command line) is displayed. +If this is not set, then $LATEXCOM (the command line) is displayed. - + env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES") LATEXFLAGS - + + General options passed to the LaTeX structured formatter and typesetter. LATEXRETRIES - + + The maximum number of times that LaTeX will be re-run if the .log -generated by the $LATEXCOM command +generated by the $LATEXCOM command indicates that there are undefined references. The default is to try to resolve undefined references by re-running LaTeX up to three times. @@ -3327,82 +3631,91 @@ by re-running LaTeX up to three times. LATEXSUFFIXES - + + The list of suffixes of files that will be scanned for LaTeX implicit dependencies (\include or \import files). The default list is: - + [".tex", ".ltx", ".latex"] LDMODULE - + + The linker for building loadable modules. -By default, this is the same as $SHLINK. +By default, this is the same as $SHLINK. LDMODULECOM - + + The command line for building loadable modules. -On Mac OS X, this uses the $LDMODULE, -$LDMODULEFLAGS and -$FRAMEWORKSFLAGS variables. -On other systems, this is the same as $SHLINK. +On Mac OS X, this uses the $LDMODULE, +$LDMODULEFLAGS and +$FRAMEWORKSFLAGS variables. +On other systems, this is the same as $SHLINK. LDMODULECOMSTR - + + The string displayed when building loadable modules. -If this is not set, then $LDMODULECOM (the command line) is displayed. +If this is not set, then $LDMODULECOM (the command line) is displayed. LDMODULEFLAGS - + + General user options passed to the linker for building loadable modules. LDMODULENOVERSIONSYMLINKS - -Instructs the LoadableModule builder to not automatically create symlinks + + +Instructs the LoadableModule builder to not automatically create symlinks for versioned modules. Defaults to $SHLIBNOVERSIONSYMLINKS LDMODULEPREFIX - + + The prefix used for loadable module file names. On Mac OS X, this is null; on other systems, this is -the same as $SHLIBPREFIX. +the same as $SHLIBPREFIX. _LDMODULESONAME - + + A macro that automatically generates loadable module's SONAME based on $TARGET, -$LDMODULEVERSION and $LDMODULESUFFIX. Used by LoadableModule builder -when the linker tool supports SONAME (e.g. gnulink). +$LDMODULEVERSION and $LDMODULESUFFIX. Used by LoadableModule builder +when the linker tool supports SONAME (e.g. gnulink). LDMODULESUFFIX - + + The suffix used for loadable module file names. On Mac OS X, this is null; on other systems, this is @@ -3412,32 +3725,35 @@ the same as $SHLIBSUFFIX. LDMODULEVERSION - + + When this construction variable is defined, a versioned loadable module -is created by LoadableModule builder. This activates the -$_LDMODULEVERSIONFLAGS and thus modifies the $LDMODULECOM as +is created by LoadableModule builder. This activates the +$_LDMODULEVERSIONFLAGS and thus modifies the $LDMODULECOM as required, adds the version number to the library name, and creates the symlinks -that are needed. $LDMODULEVERSION versions should exist in the same -format as $SHLIBVERSION. +that are needed. $LDMODULEVERSION versions should exist in the same +format as $SHLIBVERSION. LDMODULEVERSIONFLAGS - -Extra flags added to $LDMODULECOM when building versioned -LoadableModule. These flags are only used when $LDMODULEVERSION is + + +Extra flags added to $LDMODULECOM when building versioned +LoadableModule. These flags are only used when $LDMODULEVERSION is set. _LDMODULEVERSIONFLAGS - -This macro automatically introduces extra flags to $LDMODULECOM when -building versioned LoadableModule (that is when -$LDMODULEVERSION is set). _LDMODULEVERSIONFLAGS -usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated + + +This macro automatically introduces extra flags to $LDMODULECOM when +building versioned LoadableModule (that is when +$LDMODULEVERSION is set). _LDMODULEVERSIONFLAGS +usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_LDMODULESONAME). It is unused by plain (unversioned) loadable modules. @@ -3445,14 +3761,16 @@ by plain (unversioned) loadable modules. LEX - + + The lexical analyzer generator. LEXCOM - + + The command line used to call the lexical analyzer generator to generate a source file. @@ -3460,158 +3778,170 @@ to generate a source file. LEXCOMSTR - + + The string displayed when generating a source file using the lexical analyzer generator. -If this is not set, then $LEXCOM (the command line) is displayed. +If this is not set, then $LEXCOM (the command line) is displayed. - + env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES") LEXFLAGS - + + General options passed to the lexical analyzer generator. LEXUNISTD - + + Used only on windows environments to set a lex flag to prevent 'unistd.h' from being included. The default value is '--nounistd'. _LIBDIRFLAGS - + + An automatically-generated construction variable containing the linker command-line options for specifying directories to be searched for library. -The value of $_LIBDIRFLAGS is created -by respectively prepending and appending $LIBDIRPREFIX and $LIBDIRSUFFIX +The value of $_LIBDIRFLAGS is created +by respectively prepending and appending $LIBDIRPREFIX and $LIBDIRSUFFIX to the beginning and end -of each directory in $LIBPATH. +of each directory in $LIBPATH. LIBDIRPREFIX - + + The prefix used to specify a library directory on the linker command line. This will be prepended to the beginning of each directory -in the $LIBPATH construction variable -when the $_LIBDIRFLAGS variable is automatically generated. +in the $LIBPATH construction variable +when the $_LIBDIRFLAGS variable is automatically generated. LIBDIRSUFFIX - + + The suffix used to specify a library directory on the linker command line. This will be appended to the end of each directory -in the $LIBPATH construction variable -when the $_LIBDIRFLAGS variable is automatically generated. +in the $LIBPATH construction variable +when the $_LIBDIRFLAGS variable is automatically generated. LIBEMITTER - + + TODO _LIBFLAGS - + + An automatically-generated construction variable containing the linker command-line options for specifying libraries to be linked with the resulting target. -The value of $_LIBFLAGS is created -by respectively prepending and appending $LIBLINKPREFIX and $LIBLINKSUFFIX +The value of $_LIBFLAGS is created +by respectively prepending and appending $LIBLINKPREFIX and $LIBLINKSUFFIX to the beginning and end -of each filename in $LIBS. +of each filename in $LIBS. LIBLINKPREFIX - + + The prefix used to specify a library to link on the linker command line. This will be prepended to the beginning of each library -in the $LIBS construction variable -when the $_LIBFLAGS variable is automatically generated. +in the $LIBS construction variable +when the $_LIBFLAGS variable is automatically generated. LIBLINKSUFFIX - + + The suffix used to specify a library to link on the linker command line. This will be appended to the end of each library -in the $LIBS construction variable -when the $_LIBFLAGS variable is automatically generated. +in the $LIBS construction variable +when the $_LIBFLAGS variable is automatically generated. LIBPATH - + + The list of directories that will be searched for libraries. The implicit dependency scanner will search these directories for include files. Don't explicitly put include directory -arguments in $LINKFLAGS or $SHLINKFLAGS +arguments in $LINKFLAGS or $SHLINKFLAGS because the result will be non-portable and the directories will not be searched by the dependency scanner. Note: directory names in LIBPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(LIBPATH='#/libs') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + libs = Dir('libs') env = Environment(LIBPATH=libs) - + The directory list will be added to command lines through the automatically-generated -$_LIBDIRFLAGS +$_LIBDIRFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$LIBDIRPREFIX and $LIBDIRSUFFIX +$LIBDIRPREFIX and $LIBDIRSUFFIX construction variables to the beginning and end -of each directory in $LIBPATH. +of each directory in $LIBPATH. Any command lines you define that need the LIBPATH directory list should -include $_LIBDIRFLAGS: +include $_LIBDIRFLAGS: - + env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") LIBPREFIX - + + The prefix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), @@ -3623,63 +3953,65 @@ to reflect the names of the libraries they create. LIBPREFIXES - + + A list of all legal prefixes for library file names. When searching for library dependencies, SCons will look for files with these prefixes, the base library name, -and suffixes in the $LIBSUFFIXES list. +and suffixes in the $LIBSUFFIXES list. LIBS - + + A list of one or more libraries that will be linked with any executable programs created by this environment. - + The library list will be added to command lines through the automatically-generated -$_LIBFLAGS +$_LIBFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$LIBLINKPREFIX and $LIBLINKSUFFIX +$LIBLINKPREFIX and $LIBLINKSUFFIX construction variables to the beginning and end -of each filename in $LIBS. +of each filename in $LIBS. Any command lines you define that need the LIBS library list should -include $_LIBFLAGS: +include $_LIBFLAGS: - + env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE") - + If you add a File object to the -$LIBS +$LIBS list, the name of that file will be added to -$_LIBFLAGS, +$_LIBFLAGS, and thus the link line, as is, without -$LIBLINKPREFIX +$LIBLINKPREFIX or -$LIBLINKSUFFIX. +$LIBLINKSUFFIX. For example: - + env.Append(LIBS=File('/tmp/mylib.so')) - + In all cases, scons will add dependencies from the executable program to all the libraries in this list. @@ -3687,7 +4019,8 @@ all the libraries in this list. LIBSUFFIX - + + The suffix used for (static) library file names. A default value is set for each platform (posix, win32, os2, etc.), @@ -3699,10 +4032,11 @@ to reflect the names of the libraries they create. LIBSUFFIXES - + + A list of all legal suffixes for library file names. When searching for library dependencies, -SCons will look for files with prefixes, in the $LIBPREFIXES list, +SCons will look for files with prefixes, in the $LIBPREFIXES list, the base library name, and these suffixes. @@ -3710,7 +4044,8 @@ and these suffixes. LICENSE - + + The abbreviated name, preferably the SPDX code, of the license under which this project is released (GPL-3.0, LGPL-2.1, BSD-2-Clause etc.). See http://www.opensource.org/licenses/alphabetical @@ -3720,8 +4055,9 @@ for a list of license names and SPDX codes. LINESEPARATOR - -The separator used by the Substfile and Textfile builders. + + +The separator used by the Substfile and Textfile builders. This value is used between sources when constructing the target. It defaults to the current system line separator. @@ -3729,12 +4065,13 @@ It defaults to the current system line separator. LINGUAS_FILE - -The $LINGUAS_FILE defines file(s) containing list of additional linguas -to be processed by POInit, POUpdate or MOFiles -builders. It also affects Translate builder. If the variable contains -a string, it defines name of the list file. The $LINGUAS_FILE may be a -list of file names as well. If $LINGUAS_FILE is set to + + +The $LINGUAS_FILE defines file(s) containing list of additional linguas +to be processed by POInit, POUpdate or MOFiles +builders. It also affects Translate builder. If the variable contains +a string, it defines name of the list file. The $LINGUAS_FILE may be a +list of file names as well. If $LINGUAS_FILE is set to True (or non-zero numeric value), the list will be read from default file named LINGUAS. @@ -3744,50 +4081,54 @@ default file named LINK - + + The linker. LINKCOM - + + The command line used to link object files into an executable. LINKCOMSTR - + + The string displayed when object files are linked into an executable. -If this is not set, then $LINKCOM (the command line) is displayed. +If this is not set, then $LINKCOM (the command line) is displayed. - + env = Environment(LINKCOMSTR = "Linking $TARGET") LINKFLAGS - + + General user options passed to the linker. Note that this variable should not contain -(or similar) options for linking with the libraries listed in $LIBS, +(or similar) options for linking with the libraries listed in $LIBS, nor (or similar) library search path options -that scons generates automatically from $LIBPATH. +that scons generates automatically from $LIBPATH. See -$_LIBFLAGS +$_LIBFLAGS above, for the variable that expands to library-link options, and -$_LIBDIRFLAGS +$_LIBDIRFLAGS above, for the variable that expands to library search path options. @@ -3795,37 +4136,42 @@ for the variable that expands to library search path options. M4 - + + The M4 macro preprocessor. M4COM - + + The command line used to pass files through the M4 macro preprocessor. M4COMSTR - + + The string displayed when a file is passed through the M4 macro preprocessor. -If this is not set, then $M4COM (the command line) is displayed. +If this is not set, then $M4COM (the command line) is displayed. M4FLAGS - + + General options passed to the M4 macro preprocessor. MAKEINDEX - + + The makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -3833,7 +4179,8 @@ LaTeX structured formatter and typesetter. MAKEINDEXCOM - + + The command line used to call the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -3842,17 +4189,19 @@ typesetter. MAKEINDEXCOMSTR - + + The string displayed when calling the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. -If this is not set, then $MAKEINDEXCOM (the command line) is displayed. +If this is not set, then $MAKEINDEXCOM (the command line) is displayed. MAKEINDEXFLAGS - + + General options passed to the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter. @@ -3860,7 +4209,8 @@ and typesetter and the LaTeX structured formatter and typesetter. MAXLINELENGTH - + + The maximum number of characters allowed on an external command line. On Win32 systems, link lines longer than this many characters @@ -3870,159 +4220,178 @@ are linked via a temporary file name. MIDL - + + The Microsoft IDL compiler. MIDLCOM - + + The command line used to pass files to the Microsoft IDL compiler. MIDLCOMSTR - + + The string displayed when the Microsoft IDL copmiler is called. -If this is not set, then $MIDLCOM (the command line) is displayed. +If this is not set, then $MIDLCOM (the command line) is displayed. MIDLFLAGS - + + General options passed to the Microsoft IDL compiler. MOSUFFIX - + + Suffix used for MO files (default: '.mo'). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMT - + + Absolute path to msgfmt(1) binary, found by Detect(). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMTCOM - + + Complete command line to run msgfmt(1) program. -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGFMTCOMSTR - + + String to display when msgfmt(1) is invoked -(default: '', which means ``print $MSGFMTCOM''). -See msgfmt tool and MOFiles builder. +(default: '', which means ``print $MSGFMTCOM''). +See msgfmt tool and MOFiles builder. MSGFMTFLAGS - + + Additional flags to msgfmt(1). -See msgfmt tool and MOFiles builder. +See msgfmt tool and MOFiles builder. MSGINIT - + + Path to msginit(1) program (found via Detect()). -See msginit tool and POInit builder. +See msginit tool and POInit builder. MSGINITCOM - + + Complete command line to run msginit(1) program. -See msginit tool and POInit builder. +See msginit tool and POInit builder. MSGINITCOMSTR - + + String to display when msginit(1) is invoked -(default: '', which means ``print $MSGINITCOM''). -See msginit tool and POInit builder. +(default: '', which means ``print $MSGINITCOM''). +See msginit tool and POInit builder. MSGINITFLAGS - + + List of additional flags to msginit(1) (default: []). -See msginit tool and POInit builder. +See msginit tool and POInit builder. _MSGINITLOCALE - + + Internal ``macro''. Computes locale (language) name based on target filename (default: '${TARGET.filebase}' ). - -See msginit tool and POInit builder. + +See msginit tool and POInit builder. MSGMERGE - + + Absolute path to msgmerge(1) binary as found by Detect(). -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSGMERGECOM - + + Complete command line to run msgmerge(1) command. -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSGMERGECOMSTR - + + String to be displayed when msgmerge(1) is invoked -(default: '', which means ``print $MSGMERGECOM''). -See msgmerge tool and POUpdate builder. +(default: '', which means ``print $MSGMERGECOM''). +See msgmerge tool and POUpdate builder. MSGMERGEFLAGS - + + Additional flags to msgmerge(1) command. -See msgmerge tool and POUpdate builder. +See msgmerge tool and POUpdate builder. MSSDK_DIR - + + The directory containing the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. @@ -4031,7 +4400,8 @@ to be used for compilation. MSSDK_VERSION - + + The version string of the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation. @@ -4047,7 +4417,8 @@ and MSVC_BATCH - + + When set to any true value, specifies that SCons should batch compilation of object files @@ -4058,7 +4429,7 @@ and were configured in SCons using the same construction environment will be built in a single call to the compiler. Only source files that have changed since their object files were built will be passed to each compiler invocation -(via the $CHANGED_SOURCES construction variable). +(via the $CHANGED_SOURCES construction variable). Any compilations where the object (target) file base name (minus the .obj) does not match the source file base name @@ -4068,12 +4439,13 @@ will be compiled separately. MSVC_USE_SCRIPT - + + Use a batch script to set up Microsoft Visual Studio compiler - -$MSVC_USE_SCRIPT overrides $MSVC_VERSION and $TARGET_ARCH. + +$MSVC_USE_SCRIPT overrides $MSVC_VERSION and $TARGET_ARCH. If set to the name of a Visual Studio .bat file (e.g. vcvars.bat), SCons will run that bat file and extract the relevant variables from the result (typically %INCLUDE%, %LIB%, and %PATH%). Setting @@ -4085,12 +4457,13 @@ window and importing the shell's environment variables. MSVC_UWP_APP - + + Build libraries for a Universal Windows Platform (UWP) Application. - -If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point + +If $MSVC_UWP_APP is set, the Visual Studio environment will be set up to point to the Windows Store compatible libraries and Visual Studio runtimes. In doing so, any libraries that are built will be able to be used in a UWP App and published to the Windows Store. @@ -4099,7 +4472,7 @@ This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - + Valid values are '1' or '0' @@ -4107,19 +4480,20 @@ Valid values are '1' or '0' MSVC_VERSION - + + Sets the preferred version of Microsoft Visual C/C++ to use. - -If $MSVC_VERSION is not set, SCons will (by default) select the + +If $MSVC_VERSION is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system. If the specified version isn't installed, tool initialization will fail. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect. - + Valid values for Windows are 14.1, 14.0, @@ -4145,15 +4519,16 @@ Versions ending in Exp refer to "Express" or MSVS - + + When the Microsoft Visual Studio tools are initialized, they set up this dictionary with the following keys: - + VERSION the version of MSVS being used (can be set via - $MSVS_VERSION) + $MSVS_VERSION) VERSIONS @@ -4209,19 +4584,20 @@ Versions ending in Exp refer to "Express" or - If a value is not set, it was not available in the registry. + If a value is not set, it was not available in the registry. MSVS_ARCH - Sets the architecture for which the generated project(s) should build. - + + Sets the architecture for which the generated project(s) should build. + The default value is x86. - amd64 is also supported by SCons for + amd64 is also supported by SCons for most Visual Studio versions. Since Visual Studio 2015 arm is supported, and since Visual Studio 2017 arm64 is supported. - Trying to set $MSVS_ARCH + Trying to set $MSVS_ARCH to an architecture that's not supported for a given Visual Studio version will generate an error. @@ -4229,7 +4605,8 @@ Versions ending in Exp refer to "Express" or MSVS_PROJECT_GUID - + + The string placed in a generated Microsoft Visual Studio project file as the value of the ProjectGUID attribute. There is no default @@ -4241,7 +4618,8 @@ defined, a new GUID is generated. MSVS_SCC_AUX_PATH - + + The path name placed in a generated Microsoft Visual Studio project file as the value of the SccAuxPath attribute if the @@ -4254,7 +4632,8 @@ no default value. MSVS_SCC_CONNECTION_ROOT - + + The root path of projects in your SCC workspace, i.e the path under which all project and solution files will be generated. It is used as a reference path from which the @@ -4278,7 +4657,8 @@ no default value. MSVS_SCC_PROJECT_NAME - + + The project name placed in a generated Microsoft Visual Studio project file as the value of the SccProjectName attribute if the @@ -4293,7 +4673,8 @@ no default value. MSVS_SCC_PROVIDER - + + The string placed in a generated Microsoft Visual Studio project file as the value of the SccProvider attribute. The string is @@ -4306,9 +4687,10 @@ no default value. MSVS_VERSION - Sets the preferred version of Microsoft Visual Studio to use. - - If $MSVS_VERSION is not set, SCons will (by default) + + Sets the preferred version of Microsoft Visual Studio to use. + + If $MSVS_VERSION is not set, SCons will (by default) select the latest version of Visual Studio installed on your system. So, if you have version 6 and version 7 (MSVS .NET) installed, it will prefer version 7. You can override this by @@ -4317,18 +4699,19 @@ no default value. version ('6.0' or '7.0', for example). If the specified version isn't installed, tool initialization will fail. - - This is obsolete: use $MSVC_VERSION instead. If - $MSVS_VERSION is set and $MSVC_VERSION is - not, $MSVC_VERSION will be set automatically to - $MSVS_VERSION. If both are set to different values, + + This is obsolete: use $MSVC_VERSION instead. If + $MSVS_VERSION is set and $MSVC_VERSION is + not, $MSVC_VERSION will be set automatically to + $MSVS_VERSION. If both are set to different values, scons will raise an error. MSVSBUILDCOM - + + The build command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified build targets. @@ -4337,7 +4720,8 @@ no default value. MSVSCLEANCOM - + + The clean command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with the -c option to remove any specified @@ -4347,7 +4731,8 @@ no default value. MSVSENCODING - + + The encoding string placed in a generated Microsoft Visual Studio project file. The default is encoding Windows-1252. @@ -4356,12 +4741,14 @@ no default value. MSVSPROJECTCOM - The action used to generate Microsoft Visual Studio project files. + + The action used to generate Microsoft Visual Studio project files. MSVSPROJECTSUFFIX - + + The suffix used for Microsoft Visual Studio project (DSP) files. The default value is .vcproj when using Visual Studio version 7.x (.NET) or later version, @@ -4372,7 +4759,8 @@ no default value. MSVSREBUILDCOM - + + The rebuild command line placed in a generated Microsoft Visual Studio project file. The default is to have Visual Studio invoke SCons with any specified rebuild targets. @@ -4382,7 +4770,8 @@ no default value. MSVSSCONS - + + The SCons used in generated Microsoft Visual Studio project files. The default is the version of SCons being used to generate the project file. @@ -4391,7 +4780,8 @@ no default value. MSVSSCONSCOM - + + The default SCons command used in generated Microsoft Visual Studio project files. @@ -4399,30 +4789,34 @@ no default value. MSVSSCONSCRIPT - - The sconscript file (that is, SConstruct or SConscript + + + The sconscript file (that is, SConstruct or SConscript file) that will be invoked by Visual Studio project files - (through the $MSVSSCONSCOM variable). The default + (through the $MSVSSCONSCOM variable). The default is the same sconscript file that contains the call to - MSVSProject to build the project file. + MSVSProject to build the project file. MSVSSCONSFLAGS - + + The SCons flags used in generated Microsoft Visual Studio project files. MSVSSOLUTIONCOM - The action used to generate Microsoft Visual Studio solution files. + + The action used to generate Microsoft Visual Studio solution files. MSVSSOLUTIONSUFFIX - + + The suffix used for Microsoft Visual Studio solution (DSW) files. The default value is .sln when using Visual Studio version 7.x (.NET), and @@ -4433,38 +4827,43 @@ no default value. MT - + + The program used on Windows systems to embed manifests into DLLs and EXEs. -See also $WINDOWS_EMBED_MANIFEST. +See also $WINDOWS_EMBED_MANIFEST. MTEXECOM - + + The Windows command line used to embed manifests into executables. -See also $MTSHLIBCOM. +See also $MTSHLIBCOM. MTFLAGS - -Flags passed to the $MT manifest embedding program (Windows only). + + +Flags passed to the $MT manifest embedding program (Windows only). MTSHLIBCOM - + + The Windows command line used to embed manifests into shared libraries (DLLs). -See also $MTEXECOM. +See also $MTEXECOM. MWCW_VERSION - + + The version number of the MetroWerks CodeWarrior C compiler to be used. @@ -4472,7 +4871,8 @@ to be used. MWCW_VERSIONS - + + A list of installed versions of the MetroWerks CodeWarrior C compiler on this system. @@ -4480,14 +4880,16 @@ on this system. NAME - + + Specfies the name of the project to package. no_import_lib - + + When set to non-zero, suppresses creation of a corresponding Windows static import lib by the SharedLibrary @@ -4501,21 +4903,24 @@ when using Microsoft Visual Studio. OBJPREFIX - + + The prefix used for (static) object file names. OBJSUFFIX - + + The suffix used for (static) object file names. PACKAGEROOT - + + Specifies the directory where all files in resulting archive will be placed if applicable. The default value is "$NAME-$VERSION". @@ -4523,11 +4928,12 @@ placed if applicable. The default value is "$NAME-$VERSION". PACKAGETYPE - + + Selects the package type to build. Currently these are available: - + * msi - Microsoft Installer * rpm - Redhat Package Manger * ipkg - Itsy Package Management System @@ -4539,14 +4945,15 @@ Selects the package type to build. Currently these are available: * src_zip - zip file source - + This may be overridden with the "package_type" command line option. PACKAGEVERSION - + + The version of the package (not the underlying project). This is currently only used by the rpm packager and should reflect changes in the packaging, @@ -4556,7 +4963,8 @@ not the underlying project code itself. PCH - + + The Microsoft Visual C++ precompiled header that will be used when compiling object files. This variable is ignored by tools other than Microsoft Visual C++. When this variable is @@ -4566,40 +4974,44 @@ dependencies for the PCH file. Example: - + env['PCH'] = 'StdAfx.pch' PCHCOM - + + The command line used by the -PCH +PCH builder to generated a precompiled header. PCHCOMSTR - + + The string displayed when generating a precompiled header. -If this is not set, then $PCHCOM (the command line) is displayed. +If this is not set, then $PCHCOM (the command line) is displayed. PCHPDBFLAGS - + + A construction variable that, when expanded, adds the /yD flag to the command line -only if the $PDB construction variable is set. +only if the $PDB construction variable is set. PCHSTOP - + + This variable specifies how much of a source file is precompiled. This variable is ignored by tools other than Microsoft Visual C++, or when the PCH variable is not being used. When this variable is define it @@ -4608,14 +5020,15 @@ is included at the end of the precompiled portion of the source files, or the empty string if the "#pragma hrdstop" construct is being used: - + env['PCHSTOP'] = 'StdAfx.h' PDB - + + The Microsoft Visual C++ PDB file that will store debugging information for object files, shared libraries, and programs. This variable is ignored by tools other than Microsoft Visual C++. @@ -4626,11 +5039,11 @@ dependencies for the PDB file. Example: - + env['PDB'] = 'hello.pdb' - + The Visual C++ compiler switch that SCons uses by default to generate PDB information is . This works correctly with parallel () builds @@ -4642,104 +5055,116 @@ Using the instead may yield improved link-time performance, although parallel builds will no longer work. You can generate PDB files with the -switch by overriding the default $CCPDBFLAGS variable; +switch by overriding the default $CCPDBFLAGS variable; see the entry for that variable for specific examples. PDFCOM - -A deprecated synonym for $DVIPDFCOM. + + +A deprecated synonym for $DVIPDFCOM. PDFLATEX - -The pdflatex utility. + + +The pdflatex utility. PDFLATEXCOM - -The command line used to call the pdflatex utility. + + +The command line used to call the pdflatex utility. PDFLATEXCOMSTR - -The string displayed when calling the pdflatex utility. -If this is not set, then $PDFLATEXCOM (the command line) is displayed. + + +The string displayed when calling the pdflatex utility. +If this is not set, then $PDFLATEXCOM (the command line) is displayed. - + env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES") PDFLATEXFLAGS - -General options passed to the pdflatex utility. + + +General options passed to the pdflatex utility. PDFPREFIX - + + The prefix used for PDF file names. PDFSUFFIX - + + The suffix used for PDF file names. PDFTEX - -The pdftex utility. + + +The pdftex utility. PDFTEXCOM - -The command line used to call the pdftex utility. + + +The command line used to call the pdftex utility. PDFTEXCOMSTR - -The string displayed when calling the pdftex utility. -If this is not set, then $PDFTEXCOM (the command line) is displayed. + + +The string displayed when calling the pdftex utility. +If this is not set, then $PDFTEXCOM (the command line) is displayed. - + env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES") PDFTEXFLAGS - -General options passed to the pdftex utility. + + +General options passed to the pdftex utility. PKGCHK - + + On Solaris systems, the package-checking program that will -be used (along with $PKGINFO) +be used (along with $PKGINFO) to look for installed versions of the Sun PRO C++ compiler. The default is @@ -4749,10 +5174,11 @@ The default is PKGINFO - + + On Solaris systems, the package information program that will -be used (along with $PKGCHK) +be used (along with $PKGCHK) to look for installed versions of the Sun PRO C++ compiler. The default is @@ -4762,14 +5188,15 @@ The default is PLATFORM - + + The name of the platform used to create the Environment. If no platform is specified when the Environment is created, -scons +scons autodetects the platform. - + env = Environment(tools = []) if env['PLATFORM'] == 'cygwin': Tool('mingw')(env) @@ -4780,41 +5207,45 @@ else: POAUTOINIT - -The $POAUTOINIT variable, if set to True (on non-zero -numeric value), let the msginit tool to automatically initialize + + +The $POAUTOINIT variable, if set to True (on non-zero +numeric value), let the msginit tool to automatically initialize missing PO files with msginit(1). This applies to both, -POInit and POUpdate builders (and others that use any of +POInit and POUpdate builders (and others that use any of them). POCREATE_ALIAS - -Common alias for all PO files created with POInit + + +Common alias for all PO files created with POInit builder (default: 'po-create'). -See msginit tool and POInit builder. +See msginit tool and POInit builder. POSUFFIX - + + Suffix used for PO files (default: '.po') -See msginit tool and POInit builder. +See msginit tool and POInit builder. POTDOMAIN - -The $POTDOMAIN defines default domain, used to generate -POT filename as $POTDOMAIN.pot when + + +The $POTDOMAIN defines default domain, used to generate +POT filename as $POTDOMAIN.pot when no POT file name is provided by the user. This applies to -POTUpdate, POInit and POUpdate builders (and -builders, that use them, e.g. Translate). Normally (if $POTDOMAIN is +POTUpdate, POInit and POUpdate builders (and +builders, that use them, e.g. Translate). Normally (if $POTDOMAIN is not defined), the builders use messages.pot as default POT file name. @@ -4822,33 +5253,37 @@ not defined), the builders use messages.pot as default POTSUFFIX - + + Suffix used for PO Template files (default: '.pot'). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. POTUPDATE_ALIAS - + + Name of the common phony target for all PO Templates created with -POUpdate (default: 'pot-update'). -See xgettext tool and POTUpdate builder. +POUpdate (default: 'pot-update'). +See xgettext tool and POTUpdate builder. POUPDATE_ALIAS - + + Common alias for all PO files being defined with -POUpdate builder (default: 'po-update'). -See msgmerge tool and POUpdate builder. +POUpdate builder (default: 'po-update'). +See msgmerge tool and POUpdate builder. PRINT_CMD_LINE_FUNC - + + A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the @@ -4866,20 +5301,20 @@ the source(s) used (file node, list, or string name(s)), and the environment being used. - + The function must do the printing itself. The default implementation, used if this variable is not set or is None, is: - + def print_cmd_line(s, target, source, env): sys.stdout.write(s + "\n") - + Here's an example of a more interesting function: - + def print_cmd_line(s, target, source, env): sys.stdout.write("Building %s -> %s...\n" % (' and '.join([str(x) for x in source]), @@ -4888,7 +5323,7 @@ env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env.Program('foo', 'foo.c') - + This just prints "Building targetname from sourcename..." instead of the actual commands. Such a function could also log the actual commands to a log file, @@ -4898,58 +5333,66 @@ for example. PROGEMITTER - + + TODO PROGPREFIX - + + The prefix used for executable file names. PROGSUFFIX - + + The suffix used for executable file names. PSCOM - + + The command line used to convert TeX DVI files into a PostScript file. PSCOMSTR - + + The string displayed when a TeX DVI file is converted into a PostScript file. -If this is not set, then $PSCOM (the command line) is displayed. +If this is not set, then $PSCOM (the command line) is displayed. PSPREFIX - + + The prefix used for PostScript file names. PSSUFFIX - + + The prefix used for PostScript file names. QT_AUTOSCAN - + + Turn off scanning for mocable files. Use the Moc Builder to explicitly specify files to run moc on. @@ -4957,66 +5400,74 @@ specify files to run moc on. QT_BINPATH - + + The path where the qt binaries are installed. -The default value is '$QTDIR/bin'. +The default value is '$QTDIR/bin'. QT_CPPPATH - + + The path where the qt header files are installed. -The default value is '$QTDIR/include'. +The default value is '$QTDIR/include'. Note: If you set this variable to None, -the tool won't change the $CPPPATH +the tool won't change the $CPPPATH construction variable. QT_DEBUG - + + Prints lots of debugging information while scanning for moc files. QT_LIB - + + Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set -this variable to None, the tool won't change the $LIBS variable. +this variable to None, the tool won't change the $LIBS variable. QT_LIBPATH - + + The path where the qt libraries are installed. -The default value is '$QTDIR/lib'. +The default value is '$QTDIR/lib'. Note: If you set this variable to None, -the tool won't change the $LIBPATH +the tool won't change the $LIBPATH construction variable. QT_MOC - -Default value is '$QT_BINPATH/moc'. + + +Default value is '$QT_BINPATH/moc'. QT_MOCCXXPREFIX - + + Default value is ''. Prefix for moc output files, when source is a cxx file. QT_MOCCXXSUFFIX - + + Default value is '.moc'. Suffix for moc output files, when source is a cxx file. @@ -5024,22 +5475,25 @@ file. QT_MOCFROMCXXCOM - + + Command to generate a moc file from a cpp file. QT_MOCFROMCXXCOMSTR - + + The string displayed when generating a moc file from a cpp file. -If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. +If this is not set, then $QT_MOCFROMCXXCOM (the command line) is displayed. QT_MOCFROMCXXFLAGS - + + Default value is '-i'. These flags are passed to moc, when moccing a C++ file. @@ -5047,22 +5501,25 @@ C++ file. QT_MOCFROMHCOM - + + Command to generate a moc file from a header. QT_MOCFROMHCOMSTR - + + The string displayed when generating a moc file from a cpp file. -If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. +If this is not set, then $QT_MOCFROMHCOM (the command line) is displayed. QT_MOCFROMHFLAGS - + + Default value is ''. These flags are passed to moc, when moccing a header file. @@ -5070,44 +5527,50 @@ file. QT_MOCHPREFIX - + + Default value is 'moc_'. Prefix for moc output files, when source is a header. QT_MOCHSUFFIX - -Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is + + +Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is a header. QT_UIC - -Default value is '$QT_BINPATH/uic'. + + +Default value is '$QT_BINPATH/uic'. QT_UICCOM - + + Command to generate header files from .ui files. QT_UICCOMSTR - + + The string displayed when generating header files from .ui files. -If this is not set, then $QT_UICCOM (the command line) is displayed. +If this is not set, then $QT_UICCOM (the command line) is displayed. QT_UICDECLFLAGS - + + Default value is ''. These flags are passed to uic, when creating a a h file from a .ui file. @@ -5115,21 +5578,24 @@ file from a .ui file. QT_UICDECLPREFIX - + + Default value is ''. Prefix for uic generated header files. QT_UICDECLSUFFIX - + + Default value is '.h'. Suffix for uic generated header files. QT_UICIMPLFLAGS - + + Default value is ''. These flags are passed to uic, when creating a cxx file from a .ui file. @@ -5137,29 +5603,33 @@ file from a .ui file. QT_UICIMPLPREFIX - + + Default value is 'uic_'. Prefix for uic generated implementation files. QT_UICIMPLSUFFIX - -Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation + + +Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation files. QT_UISUFFIX - + + Default value is '.ui'. Suffix of designer input files. QTDIR - + + The qt tool tries to take this from os.environ. It also initializes all QT_* construction variables listed below. @@ -5168,24 +5638,24 @@ with python's os.path.join() method, but are listed here with the '/' separator for easier reading.) In addition, the construction environment -variables $CPPPATH, -$LIBPATH and -$LIBS may be modified +variables $CPPPATH, +$LIBPATH and +$LIBS may be modified and the variables -$PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER +$PROGEMITTER, $SHLIBEMITTER and $LIBEMITTER are modified. Because the build-performance is affected when using this tool, you have to explicitly specify it at Environment creation: - + Environment(tools=['default','qt']) - + The qt tool supports the following operations: - + Automatic moc file generation from header files. You do not have to specify moc files explicitly, the tool does it for you. However, there are a few preconditions to do so: Your header file must have @@ -5193,11 +5663,11 @@ the same filebase as your implementation file and must stay in the same directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding -Moc() +Moc() builder method. - + Automatic moc file generation from cxx files. As stated in the qt documentation, include the moc file at the end of the cxx file. Note that you have to include the file, which is generated @@ -5206,11 +5676,11 @@ by the transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by d do not include the correct file. If you are using VariantDir, you may need to specify duplicate=1. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0. See also the corresponding -Moc +Moc builder method. - + Automatic handling of .ui files. The implementation files generated from .ui files are handled much the same as yacc or lex files. Each .ui file given as a source of Program, Library or @@ -5218,47 +5688,52 @@ SharedLibrary will generate three files, the declaration file, the implementation file and a moc file. Because there are also generated headers, you may need to specify duplicate=1 in calls to VariantDir. See also the corresponding -Uic +Uic builder method. RANLIB - + + The archive indexer. RANLIBCOM - + + The command line used to index a static library archive. RANLIBCOMSTR - + + The string displayed when a static library archive is indexed. -If this is not set, then $RANLIBCOM (the command line) is displayed. +If this is not set, then $RANLIBCOM (the command line) is displayed. - + env = Environment(RANLIBCOMSTR = "Indexing $TARGET") RANLIBFLAGS - + + General options passed to the archive indexer. RC - + + The resource compiler used to build a Microsoft Visual C++ resource file. @@ -5266,7 +5741,8 @@ a Microsoft Visual C++ resource file. RCCOM - + + The command line used to build a Microsoft Visual C++ resource file. @@ -5274,60 +5750,66 @@ a Microsoft Visual C++ resource file. RCCOMSTR - + + The string displayed when invoking the resource compiler to build a Microsoft Visual C++ resource file. -If this is not set, then $RCCOM (the command line) is displayed. +If this is not set, then $RCCOM (the command line) is displayed. RCFLAGS - + + The flags passed to the resource compiler by the RES builder. RCINCFLAGS - + + An automatically-generated construction variable containing the command-line options for specifying directories to be searched by the resource compiler. -The value of $RCINCFLAGS is created +The value of $RCINCFLAGS is created by respectively prepending and appending -$RCINCPREFIX and $RCINCSUFFIX +$RCINCPREFIX and $RCINCSUFFIX to the beginning and end -of each directory in $CPPPATH. +of each directory in $CPPPATH. RCINCPREFIX - + + The prefix (flag) used to specify an include directory on the resource compiler command line. This will be prepended to the beginning of each directory -in the $CPPPATH construction variable -when the $RCINCFLAGS variable is expanded. +in the $CPPPATH construction variable +when the $RCINCFLAGS variable is expanded. RCINCSUFFIX - + + The suffix used to specify an include directory on the resource compiler command line. This will be appended to the end of each directory -in the $CPPPATH construction variable -when the $RCINCFLAGS variable is expanded. +in the $CPPPATH construction variable +when the $RCINCFLAGS variable is expanded. RDirs - + + A function that converts a string into a list of Dir instances by searching the repositories. @@ -5335,35 +5817,39 @@ searching the repositories. REGSVR - + + The program used on Windows systems to register a newly-built DLL library -whenever the SharedLibrary builder +whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOM - + + The command line used on Windows systems to register a newly-built DLL library -whenever the SharedLibrary builder +whenever the SharedLibrary builder is passed a keyword argument of register=1. REGSVRCOMSTR - + + The string displayed when registering a newly-built DLL file. -If this is not set, then $REGSVRCOM (the command line) is displayed. +If this is not set, then $REGSVRCOM (the command line) is displayed. REGSVRFLAGS - + + Flags passed to the DLL registration program on Windows systems when a newly-built DLL library is registered. By default, @@ -5375,66 +5861,72 @@ and requiring user attention. RMIC - + + The Java RMI stub compiler. RMICCOM - + + The command line used to compile stub and skeleton class files from Java classes that contain RMI implementations. -Any options specified in the $RMICFLAGS construction variable +Any options specified in the $RMICFLAGS construction variable are included on this command line. RMICCOMSTR - + + The string displayed when compiling stub and skeleton class files from Java classes that contain RMI implementations. -If this is not set, then $RMICCOM (the command line) is displayed. +If this is not set, then $RMICCOM (the command line) is displayed. - + env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES") RMICFLAGS - + + General options passed to the Java RMI stub compiler. _RPATH - + + An automatically-generated construction variable containing the rpath flags to be used when linking a program with shared libraries. -The value of $_RPATH is created -by respectively prepending $RPATHPREFIX and appending $RPATHSUFFIX +The value of $_RPATH is created +by respectively prepending $RPATHPREFIX and appending $RPATHSUFFIX to the beginning and end -of each directory in $RPATH. +of each directory in $RPATH. RPATH - + + A list of paths to search for shared libraries when running programs. Currently only used in the GNU (gnulink), IRIX (sgilink) and Sun (sunlink) linkers. Ignored on platforms and toolchains that don't support it. Note that the paths added to RPATH are not transformed by -scons +scons in any way: if you want an absolute path, you must make it absolute yourself. @@ -5442,87 +5934,96 @@ path, you must make it absolute yourself. RPATHPREFIX - + + The prefix used to specify a directory to be searched for shared libraries when running programs. This will be prepended to the beginning of each directory -in the $RPATH construction variable -when the $_RPATH variable is automatically generated. +in the $RPATH construction variable +when the $_RPATH variable is automatically generated. RPATHSUFFIX - + + The suffix used to specify a directory to be searched for shared libraries when running programs. This will be appended to the end of each directory -in the $RPATH construction variable -when the $_RPATH variable is automatically generated. +in the $RPATH construction variable +when the $_RPATH variable is automatically generated. RPCGEN - + + The RPC protocol compiler. RPCGENCLIENTFLAGS - + + Options passed to the RPC protocol compiler when generating client side stubs. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENFLAGS - + + General options passed to the RPC protocol compiler. RPCGENHEADERFLAGS - + + Options passed to the RPC protocol compiler when generating a header file. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENSERVICEFLAGS - + + Options passed to the RPC protocol compiler when generating server side stubs. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. RPCGENXDRFLAGS - + + Options passed to the RPC protocol compiler when generating XDR routines. These are in addition to any flags specified in the -$RPCGENFLAGS +$RPCGENFLAGS construction variable. SCANNERS - + + A list of the available implicit dependency scanners. New file scanners may be added by appending to this list, @@ -5537,50 +6038,55 @@ below, for more information. SCONS_HOME - + + The (optional) path to the SCons library directory, initialized from the external environment. If set, this is used to construct a shorter and more efficient search path in - the $MSVSSCONS command line executed from Microsoft + the $MSVSSCONS command line executed from Microsoft Visual Studio project files. SHCC - + + The C compiler used for generating shared-library objects. SHCCCOM - + + The command line used to compile a C source file to a shared-library object file. -Any options specified in the $SHCFLAGS, -$SHCCFLAGS and -$CPPFLAGS construction variables +Any options specified in the $SHCFLAGS, +$SHCCFLAGS and +$CPPFLAGS construction variables are included on this command line. SHCCCOMSTR - + + The string displayed when a C source file is compiled to a shared object file. -If this is not set, then $SHCCCOM (the command line) is displayed. +If this is not set, then $SHCCCOM (the command line) is displayed. - + env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") SHCCFLAGS - + + Options that are passed to the C and C++ compilers to generate shared-library objects. @@ -5588,7 +6094,8 @@ to generate shared-library objects. SHCFLAGS - + + Options that are passed to the C compiler (only; not C++) to generate shared-library objects. @@ -5596,38 +6103,42 @@ to generate shared-library objects. SHCXX - + + The C++ compiler used for generating shared-library objects. SHCXXCOM - + + The command line used to compile a C++ source file to a shared-library object file. -Any options specified in the $SHCXXFLAGS and -$CPPFLAGS construction variables +Any options specified in the $SHCXXFLAGS and +$CPPFLAGS construction variables are included on this command line. SHCXXCOMSTR - + + The string displayed when a C++ source file is compiled to a shared object file. -If this is not set, then $SHCXXCOM (the command line) is displayed. +If this is not set, then $SHCXXCOM (the command line) is displayed. - + env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET") SHCXXFLAGS - + + Options that are passed to the C++ compiler to generate shared-library objects. @@ -5635,15 +6146,18 @@ to generate shared-library objects. SHDC - + + The name of the compiler to use when compiling D source destined to be in a shared objects. - + + The name of the compiler to use when compiling D source destined to be in a shared objects. - + + The name of the compiler to use when compiling D source destined to be in a shared objects. @@ -5651,42 +6165,50 @@ to generate shared-library objects. SHDCOM - + + The command line to use when compiling code to be part of shared objects. - + + The command line to use when compiling code to be part of shared objects. - + + The command line to use when compiling code to be part of shared objects. SHDLIBVERSION - + + SHDLIBVERSION. SHDLIBVERSIONFLAGS - + + SHDLIBVERSIONFLAGS. SHDLINK - + + The linker to use when creating shared objects for code bases include D sources. - + + The linker to use when creating shared objects for code bases include D sources. - + + The linker to use when creating shared objects for code bases include D sources. @@ -5694,62 +6216,71 @@ to generate shared-library objects. SHDLINKCOM - + + The command line to use when generating shared objects. - + + The command line to use when generating shared objects. - + + The command line to use when generating shared objects. SHDLINKFLAGS - + + The list of flags to use when generating a shared object. - + + The list of flags to use when generating a shared object. - + + The list of flags to use when generating a shared object. SHELL - + + A string naming the shell program that will be passed to the -$SPAWN +$SPAWN function. See the -$SPAWN +$SPAWN construction variable for more information. SHF03 - + + The Fortran 03 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF03 if you need to use a specific compiler +You only need to set $SHF03 if you need to use a specific compiler or compiler version for Fortran 03 files. SHF03COM - + + The command line used to compile a Fortran 03 source file to a shared-library object file. -You only need to set $SHF03COM if you need to use a specific +You only need to set $SHF03COM if you need to use a specific command line for Fortran 03 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -5757,22 +6288,24 @@ for all Fortran versions. SHF03COMSTR - + + The string displayed when a Fortran 03 source file is compiled to a shared-library object file. -If this is not set, then $SHF03COM or $SHFORTRANCOM +If this is not set, then $SHF03COM or $SHFORTRANCOM (the command line) is displayed. SHF03FLAGS - + + Options that are passed to the Fortran 03 compiler to generated shared-library objects. -You only need to set $SHF03FLAGS if you need to define specific +You only need to set $SHF03FLAGS if you need to define specific user options for Fortran 03 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -5781,15 +6314,16 @@ for all Fortran versions. SHF03PPCOM - + + The command line used to compile a Fortran 03 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF03FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF03FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF03PPCOM if you need to use a specific +You only need to set $SHF03PPCOM if you need to use a specific C-preprocessor command line for Fortran 03 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -5797,35 +6331,38 @@ for all Fortran versions. SHF03PPCOMSTR - + + 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 $SHF03PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF03PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF08 - + + The Fortran 08 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF08 if you need to use a specific compiler +You only need to set $SHF08 if you need to use a specific compiler or compiler version for Fortran 08 files. SHF08COM - + + The command line used to compile a Fortran 08 source file to a shared-library object file. -You only need to set $SHF08COM if you need to use a specific +You only need to set $SHF08COM if you need to use a specific command line for Fortran 08 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -5833,22 +6370,24 @@ for all Fortran versions. SHF08COMSTR - + + The string displayed when a Fortran 08 source file is compiled to a shared-library object file. -If this is not set, then $SHF08COM or $SHFORTRANCOM +If this is not set, then $SHF08COM or $SHFORTRANCOM (the command line) is displayed. SHF08FLAGS - + + Options that are passed to the Fortran 08 compiler to generated shared-library objects. -You only need to set $SHF08FLAGS if you need to define specific +You only need to set $SHF08FLAGS if you need to define specific user options for Fortran 08 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -5857,15 +6396,16 @@ for all Fortran versions. SHF08PPCOM - + + The command line used to compile a Fortran 08 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF08FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF08FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF08PPCOM if you need to use a specific +You only need to set $SHF08PPCOM if you need to use a specific C-preprocessor command line for Fortran 08 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -5873,35 +6413,38 @@ for all Fortran versions. SHF08PPCOMSTR - + + 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 $SHF08PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF08PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF77 - + + The Fortran 77 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF77 if you need to use a specific compiler +You only need to set $SHF77 if you need to use a specific compiler or compiler version for Fortran 77 files. SHF77COM - + + The command line used to compile a Fortran 77 source file to a shared-library object file. -You only need to set $SHF77COM if you need to use a specific +You only need to set $SHF77COM if you need to use a specific command line for Fortran 77 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -5909,22 +6452,24 @@ for all Fortran versions. SHF77COMSTR - + + The string displayed when a Fortran 77 source file is compiled to a shared-library object file. -If this is not set, then $SHF77COM or $SHFORTRANCOM +If this is not set, then $SHF77COM or $SHFORTRANCOM (the command line) is displayed. SHF77FLAGS - + + Options that are passed to the Fortran 77 compiler to generated shared-library objects. -You only need to set $SHF77FLAGS if you need to define specific +You only need to set $SHF77FLAGS if you need to define specific user options for Fortran 77 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -5933,15 +6478,16 @@ for all Fortran versions. SHF77PPCOM - + + The command line used to compile a Fortran 77 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF77PPCOM if you need to use a specific +You only need to set $SHF77PPCOM if you need to use a specific C-preprocessor command line for Fortran 77 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -5949,35 +6495,38 @@ for all Fortran versions. SHF77PPCOMSTR - + + 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 $SHF77PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF77PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF90 - + + The Fortran 90 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF90 if you need to use a specific compiler +You only need to set $SHF90 if you need to use a specific compiler or compiler version for Fortran 90 files. SHF90COM - + + The command line used to compile a Fortran 90 source file to a shared-library object file. -You only need to set $SHF90COM if you need to use a specific +You only need to set $SHF90COM if you need to use a specific command line for Fortran 90 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -5985,22 +6534,24 @@ for all Fortran versions. SHF90COMSTR - + + The string displayed when a Fortran 90 source file is compiled to a shared-library object file. -If this is not set, then $SHF90COM or $SHFORTRANCOM +If this is not set, then $SHF90COM or $SHFORTRANCOM (the command line) is displayed. SHF90FLAGS - + + Options that are passed to the Fortran 90 compiler to generated shared-library objects. -You only need to set $SHF90FLAGS if you need to define specific +You only need to set $SHF90FLAGS if you need to define specific user options for Fortran 90 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6009,15 +6560,16 @@ for all Fortran versions. SHF90PPCOM - + + The command line used to compile a Fortran 90 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF90PPCOM if you need to use a specific +You only need to set $SHF90PPCOM if you need to use a specific C-preprocessor command line for Fortran 90 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6025,35 +6577,38 @@ for all Fortran versions. SHF90PPCOMSTR - + + 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 $SHF90PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF90PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHF95 - + + The Fortran 95 compiler used for generating shared-library objects. -You should normally set the $SHFORTRAN variable, +You should normally set the $SHFORTRAN variable, which specifies the default Fortran compiler for all Fortran versions. -You only need to set $SHF95 if you need to use a specific compiler +You only need to set $SHF95 if you need to use a specific compiler or compiler version for Fortran 95 files. SHF95COM - + + The command line used to compile a Fortran 95 source file to a shared-library object file. -You only need to set $SHF95COM if you need to use a specific +You only need to set $SHF95COM if you need to use a specific command line for Fortran 95 files. -You should normally set the $SHFORTRANCOM variable, +You should normally set the $SHFORTRANCOM variable, which specifies the default command line for all Fortran versions. @@ -6061,22 +6616,24 @@ for all Fortran versions. SHF95COMSTR - + + The string displayed when a Fortran 95 source file is compiled to a shared-library object file. -If this is not set, then $SHF95COM or $SHFORTRANCOM +If this is not set, then $SHF95COM or $SHFORTRANCOM (the command line) is displayed. SHF95FLAGS - + + Options that are passed to the Fortran 95 compiler to generated shared-library objects. -You only need to set $SHF95FLAGS if you need to define specific +You only need to set $SHF95FLAGS if you need to define specific user options for Fortran 95 files. -You should normally set the $SHFORTRANFLAGS variable, +You should normally set the $SHFORTRANFLAGS variable, which specifies the user-specified options passed to the default Fortran compiler for all Fortran versions. @@ -6085,15 +6642,16 @@ for all Fortran versions. SHF95PPCOM - + + The command line used to compile a Fortran 95 source file to a shared-library object file after first running the file through the C preprocessor. -Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables +Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables are included on this command line. -You only need to set $SHF95PPCOM if you need to use a specific +You only need to set $SHF95PPCOM if you need to use a specific C-preprocessor command line for Fortran 95 files. -You should normally set the $SHFORTRANPPCOM variable, +You should normally set the $SHFORTRANPPCOM variable, which specifies the default C-preprocessor command line for all Fortran versions. @@ -6101,25 +6659,28 @@ for all Fortran versions. SHF95PPCOMSTR - + + 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 $SHF95PPCOM or $SHFORTRANPPCOM +If this is not set, then $SHF95PPCOM or $SHFORTRANPPCOM (the command line) is displayed. SHFORTRAN - + + The default Fortran compiler used for generating shared-library objects. SHFORTRANCOM - + + The command line used to compile a Fortran source file to a shared-library object file. @@ -6127,17 +6688,19 @@ to a shared-library object file. SHFORTRANCOMSTR - + + The string displayed when a Fortran source file is compiled to a shared-library object file. -If this is not set, then $SHFORTRANCOM +If this is not set, then $SHFORTRANCOM (the command line) is displayed. SHFORTRANFLAGS - + + Options that are passed to the Fortran compiler to generate shared-library objects. @@ -6145,85 +6708,94 @@ to generate shared-library objects. SHFORTRANPPCOM - + + The command line used to compile a Fortran source file to a shared-library object file after first running the file through the C preprocessor. Any options specified -in the $SHFORTRANFLAGS and -$CPPFLAGS construction variables +in the $SHFORTRANFLAGS and +$CPPFLAGS construction variables are included on this command line. SHFORTRANPPCOMSTR - + + 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 $SHFORTRANPPCOM +If this is not set, then $SHFORTRANPPCOM (the command line) is displayed. SHLIBEMITTER - + + TODO SHLIBNOVERSIONSYMLINKS - -Instructs the SharedLibrary builder to not create symlinks for versioned + + +Instructs the SharedLibrary builder to not create symlinks for versioned shared libraries. SHLIBPREFIX - + + The prefix used for shared library file names. _SHLIBSONAME - + + A macro that automatically generates shared library's SONAME based on $TARGET, -$SHLIBVERSION and $SHLIBSUFFIX. Used by SharedLibrary builder when -the linker tool supports SONAME (e.g. gnulink). +$SHLIBVERSION and $SHLIBSUFFIX. Used by SharedLibrary builder when +the linker tool supports SONAME (e.g. gnulink). SHLIBSUFFIX - + + The suffix used for shared library file names. SHLIBVERSION - + + When this construction variable is defined, a versioned shared library -is created by SharedLibrary builder. This activates the -$_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as +is created by SharedLibrary builder. This activates the +$_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as required, adds the version number to the library name, and creates the symlinks -that are needed. $SHLIBVERSION versions should exist as alpha-numeric, +that are needed. $SHLIBVERSION versions should exist as alpha-numeric, decimal-delimited values as defined by the regular expression "\w+[\.\w+]*". -Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. +Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. _SHLIBVERSIONFLAGS - -This macro automatically introduces extra flags to $SHLINKCOM when -building versioned SharedLibrary (that is when $SHLIBVERSION -is set). _SHLIBVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS + + +This macro automatically introduces extra flags to $SHLINKCOM when +building versioned SharedLibrary (that is when $SHLIBVERSION +is set). _SHLIBVERSIONFLAGS usually adds $SHLIBVERSIONFLAGS and some extra dynamically generated options (such as -Wl,-soname=$_SHLIBSONAME. It is unused by "plain" (unversioned) shared libraries. @@ -6232,58 +6804,63 @@ and some extra dynamically generated options (such as SHLIBVERSIONFLAGS - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is set. SHLINK - + + The linker for programs that use shared libraries. SHLINKCOM - + + The command line used to link programs using shared libraries. SHLINKCOMSTR - + + The string displayed when programs using shared libraries are linked. -If this is not set, then $SHLINKCOM (the command line) is displayed. +If this is not set, then $SHLINKCOM (the command line) is displayed. - + env = Environment(SHLINKCOMSTR = "Linking shared $TARGET") SHLINKFLAGS - + + General user options passed to the linker for programs using shared libraries. Note that this variable should not contain -(or similar) options for linking with the libraries listed in $LIBS, +(or similar) options for linking with the libraries listed in $LIBS, nor (or similar) include search path options -that scons generates automatically from $LIBPATH. +that scons generates automatically from $LIBPATH. See -$_LIBFLAGS +$_LIBFLAGS above, for the variable that expands to library-link options, and -$_LIBDIRFLAGS +$_LIBDIRFLAGS above, for the variable that expands to library search path options. @@ -6291,32 +6868,36 @@ for the variable that expands to library search path options. SHOBJPREFIX - + + The prefix used for shared object file names. SHOBJSUFFIX - + + The suffix used for shared object file names. SONAME - + + Variable used to hard-code SONAME for versioned shared library/loadable module. env.SharedLibrary('test', 'test.c', SHLIBVERSION='0.1.2', SONAME='libtest.so.2') -The variable is used, for example, by gnulink linker tool. +The variable is used, for example, by gnulink linker tool. SOURCE - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6325,7 +6906,8 @@ that may not be set or used in a construction environment. SOURCE_URL - + + The URL (web address) of the location from which the project was retrieved. @@ -6337,7 +6919,8 @@ field in the controlling information for Ipkg and RPM packages. SOURCES - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6346,16 +6929,17 @@ that may not be set or used in a construction environment. SPAWN - + + A command interpreter function that will be called to execute command line strings. The function must expect the following arguments: - + def spawn(shell, escape, cmd, args, env): - + sh is a string naming the shell program to use. escape @@ -6373,15 +6957,17 @@ in which the command should be executed. STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME - + + When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library. SUBST_DICT - -The dictionary used by the Substfile or Textfile builders + + +The dictionary used by the Substfile or Textfile builders for substitution values. It can be anything acceptable to the dict() constructor, so in addition to a dictionary, @@ -6391,23 +6977,26 @@ lists of tuples are also acceptable. SUBSTFILEPREFIX - -The prefix used for Substfile file names, + + +The prefix used for Substfile file names, the null string by default. SUBSTFILESUFFIX - -The suffix used for Substfile file names, + + +The suffix used for Substfile file names, the null string by default. SUMMARY - + + A short summary of what the project is about. This is used to fill in the Summary: @@ -6420,32 +7009,35 @@ field in MSI packages. SWIG - + + The scripting language wrapper and interface generator. SWIGCFILESUFFIX - + + The suffix that will be used for intermediate C source files generated by the scripting language wrapper and interface generator. The default value is -_wrap$CFILESUFFIX. +_wrap$CFILESUFFIX. By default, this value is used whenever the option is not specified as part of the -$SWIGFLAGS +$SWIGFLAGS construction variable. SWIGCOM - + + The command line used to call the scripting language wrapper and interface generator. @@ -6453,32 +7045,35 @@ the scripting language wrapper and interface generator. SWIGCOMSTR - + + The string displayed when calling the scripting language wrapper and interface generator. -If this is not set, then $SWIGCOM (the command line) is displayed. +If this is not set, then $SWIGCOM (the command line) is displayed. SWIGCXXFILESUFFIX - + + The suffix that will be used for intermediate C++ source files generated by the scripting language wrapper and interface generator. The default value is -_wrap$CFILESUFFIX. +_wrap$CFILESUFFIX. By default, this value is used whenever the -c++ option is specified as part of the -$SWIGFLAGS +$SWIGFLAGS construction variable. SWIGDIRECTORSUFFIX - + + The suffix that will be used for intermediate C++ header files generated by the scripting language wrapper and interface generator. These are only generated for C++ code when the SWIG 'directors' feature is @@ -6490,7 +7085,8 @@ The default value is SWIGFLAGS - + + General options passed to the scripting language wrapper and interface generator. This is where you should set @@ -6501,57 +7097,61 @@ or whatever other options you want to specify to SWIG. If you set the option in this variable, -scons +scons will, by default, generate a C++ intermediate source file with the extension that is specified as the -$CXXFILESUFFIX +$CXXFILESUFFIX variable. _SWIGINCFLAGS - + + An automatically-generated construction variable containing the SWIG command-line options for specifying directories to be searched for included files. -The value of $_SWIGINCFLAGS is created +The value of $_SWIGINCFLAGS is created by respectively prepending and appending -$SWIGINCPREFIX and $SWIGINCSUFFIX +$SWIGINCPREFIX and $SWIGINCSUFFIX to the beginning and end -of each directory in $SWIGPATH. +of each directory in $SWIGPATH. SWIGINCPREFIX - + + The prefix used to specify an include directory on the SWIG command line. This will be prepended to the beginning of each directory -in the $SWIGPATH construction variable -when the $_SWIGINCFLAGS variable is automatically generated. +in the $SWIGPATH construction variable +when the $_SWIGINCFLAGS variable is automatically generated. SWIGINCSUFFIX - + + The suffix used to specify an include directory on the SWIG command line. This will be appended to the end of each directory -in the $SWIGPATH construction variable -when the $_SWIGINCFLAGS variable is automatically generated. +in the $SWIGPATH construction variable +when the $_SWIGINCFLAGS variable is automatically generated. SWIGOUTDIR - + + Specifies the output directory in which the scripting language wrapper and interface generator should place generated language-specific files. This will be used by SCons to identify -the files that will be generated by the swig call, +the files that will be generated by the swig call, and translated into the swig -outdir option on the command line. @@ -6559,14 +7159,15 @@ and translated into the SWIGPATH - + + The list of directories that the scripting language wrapper and interface generate will search for included files. The SWIG implicit dependency scanner will search these directories for include files. The default value is an empty list. - + Don't explicitly put include directory arguments in SWIGFLAGS; the result will be non-portable @@ -6574,90 +7175,96 @@ and the directories will not be searched by the dependency scanner. Note: directory names in SWIGPATH will be looked-up relative to the SConscript directory when they are used in a command. To force -scons +scons to look-up a directory relative to the root of the source tree use #: - + env = Environment(SWIGPATH='#/include') - + The directory look-up can also be forced using the -Dir() +Dir() function: - + include = Dir('include') env = Environment(SWIGPATH=include) - + The directory list will be added to command lines through the automatically-generated -$_SWIGINCFLAGS +$_SWIGINCFLAGS construction variable, which is constructed by respectively prepending and appending the values of the -$SWIGINCPREFIX and $SWIGINCSUFFIX +$SWIGINCPREFIX and $SWIGINCSUFFIX construction variables to the beginning and end -of each directory in $SWIGPATH. +of each directory in $SWIGPATH. Any command lines you define that need the SWIGPATH directory list should -include $_SWIGINCFLAGS: +include $_SWIGINCFLAGS: - + env = Environment(SWIGCOM="my_swig -o $TARGET $_SWIGINCFLAGS $SOURCES") SWIGVERSION - + + The version number of the SWIG tool. TAR - + + The tar archiver. TARCOM - + + The command line used to call the tar archiver. TARCOMSTR - + + The string displayed when archiving files using the tar archiver. -If this is not set, then $TARCOM (the command line) is displayed. +If this is not set, then $TARCOM (the command line) is displayed. - + env = Environment(TARCOMSTR = "Archiving $TARGET") TARFLAGS - + + General options passed to the tar archiver. TARGET - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6666,16 +7273,18 @@ that may not be set or used in a construction environment. TARGET_ARCH - + + The name of the target hardware architecture for the compiled objects created by this Environment. This defaults to the value of HOST_ARCH, and the user can override it. Currently only set for Win32. - + + Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to -$HOST_ARCH, or, if that is unset, to the architecture of the +$HOST_ARCH, or, if that is unset, to the architecture of the running machine's OS (note that the python build or architecture has no effect). This variable must be passed as an argument to the Environment() @@ -6687,7 +7296,7 @@ all installed MSVC's that support the TARGET_ARCH, selecting the latest version for use. - + Valid values for Windows are x86, arm, @@ -6707,7 +7316,8 @@ For example, if you want to compile 64-bit binaries, you would set TARGET_OS - + + The name of the target operating system for the compiled objects created by this Environment. This defaults to the value of HOST_OS, and the user can override it. @@ -6717,7 +7327,8 @@ For example, if you want to compile 64-bit binaries, you would set TARGETS - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6726,15 +7337,17 @@ that may not be set or used in a construction environment. TARSUFFIX - + + The suffix used for tar file names. TEMPFILEARGJOIN - -The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by $MAXLINELENGTH. + + +The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by $MAXLINELENGTH. The default value is a space. However for MSVC, MSLINK the default is a line seperator characters as defined by os.linesep. Note this value is used literally and not expanded by the subst logic. @@ -6742,7 +7355,8 @@ Note this value is used literally and not expanded by the subst logic. TEMPFILEPREFIX - + + The prefix for a temporary file used to store lines lines longer than $MAXLINELENGTH as operations which call out to a shell will fail @@ -6758,7 +7372,8 @@ or '-via' for ARM toolchain. TEMPFILESUFFIX - + + The suffix used for the temporary file name used for long command lines. The name should include the dot ('.') if one is wanted as @@ -6769,41 +7384,46 @@ The default is '.lnk'. TEX - + + The TeX formatter and typesetter. TEXCOM - + + The command line used to call the TeX formatter and typesetter. TEXCOMSTR - + + The string displayed when calling the TeX formatter and typesetter. -If this is not set, then $TEXCOM (the command line) is displayed. +If this is not set, then $TEXCOM (the command line) is displayed. - + env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES") TEXFLAGS - + + General options passed to the TeX formatter and typesetter. TEXINPUTS - + + List of directories that the LaTeX program will search for include directories. The LaTeX implicit dependency scanner will search these @@ -6813,23 +7433,26 @@ directories for \include and \import files. TEXTFILEPREFIX - -The prefix used for Textfile file names, + + +The prefix used for Textfile file names, the null string by default. TEXTFILESUFFIX - -The suffix used for Textfile file names; + + +The suffix used for Textfile file names; .txt by default. TOOLS - + + A list of the names of the Tool specifications that are part of this construction environment. @@ -6837,7 +7460,8 @@ that are part of this construction environment. UNCHANGED_SOURCES - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6846,7 +7470,8 @@ that may not be set or used in a construction environment. UNCHANGED_TARGETS - + + A reserved variable name that may not be set or used in a construction environment. (See "Variable Substitution," below.) @@ -6855,7 +7480,8 @@ that may not be set or used in a construction environment. VENDOR - + + The person or organization who supply the packaged software. This is used to fill in the Vendor: @@ -6868,60 +7494,68 @@ field in the controlling information for MSI packages. VERSION - + + The version of the project, specified as a string. WIN32_INSERT_DEF - -A deprecated synonym for $WINDOWS_INSERT_DEF. + + +A deprecated synonym for $WINDOWS_INSERT_DEF. WIN32DEFPREFIX - -A deprecated synonym for $WINDOWSDEFPREFIX. + + +A deprecated synonym for $WINDOWSDEFPREFIX. WIN32DEFSUFFIX - -A deprecated synonym for $WINDOWSDEFSUFFIX. + + +A deprecated synonym for $WINDOWSDEFSUFFIX. WIN32EXPPREFIX - -A deprecated synonym for $WINDOWSEXPSUFFIX. + + +A deprecated synonym for $WINDOWSEXPSUFFIX. WIN32EXPSUFFIX - -A deprecated synonym for $WINDOWSEXPSUFFIX. + + +A deprecated synonym for $WINDOWSEXPSUFFIX. WINDOWS_EMBED_MANIFEST - + + Set this variable to True or 1 to embed the compiler-generated manifest (normally ${TARGET}.manifest) into all Windows exes and DLLs built with this environment, as a resource during their link step. -This is done using $MT and $MTEXECOM and $MTSHLIBCOM. +This is done using $MT and $MTEXECOM and $MTSHLIBCOM. WINDOWS_INSERT_DEF - + + When this is set to true, a library build of a Windows shared library (.dll file) @@ -6935,9 +7569,10 @@ The default is 0 (do not build a .def file). WINDOWS_INSERT_MANIFEST - + + When this is set to true, -scons +scons will be aware of the .manifest files generated by Microsoft Visua C/C++ 8. @@ -6946,35 +7581,40 @@ files generated by Microsoft Visua C/C++ 8. WINDOWSDEFPREFIX - + + The prefix used for Windows .def file names. WINDOWSDEFSUFFIX - + + The suffix used for Windows .def file names. WINDOWSEXPPREFIX - + + The prefix used for Windows .exp file names. WINDOWSEXPSUFFIX - + + The suffix used for Windows .exp file names. WINDOWSPROGMANIFESTPREFIX - + + The prefix used for executable program .manifest files generated by Microsoft Visual C/C++. @@ -6982,7 +7622,8 @@ generated by Microsoft Visual C/C++. WINDOWSPROGMANIFESTSUFFIX - + + The suffix used for executable program .manifest files generated by Microsoft Visual C/C++. @@ -6990,7 +7631,8 @@ generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTPREFIX - + + The prefix used for shared library .manifest files generated by Microsoft Visual C/C++. @@ -6998,7 +7640,8 @@ generated by Microsoft Visual C/C++. WINDOWSSHLIBMANIFESTSUFFIX - + + The suffix used for shared library .manifest files generated by Microsoft Visual C/C++. @@ -7006,7 +7649,8 @@ generated by Microsoft Visual C/C++. X_IPK_DEPENDS - + + This is used to fill in the Depends: field in the controlling information for Ipkg packages. @@ -7015,7 +7659,8 @@ field in the controlling information for Ipkg packages. X_IPK_DESCRIPTION - + + This is used to fill in the Description: field in the controlling information for Ipkg packages. @@ -7026,7 +7671,8 @@ The default value is X_IPK_MAINTAINER - + + This is used to fill in the Maintainer: field in the controlling information for Ipkg packages. @@ -7035,7 +7681,8 @@ field in the controlling information for Ipkg packages. X_IPK_PRIORITY - + + This is used to fill in the Priority: field in the controlling information for Ipkg packages. @@ -7044,7 +7691,8 @@ field in the controlling information for Ipkg packages. X_IPK_SECTION - + + This is used to fill in the Section: field in the controlling information for Ipkg packages. @@ -7053,7 +7701,8 @@ field in the controlling information for Ipkg packages. X_MSI_LANGUAGE - + + This is used to fill in the Language: attribute in the controlling information for MSI packages. @@ -7062,7 +7711,8 @@ attribute in the controlling information for MSI packages. X_MSI_LICENSE_TEXT - + + The text of the software license in RTF format. Carriage return characters will be replaced with the RTF equivalent \\par. @@ -7071,14 +7721,16 @@ replaced with the RTF equivalent \\par. X_MSI_UPGRADE_CODE - + + TODO X_RPM_AUTOREQPROV - + + This is used to fill in the AutoReqProv: field in the RPM @@ -7088,14 +7740,16 @@ field in the RPM X_RPM_BUILD - + + internal, but overridable X_RPM_BUILDREQUIRES - + + This is used to fill in the BuildRequires: field in the RPM @@ -7106,21 +7760,24 @@ Note this should only be used on a host managed by rpm as the dependencies will X_RPM_BUILDROOT - + + internal, but overridable X_RPM_CLEAN - + + internal, but overridable X_RPM_CONFLICTS - + + This is used to fill in the Conflicts: field in the RPM @@ -7130,7 +7787,8 @@ field in the RPM X_RPM_DEFATTR - + + This value is used as the default attributes for the files in the RPM package. The default value is @@ -7140,7 +7798,8 @@ The default value is X_RPM_DISTRIBUTION - + + This is used to fill in the Distribution: field in the RPM @@ -7150,7 +7809,8 @@ field in the RPM X_RPM_EPOCH - + + This is used to fill in the Epoch: field in the RPM @@ -7160,7 +7820,8 @@ field in the RPM X_RPM_EXCLUDEARCH - + + This is used to fill in the ExcludeArch: field in the RPM @@ -7170,7 +7831,8 @@ field in the RPM X_RPM_EXLUSIVEARCH - + + This is used to fill in the ExclusiveArch: field in the RPM @@ -7180,7 +7842,8 @@ field in the RPM X_RPM_EXTRADEFS - + + A list used to supply extra defintions or flags to be added to the RPM .spec file. Each item is added as-is with a carriage return appended. @@ -7196,7 +7859,7 @@ list that does not include the default line. Added in version 3.1. - + env.Package( NAME = 'foo', ... @@ -7211,7 +7874,8 @@ env.Package( X_RPM_GROUP - + + This is used to fill in the Group: field in the RPM @@ -7221,7 +7885,8 @@ field in the RPM X_RPM_GROUP_lang - + + This is used to fill in the Group(lang): field in the RPM @@ -7236,7 +7901,8 @@ the appropriate language code. X_RPM_ICON - + + This is used to fill in the Icon: field in the RPM @@ -7246,14 +7912,16 @@ field in the RPM X_RPM_INSTALL - + + internal, but overridable X_RPM_PACKAGER - + + This is used to fill in the Packager: field in the RPM @@ -7263,7 +7931,8 @@ field in the RPM X_RPM_POSTINSTALL - + + This is used to fill in the %post: section in the RPM @@ -7273,7 +7942,8 @@ section in the RPM X_RPM_POSTUNINSTALL - + + This is used to fill in the %postun: section in the RPM @@ -7283,7 +7953,8 @@ section in the RPM X_RPM_PREFIX - + + This is used to fill in the Prefix: field in the RPM @@ -7293,7 +7964,8 @@ field in the RPM X_RPM_PREINSTALL - + + This is used to fill in the %pre: section in the RPM @@ -7303,14 +7975,16 @@ section in the RPM X_RPM_PREP - + + internal, but overridable X_RPM_PREUNINSTALL - + + This is used to fill in the %preun: section in the RPM @@ -7320,7 +7994,8 @@ section in the RPM X_RPM_PROVIDES - + + This is used to fill in the Provides: field in the RPM @@ -7330,7 +8005,8 @@ field in the RPM X_RPM_REQUIRES - + + This is used to fill in the Requires: field in the RPM @@ -7340,7 +8016,8 @@ field in the RPM X_RPM_SERIAL - + + This is used to fill in the Serial: field in the RPM @@ -7350,7 +8027,8 @@ field in the RPM X_RPM_URL - + + This is used to fill in the Url: field in the RPM @@ -7360,33 +8038,37 @@ field in the RPM XGETTEXT - + + Path to xgettext(1) program (found via Detect()). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTCOM - + + Complete xgettext command line. -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTCOMSTR - + + A string that is shown when xgettext(1) command is invoked -(default: '', which means "print $XGETTEXTCOM"). -See xgettext tool and POTUpdate builder. +(default: '', which means "print $XGETTEXTCOM"). +See xgettext tool and POTUpdate builder. _XGETTEXTDOMAIN - + + Internal "macro". Generates xgettext domain name form source and target (default: '${TARGET.filebase}'). @@ -7394,36 +8076,40 @@ form source and target (default: '${TARGET.filebase}'). XGETTEXTFLAGS - + + Additional flags to xgettext(1). -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. XGETTEXTFROM - + + Name of file containing list of xgettext(1)'s source files. Autotools' users know this as POTFILES.in so they will in most cases set XGETTEXTFROM="POTFILES.in" here. -The $XGETTEXTFROM files have same syntax and semantics as the well known +The $XGETTEXTFROM files have same syntax and semantics as the well known GNU POTFILES.in. -See xgettext tool and POTUpdate builder. +See xgettext tool and POTUpdate builder. _XGETTEXTFROMFLAGS - + + Internal "macro". Genrates list of -D<dir> flags -from the $XGETTEXTPATH list. +from the $XGETTEXTPATH list. XGETTEXTFROMPREFIX - -This flag is used to add single $XGETTEXTFROM file to + + +This flag is used to add single $XGETTEXTFROM file to xgettext(1)'s commandline (default: '-f'). @@ -7431,34 +8117,38 @@ This flag is used to add single $XGETTEXT XGETTEXTFROMSUFFIX - + + (default: '') XGETTEXTPATH - + + List of directories, there xgettext(1) will look for source files (default: []). -This variable works only together with $XGETTEXTFROM +This variable works only together with $XGETTEXTFROM -See also xgettext tool and POTUpdate builder. +See also xgettext tool and POTUpdate builder. _XGETTEXTPATHFLAGS - + + Internal "macro". Generates list of -f<file> flags -from $XGETTEXTFROM. +from $XGETTEXTFROM. XGETTEXTPATHPREFIX - + + This flag is used to add single search path to xgettext(1)'s commandline (default: '-D'). @@ -7467,21 +8157,24 @@ This flag is used to add single search path to XGETTEXTPATHSUFFIX - + + (default: '') YACC - + + The parser generator. YACCCOM - + + The command line used to call the parser generator to generate a source file. @@ -7489,22 +8182,24 @@ to generate a source file. YACCCOMSTR - + + The string displayed when generating a source file using the parser generator. -If this is not set, then $YACCCOM (the command line) is displayed. +If this is not set, then $YACCCOM (the command line) is displayed. - + env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES") YACCFLAGS - + + General options passed to the parser generator. -If $YACCFLAGS contains a option, +If $YACCFLAGS contains a option, SCons assumes that the call will also create a .h file (if the yacc source file ends in a .y suffix) or a .hpp file @@ -7514,7 +8209,8 @@ or a .hpp file YACCHFILESUFFIX - + + The suffix of the C header file generated by the parser generator when the @@ -7532,7 +8228,8 @@ The default value is YACCHXXFILESUFFIX - + + The suffix of the C++ header file generated by the parser generator when the @@ -7548,7 +8245,7 @@ The default value is except on Mac OS X, where the default is ${TARGET.suffix}.h. -because the default bison parser generator just +because the default bison parser generator just appends .h to the name of the generated C++ file. @@ -7556,7 +8253,8 @@ to the name of the generated C++ file. YACCVCGFILESUFFIX - + + The suffix of the file containing the VCG grammar automaton definition when the @@ -7574,14 +8272,16 @@ The default value is ZIP - + + The zip compression and file packaging utility. ZIPCOM - + + The command line used to call the zip utility, or the internal Python function used to create a zip archive. @@ -7590,7 +8290,8 @@ zip archive. ZIPCOMPRESSION - + + The compression flag @@ -7610,39 +8311,42 @@ module is unavailable. ZIPCOMSTR - + + The string displayed when archiving files using the zip utility. -If this is not set, then $ZIPCOM +If this is not set, then $ZIPCOM (the command line or internal Python function) is displayed. - + env = Environment(ZIPCOMSTR = "Zipping $TARGET") ZIPFLAGS - + + General options passed to the zip utility. ZIPROOT - + + An optional zip root directory (default empty). The filenames stored in the zip file will be relative to this directory, if given. Otherwise the filenames are relative to the current directory of the command. For instance: - + env = Environment() env.Zip('foo.zip', 'subdir1/subdir2/file1', ZIPROOT='subdir1') - + will produce a zip file foo.zip containing a file with the name subdir2/file1 rather than @@ -7652,7 +8356,8 @@ containing a file with the name ZIPSUFFIX - + + The suffix used for zip file names. -- cgit v0.12 From b7f00d77d207b3ff6d6fac2103d8aebe2a29aafe Mon Sep 17 00:00:00 2001 From: Adam Gross Date: Fri, 19 Jul 2019 17:47:05 -0400 Subject: [ci skip] Improve description of change in CHANGES.txt --- src/CHANGES.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2b3e627..ce7e43a 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -53,8 +53,11 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. From Adam Gross: - - Upgrade and improve Visual Studio solution/project generation code - + - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. + - Added support for Visual Studio 2017 and 2019. + - Added support for the following per-variant parameters to the builder: + - cpppaths: Provides per-variant include paths. + - cppdefines: Provides per-variant preprocessor definitions. From Michael Hartmann: - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM -- cgit v0.12 From 7c99f8d851ba1fdf37bf8942d8ecb361f2512d09 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 20 Jul 2019 16:46:28 -0700 Subject: Regenerated docs for X.Y.Z release. --- doc/generated/builders.gen | 38 ++++++++++++++++++++-- doc/generated/examples/caching_ex-random_1.xml | 4 +-- doc/generated/examples/troubleshoot_Dump_1.xml | 1 - doc/generated/examples/troubleshoot_Dump_2.xml | 3 +- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- .../examples/troubleshoot_stacktrace_2.xml | 4 +-- doc/generated/tools.gen | 12 +++---- doc/generated/tools.mod | 4 +-- doc/generated/variables.gen | 25 +++++++------- doc/generated/variables.mod | 4 +-- 10 files changed, 64 insertions(+), 33 deletions(-) diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index dc05443..7c62558 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -849,14 +849,16 @@ Compile files for languages defined in LINGUAS file latest installed version, or the version specified by $MSVS_VERSION in the Environment constructor). For Visual Studio 6, it will generate a .dsp - file. For Visual Studio 7 (.NET) and later versions, it will - generate a .vcproj file. + file. For Visual Studio 7, 8, and 9, it will + generate a .vcproj file. For Visual + Studio 10 and later, it will generate a + .vcxproj file. By default, this also generates a solution file for the specified project, a .dsw file for Visual Studio 6 or a .sln file for - Visual Studio 7 (.NET). This behavior may be disabled by + Visual Studio 7 and later. This behavior may be disabled by specifying auto_build_solution=0 when you call MSVSProject, in which case you presumably want to build the solution file(s) by calling the MSVSSolution @@ -929,6 +931,36 @@ Compile files for languages defined in LINGUAS file + cppdefines + + + Preprocessor definitions for the different variants. + The number of cppdefines entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPDEFINES entry for all variants. + + + + + cpppaths + + + Compiler include paths for the different variants. + The number of cpppaths entries + must match the number of variant + entries, or be empty (not specified). If you give + only one, it will automatically be propagated to all + variants. If you don't give this parameter, SCons + will use the invoking environment's + CPPPATH entry for all variants. + + + + buildtarget diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 9ad59e0..58ff6ae 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q -cc -o f4.o -c f4.c -cc -o f2.o -c f2.c cc -o f3.o -c f3.c +cc -o f2.o -c f2.c cc -o f5.o -c f5.c cc -o f1.o -c f1.c +cc -o f4.o -c f4.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml index 99518c0..99d1399 100644 --- a/doc/generated/examples/troubleshoot_Dump_1.xml +++ b/doc/generated/examples/troubleshoot_Dump_1.xml @@ -57,7 +57,6 @@ scons: Reading SConscript files ... 'TARGET_ARCH': None, 'TARGET_OS': None, 'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>, - 'TEMPFILEARGJOIN': ' ', 'TEMPFILEPREFIX': '@', 'TOOLS': ['install', 'install'], '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}', diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml index d83fb94..e8e0960 100644 --- a/doc/generated/examples/troubleshoot_Dump_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_2.xml @@ -80,7 +80,7 @@ scons: Reading SConscript files ... 'SHCXX': '$CXX', 'SHCXXCOM': '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}', 'SHCXXFLAGS': ['$CXXFLAGS'], - 'SHELL': 'command', + 'SHELL': None, 'SHLIBPREFIX': '', 'SHLIBSUFFIX': '.dll', 'SHOBJPREFIX': '$OBJPREFIX', @@ -90,7 +90,6 @@ scons: Reading SConscript files ... 'TARGET_ARCH': None, 'TARGET_OS': None, 'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>, - 'TEMPFILEARGJOIN': '\n', 'TEMPFILEPREFIX': '@', 'TOOLS': ['msvc', 'install', 'install'], '_CCCOMCOM': '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS', diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index 8f06986..04b09fd 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/Users/bdbaddog/devel/scons/git/scons-bugfixes-3/bootstrap/src/script/scons.py", line 204, in <module> +File "/home/bdeegan/devel/scons/git/as_scons/bootstrap/src/script/scons.py", line 204, in <module> diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml index 2d88ae8..76cfc1a 100644 --- a/doc/generated/examples/troubleshoot_stacktrace_2.xml +++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml @@ -4,10 +4,10 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons: internal stack trace: File "bootstrap/src/engine/SCons/Job.py", line 199, in start task.prepare() - File "bootstrap/src/engine/SCons/Script/Main.py", line 190, in prepare + File "bootstrap/src/engine/SCons/Script/Main.py", line 177, in prepare return SCons.Taskmaster.OutOfDateTask.prepare(self) File "bootstrap/src/engine/SCons/Taskmaster.py", line 198, in prepare executor.prepare() - File "bootstrap/src/engine/SCons/Executor.py", line 431, in prepare + File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0])) diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index ecd9c98..be717e3 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -779,19 +779,19 @@ Sets construction variables for the Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. - - Packaging + + packaging -Sets construction variables for the Package Builder. +A framework for building binary and source packages. - - packaging + + Packaging -A framework for building binary and source packages. +Sets construction variables for the Package Builder. diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index 1209d74..f9bc1d7 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -Packaging"> packaging"> +Packaging"> pdf"> pdflatex"> pdftex"> @@ -186,8 +186,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -Packaging"> packaging"> +Packaging"> pdf"> pdflatex"> pdftex"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 5606e2e..28dfc59 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -3298,7 +3298,7 @@ The command line used to call the Java archive tool. The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3308,7 +3308,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -4495,6 +4495,7 @@ constructor; setting it later has no effect. Valid values for Windows are +14.2, 14.1, 14.0, 14.0Exp, @@ -6789,16 +6790,6 @@ Example - - SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is -set. - - - _SHLIBVERSIONFLAGS @@ -6812,6 +6803,16 @@ and some extra dynamically generated options (such as + + SHLIBVERSIONFLAGS + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is +set. + + + SHLINK diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 372a15f..47576f4 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -504,8 +504,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> +$SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> @@ -1144,8 +1144,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> +$SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> -- cgit v0.12 From e724ae812eb96f4858a132f5b8c769724744faf6 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 20 Jul 2019 17:00:05 -0700 Subject: changes for release 3.1.0 --- README.rst | 14 ++++---- ReleaseConfig | 2 +- SConstruct | 4 +-- debian/changelog | 4 +-- src/Announce.txt | 2 +- src/CHANGES.txt | 18 ++++------ src/RELEASE.txt | 80 +++++++++++++++--------------------------- testing/framework/TestSCons.py | 2 +- 8 files changed, 48 insertions(+), 78 deletions(-) diff --git a/README.rst b/README.rst index ea7667c..07be9a9 100755 --- a/README.rst +++ b/README.rst @@ -499,13 +499,13 @@ about `Executing SCons Without Installing`_):: Depending on the utilities installed on your system, any or all of the following packages will be built:: - build/dist/scons-3.0.5.tar.gz - build/dist/scons-3.0.5.zip - build/dist/scons-doc-3.0.5.tar.gz - build/dist/scons-local-3.0.5.tar.gz - build/dist/scons-local-3.0.5.zip - build/dist/scons-src-3.0.5.tar.gz - build/dist/scons-src-3.0.5.zip + build/dist/scons-3.1.0.tar.gz + build/dist/scons-3.1.0.zip + build/dist/scons-doc-3.1.0.tar.gz + build/dist/scons-local-3.1.0.tar.gz + build/dist/scons-local-3.1.0.zip + build/dist/scons-src-3.1.0.tar.gz + build/dist/scons-src-3.1.0.zip The SConstruct file is supposed to be smart enough to avoid trying to build packages for which you don't have the proper utilities installed. For diff --git a/ReleaseConfig b/ReleaseConfig index ca7e1cf..b553411 100755 --- a/ReleaseConfig +++ b/ReleaseConfig @@ -32,7 +32,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # 'final', the patchlevel is set to the release date. This value is # mandatory and must be present in this file. #version_tuple = (2, 2, 0, 'final', 0) -version_tuple = (3, 0, 6, 'alpha', 0) +version_tuple = (3, 1, 0) # Python versions prior to unsupported_python_version cause a fatal error # when that version is used. Python versions prior to deprecate_python_version diff --git a/SConstruct b/SConstruct index d4b3e00..40764dc 100644 --- a/SConstruct +++ b/SConstruct @@ -8,7 +8,7 @@ from __future__ import print_function copyright_years = '2001 - 2019' # This gets inserted into the man pages to reflect the month of release. -month_year = 'March 2019' +month_year = 'July 2019' # # __COPYRIGHT__ @@ -49,7 +49,7 @@ import textwrap import bootstrap project = 'scons' -default_version = '3.0.5' +default_version = '3.1.0' copyright = "Copyright (c) %s The SCons Foundation" % copyright_years SConsignFile() diff --git a/debian/changelog b/debian/changelog index 8744ba4..77ac165 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -scons (3.0.5) unstable; urgency=low +scons (3.1.0) unstable; urgency=low * Maintenance Release - -- William Deegan Mon, 26 Mar 2019 15:04:42 -0700 + -- William Deegan Sat, 20 Jul 2019 15:04:42 -0700 scons (3.0.4) unstable; urgency=low diff --git a/src/Announce.txt b/src/Announce.txt index 1359696..2ceb8bc 100755 --- a/src/Announce.txt +++ b/src/Announce.txt @@ -18,7 +18,7 @@ So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. -RELEASE VERSION/DATE TO BE FILLED IN LATER +RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ce7e43a..a23140c 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -4,19 +4,12 @@ Change Log - -**PLEASE ADD YOUR NAME IN ALPHABETICAL ORDER TO AVOID NEEDED TO REORDER BELOW** - -RELEASE VERSION/DATE TO BE FILLED IN LATER +RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From Joseph Brill: - Code to supply correct version-specifier argument to vswhere for VS version selection. - From Peter Diener: - - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures - - Fix issue #3135 - Handle Fortran submodules and type bound procedures - From William Deegan: - Enhanced --debug=explain output. Now the separate components of the dependency list are split up as follows: @@ -52,6 +45,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER def my_decider(dependency, target, prev_ni, repo_node): Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. + From Peter Diener: + - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + - Fix issue #3135 - Handle Fortran submodules and type bound procedures + From Adam Gross: - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. - Added support for Visual Studio 2017 and 2019. @@ -68,6 +65,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Mathew Robinson: - Update cache debug output to include cache hit rate. - No longer unintentionally hide exceptions in Action.py + - Allow builders and pseudo-builders to inherit from OverrideEnvironments From Leonard de Ruijter: - Add logic to derive correct version argument to vswhere @@ -102,10 +100,6 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Fix more re patterns that contain \ but not specified as raw strings (affects scanners for D, LaTeX, swig) - From Mathew Robinson: - - Update cache debug output to include cache hit rate. - - No longer unintentionally hide exceptions in Action.py - - Allow builders and pseudo-builders to inherit from OverrideEnvironments RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 9e4e314..bdf3a79 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -1,43 +1,22 @@ - A new SCons checkpoint release, 3.0.6.alpha.yyyymmdd, is now available + A new SCons checkpoint release, 3.1.0, is now available on the SCons download page: https://scons.org/pages/download.html - XXX The primary purpose of this release ... XXX - - A SCons "checkpoint release" is intended to provide early access to - new features so they can be tested in the field before being released - for adoption by other software distributions. - - Note that a checkpoint release is developed using the same test-driven - development methodology as all SCons releases. Existing SCons - functionality should all work as it does in previous releases (except - for any changes identified in the release notes) and early adopters - should be able to use a checkpoint release safely for production work - with existing SConscript files. If not, it represents not only a bug - in SCons but also a hole in the regression test suite, and we want to - hear about it. - - New features may be more lightly tested than in past releases, - especially as concerns their interaction with all of the other - functionality in SCons. We are especially interested in hearing bug - reports about new functionality. - - We do not recommend that downstream distributions (Debian, Fedora, - etc.) package a checkpoint release, mainly to avoid confusing the - "public" release numbering with the long checkpoint release names. - - Here is a summary of the changes since 1.3.0: + Here is a summary of the changes since 3.0.5: NEW FUNCTIONALITY - Added variable TEMPFILEARGJOIN to specify how to join arguments written to temp files used when command lines exceed MAXLINELENGTH when the command uses $TEMPFILE{...} + - Support for MSVC 2019 + - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. + - Added support for Visual Studio 2017 and 2019. + - Added support for the following per-variant parameters to the builder: + - cpppaths: Provides per-variant include paths. + - cppdefines: Provides per-variant preprocessor definitions. - DEPRECATED FUNCTIONALITY - - - List anything that's been deprecated since the last release CHANGED/ENHANCED EXISTING FUNCTIONALITY @@ -48,7 +27,6 @@ def my_decider(dependency, target, prev_ni, repo_node): Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. - - Enhanced --debug=explain output. Now the separate components of the dependency list are split up as follows: @@ -62,7 +40,6 @@ ->Implicit Old:/usr/bin/python New:/usr/bin/python - - Changed: Pseudo-builders now inherit OverrideEnvironments. For example when calling a pseudo-builder from another pseudo-builder the override variables passed to the first @@ -71,29 +48,28 @@ will automatically inherit these override values. FIXES - - - List fixes of outright bugs - - IMPROVEMENTS - - - List improvements that wouldn't be visible to the user in the - documentation: performance improvements (describe the circumstances + - Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file + is generated. This was causing the > 1th target to not have it's implicit list cleared when the source + file was actually built, leaving an implicit list similar to follows for 2nd and higher target + ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] + This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this + ['zzz', 'yyy', 'xxx', '/usr/bin/python'] + Which would trigger a rebuild because the order changed. + The fix involved added logic to mark all shared targets as peers and then ensure they're implicit + list is all cleared together. + - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + Renamed to SConsEnvironmentError + - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable + which specifies what character to join all the argements output into the tempfile. The default remains a space + when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) + - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + + - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + - Enable LaTeX scanner to find more than one include per line + under which they would be observed), or major code cleanups - PACKAGING - - - List changes in the way SCons is packaged and/or released - - DOCUMENTATION - - - List any significant changes to the documentation (not individual - typo fixes, even if they're mentioned in src/CHANGES.txt to give - the contributor credit) - - DEVELOPMENT - - - List visible changes in the way SCons is developed - Thanks to CURLY, LARRY, and MOE for their contributions to this release. Contributors are listed alphabetically by their last name. diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 907eac7..89ad43b 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -35,7 +35,7 @@ from TestCmd import PIPE # here provides some independent verification that what we packaged # conforms to what we expect. -default_version = '3.0.5' +default_version = '3.1.0' python_version_unsupported = (2, 6, 0) python_version_deprecated = (2, 7, 0) -- cgit v0.12 From ae4de9ab2249be220b6658a514eef8c3a57afc04 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 20 Jul 2019 19:32:06 -0700 Subject: Add shortlog to RELEASE.txt --- src/RELEASE.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/RELEASE.txt b/src/RELEASE.txt index bdf3a79..5927ef8 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -70,8 +70,12 @@ under which they would be observed), or major code cleanups - Thanks to CURLY, LARRY, and MOE for their contributions to this release. - Contributors are listed alphabetically by their last name. - -__COPYRIGHT__ -__FILE__ __REVISION__ __DATE__ __DEVELOPER__ +git shortlog --no-merges -ns 3.0.5..HEAD + 64 William Deegan + 56 Mats Wichmann + 10 Adam Gross + 4 Mathew Robinson + 4 Peter Diener + 3 Lukas Schrangl + 1 Daniel Holth + 1 bdbaddog -- cgit v0.12 From bd4188e061e735f83dd6604600b2720caf3e9ea4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Sat, 20 Jul 2019 19:43:37 -0700 Subject: [ci skip] post release --- ReleaseConfig | 2 +- src/CHANGES.txt | 14 ++++++++++++++ src/RELEASE.txt | 36 ++++-------------------------------- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/ReleaseConfig b/ReleaseConfig index ca7e1cf..b3893bd 100755 --- a/ReleaseConfig +++ b/ReleaseConfig @@ -32,7 +32,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # 'final', the patchlevel is set to the release date. This value is # mandatory and must be present in this file. #version_tuple = (2, 2, 0, 'final', 0) -version_tuple = (3, 0, 6, 'alpha', 0) +version_tuple = (3, 1, 1, 'alpha', 0) # Python versions prior to unsupported_python_version cause a fatal error # when that version is used. Python versions prior to deprecate_python_version diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ce7e43a..842767a 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -9,6 +9,20 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER + From John Doe: + + - Whatever John Doe did. + + +RELEASE VERSION/DATE TO BE FILLED IN LATER + + From John Doe: + + - Whatever John Doe did. + + +RELEASE VERSION/DATE TO BE FILLED IN LATER + From Joseph Brill: - Code to supply correct version-specifier argument to vswhere for VS version selection. diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 9e4e314..17e698f 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -1,4 +1,4 @@ - A new SCons checkpoint release, 3.0.6.alpha.yyyymmdd, is now available + A new SCons checkpoint release, 3.1.2.alpha.yyyymmdd, is now available on the SCons download page: https://scons.org/pages/download.html @@ -31,9 +31,7 @@ NEW FUNCTIONALITY - - Added variable TEMPFILEARGJOIN to specify how to join arguments written - to temp files used when command lines exceed MAXLINELENGTH when the - command uses $TEMPFILE{...} + - List new features (presumably why a checkpoint is being released) DEPRECATED FUNCTIONALITY @@ -41,34 +39,8 @@ CHANGED/ENHANCED EXISTING FUNCTIONALITY - - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. - From: - def my_decider(dependency, target, prev_ni): - To: - def my_decider(dependency, target, prev_ni, repo_node): - Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. - - - - Enhanced --debug=explain output. Now the separate components of the dependency list are split up - as follows: - - scons: rebuilding `file3' because: - the dependency order changed: - ->Sources - Old:xxx New:zzz - Old:yyy New:yyy - Old:zzz New:xxx - ->Depends - ->Implicit - Old:/usr/bin/python New:/usr/bin/python - - - - Changed: Pseudo-builders now inherit OverrideEnvironments. For - example when calling a pseudo-builder from another - pseudo-builder the override variables passed to the first - pseudo-builder call had to be explicitly passed on to the - internal pseudo-builder call. Now the second pseudo-builder call - will automatically inherit these override values. + - List modifications to existing features, where the previous behavior + wouldn't actually be considered a bug FIXES -- cgit v0.12 From 1d146c46d99cd8f0acad622e3b0665d184aea976 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 24 Jul 2019 15:10:10 -0700 Subject: move files back to develop mode --- src/Announce.txt | 2 +- src/CHANGES.txt | 9 +-------- src/RELEASE.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/src/Announce.txt b/src/Announce.txt index 2ceb8bc..1359696 100755 --- a/src/Announce.txt +++ b/src/Announce.txt @@ -18,7 +18,7 @@ So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. -RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 +RELEASE VERSION/DATE TO BE FILLED IN LATER Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes diff --git a/src/CHANGES.txt b/src/CHANGES.txt index da238d7..b5b6652 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -4,13 +4,6 @@ Change Log -RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 - - From John Doe: - - - Whatever John Doe did. - - RELEASE VERSION/DATE TO BE FILLED IN LATER From John Doe: @@ -18,7 +11,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Whatever John Doe did. -RELEASE VERSION/DATE TO BE FILLED IN LATER +RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From Joseph Brill: - Code to supply correct version-specifier argument to vswhere for diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 54cdfe3..17e698f 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -3,15 +3,71 @@ https://scons.org/pages/download.html - Here is a summary of the changes since 3.1.0: + XXX The primary purpose of this release ... XXX + + A SCons "checkpoint release" is intended to provide early access to + new features so they can be tested in the field before being released + for adoption by other software distributions. + + Note that a checkpoint release is developed using the same test-driven + development methodology as all SCons releases. Existing SCons + functionality should all work as it does in previous releases (except + for any changes identified in the release notes) and early adopters + should be able to use a checkpoint release safely for production work + with existing SConscript files. If not, it represents not only a bug + in SCons but also a hole in the regression test suite, and we want to + hear about it. + + New features may be more lightly tested than in past releases, + especially as concerns their interaction with all of the other + functionality in SCons. We are especially interested in hearing bug + reports about new functionality. + + We do not recommend that downstream distributions (Debian, Fedora, + etc.) package a checkpoint release, mainly to avoid confusing the + "public" release numbering with the long checkpoint release names. + + Here is a summary of the changes since 1.3.0: NEW FUNCTIONALITY - List new features (presumably why a checkpoint is being released) + DEPRECATED FUNCTIONALITY + + - List anything that's been deprecated since the last release + CHANGED/ENHANCED EXISTING FUNCTIONALITY - List modifications to existing features, where the previous behavior wouldn't actually be considered a bug FIXES + + - List fixes of outright bugs + + IMPROVEMENTS + + - List improvements that wouldn't be visible to the user in the + documentation: performance improvements (describe the circumstances + under which they would be observed), or major code cleanups + + PACKAGING + + - List changes in the way SCons is packaged and/or released + + DOCUMENTATION + + - List any significant changes to the documentation (not individual + typo fixes, even if they're mentioned in src/CHANGES.txt to give + the contributor credit) + + DEVELOPMENT + + - List visible changes in the way SCons is developed + + Thanks to CURLY, LARRY, and MOE for their contributions to this release. + Contributors are listed alphabetically by their last name. + +__COPYRIGHT__ +__FILE__ __REVISION__ __DATE__ __DEVELOPER__ -- cgit v0.12 From ee29cd2caeae25421e2647dd1dbd66c067149652 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 24 Jul 2019 14:54:38 -0700 Subject: Remove usage of DeciderNeedsNode which has been removed from --debug=explain code --- src/engine/SCons/Node/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 3073d59..572465f 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1661,10 +1661,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): if k not in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) else: - try: - changed = _decider_map[k.changed_since_last_build](k, self, osig[k]) - except DeciderNeedsNode as e: - changed = e.decider(self, osig[k], node=self) + changed = _decider_map[k.changed_since_last_build](k, self, osig[k]) if changed: lines.append("`%s' changed\n" % stringify(k)) -- cgit v0.12 From af603b57286c863f49ab40a51a106c04d8b72c2d Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 24 Jul 2019 15:04:19 -0700 Subject: Remove reference to DeciderNeedsNode from test. Logic still needed to test GH Issue #3303 --- test/Configure/option--config.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/Configure/option--config.py b/test/Configure/option--config.py index 02f10ce..ad4f144 100644 --- a/test/Configure/option--config.py +++ b/test/Configure/option--config.py @@ -126,8 +126,6 @@ test.checkLogAndStdout(["Checking for C header file non_system_header0.h... ", test.file_fixture('test_main.c') # Check the combination of --config=force and Decider('MD5-timestamp') -# On second run there was an issue where the decider would throw DeciderNeedsNode -# exception which the configure code didn't handle. SConstruct_path = test.workpath('SConstruct') test.write(SConstruct_path, """ env = Environment() -- cgit v0.12 From 00e88a8b08b05d2ee41668ddd2229e5cf98cb143 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 24 Jul 2019 15:11:42 -0700 Subject: add blurb to CHANGES.txt --- src/CHANGES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b5b6652..8a48bd4 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,9 +6,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - From John Doe: + From William Deegan: - - Whatever John Doe did. + - Remove obsoleted references to DeciderNeedsNode which could cause crash when using --debug=explain RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 -- cgit v0.12 From b4b861514b5a3c431e81d926333d6984499d0b20 Mon Sep 17 00:00:00 2001 From: benjamin reed Date: Thu, 25 Jul 2019 22:36:16 -0700 Subject: add -fmerge-all-constants flag to LINKFLAGS -fmerge-all-constants doesn't fully work if it isn't also included as part of the link step. This change will add -fmerge-all-constants to both CCFLAGS and LINKFLAGS if it is specified as a build flag. --- src/CHANGES.txt | 3 +++ src/engine/SCons/Environment.py | 1 + src/engine/SCons/EnvironmentTests.py | 6 ++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b5b6652..85eb872 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -10,6 +10,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Whatever John Doe did. + From Ben Reed: + - Added -fmerge-all-constants to flags that get included in both CCFLAGS and LINKFLAGS. + RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index 8d06af7..5faa2d0 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -783,6 +783,7 @@ class SubstitutionEnvironment(object): elif arg in ['-mno-cygwin', '-pthread', '-openmp', + '-fmerge-all-constants', '-fopenmp']: dict['CCFLAGS'].append(arg) dict['LINKFLAGS'].append(arg) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 834cfd1..2e5f02a 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -797,6 +797,7 @@ sys.exit(0) "-F fwd3 " + \ "-dylib_file foo-dylib " + \ "-pthread " + \ + "-fmerge-all-constants " +\ "-fopenmp " + \ "-mno-cygwin -mwindows " + \ "-arch i386 -isysroot /tmp " + \ @@ -811,7 +812,8 @@ sys.exit(0) assert d['ASFLAGS'] == ['-as'], d['ASFLAGS'] assert d['CFLAGS'] == ['-std=c99'] assert d['CCFLAGS'] == ['-X', '-Wa,-as', - '-pthread', '-fopenmp', '-mno-cygwin', + '-pthread', '-fmerge-all-constants', + '-fopenmp', '-mno-cygwin', ('-arch', 'i386'), ('-isysroot', '/tmp'), ('-iquote', '/usr/include/foo1'), ('-isystem', '/usr/include/foo2'), @@ -832,7 +834,7 @@ sys.exit(0) assert LIBS == ['xxx', 'yyy', 'ascend'], (d['LIBS'], LIBS) assert d['LINKFLAGS'] == ['-Wl,-link', '-dylib_file', 'foo-dylib', - '-pthread', '-fopenmp', + '-pthread', '-fmerge-all-constants', '-fopenmp', '-mno-cygwin', '-mwindows', ('-arch', 'i386'), ('-isysroot', '/tmp'), -- cgit v0.12 From 6f14cfb16b620af1c2667926aaaa80d26b8033a2 Mon Sep 17 00:00:00 2001 From: Jason Kenny Date: Tue, 30 Jul 2019 16:03:50 -0500 Subject: Add test and fix to regression in current 3.1.0 drop --- src/CHANGES.txt | 24 ++++++++------- src/engine/SCons/Node/FS.py | 2 ++ test/Decider/MD5-timestamp-explain.py | 56 +++++++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 test/Decider/MD5-timestamp-explain.py diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 8a48bd4..4a8262c 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -10,6 +10,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Remove obsoleted references to DeciderNeedsNode which could cause crash when using --debug=explain + From Jason Kenny + + - Add Fix and test for regression in 3.1.0 when using Decider('MD5-timestamp') and --debug=explain + RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 @@ -20,7 +24,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From William Deegan: - Enhanced --debug=explain output. Now the separate components of the dependency list are split up as follows: - + scons: rebuilding `file3' because: the dependency order changed: ->Sources @@ -91,7 +95,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 - More fixes for newer Java versions (since 9): handle new jdk directory naming (jdk-X.Y instead of jdkX.Y) on Windows; handle two-digit major version. Docstrings improved. - - Fixups for pylint: exception types, redefined functions, + - Fixups for pylint: exception types, redefined functions, globals, etc. Some old code removed to resolve issues (hashlib is always present on modern Pythons; no longer need the code for 2.5-and-earlier optparse). cmp is not a builtin function in Py3, @@ -101,7 +105,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 - Add a PY3-only function for setting up the cachedir that should be less prone to races. Add a hack to the PY2 version (from Issue #3351) to be less prone to a race in the check for old-style cache. - - Fix coding error in docbook tool only exercised when using python lxml + - Fix coding error in docbook tool only exercised when using python lxml - Recognize two additional GNU compiler header directory options in ParseFlags: -iquote and -idirafter. - Fix more re patterns that contain \ but not specified as raw strings @@ -148,7 +152,7 @@ From Daniel Moody: From Bernhard M. Wiedemann: - Do not store build host+user name if reproducible builds are wanted - + RELEASE 3.0.4 - Mon, 20 Jan 2019 22:49:27 +0000 @@ -216,9 +220,9 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 - Fix GH Issue #2580 - # in FRAMEWORKPATH doesn't get properly expanded. The # is left in the command line. - Fix issue #2980 with credit to Piotr Bartosik (and William Blevins). This is an issue where using - TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being written into the .sconsign. - The difference between Piotr Bartosik's patch and the current code is that the more complicated - creation of file to csig map is only done when the count of children for the current node doesn't + TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being written into the .sconsign. + The difference between Piotr Bartosik's patch and the current code is that the more complicated + creation of file to csig map is only done when the count of children for the current node doesn't match the previous count which is loaded from the sconsign. - Fix issue # 3106 MSVC if using MSVC_BATCH and target dir had a space would fail due to quirk in MSVC's handling of escaped targetdirs when batch compiling. @@ -254,7 +258,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 - Removed unused --warn options from the man page and source code. From Arda Fu - - Fix cpp scanner regex logic to treat ifndef for py3.5+. Previously it was + - Fix cpp scanner regex logic to treat ifndef for py3.5+. Previously it was not properly differentiating between if, ifdef, and ifndef. From Philipp Maierhöfer @@ -265,7 +269,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 From Matthew Marinets: - Fixed an issue that caused the Java emitter to incorrectly parse arguments to constructors that implemented a class. - + From Fredrik Medley: - Fix exception when printing of EnviromentError messages. Specifically, this fixes error reporting of the race condition when @@ -386,7 +390,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 filter type -> list in ipk From Bernhard M. Wiedemann: - - Update SCons' internal scons build logic to allow overriding build date + - Update SCons' internal scons build logic to allow overriding build date with SOURCE_DATE_EPOCH for SCons itself. - Change the datestamps in SCons' docs and embedded in code use ISO 8601 format and UTC diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 33105fb..6b0fe98 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -3436,6 +3436,8 @@ class File(Base): Boolean - Indicates if node(File) has changed. """ + if node is None: + node = self # Now get sconsign name -> csig map and then get proper prev_ni if possible bi = node.get_stored_info().binfo rebuilt = False diff --git a/test/Decider/MD5-timestamp-explain.py b/test/Decider/MD5-timestamp-explain.py new file mode 100644 index 0000000..357d924 --- /dev/null +++ b/test/Decider/MD5-timestamp-explain.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# +# __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__" + +""" +Verify behavior of the MD5-timestamp Decider() setting. +""" + +import TestSCons + +test = TestSCons.TestSCons() + +test.write('SConstruct', """\ +import random +env = Environment() +env.Decider('MD5-timestamp') +# for testing use raw python API +with open("hello.h.in","w") as outfile: + outfile.write("// {}".format(random.randint(1,100))) +env.Command("hello.h","hello.h.in",[Copy("$TARGET","$SOURCE")]) +""") + + +test.run(arguments = '--debug=explain') +# this should not be up-to-date and it should not crash +test.not_up_to_date(arguments = '--debug=explain') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: -- cgit v0.12 From b947140417e2641331106036ed3b30e981942edd Mon Sep 17 00:00:00 2001 From: benjamin reed Date: Wed, 31 Jul 2019 00:14:09 -0700 Subject: simple changes to tests and doc * made test coverage for -fmerge-all-constants match -mno-cygwin * added -fmerge-all-constants to Environment.xml --- src/engine/SCons/Environment.xml | 49 ++++++++++++++++++------------------ src/engine/SCons/EnvironmentTests.py | 4 ++- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index 1b0a04c..e51f957 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -2301,30 +2301,31 @@ and added to the following construction variables: --arch CCFLAGS, LINKFLAGS --D CPPDEFINES --framework FRAMEWORKS --frameworkdir= FRAMEWORKPATH --include CCFLAGS --isysroot CCFLAGS, LINKFLAGS --isystem CCFLAGS --iquote CCFLAGS --idirafter CCFLAGS --I CPPPATH --l LIBS --L LIBPATH --mno-cygwin CCFLAGS, LINKFLAGS --mwindows LINKFLAGS --pthread CCFLAGS, LINKFLAGS --std= CFLAGS --Wa, ASFLAGS, CCFLAGS --Wl,-rpath= RPATH --Wl,-R, RPATH --Wl,-R RPATH --Wl, LINKFLAGS --Wp, CPPFLAGS -- CCFLAGS -+ CCFLAGS, LINKFLAGS +-arch CCFLAGS, LINKFLAGS +-D CPPDEFINES +-framework FRAMEWORKS +-frameworkdir= FRAMEWORKPATH +-fmerge-all-constants CCFLAGS, LINKFLAGS +-include CCFLAGS +-isysroot CCFLAGS, LINKFLAGS +-isystem CCFLAGS +-iquote CCFLAGS +-idirafter CCFLAGS +-I CPPPATH +-l LIBS +-L LIBPATH +-mno-cygwin CCFLAGS, LINKFLAGS +-mwindows LINKFLAGS +-pthread CCFLAGS, LINKFLAGS +-std= CFLAGS +-Wa, ASFLAGS, CCFLAGS +-Wl,-rpath= RPATH +-Wl,-R, RPATH +-Wl,-R RPATH +-Wl, LINKFLAGS +-Wp, CPPFLAGS +- CCFLAGS ++ CCFLAGS, LINKFLAGS diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 2e5f02a..8355f26 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -2027,6 +2027,7 @@ def generate(env): "-F fwd3 " + \ "-pthread " + \ "-mno-cygwin -mwindows " + \ + "-fmerge-all-constants " + \ "-arch i386 -isysroot /tmp " + \ "-iquote /usr/include/foo1 " + \ "-isystem /usr/include/foo2 " + \ @@ -2037,7 +2038,7 @@ def generate(env): assert save_command == ['fake command'], save_command assert env['ASFLAGS'] == ['assembler', '-as'], env['ASFLAGS'] assert env['CCFLAGS'] == ['', '-X', '-Wa,-as', - '-pthread', '-mno-cygwin', + '-pthread', '-fmerge-all-constants', '-mno-cygwin', ('-arch', 'i386'), ('-isysroot', '/tmp'), ('-iquote', '/usr/include/foo1'), ('-isystem', '/usr/include/foo2'), @@ -2051,6 +2052,7 @@ def generate(env): assert env['LIBPATH'] == ['list', '/usr/fax', 'foo'], env['LIBPATH'] assert env['LIBS'] == ['xxx', 'yyy', env.File('abc')], env['LIBS'] assert env['LINKFLAGS'] == ['', '-Wl,-link', '-pthread', + '-fmerge-all-constants', '-mno-cygwin', '-mwindows', ('-arch', 'i386'), ('-isysroot', '/tmp'), -- cgit v0.12 From ed1da2a36133d7917625591d8e7c4452c13f70ae Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Mon, 29 Jul 2019 13:34:34 -0400 Subject: [ci skip] Add explanation of situations causing issue #3415 --- src/CHANGES.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index b5b6652..954e2f8 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -10,6 +10,14 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER - Whatever John Doe did. + From Mathew Robinson: + + - Fix issue #3415 - Update remaining usages of EnvironmentError to SConsEnvironmentError + this patch fixes issues introduced in 3.1.0 where any of the + following would cause SCons to error and exit: + - CacheDir not write-able + - JSON encoding errors for CacheDir config + - JSON decoding errors for CacheDir config RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 -- cgit v0.12 From b0099386d35542dfd48f2dd73254fb2e91367e99 Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Sun, 21 Jul 2019 10:57:35 -0400 Subject: Fix some lingering SCons.Errors.EnvironmentError usage (fixes #3415) --- src/engine/SCons/CacheDir.py | 7 ++-- src/engine/SCons/CacheDirTests.py | 87 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 3 deletions(-) diff --git a/src/engine/SCons/CacheDir.py b/src/engine/SCons/CacheDir.py index 704b9a5..10c088d 100644 --- a/src/engine/SCons/CacheDir.py +++ b/src/engine/SCons/CacheDir.py @@ -33,6 +33,7 @@ import os import stat import sys +import SCons import SCons.Action import SCons.Warnings from SCons.Util import PY3 @@ -185,7 +186,7 @@ class CacheDir(object): pass except OSError: msg = "Failed to create cache directory " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) try: with open(config_file, 'x') as config: @@ -194,14 +195,14 @@ class CacheDir(object): json.dump(self.config, config) except Exception: msg = "Failed to write cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) except FileExistsError: try: with open(config_file) as config: self.config = json.load(config) except ValueError: msg = "Failed to read cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) def _readconfig2(self, path): diff --git a/src/engine/SCons/CacheDirTests.py b/src/engine/SCons/CacheDirTests.py index ef87746..8523fb7 100644 --- a/src/engine/SCons/CacheDirTests.py +++ b/src/engine/SCons/CacheDirTests.py @@ -27,10 +27,13 @@ import os.path import shutil import sys import unittest +import tempfile +import stat from TestCmd import TestCmd import SCons.CacheDir +from SCons.Util import PY3 built_it = None @@ -112,6 +115,90 @@ class CacheDirTestCase(BaseTestCase): finally: SCons.Util.MD5collect = save_collect +class ExceptionTestCase(unittest.TestCase): + """Test that the correct exceptions are thrown by CacheDir.""" + + # Don't inherit from BaseTestCase, we're by definition trying to + # break things so we really want a clean slate for each test. + def setUp(self): + self.tmpdir = tempfile.mkdtemp() + self._CacheDir = SCons.CacheDir.CacheDir(self.tmpdir) + + def tearDown(self): + shutil.rmtree(self.tmpdir) + + @unittest.skipIf(sys.platform.startswith("win"), "This fixture will not trigger an OSError on Windows") + def test_throws_correct_on_OSError(self): + """Test that the correct error is thrown when cache directory cannot be created.""" + privileged_dir = os.path.join(os.getcwd(), "privileged") + try: + os.mkdir(privileged_dir) + os.chmod(privileged_dir, stat.S_IREAD) + cd = SCons.CacheDir.CacheDir(os.path.join(privileged_dir, "cache")) + assert False, "Should have raised exception and did not" + except SCons.Errors.SConsEnvironmentError as e: + assert str(e) == "Failed to create cache directory {}".format(os.path.join(privileged_dir, "cache")) + except Exception as e: + assert False, "Got unexpected exception: {}".format(str(e)) + finally: + os.chmod(privileged_dir, stat.S_IWRITE | stat.S_IEXEC | stat.S_IREAD) + shutil.rmtree(privileged_dir) + + + def test_throws_correct_when_failed_to_write_configfile(self): + class Unserializable: + """A class which the JSON should not be able to serialize""" + + def __init__(self, oldconfig): + self.something = 1 # Make the object unserializable + # Pretend to be the old config just enough + self.__dict__["prefix_len"] = oldconfig["prefix_len"] + + def __getitem__(self, name, default=None): + if name == "prefix_len": + return self.__dict__["prefix_len"] + else: + return None + + def __setitem__(self, name, value): + self.__dict__[name] = value + + oldconfig = self._CacheDir.config + self._CacheDir.config = Unserializable(oldconfig) + # Remove the config file that got created on object creation + # so that _readconfig* will try to rewrite it + old_config = os.path.join(self._CacheDir.path, "config") + os.remove(old_config) + + try: + if PY3: + self._CacheDir._readconfig3(self._CacheDir.path) + else: + self._CacheDir._readconfig2(self._CacheDir.path) + assert False, "Should have raised exception and did not" + except SCons.Errors.SConsEnvironmentError as e: + assert str(e) == "Failed to write cache configuration for {}".format(self._CacheDir.path) + except Exception as e: + assert False, "Got unexpected exception: {}".format(str(e)) + + def test_raise_environment_error_on_invalid_json(self): + config_file = os.path.join(self._CacheDir.path, "config") + with open(config_file, "r") as cfg: + content = cfg.read() + # This will make JSON load raise a ValueError + content += "{}" + with open(config_file, "w") as cfg: + cfg.write(content) + + try: + # Construct a new cache dir that will try to read the invalid config + new_cache_dir = SCons.CacheDir.CacheDir(self._CacheDir.path) + assert False, "Should have raised exception and did not" + except SCons.Errors.SConsEnvironmentError as e: + assert str(e) == "Failed to read cache configuration for {}".format(self._CacheDir.path) + except Exception as e: + assert False, "Got unexpected exception: {}".format(str(e)) + class FileTestCase(BaseTestCase): """ Test calling CacheDir code through Node.FS.File interfaces. -- cgit v0.12 From 2c379597163e61009aa6a8c7b9c734e57d317ec5 Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Wed, 31 Jul 2019 14:29:21 -0400 Subject: Don't chain exceptions in CacheDirTests --- src/engine/SCons/CacheDirTests.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/engine/SCons/CacheDirTests.py b/src/engine/SCons/CacheDirTests.py index 8523fb7..07c32b4 100644 --- a/src/engine/SCons/CacheDirTests.py +++ b/src/engine/SCons/CacheDirTests.py @@ -138,8 +138,6 @@ class ExceptionTestCase(unittest.TestCase): assert False, "Should have raised exception and did not" except SCons.Errors.SConsEnvironmentError as e: assert str(e) == "Failed to create cache directory {}".format(os.path.join(privileged_dir, "cache")) - except Exception as e: - assert False, "Got unexpected exception: {}".format(str(e)) finally: os.chmod(privileged_dir, stat.S_IWRITE | stat.S_IEXEC | stat.S_IREAD) shutil.rmtree(privileged_dir) @@ -178,8 +176,6 @@ class ExceptionTestCase(unittest.TestCase): assert False, "Should have raised exception and did not" except SCons.Errors.SConsEnvironmentError as e: assert str(e) == "Failed to write cache configuration for {}".format(self._CacheDir.path) - except Exception as e: - assert False, "Got unexpected exception: {}".format(str(e)) def test_raise_environment_error_on_invalid_json(self): config_file = os.path.join(self._CacheDir.path, "config") @@ -196,8 +192,6 @@ class ExceptionTestCase(unittest.TestCase): assert False, "Should have raised exception and did not" except SCons.Errors.SConsEnvironmentError as e: assert str(e) == "Failed to read cache configuration for {}".format(self._CacheDir.path) - except Exception as e: - assert False, "Got unexpected exception: {}".format(str(e)) class FileTestCase(BaseTestCase): """ -- cgit v0.12 From 7b0ca02591b88f5b86d1a8a57b3fb12c97cca21f Mon Sep 17 00:00:00 2001 From: benjamin reed Date: Wed, 31 Jul 2019 17:09:07 -0700 Subject: make expected flag order match the order passed. --- src/engine/SCons/EnvironmentTests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 8355f26..70e1a37 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -2026,8 +2026,8 @@ def generate(env): "-Ffwd2 " + \ "-F fwd3 " + \ "-pthread " + \ - "-mno-cygwin -mwindows " + \ "-fmerge-all-constants " + \ + "-mno-cygwin -mwindows " + \ "-arch i386 -isysroot /tmp " + \ "-iquote /usr/include/foo1 " + \ "-isystem /usr/include/foo2 " + \ -- cgit v0.12 From 2b4e05d0f38b1115e0909f53f06b6f52ed0ef3d4 Mon Sep 17 00:00:00 2001 From: benjamin reed Date: Wed, 31 Jul 2019 23:16:33 -0700 Subject: Added -fopenmp and -openmp to the docs. --- src/engine/SCons/Environment.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/engine/SCons/Environment.xml b/src/engine/SCons/Environment.xml index e51f957..46a00d2 100644 --- a/src/engine/SCons/Environment.xml +++ b/src/engine/SCons/Environment.xml @@ -2306,6 +2306,7 @@ and added to the following construction variables: -framework FRAMEWORKS -frameworkdir= FRAMEWORKPATH -fmerge-all-constants CCFLAGS, LINKFLAGS +-fopenmp CCFLAGS, LINKFLAGS -include CCFLAGS -isysroot CCFLAGS, LINKFLAGS -isystem CCFLAGS @@ -2316,6 +2317,7 @@ and added to the following construction variables: -L LIBPATH -mno-cygwin CCFLAGS, LINKFLAGS -mwindows LINKFLAGS +-openmp CCFLAGS, LINKFLAGS -pthread CCFLAGS, LINKFLAGS -std= CFLAGS -Wa, ASFLAGS, CCFLAGS -- cgit v0.12 From f18e32cbc13d1226a3df16856aab355f1995174b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 20 Jul 2019 15:12:47 -0600 Subject: Document and polish runtest.py This is a minor change to runtest, some slight rearrangements, adding a docstring, clarifying a few comments. The subclass of Thread is now more precise in following the Thread constructor. Signed-off-by: Mats Wichmann --- runtest.py | 95 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 44 deletions(-) diff --git a/runtest.py b/runtest.py index 1982764..25c92bd 100755 --- a/runtest.py +++ b/runtest.py @@ -71,7 +71,6 @@ Environment Variables: from __future__ import print_function - import getopt import glob import os @@ -367,7 +366,7 @@ else: return (spawned_stderr, spawned_stdout, p.wait()) -class Base(object): +class RuntestBase(object): def __init__(self, path, num, spe=None): self.path = path self.num = num @@ -381,7 +380,7 @@ class Base(object): self.status = None -class SystemExecutor(Base): +class SystemExecutor(RuntestBase): def execute(self): self.stderr, self.stdout, s = spawn_it(self.command_args) self.status = s @@ -389,7 +388,7 @@ class SystemExecutor(Base): sys.stdout.write("Unexpected exit status %d\n" % s) -class PopenExecutor(Base): +class PopenExecutor(RuntestBase): # For an explanation of the following 'if ... else' # and the 'allow_pipe_files' option, please check out the # definition of spawn_it() above. @@ -639,15 +638,14 @@ else: # Each test path specifies a test file, or a directory to search for # SCons tests. SCons code layout assumes that any file under the 'src' - # subdirectory that ends with 'Tests.py' is a unit test, and Python + # subdirectory that ends with 'Tests.py' is a unit test, and any Python # script (*.py) under the 'test' subdirectory an end-to-end test. + # We need to track these because they are invoked differently. # # Note that there are some tests under 'src' that *begin* with # 'test_', but they're packaging and installation tests, not # functional tests, so we don't execute them by default. (They can - # still be executed by hand, though, and are routinely executed - # by the Aegis packaging build to make sure that we're building - # things correctly.) + # still be executed by hand, though). if options.all: testpaths = ['src', 'test'] @@ -733,37 +731,46 @@ else: total_start_time = time_func() total_num_tests = len(tests) -tests_completed = 0 -tests_passing = 0 -tests_failing = 0 -def log_result(t, io_lock): - global tests_completed, tests_passing, tests_failing - tests_completed += 1 - if t.status == 0: - tests_passing += 1 - else: - tests_failing += 1 +def log_result(t, io_lock=None): + """ log the result of a test. + + "log" in this case means writing to stdout. Since we might be + called from from any of several diffrent threads (multi-job run), + we need to lock access to the log to avoid interleaving. The same + would apply if output was a file. + + :param t: a completed testcase + :type t: Test + :param io_lock: + :type io_lock: threading.Lock + """ + + # there is no lock in single-job run, which includes + # running test/runtest tests from multi-job run, so check. if io_lock: io_lock.acquire() - if suppress_output or catch_output: - sys.stdout.write(t.headline) - if not suppress_output: - if t.stdout: - print(t.stdout) - if t.stderr: - print(t.stderr) - print_time_func("Test execution time: %.1f seconds\n", t.test_time) - if io_lock: - io_lock.release() + try: + if suppress_output or catch_output: + sys.stdout.write(t.headline) + if not suppress_output: + if t.stdout: + print(t.stdout) + if t.stderr: + print(t.stderr) + print_time_func("Test execution time: %.1f seconds\n", t.test_time) + finally: + if io_lock: + io_lock.release() + if quit_on_failure and t.status == 1: print("Exiting due to error") print(t.status) sys.exit(1) -def run_test(t, io_lock, run_async=True): +def run_test(t, io_lock=None, run_async=True): t.headline = "" command_args = [] if sys.version_info[0] < 3: @@ -797,39 +804,39 @@ def run_test(t, io_lock, run_async=True): test_start_time = time_func() if execute_tests: t.execute() + t.test_time = time_func() - test_start_time - log_result(t, io_lock) + log_result(t, io_lock=io_lock) class RunTest(threading.Thread): - def __init__(self, queue, io_lock): - threading.Thread.__init__(self) + def __init__(self, queue=None, io_lock=None, + group=None, target=None, name=None, args=(), kwargs=None): + super(RunTest, self).__init__(group=group, target=target, name=name) self.queue = queue self.io_lock = io_lock def run(self): - while True: - t = self.queue.get() - run_test(t, self.io_lock, True) + for t in iter(self.queue.get, None): + run_test(t, io_lock=self.io_lock, run_async=True) self.queue.task_done() if jobs > 1: - print("Running tests using %d jobs"%jobs) - # Start worker threads + print("Running tests using %d jobs" % jobs) queue = Queue() + for t in tests: + queue.put(t) io_lock = threading.Lock() - for _ in range(jobs): - t = RunTest(queue, io_lock) + # Start worker threads to consume the queue + threads = [RunTest(queue=queue, io_lock=io_lock) for _ in range(jobs)] + for t in threads: t.daemon = True t.start() - # Give tasks to workers - for t in tests: - queue.put(t) - # wait until all done + # wait on the queue rather than the individual threads queue.join() else: for t in tests: - run_test(t, None, False) + run_test(t, io_lock=None, run_async=False) # --- all tests are complete by the time we get here --- if len(tests) > 0: -- cgit v0.12 From c5ccc294306f1cedae2feb4f2df55e99d02905d9 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sat, 20 Jul 2019 15:18:19 -0600 Subject: [PR #3411] fix typo spotted by sider CI Signed-off-by: Mats Wichmann --- runtest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtest.py b/runtest.py index 25c92bd..464b593 100755 --- a/runtest.py +++ b/runtest.py @@ -31,8 +31,8 @@ Options: -n --no-exec No execute, just print command lines. --nopipefiles Do not use the "file pipe" workaround for Popen() for starting tests. WARNING: use only when too much - file traffic is giving you trouble AND you can be - sure that none of your tests create output >65K + file traffic is giving you trouble AND you can be + sure that none of your tests create output >65K chars! You might run into some deadlocks else. -o --output FILE Save the output from a test run to the log file. -P PYTHON Use the specified Python interpreter. @@ -678,7 +678,7 @@ else: tests.extend(unittests) tests.extend(endtests) tests.sort() - + if not tests: sys.stderr.write(usagestr + """ runtest.py: No tests were found. @@ -737,7 +737,7 @@ def log_result(t, io_lock=None): """ log the result of a test. "log" in this case means writing to stdout. Since we might be - called from from any of several diffrent threads (multi-job run), + called from from any of several different threads (multi-job run), we need to lock access to the log to avoid interleaving. The same would apply if output was a file. -- cgit v0.12 From 6aadc91de533ceb33a474238fef8a6bd339066d8 Mon Sep 17 00:00:00 2001 From: Mathew Robinson Date: Tue, 6 Aug 2019 10:28:38 -0400 Subject: [ci skip] Clarify docs about writing your own Builder and link to Action Objects man page --- doc/user/builders-writing.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index ce95128..e20e99b 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -453,7 +453,7 @@ def build_function(target, source, env): A list of Node objects representing the target or targets to be - built by this builder function. + built by this function. The file names of these target(s) may be extracted using the Python &str; function. @@ -469,7 +469,7 @@ def build_function(target, source, env): A list of Node objects representing the sources to be - used by this builder function to build the targets. + used by this function to build the targets. The file names of these source(s) may be extracted using the Python &str; function. @@ -484,7 +484,7 @@ def build_function(target, source, env): The &consenv; used for building the target(s). - The builder function may use any of the + The function may use any of the environment's construction variables in any way to affect how it builds the targets. @@ -496,13 +496,14 @@ def build_function(target, source, env): - The builder function must - return a 0 or None value - if the target(s) are built successfully. - The builder function - may raise an exception - or return any non-zero value - to indicate that the build is unsuccessful. + The function will be constructed as a SCons FunctionAction and + must return a 0 or None + value if the target(s) are built successfully. The function may + raise an exception or return any non-zero value to indicate that + the build is unsuccessful. + + For more information on Actions see the Action Objects section of + the man page. -- cgit v0.12 From fdae63a03255af622ac21b50e200036fea951388 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 7 Aug 2019 20:06:22 -0500 Subject: Regenerated docs for 3.1.1 release. --- doc/generated/examples/caching_ex-random_1.xml | 4 +- doc/generated/examples/troubleshoot_Dump_1.xml | 1 + doc/generated/examples/troubleshoot_Dump_2.xml | 3 +- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- .../examples/troubleshoot_stacktrace_2.xml | 4 +- doc/generated/functions.gen | 51 ++++++++++++---------- doc/generated/tools.gen | 12 ++--- doc/generated/tools.mod | 4 +- doc/generated/variables.gen | 24 +++++----- doc/generated/variables.mod | 4 +- 10 files changed, 57 insertions(+), 52 deletions(-) diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index 58ff6ae..d484ca4 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q +cc -o f4.o -c f4.c cc -o f3.o -c f3.c -cc -o f2.o -c f2.c cc -o f5.o -c f5.c +cc -o f2.o -c f2.c cc -o f1.o -c f1.c -cc -o f4.o -c f4.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml index 99d1399..99518c0 100644 --- a/doc/generated/examples/troubleshoot_Dump_1.xml +++ b/doc/generated/examples/troubleshoot_Dump_1.xml @@ -57,6 +57,7 @@ scons: Reading SConscript files ... 'TARGET_ARCH': None, 'TARGET_OS': None, 'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>, + 'TEMPFILEARGJOIN': ' ', 'TEMPFILEPREFIX': '@', 'TOOLS': ['install', 'install'], '_CPPDEFFLAGS': '${_defines(CPPDEFPREFIX, CPPDEFINES, CPPDEFSUFFIX, __env__)}', diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml index e8e0960..d83fb94 100644 --- a/doc/generated/examples/troubleshoot_Dump_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_2.xml @@ -80,7 +80,7 @@ scons: Reading SConscript files ... 'SHCXX': '$CXX', 'SHCXXCOM': '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}', 'SHCXXFLAGS': ['$CXXFLAGS'], - 'SHELL': None, + 'SHELL': 'command', 'SHLIBPREFIX': '', 'SHLIBSUFFIX': '.dll', 'SHOBJPREFIX': '$OBJPREFIX', @@ -90,6 +90,7 @@ scons: Reading SConscript files ... 'TARGET_ARCH': None, 'TARGET_OS': None, 'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>, + 'TEMPFILEARGJOIN': '\n', 'TEMPFILEPREFIX': '@', 'TOOLS': ['msvc', 'install', 'install'], '_CCCOMCOM': '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $CCPCHFLAGS $CCPDBFLAGS', diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index 04b09fd..ed8f6d9 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/home/bdeegan/devel/scons/git/as_scons/bootstrap/src/script/scons.py", line 204, in <module> +File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/scons.py", line 204, in <module> diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml index 76cfc1a..2d88ae8 100644 --- a/doc/generated/examples/troubleshoot_stacktrace_2.xml +++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml @@ -4,10 +4,10 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons: internal stack trace: File "bootstrap/src/engine/SCons/Job.py", line 199, in start task.prepare() - File "bootstrap/src/engine/SCons/Script/Main.py", line 177, in prepare + File "bootstrap/src/engine/SCons/Script/Main.py", line 190, in prepare return SCons.Taskmaster.OutOfDateTask.prepare(self) File "bootstrap/src/engine/SCons/Taskmaster.py", line 198, in prepare executor.prepare() - File "bootstrap/src/engine/SCons/Executor.py", line 430, in prepare + File "bootstrap/src/engine/SCons/Executor.py", line 431, in prepare raise SCons.Errors.StopError(msg % (s, self.batches[0].targets[0])) diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 5e8bebb..9bed358 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -2948,30 +2948,33 @@ and added to the following construction variables: --arch CCFLAGS, LINKFLAGS --D CPPDEFINES --framework FRAMEWORKS --frameworkdir= FRAMEWORKPATH --include CCFLAGS --isysroot CCFLAGS, LINKFLAGS --isystem CCFLAGS --iquote CCFLAGS --idirafter CCFLAGS --I CPPPATH --l LIBS --L LIBPATH --mno-cygwin CCFLAGS, LINKFLAGS --mwindows LINKFLAGS --pthread CCFLAGS, LINKFLAGS --std= CFLAGS --Wa, ASFLAGS, CCFLAGS --Wl,-rpath= RPATH --Wl,-R, RPATH --Wl,-R RPATH --Wl, LINKFLAGS --Wp, CPPFLAGS -- CCFLAGS -+ CCFLAGS, LINKFLAGS +-arch CCFLAGS, LINKFLAGS +-D CPPDEFINES +-framework FRAMEWORKS +-frameworkdir= FRAMEWORKPATH +-fmerge-all-constants CCFLAGS, LINKFLAGS +-fopenmp CCFLAGS, LINKFLAGS +-include CCFLAGS +-isysroot CCFLAGS, LINKFLAGS +-isystem CCFLAGS +-iquote CCFLAGS +-idirafter CCFLAGS +-I CPPPATH +-l LIBS +-L LIBPATH +-mno-cygwin CCFLAGS, LINKFLAGS +-mwindows LINKFLAGS +-openmp CCFLAGS, LINKFLAGS +-pthread CCFLAGS, LINKFLAGS +-std= CFLAGS +-Wa, ASFLAGS, CCFLAGS +-Wl,-rpath= RPATH +-Wl,-R, RPATH +-Wl,-R RPATH +-Wl, LINKFLAGS +-Wp, CPPFLAGS +- CCFLAGS ++ CCFLAGS, LINKFLAGS diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index be717e3..ecd9c98 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -779,19 +779,19 @@ Sets construction variables for the Sets: &cv-link-AS;, &cv-link-ASCOM;, &cv-link-ASFLAGS;, &cv-link-ASPPCOM;, &cv-link-ASPPFLAGS;.Uses: &cv-link-ASCOMSTR;, &cv-link-ASPPCOMSTR;. - - packaging + + Packaging -A framework for building binary and source packages. +Sets construction variables for the Package Builder. - - Packaging + + packaging -Sets construction variables for the Package Builder. +A framework for building binary and source packages. diff --git a/doc/generated/tools.mod b/doc/generated/tools.mod index f9bc1d7..1209d74 100644 --- a/doc/generated/tools.mod +++ b/doc/generated/tools.mod @@ -78,8 +78,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> @@ -186,8 +186,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. mwcc"> mwld"> nasm"> -packaging"> Packaging"> +packaging"> pdf"> pdflatex"> pdftex"> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 28dfc59..3f26933 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -3298,7 +3298,7 @@ The command line used to call the Java archive tool. The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3308,7 +3308,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -6790,6 +6790,16 @@ Example + + SHLIBVERSIONFLAGS + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is +set. + + + _SHLIBVERSIONFLAGS @@ -6803,16 +6813,6 @@ and some extra dynamically generated options (such as - - SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is -set. - - - SHLINK diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 47576f4..372a15f 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -504,8 +504,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> @@ -1144,8 +1144,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$_SHLIBVERSIONFLAGS"> $SHLIBVERSIONFLAGS"> +$_SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> -- cgit v0.12 From 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 7 Aug 2019 20:11:27 -0500 Subject: Changes for 3.1.1 release --- README.rst | 14 +++++++------- ReleaseConfig | 2 +- SConstruct | 4 ++-- src/Announce.txt | 2 +- src/CHANGES.txt | 4 ++-- src/RELEASE.txt | 2 +- testing/framework/TestSCons.py | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index 07be9a9..9589df7 100755 --- a/README.rst +++ b/README.rst @@ -499,13 +499,13 @@ about `Executing SCons Without Installing`_):: Depending on the utilities installed on your system, any or all of the following packages will be built:: - build/dist/scons-3.1.0.tar.gz - build/dist/scons-3.1.0.zip - build/dist/scons-doc-3.1.0.tar.gz - build/dist/scons-local-3.1.0.tar.gz - build/dist/scons-local-3.1.0.zip - build/dist/scons-src-3.1.0.tar.gz - build/dist/scons-src-3.1.0.zip + build/dist/scons-3.1.1.tar.gz + build/dist/scons-3.1.1.zip + build/dist/scons-doc-3.1.1.tar.gz + build/dist/scons-local-3.1.1.tar.gz + build/dist/scons-local-3.1.1.zip + build/dist/scons-src-3.1.1.tar.gz + build/dist/scons-src-3.1.1.zip The SConstruct file is supposed to be smart enough to avoid trying to build packages for which you don't have the proper utilities installed. For diff --git a/ReleaseConfig b/ReleaseConfig index b3893bd..2bddfa0 100755 --- a/ReleaseConfig +++ b/ReleaseConfig @@ -32,7 +32,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" # 'final', the patchlevel is set to the release date. This value is # mandatory and must be present in this file. #version_tuple = (2, 2, 0, 'final', 0) -version_tuple = (3, 1, 1, 'alpha', 0) +version_tuple = (3, 1, 1) # Python versions prior to unsupported_python_version cause a fatal error # when that version is used. Python versions prior to deprecate_python_version diff --git a/SConstruct b/SConstruct index 40764dc..8db1657 100644 --- a/SConstruct +++ b/SConstruct @@ -8,7 +8,7 @@ from __future__ import print_function copyright_years = '2001 - 2019' # This gets inserted into the man pages to reflect the month of release. -month_year = 'July 2019' +month_year = 'August 2019' # # __COPYRIGHT__ @@ -49,7 +49,7 @@ import textwrap import bootstrap project = 'scons' -default_version = '3.1.0' +default_version = '3.1.1' copyright = "Copyright (c) %s The SCons Foundation" % copyright_years SConsignFile() diff --git a/src/Announce.txt b/src/Announce.txt index 1359696..425aaa1 100755 --- a/src/Announce.txt +++ b/src/Announce.txt @@ -18,7 +18,7 @@ So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. -RELEASE VERSION/DATE TO BE FILLED IN LATER +RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes diff --git a/src/CHANGES.txt b/src/CHANGES.txt index e33aa6a..953931b 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -4,13 +4,13 @@ Change Log -RELEASE VERSION/DATE TO BE FILLED IN LATER +RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 From William Deegan: - Remove obsoleted references to DeciderNeedsNode which could cause crash when using --debug=explain From Jason Kenny - - Add Fix and test for regression in 3.1.0 when using Decider('MD5-timestamp') and --debug=explain + - Add Fix and test for crash in 3.1.0 when using Decider('MD5-timestamp') and --debug=explain From Ben Reed: - Added -fmerge-all-constants to flags that get included in both CCFLAGS and LINKFLAGS. diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 17e698f..a2f7918 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -1,4 +1,4 @@ - A new SCons checkpoint release, 3.1.2.alpha.yyyymmdd, is now available + A new SCons checkpoint release, 3.1.1, is now available on the SCons download page: https://scons.org/pages/download.html diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 89ad43b..7dc9e74 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -35,7 +35,7 @@ from TestCmd import PIPE # here provides some independent verification that what we packaged # conforms to what we expect. -default_version = '3.1.0' +default_version = '3.1.1' python_version_unsupported = (2, 6, 0) python_version_deprecated = (2, 7, 0) -- cgit v0.12