diff options
author | Steven Knight <knight@baldmt.com> | 2005-01-06 01:39:03 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-01-06 01:39:03 (GMT) |
commit | 8209788c5d6a2554317a13416bb953b6c3f572ab (patch) | |
tree | 94c9d4e2e123a270c35f30c4b8691f1feeb0f2e3 /src/engine/SCons/Tool | |
parent | 1344c9c2297d5e0931bfcd15a853b13d8e5caf34 (diff) | |
download | SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.zip SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.tar.gz SCons-8209788c5d6a2554317a13416bb953b6c3f572ab.tar.bz2 |
More command-line customizability: , , , , , , .
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r-- | src/engine/SCons/Tool/Perforce.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 19 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dvipdf.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dvips.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Tool/gs.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Tool/m4.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Tool/swig.py | 7 |
7 files changed, 41 insertions, 12 deletions
diff --git a/src/engine/SCons/Tool/Perforce.py b/src/engine/SCons/Tool/Perforce.py index 0c6796c..22c75e9 100644 --- a/src/engine/SCons/Tool/Perforce.py +++ b/src/engine/SCons/Tool/Perforce.py @@ -35,6 +35,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import SCons.Action import SCons.Builder import SCons.Node.FS import SCons.Util @@ -42,18 +43,21 @@ import SCons.Util # This function should maybe be moved to SCons.Util? from SCons.Tool.PharLapCommon import addPathIfNotExists + + # Variables that we want to import from the base OS environment. _import_env = [ 'P4PORT', 'P4CLIENT', 'P4USER', 'USER', 'USERNAME', 'P4PASSWD', 'P4CHARSET', 'P4LANGUAGE', 'SYSTEMROOT' ] +PerforceAction = SCons.Action.Action('$P4COM', '$P4COMSTR') + def generate(env): """Add a Builder factory function and construction variables for Perforce to an Environment.""" def PerforceFactory(env=env): """ """ - return SCons.Builder.Builder(action = '$P4COM', - env = env) + return SCons.Builder.Builder(action = PerforceAction, env = env) #setattr(env, 'Perforce', PerforceFactory) env.Perforce = PerforceFactory diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py index 5d773c3..914129c 100644 --- a/src/engine/SCons/Tool/dmd.py +++ b/src/engine/SCons/Tool/dmd.py @@ -58,10 +58,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import string -import SCons.Tool -import SCons.Scanner.D +import SCons.Action import SCons.Builder import SCons.Defaults +import SCons.Scanner.D +import SCons.Tool # Adapted from c++.py def isD(source): @@ -85,8 +86,10 @@ def generate(env): static_obj, shared_obj = SCons.Tool.createObjBuilders(env) - static_obj.add_action('.d', '$DCOM') - shared_obj.add_action('.d', '$DCOM') + DAction = SCons.Action.Action('$DCOM', '$DCOMSTR') + + static_obj.add_action('.d', DAction) + shared_obj.add_action('.d', DAction) static_obj.add_emitter('.d', SCons.Defaults.StaticObjectEmitter) shared_obj.add_emitter('.d', SCons.Defaults.SharedObjectEmitter) @@ -152,6 +155,10 @@ def generate(env): def _smartLink(source, target, env, for_signature, defaultLinker=linkcom): if isD(source): + # XXX I'm not sure how to add a $DLINKCOMSTR variable + # so that it works with this _smartLink() logic, + # and I don't have a D compiler/linker to try it out, + # so we'll leave it alone for now. return '$DLINKCOM' else: return defaultLinker @@ -164,6 +171,10 @@ def generate(env): def _smartLib(source, target, env, for_signature, defaultLib=arcom): if isD(source): + # XXX I'm not sure how to add a $DLIBCOMSTR variable + # so that it works with this _smartLib() logic, and + # I don't have a D compiler/archiver to try it out, + # so we'll leave it alone for now. return '$DLIBCOM' else: return defaultLib diff --git a/src/engine/SCons/Tool/dvipdf.py b/src/engine/SCons/Tool/dvipdf.py index 8c51ac0..1ffb655 100644 --- a/src/engine/SCons/Tool/dvipdf.py +++ b/src/engine/SCons/Tool/dvipdf.py @@ -33,9 +33,12 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Action import SCons.Defaults import SCons.Util +PDFAction = SCons.Action.Action('$DVIPDFCOM', '$DVIPDFCOMSTR') + def generate(env): """Add Builders and construction variables for dvipdf to an Environment.""" try: @@ -43,7 +46,7 @@ def generate(env): except KeyError: bld = SCons.Defaults.PDF() env['BUILDERS']['PDF'] = bld - bld.add_action('.dvi', '$PDFCOM') + bld.add_action('.dvi', PDFAction) env['DVIPDF'] = 'dvipdf' env['DVIPDFFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/dvips.py b/src/engine/SCons/Tool/dvips.py index d70d78d..d2debf0 100644 --- a/src/engine/SCons/Tool/dvips.py +++ b/src/engine/SCons/Tool/dvips.py @@ -34,10 +34,13 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.Action +import SCons.Builder import SCons.Defaults import SCons.Util -PostScript = SCons.Builder.Builder(action = '$PSCOM', +PSAction = SCons.Action.Action('$PSCOM', '$PSCOMSTR') + +PostScript = SCons.Builder.Builder(action = PSAction, prefix = '$PSPREFIX', suffix = '$PSSUFFIX', src_suffix = '.dvi', diff --git a/src/engine/SCons/Tool/gs.py b/src/engine/SCons/Tool/gs.py index 2666189..7df110a 100644 --- a/src/engine/SCons/Tool/gs.py +++ b/src/engine/SCons/Tool/gs.py @@ -33,6 +33,7 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Action import SCons.Defaults import SCons.Platform import SCons.Util @@ -47,6 +48,8 @@ elif platform == 'win32': else: gs = 'gs' +GhostscriptAction = SCons.Action.Action('$GSCOM', '$GSCOMSTR') + def generate(env): """Add Builders and construction variables for Ghostscript to an Environment.""" @@ -56,7 +59,7 @@ def generate(env): bld = SCons.Defaults.PDF() env['BUILDERS']['PDF'] = bld - bld.add_action('.ps', '$GSCOM') + bld.add_action('.ps', GhostscriptAction) env['GS'] = gs env['GSFLAGS'] = SCons.Util.CLVar('-dNOPAUSE -dBATCH -sDEVICE=pdfwrite') diff --git a/src/engine/SCons/Tool/m4.py b/src/engine/SCons/Tool/m4.py index 3fd2d66..06757bf 100644 --- a/src/engine/SCons/Tool/m4.py +++ b/src/engine/SCons/Tool/m4.py @@ -33,12 +33,14 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Action import SCons.Builder import SCons.Util def generate(env): """Add Builders and construction variables for m4 to an Environment.""" - bld = SCons.Builder.Builder(action = '$M4COM', src_suffix = '.m4') + M4Action = SCons.Action.Action('$M4COM', '$M4COMSTR') + bld = SCons.Builder.Builder(action = M4Action, src_suffix = '.m4') env['BUILDERS']['M4'] = bld diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index 66e6011..449e3aa 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -33,10 +33,13 @@ selection method. __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +import SCons.Action import SCons.Defaults import SCons.Tool import SCons.Util +SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR') + def swigSuffixEmitter(env, source): if '-c++' in SCons.Util.CLVar(env.subst("$SWIGFLAGS")): return '$SWIGCXXFILESUFFIX' @@ -50,8 +53,8 @@ def generate(env): c_file.suffix['.i'] = swigSuffixEmitter cxx_file.suffix['.i'] = swigSuffixEmitter - c_file.add_action('.i', '$SWIGCOM') - cxx_file.add_action('.i', '$SWIGCOM') + c_file.add_action('.i', SwigAction) + cxx_file.add_action('.i', SwigAction) env['SWIG'] = 'swig' env['SWIGFLAGS'] = SCons.Util.CLVar('') |