Skip to content

Commit 1bbfe9a

Browse files
mistydemeoevanlucas
authored andcommitted
build: fix configure script for double-digits
Compare versions using tuples instead of strings so that it is future-proofed against versions that contain a number that is more than one digit. PR-URL: #21183 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 1e49ead commit 1bbfe9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

configure

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

613613
values = (proc.communicate()[0].split() + ['0'] * 7)[0:7]
614614
is_clang = values[0] == '1'
615-
gcc_version = '%s.%s.%s' % tuple(values[1:1+3])
616-
clang_version = '%s.%s.%s' % tuple(values[4:4+3])
615+
gcc_version = tuple(values[1:1+3])
616+
clang_version = tuple(values[4:4+3])
617617

618618
return (True, is_clang, clang_version, gcc_version)
619619

@@ -707,13 +707,13 @@ def check_compiler(o):
707707
ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++')
708708
if not ok:
709709
warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX)
710-
elif clang_version < '3.4.2' if is_clang else gcc_version < '4.9.4':
710+
elif clang_version < (3, 4, 2) if is_clang else gcc_version < (4, 9, 4):
711711
warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX)
712712

713713
ok, is_clang, clang_version, gcc_version = try_check_compiler(CC, 'c')
714714
if not ok:
715715
warn('failed to autodetect C compiler version (CC=%s)' % CC)
716-
elif not is_clang and gcc_version < '4.2.0':
716+
elif not is_clang and gcc_version < (4, 2, 0):
717717
# clang 3.2 is a little white lie because any clang version will probably
718718
# do for the C bits. However, we might as well encourage people to upgrade
719719
# to a version that is not completely ancient.

0 commit comments

Comments
 (0)