Move Action initializations for common default COM values from Tool/*.py to Defaults.py.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 16 May 2004 04:18:22 +0000 (04:18 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 16 May 2004 04:18:22 +0000 (04:18 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@978 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Defaults.py
src/engine/SCons/Tool/__init__.py
src/engine/SCons/Tool/lex.py
src/engine/SCons/Tool/yacc.py

index f760d7b876225ff065cd443fa3e5b65c2f9abeac..8d35dc540532332c74e3757cd716d0e3ba39b3b7 100644 (file)
@@ -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.
index 98c9195664358cec6af9884660d3caf239a4f13f..7a47b21521bbde8d815fabe4ded698bc69f1bf7e 100644 (file)
@@ -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():
index 6ddc537274c95c88f9776b7449fbdc23fc5951d5..667e085367d59e552dca21415483f83850315257 100644 (file)
@@ -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',
index 004d0da2d0167a8d4775f8be15db5be8aa7c8134..18acbbd329615983efeb29216cbce0e87856f5b5 100644 (file)
@@ -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('')
index cf54b78c2a13bde8e28ba36e4288c759a1acb193..ff3f040f4058c18b5f975ab3c420f836d1f5aafc 100644 (file)
@@ -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)