Issue 1372 version detection for old and buggy sun compilers

This commit is contained in:
Thomas Nagy 2013-11-08 22:45:11 +01:00
parent 067ade9a40
commit dcd6184d3f
1 changed files with 5 additions and 1 deletions

View File

@ -1153,7 +1153,11 @@ def get_suncc_version(conf, cc):
try:
out, err = conf.cmd_and_log(cmd, output=0)
except Errors.WafError:
conf.fatal('Could not find suncc %r' % cmd)
# Older versions of the compiler exit with non-zero status when reporting their version
if not (hasattr(e, 'returncode') and hasattr(e, 'stdout') and hasattr(e, 'stderr')):
conf.fatal('Could not find suncc %r' % cmd)
out = e.stdout
err = e.stderr
version = (out or err)
version = version.split('\n')[0]