From ec7c65139415ccfa024615aae4d26409bc7c874c Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 8 Nov 2013 22:45:11 +0100 Subject: [PATCH] Issue 1372 version detection for old and buggy sun compilers --- waflib/Tools/c_config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/waflib/Tools/c_config.py b/waflib/Tools/c_config.py index ae4f534d..ccb65c43 100755 --- a/waflib/Tools/c_config.py +++ b/waflib/Tools/c_config.py @@ -1148,7 +1148,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]