Fix RANLIB tests for systems that don't have ranlib. (Charles Crain.)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 7 Mar 2002 23:18:02 +0000 (23:18 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 7 Mar 2002 23:18:02 +0000 (23:18 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@286 fdb21ef1-2011-0410-befe-b5e4ea1792b1

test/RANLIB.py
test/RANLIBFLAGS.py

index 2e151cd0829cc062ba5ded7da2fccda1653c5e1a..d255b7ab1ea6d48d5f4fe23739ce5ce8c566354e 100644 (file)
@@ -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
index 1855af221591af64f476db23e1c302ec4f53d3d0..5549e941f6197a0d90f7fb75427a4dbb392cd63d 100644 (file)
@@ -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