diff options
author | Steven Knight <knight@baldmt.com> | 2004-05-16 04:18:22 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-05-16 04:18:22 (GMT) |
commit | 53dbe8a6dc45863207388a65318a9fe8bcc480e9 (patch) | |
tree | efdb6c9f8d20130118d1f783a1cac6dc831652d7 /src | |
parent | 86c11822b8f41dff8ec28e4ee8a8afeec9bfaa5f (diff) | |
download | SCons-53dbe8a6dc45863207388a65318a9fe8bcc480e9.zip SCons-53dbe8a6dc45863207388a65318a9fe8bcc480e9.tar.gz SCons-53dbe8a6dc45863207388a65318a9fe8bcc480e9.tar.bz2 |
Move Action initializations for common default COM values from Tool/*.py to Defaults.py.
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 5 | ||||
-rw-r--r-- | src/engine/SCons/Defaults.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Tool/lex.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/yacc.py | 5 |
5 files changed, 22 insertions, 7 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index f760d7b..8d35dc5 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -110,6 +110,11 @@ RELEASE 0.96 - XXX - Change the .sconsign format and the checks for whether a Node is up-to-date to make dependency checks more efficient and correct. + - Add wrapper Actions to SCons.Defaults for $ASCOM, $ASPPCOM, $LINKCOM, + $SHLINKCOM, $ARCOM, $LEXCOM and $YACCCOM. This makes it possible + to replace the default print behavior with a custom strfunction() + for each of these. + From Gary Oberbrunner: - Add a --debug=presub option to print actions prior to substitution. diff --git a/src/engine/SCons/Defaults.py b/src/engine/SCons/Defaults.py index 98c9195..7a47b21 100644 --- a/src/engine/SCons/Defaults.py +++ b/src/engine/SCons/Defaults.py @@ -128,6 +128,14 @@ ShF77PPAction = SCons.Action.Action("$SHF77PPCOM") ASAction = SCons.Action.Action("$ASCOM") ASPPAction = SCons.Action.Action("$ASPPCOM") +LinkAction = SCons.Action.Action("$LINKCOM") +ShLinkAction = SCons.Action.Action("$SHLINKCOM") + +ArAction = SCons.Action.Action("$ARCOM") + +LexAction = SCons.Action.Action("$LEXCOM") +YaccAction = SCons.Action.Action("$YACCCOM") + ProgScan = SCons.Scanner.Prog.ProgScan() def DVI(): diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index 6ddc537..667e085 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -98,7 +98,7 @@ def createProgBuilder(env): try: program = env['BUILDERS']['Program'] except KeyError: - program = SCons.Builder.Builder(action = '$LINKCOM', + program = SCons.Builder.Builder(action = SCons.Defaults.LinkAction, emitter = '$PROGEMITTER', prefix = '$PROGPREFIX', suffix = '$PROGSUFFIX', @@ -119,7 +119,7 @@ def createStaticLibBuilder(env): try: static_lib = env['BUILDERS']['StaticLibrary'] except KeyError: - static_lib = SCons.Builder.Builder(action = "$ARCOM", + static_lib = SCons.Builder.Builder(action = SCons.Defaults.ArAction, emitter = '$LIBEMITTER', prefix = '$LIBPREFIX', suffix = '$LIBSUFFIX', @@ -140,7 +140,8 @@ def createSharedLibBuilder(env): try: shared_lib = env['BUILDERS']['SharedLibrary'] except KeyError: - action_list = [ SCons.Defaults.SharedCheck, "$SHLINKCOM" ] + action_list = [ SCons.Defaults.SharedCheck, + SCons.Defaults.ShLinkAction ] shared_lib = SCons.Builder.Builder(action = action_list, emitter = "$SHLIBEMITTER", prefix = '$SHLIBPREFIX', diff --git a/src/engine/SCons/Tool/lex.py b/src/engine/SCons/Tool/lex.py index 004d0da..18acbbd 100644 --- a/src/engine/SCons/Tool/lex.py +++ b/src/engine/SCons/Tool/lex.py @@ -41,8 +41,8 @@ def generate(env): """Add Builders and construction variables for lex to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) - c_file.add_action('.l', '$LEXCOM') - cxx_file.add_action('.ll', '$LEXCOM') + c_file.add_action('.l', SCons.Defaults.LexAction) + cxx_file.add_action('.ll', SCons.Defaults.LexAction) env['LEX'] = env.Detect('flex') or 'lex' env['LEXFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/yacc.py b/src/engine/SCons/Tool/yacc.py index cf54b78..ff3f040 100644 --- a/src/engine/SCons/Tool/yacc.py +++ b/src/engine/SCons/Tool/yacc.py @@ -35,6 +35,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os.path +import SCons.Defaults import SCons.Tool import SCons.Util @@ -59,8 +60,8 @@ def generate(env): """Add Builders and construction variables for yacc to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) - c_file.add_action('.y', '$YACCCOM') - cxx_file.add_action('.yy', '$YACCCOM') + c_file.add_action('.y', SCons.Defaults.YaccAction) + cxx_file.add_action('.yy', SCons.Defaults.YaccAction) c_file.add_emitter('.y', yEmitter) cxx_file.add_emitter('.yy', yyEmitter) |