@@ -650,7 +650,7 @@ def get_version_helper(cc, regexp):
650
650
if match:
651
651
return match.group(2)
652
652
else:
653
- return 0
653
+ return ' 0 '
654
654
655
655
def get_nasm_version(asm):
656
656
try:
@@ -661,15 +661,15 @@ def get_nasm_version(asm):
661
661
warn(' ' ' No acceptable ASM compiler found!
662
662
Please make sure you have installed NASM from http://www.nasm.us
663
663
and refer BUILDING.md.' ' ' )
664
- return 0
664
+ return ' 0 '
665
665
666
666
match = re.match(r" NASM version ([2-9]\.[0-9][0-9]+)" ,
667
667
proc.communicate ()[0])
668
668
669
669
if match:
670
670
return match.group(1)
671
671
else:
672
- return 0
672
+ return ' 0 '
673
673
674
674
def get_llvm_version(cc):
675
675
return get_version_helper(
@@ -699,7 +699,7 @@ def get_gas_version(cc):
699
699
if match:
700
700
return match.group(1)
701
701
else:
702
- return 0
702
+ return ' 0 '
703
703
704
704
# Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes
705
705
# the version check more by accident than anything else but a more rigorous
@@ -1084,6 +1084,19 @@ def configure_openssl(o):
1084
1084
variables[' node_use_openssl' ] = b(not options.without_ssl)
1085
1085
variables[' node_shared_openssl' ] = b(options.shared_openssl)
1086
1086
variables[' openssl_no_asm' ] = 1 if options.openssl_no_asm else 0
1087
+ variables[' openssl_fips' ] = ' '
1088
+
1089
+ if options.without_ssl:
1090
+ def without_ssl_error(option):
1091
+ error(' --without-ssl is incompatible with %s' % option)
1092
+ if options.shared_openssl:
1093
+ without_ssl_error(' --shared-openssl' )
1094
+ if options.openssl_no_asm:
1095
+ without_ssl_error(' --openssl-no-asm' )
1096
+ if options.openssl_fips:
1097
+ without_ssl_error(' --openssl-fips' )
1098
+ return
1099
+
1087
1100
if options.use_openssl_ca_store:
1088
1101
o[' defines' ] += [' NODE_OPENSSL_CERT_STORE' ]
1089
1102
if options.openssl_system_ca_path:
@@ -1092,35 +1105,31 @@ def configure_openssl(o):
1092
1105
if options.without_node_options:
1093
1106
o[' defines' ] += [' NODE_WITHOUT_NODE_OPTIONS' ]
1094
1107
1095
- # supported asm compiler for AVX2. See https://github.com/openssl/openssl/
1096
- # blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
1097
- openssl110_asm_supported = \
1098
- (' gas_version' in variables and variables[' gas_version' ] > = ' 2.23' ) or \
1099
- (' xcode_version' in variables and variables[' xcode_version' ] > = ' 5.0' ) or \
1100
- (' llvm_version' in variables and variables[' llvm_version' ] > = ' 3.3' ) or \
1101
- (' nasm_version' in variables and variables[' nasm_version' ] > = ' 2.10' )
1108
+ if not options.shared_openssl and not options.openssl_no_asm:
1109
+ # supported asm compiler for AVX2. See https://github.com/openssl/openssl/
1110
+ # blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
1111
+ openssl110_asm_supported = \
1112
+ (' gas_version' in variables and float(variables[' gas_version' ]) > = 2.23) or \
1113
+ (' xcode_version' in variables and float(variables[' xcode_version' ]) > = 5.0) or \
1114
+ (' llvm_version' in variables and float(variables[' llvm_version' ]) > = 3.3) or \
1115
+ (' nasm_version' in variables and float(variables[' nasm_version' ]) > = 2.10)
1102
1116
1103
- if not options.without_ssl and not openssl110_asm_supported and \
1104
- variables[' openssl_no_asm' ] == 0:
1105
- warn(' ' ' openssl_no_asm is enabled due to missed or old assembler.
1106
- Please refer BUILDING.md' ' ' )
1107
- variables[' openssl_no_asm' ] = 1
1117
+ if not openssl110_asm_supported:
1118
+ error(' ' ' Did not find a new enough assembler, install one or build with
1119
+ --openssl-no-asm.
1120
+ Please refer to BUILDING.md' ' ' )
1121
+
1122
+ elif options.openssl_no_asm:
1123
+ warn(' ' ' --openssl-no-asm will result in binaries that do not take advantage
1124
+ of modern CPU cryptographic instructions and will therefore be slower.
1125
+ Please refer to BUILDING.md' ' ' )
1126
+
1127
+ if options.openssl_no_asm and options.shared_openssl:
1128
+ error(' --openssl-no-asm is incompatible with --shared-openssl' )
1108
1129
1109
1130
if options.openssl_fips:
1110
- error(' FIPS is not supported in this version' )
1111
- variables[' openssl_fips' ] = ' '
1131
+ error(' FIPS is not supported in this version of Node.js' )
1112
1132
1113
- if options.without_ssl:
1114
- def without_ssl_error(option):
1115
- print(' Error: --without-ssl is incompatible with %s' % option)
1116
- exit(1)
1117
- if options.shared_openssl:
1118
- without_ssl_error(' --shared-openssl' )
1119
- if options.openssl_no_asm:
1120
- without_ssl_error(' --openssl-no-asm' )
1121
- if options.openssl_fips:
1122
- without_ssl_error(' --openssl-fips' )
1123
- return
1124
1133
configure_library(' openssl' , o)
1125
1134
1126
1135
0 commit comments