summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/__init__.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index a58ac6d..34e9e0d 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -55,9 +55,23 @@ class ToolSpec:
def __str__(self):
return self.name
-def Tool(name):
- """Select a canned Tool specification.
- """
+def Tool(name, toolpath=[]):
+ "Select a canned Tool specification, optionally searching in toolpath."
+
+ try:
+ file, path, desc = imp.find_module(name, toolpath)
+ try:
+ module = imp.load_module(name, file, path, desc)
+ spec = ToolSpec(name)
+ spec.generate = module.generate
+ spec.exists = module.exists
+ return spec
+ finally:
+ if file:
+ file.close()
+ except ImportError, e:
+ pass
+
full_name = 'SCons.Tool.' + name
if not sys.modules.has_key(full_name):
try: