Skip to content

Commit 8d4d396

Browse files
richardlauBethGriggs
authored andcommitted
build: fix compiler version detection
Compiler version tuples should be numeric for tuple comparisons to work. Also correct check for AIX where the minimum supported GCC is 6.3.0 PR-URL: #24879 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent a7f36dd commit 8d4d396

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎configure.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ def try_check_compiler(cc, lang):
654654

655655
values= (proc.communicate()[0].split() + ['0'] *7)[0:7]
656656
is_clang=values[0] =='1'
657-
gcc_version=tuple(values[1:1+3])
658-
clang_version=tuple(values[4:4+3])
657+
gcc_version=tuple(map(int, values[1:1+3]))
658+
clang_version=tuple(map(int, values[4:4+3])) ifis_clangelseNone
659659

660660
return (True, is_clang, clang_version, gcc_version)
661661

@@ -752,6 +752,8 @@ def check_compiler(o):
752752
ok, is_clang, clang_version, gcc_version=try_check_compiler(CXX, 'c++')
753753
ifnotok:
754754
warn('failed to autodetect C++ compiler version (CXX=%s)'%CXX)
755+
elifsys.platform.startswith('aix') andgcc_version< (6, 3, 0):
756+
warn('C++ compiler too old, need g++ 6.3.0 (CXX=%s)'%CXX)
755757
elifclang_version< (3, 4, 2) ifis_clangelsegcc_version< (4, 9, 4):
756758
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)'%CXX)
757759

@@ -920,8 +922,7 @@ def gcc_version_ge(version_checked):
920922
forcompilerin [(CC, 'c'), (CXX, 'c++')]:
921923
ok, is_clang, clang_version, compiler_version= \
922924
try_check_compiler(compiler[0], compiler[1])
923-
compiler_version_num=tuple(map(int, compiler_version))
924-
ifis_clangorcompiler_version_num<version_checked:
925+
ifis_clangorcompiler_version<version_checked:
925926
returnFalse
926927
returnTrue
927928

0 commit comments

Comments
 (0)