summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Util.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-09-05 00:04:32 (GMT)
committerSteven Knight <knight@baldmt.com>2002-09-05 00:04:32 (GMT)
commit246819663b8eaeb130580f4b97990248f26eaadd (patch)
treef9ca305b654b4d35be2ba9a59bc85f341b916ac4 /src/engine/SCons/Util.py
parent08ecd797ee635637097196960ea6a90e8dd29d62 (diff)
downloadSCons-246819663b8eaeb130580f4b97990248f26eaadd.zip
SCons-246819663b8eaeb130580f4b97990248f26eaadd.tar.gz
SCons-246819663b8eaeb130580f4b97990248f26eaadd.tar.bz2
Fix the tests that broke from the tool auto-detect stuff. (Anthony Roach and SK)
Diffstat (limited to 'src/engine/SCons/Util.py')
-rw-r--r--src/engine/SCons/Util.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py
index 63c992e..bcf0e14 100644
--- a/src/engine/SCons/Util.py
+++ b/src/engine/SCons/Util.py
@@ -489,3 +489,17 @@ else:
if stat.S_IMODE(st[stat.ST_MODE]) & 0111:
return f
return None
+
+def Detect(progs, env=None):
+ "Return the first available program in progs"
+ path = None
+ pathext = None
+ if env and env.has_key('ENV'):
+ if env['ENV'].has_key('PATH'):
+ path = env['ENV']['PATH']
+ if env['ENV'].has_key('PATHEXT'):
+ pathext = env['ENV']['PATHEXT']
+ for prog in progs:
+ path = WhereIs(prog, path, pathext)
+ if path: return prog
+ return None