summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-10-09 10:36:52 +0200
committerMichaël Zasso <targos@protonmail.com>2019-10-13 20:28:17 +0200
commit6c205aba00d8a3ebad95eec60b0fcee46484cf4a (patch)
tree7327978c5d1c1b22efdf11a2ec23c184e62e21d4
parent66b953207d6f0e9c98155af97147a731b2e461bd (diff)
downloadandroid-node-v8-6c205aba00d8a3ebad95eec60b0fcee46484cf4a.tar.gz
android-node-v8-6c205aba00d8a3ebad95eec60b0fcee46484cf4a.tar.bz2
android-node-v8-6c205aba00d8a3ebad95eec60b0fcee46484cf4a.zip
build: always use strings for compiler version in gyp files
If GYP finds a string variable that can be converted to an integer, it will do it when the variable is expanded. Use "0.0" instead of "0" to force strings and be able to use comparison operations such as `gas_version >= "2.26"` in Python 3. PR-URL: https://github.com/nodejs/node/pull/29897 Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
-rwxr-xr-xconfigure.py12
-rw-r--r--deps/openssl/openssl.gyp6
-rw-r--r--deps/openssl/openssl_common.gypi2
-rw-r--r--node.gyp2
4 files changed, 11 insertions, 11 deletions
diff --git a/configure.py b/configure.py
index 0b6f67f68c..dd93d56e55 100755
--- a/configure.py
+++ b/configure.py
@@ -703,7 +703,7 @@ def get_version_helper(cc, regexp):
if match:
return match.group(2)
else:
- return '0'
+ return '0.0'
def get_nasm_version(asm):
try:
@@ -714,7 +714,7 @@ def get_nasm_version(asm):
warn('''No acceptable ASM compiler found!
Please make sure you have installed NASM from https://www.nasm.us
and refer BUILDING.md.''')
- return '0'
+ return '0.0'
match = re.match(r"NASM version ([2-9]\.[0-9][0-9]+)",
to_utf8(proc.communicate()[0]))
@@ -722,7 +722,7 @@ def get_nasm_version(asm):
if match:
return match.group(1)
else:
- return '0'
+ return '0.0'
def get_llvm_version(cc):
return get_version_helper(
@@ -755,7 +755,7 @@ def get_gas_version(cc):
return match.group(1)
else:
warn('Could not recognize `gas`: ' + gas_ret)
- return '0'
+ return '0.0'
# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
# the version check more by accident than anything else but a more rigorous
@@ -766,7 +766,7 @@ def check_compiler(o):
if not options.openssl_no_asm and options.dest_cpu in ('x86', 'x64'):
nasm_version = get_nasm_version('nasm')
o['variables']['nasm_version'] = nasm_version
- if nasm_version == 0:
+ if nasm_version == '0.0':
o['variables']['openssl_no_asm'] = 1
return
@@ -785,7 +785,7 @@ def check_compiler(o):
# to a version that is not completely ancient.
warn('C compiler too old, need gcc 4.2 or clang 3.2 (CC=%s)' % CC)
- o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else 0
+ o['variables']['llvm_version'] = get_llvm_version(CC) if is_clang else '0.0'
# Need xcode_version or gas_version when openssl asm files are compiled.
if options.without_ssl or options.openssl_no_asm or options.shared_openssl:
diff --git a/deps/openssl/openssl.gyp b/deps/openssl/openssl.gyp
index 60f6ee03a7..0ca7515611 100644
--- a/deps/openssl/openssl.gyp
+++ b/deps/openssl/openssl.gyp
@@ -1,8 +1,8 @@
{
'variables': {
- 'gas_version%': 0,
- 'llvm_version%': 0,
- 'nasm_version%': 0,
+ 'gas_version%': '0.0',
+ 'llvm_version%': '0.0',
+ 'nasm_version%': '0.0',
},
'targets': [
{
diff --git a/deps/openssl/openssl_common.gypi b/deps/openssl/openssl_common.gypi
index c4b95c20ae..67640a6325 100644
--- a/deps/openssl/openssl_common.gypi
+++ b/deps/openssl/openssl_common.gypi
@@ -64,7 +64,7 @@
'TERMIOS',
],
'conditions': [
- [ 'llvm_version==0', {
+ [ 'llvm_version=="0.0"', {
'cflags': ['-Wno-old-style-declaration',],
}],
],
diff --git a/node.gyp b/node.gyp
index ced6fbc954..79969a4c83 100644
--- a/node.gyp
+++ b/node.gyp
@@ -290,7 +290,7 @@
'-Wl,-bnoerrmsg',
],
}],
- ['(OS=="linux" or OS=="mac") and llvm_version!=0', {
+ ['OS in ("linux", "mac") and llvm_version != "0.0"', {
'libraries': ['-latomic'],
}],
],