diff options
author | Steven Knight <knight@baldmt.com> | 2002-09-05 00:04:32 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2002-09-05 00:04:32 (GMT) |
commit | 246819663b8eaeb130580f4b97990248f26eaadd (patch) | |
tree | f9ca305b654b4d35be2ba9a59bc85f341b916ac4 /src/engine/SCons/Util.py | |
parent | 08ecd797ee635637097196960ea6a90e8dd29d62 (diff) | |
download | SCons-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.py | 14 |
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 |