aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-03-03 13:13:31 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-03-03 13:13:31 +0200
commit5d2f6b2a6e0d94145f48521fb07993281b13936d (patch)
tree93ed0190993321de0852cb39a763df9d4d52e590
parent3f3496f08aea4cf77f3950908024925080a77b21 (diff)
downloadmeson-5d2f6b2a6e0d94145f48521fb07993281b13936d.zip
meson-5d2f6b2a6e0d94145f48521fb07993281b13936d.tar.gz
meson-5d2f6b2a6e0d94145f48521fb07993281b13936d.tar.bz2
Fix tool detection in OSX.
-rwxr-xr-xenvironment.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/environment.py b/environment.py
index 8efdaa2..6169475 100755
--- a/environment.py
+++ b/environment.py
@@ -319,15 +319,21 @@ class Environment():
def detect_static_linker(self):
exelist = self.get_static_linker_exelist()
- p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE)
- out = p.communicate()[0]
+ p = subprocess.Popen(exelist + ['--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (out, err) = p.communicate()
out = out.decode()
+ err = err.decode()
if p.returncode == 0:
return ArLinker(exelist)
+ if p.returncode == 1 and err.startswith('usage'): # OSX
+ return ArLinker(exelist)
raise EnvironmentException('Unknown static linker "' + ' '.join(exelist) + '"')
def detect_ccache(self):
- has_ccache = subprocess.call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ try:
+ has_ccache = subprocess.call(['ccache', '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ except FileNotFoundError:
+ has_ccache = 1
if has_ccache == 0:
cmdlist = ['ccache']
else: