mirror of https://gitlab.com/ita1024/waf.git
Issue 1339 detect the sun compiler version number
This commit is contained in:
parent
d4d33bba2a
commit
f588f95a27
|
@ -1136,6 +1136,27 @@ def get_xlc_version(conf, cc):
|
||||||
else:
|
else:
|
||||||
conf.fatal('Could not determine the XLC version.')
|
conf.fatal('Could not determine the XLC version.')
|
||||||
|
|
||||||
|
@conf
|
||||||
|
def get_suncc_version(conf, cc):
|
||||||
|
"""Get the compiler version"""
|
||||||
|
|
||||||
|
cmd = cc + ['-V']
|
||||||
|
try:
|
||||||
|
out, err = conf.cmd_and_log(cmd, output=0)
|
||||||
|
except Errors.WafError:
|
||||||
|
conf.fatal('Could not find suncc %r' % cmd)
|
||||||
|
|
||||||
|
version = (out or err)
|
||||||
|
version = version.split('\n')[0]
|
||||||
|
|
||||||
|
version_re = re.compile(r'cc:\s+sun\s+(c\+\+|c)\s+(?P<major>\d*)\.(?P<minor>\d*)', re.I).search
|
||||||
|
match = version_re(version)
|
||||||
|
if match:
|
||||||
|
k = match.groupdict()
|
||||||
|
conf.env['CC_VERSION'] = (k['major'], k['minor'])
|
||||||
|
else:
|
||||||
|
conf.fatal('Could not determine the suncc version.')
|
||||||
|
|
||||||
# ============ the --as-needed flag should added during the configuration, not at runtime =========
|
# ============ the --as-needed flag should added during the configuration, not at runtime =========
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
|
|
|
@ -28,6 +28,8 @@ def find_scc(conf):
|
||||||
|
|
||||||
v['CC'] = cc
|
v['CC'] = cc
|
||||||
v['CC_NAME'] = 'sun'
|
v['CC_NAME'] = 'sun'
|
||||||
|
conf.get_suncc_version(cc)
|
||||||
|
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def scc_common_flags(conf):
|
def scc_common_flags(conf):
|
||||||
|
|
|
@ -29,6 +29,8 @@ def find_sxx(conf):
|
||||||
|
|
||||||
v['CXX'] = cc
|
v['CXX'] = cc
|
||||||
v['CXX_NAME'] = 'sun'
|
v['CXX_NAME'] = 'sun'
|
||||||
|
conf.get_suncc_version(cc)
|
||||||
|
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def sxx_common_flags(conf):
|
def sxx_common_flags(conf):
|
||||||
|
|
Loading…
Reference in New Issue