From: stevenknight Date: Sun, 16 May 2004 04:18:22 +0000 (+0000) Subject: Move Action initializations for common default COM values from Tool/*.py to Defaults.py. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bab6cf1c366666d7178009da5ac9ba95a8b8e308;p=scons.git Move Action initializations for common default COM values from Tool/*.py to Defaults.py. git-svn-id: http://scons.tigris.org/svn/scons/trunk@978 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index f760d7b8..8d35dc54 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 98c91956..7a47b215 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 6ddc5372..667e0853 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 004d0da2..18acbbd3 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 cf54b78c..ff3f040f 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)