From 232ea1169c24b803d0c90e3cdb277e356b2eb087 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 7 Mar 2002 23:18:02 +0000 Subject: Fix RANLIB tests for systems that don't have ranlib. (Charles Crain.) --- test/RANLIB.py | 10 ++++++++++ test/RANLIBFLAGS.py | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/test/RANLIB.py b/test/RANLIB.py index 2e151cd..d255b7a 100644 --- a/test/RANLIB.py +++ b/test/RANLIB.py @@ -25,6 +25,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import os.path import string import sys import TestSCons @@ -36,8 +37,17 @@ if sys.platform == 'win32': else: _exe = '' +ranlib = None +for dir in string.split(os.environ['PATH'], os.pathsep): + r = os.path.join(dir, 'ranlib' + _exe) + if os.path.exists(r): + ranlib = r + break + test = TestSCons.TestSCons() +test.no_result(not ranlib) + test.write("wrapper.py", """import os import string diff --git a/test/RANLIBFLAGS.py b/test/RANLIBFLAGS.py index 1855af2..5549e94 100644 --- a/test/RANLIBFLAGS.py +++ b/test/RANLIBFLAGS.py @@ -36,8 +36,17 @@ if sys.platform == 'win32': else: _exe = '' +ranlib = None +for dir in string.split(os.environ['PATH'], os.pathsep): + r = os.path.join(dir, 'ranlib' + _exe) + if os.path.exists(r): + ranlib = r + break + test = TestSCons.TestSCons() +test.no_result(not ranlib) + test.write("wrapper.py", """import os import string -- cgit v0.12