diff options
author | Jack Lloyd <[email protected]> | 2017-12-31 10:25:50 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-31 10:25:50 -0500 |
commit | 042bad2f7a7f9e12b4ba6c91f8458875537b5a47 (patch) | |
tree | 25653ff3c4b40e10449d508eb6796214a33b9aa1 | |
parent | 46e930509929e47e69b328e8cb4e7ea46ed3307b (diff) |
Add version detection for XLC [ci skip]
We don't need it right now but may later and it avoids a scary
warning when configuring the build.
-rwxr-xr-x | configure.py | 8 | ||||
-rw-r--r-- | src/build-data/detect_version.cpp | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/configure.py b/configure.py index 2c4f7b5de..463102ee4 100755 --- a/configure.py +++ b/configure.py @@ -2815,6 +2815,7 @@ def calculate_cc_min_version(options, ccinfo, source_paths): 'msvc': r'^ *MSVC ([0-9]{2})([0-9]{2})$', 'gcc': r'^ *GCC ([0-9]+) ([0-9]+)$', 'clang': r'^ *CLANG ([0-9]+) ([0-9]+)$', + 'xlc': r'^ *XLC (0x[0-9a-fA-F]{2})([0-9a-fA-F]{2})$' } if ccinfo.basename not in version_patterns: @@ -2839,13 +2840,16 @@ def calculate_cc_min_version(options, ccinfo, source_paths): logging.warning('Could not execute %s for version check: %s' % (cmd, e)) return "0.0" + def cleanup_output(output): + return ('\n'.join([l for l in output.splitlines() if l.startswith('#') is False])).strip() + match = re.search(version_patterns[ccinfo.basename], cc_output, flags=re.MULTILINE) if match is None: logging.warning("Tried to get %s version, but output '%s' does not match expected version format" % ( - ccinfo.basename, cc_output)) + ccinfo.basename, cleanup_output(cc_output))) return "0.0" - cc_version = "%d.%d" % (int(match.group(1)), int(match.group(2))) + cc_version = "%d.%d" % (int(match.group(1), 0), int(match.group(2), 0)) logging.info('Auto-detected compiler version %s' % (cc_version)) return cc_version diff --git a/src/build-data/detect_version.cpp b/src/build-data/detect_version.cpp index 42c4a2605..12a5a707e 100644 --- a/src/build-data/detect_version.cpp +++ b/src/build-data/detect_version.cpp @@ -16,6 +16,10 @@ */ MSVC _MSC_VER +#elif defined(__xlC__) + + XLC __xlC__ + #elif defined(__clang__) && defined(__apple_build_version__) /* |