Skip to content

Commit ae772b7

Browse files
richardlautargos
authored andcommittedApr 22, 2020
build: log detected compilers in --verbose mode
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 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>
1 parent c78019d commit ae772b7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎configure.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -815,21 +815,27 @@ def check_compiler(o):
815815
return
816816

817817
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
818+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
819+
print_verbose('Detected %sC++ compiler (CXX=%s) version: %s' %
820+
('clang ' if is_clang else '', CXX, version_str))
818821
if not ok:
819822
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
820823
elif clang_version < (8, 0, 0) if is_clang else gcc_version < (6, 3, 0):
821824
warn('C++ compiler (CXX=%s, %s) too old, need g++ 6.3.0 or clang++ 8.0.0' %
822-
(CXX, ".".join(map(str, clang_version if is_clang else gcc_version))))
825+
(CXX, version_str))
823826

824827
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
828+
version_str = ".".join(map(str, clang_version if is_clang else gcc_version))
829+
print_verbose('Detected %sC compiler (CC=%s) version: %s' %
830+
('clang ' if is_clang else '', CC, version_str))
825831
if not ok:
826832
warn('failed to autodetect C compiler version (CC=%s)' % CC)
827833
elif not is_clang and gcc_version < (4, 2, 0):
828834
# clang 3.2 is a little white lie because any clang version will probably
829835
# do for the C bits. However, we might as well encourage people to upgrade
830836
# to a version that is not completely ancient.
831837
warn('C compiler (CC=%s, %s) too old, need gcc 4.2 or clang 3.2' %
832-
(CC, ".".join(map(str, gcc_version))))
838+
(CC, version_str))
833839

834840
o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0'
835841

0 commit comments

Comments
 (0)
Please sign in to comment.