diff options
author | Richard Lau <riclau@uk.ibm.com> | 2018-12-06 14:35:02 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-12-08 15:23:30 -0800 |
commit | c3dd0d001abdb983d19987c76cad7ef30ef82a25 (patch) | |
tree | 030bf51f45b85b57ef85903f0f8af45727d6017f /configure.py | |
parent | 61a89630ee5664b1f909b310a016b522a6285521 (diff) | |
download | android-node-v8-c3dd0d001abdb983d19987c76cad7ef30ef82a25.tar.gz android-node-v8-c3dd0d001abdb983d19987c76cad7ef30ef82a25.tar.bz2 android-node-v8-c3dd0d001abdb983d19987c76cad7ef30ef82a25.zip |
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: https://github.com/nodejs/node/pull/24879
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/configure.py b/configure.py index 1bef01baef..ca87082424 100755 --- a/configure.py +++ b/configure.py @@ -655,8 +655,8 @@ def try_check_compiler(cc, lang): values = (proc.communicate()[0].split() + ['0'] * 7)[0:7] is_clang = values[0] == '1' - gcc_version = tuple(values[1:1+3]) - clang_version = tuple(values[4:4+3]) + gcc_version = tuple(map(int, values[1:1+3])) + clang_version = tuple(map(int, values[4:4+3])) if is_clang else None return (True, is_clang, clang_version, gcc_version) @@ -753,6 +753,8 @@ def check_compiler(o): ok, is_clang, clang_version, gcc_version = try_check_compiler(CXX, 'c++') if not ok: warn('failed to autodetect C++ compiler version (CXX=%s)' % CXX) + elif sys.platform.startswith('aix') and gcc_version < (6, 3, 0): + warn('C++ compiler too old, need g++ 6.3.0 (CXX=%s)' % CXX) elif clang_version < (3, 4, 2) if is_clang else gcc_version < (4, 9, 4): warn('C++ compiler too old, need g++ 4.9.4 or clang++ 3.4.2 (CXX=%s)' % CXX) @@ -921,8 +923,7 @@ def gcc_version_ge(version_checked): for compiler in [(CC, 'c'), (CXX, 'c++')]: ok, is_clang, clang_version, compiler_version = \ try_check_compiler(compiler[0], compiler[1]) - compiler_version_num = tuple(map(int, compiler_version)) - if is_clang or compiler_version_num < version_checked: + if is_clang or compiler_version < version_checked: return False return True |