Skip to content

Commit

Permalink
build: log detected compilers in --verbose mode
Browse files Browse the repository at this point in the history
Log the versions of the detected compilers when the configure script
is run with `--verbose` to help verify which compiler is being used if
multiple toolchains are installed on the system.

Signed-off-by: Richard Lau <riclau@uk.ibm.com>

PR-URL: #32715
Backport-PR-URL: #32820
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
richardlau committed Jul 1, 2020
1 parent 5436569 commit 9915774
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,9 @@ def check_compiler(o):
return

ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
print_verbose('Detected %sC++ compiler (CXX=%s) version: %s' %
('clang ' if is_clang else '', CXX, version_str))
if not ok:
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
elif sys.platform.startswith('aix') and gcc_version < (6, 3, 0):
Expand All @@ -758,6 +761,9 @@ def check_compiler(o):
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX)

ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
print_verbose('Detected %sC compiler (CC=%s) version: %s' %
('clang ' if is_clang else '', CC, version_str))
if not ok:
warn('failed to autodetect C compiler version (CC=%s)' % CC)
elif not is_clang and gcc_version < (4, 2, 0):
Expand Down

0 comments on commit 9915774

Please sign in to comment.