@@ -39,7 +39,7 @@ parser.add_option('--dest-cpu',
39
39
action = 'store' ,
40
40
dest = 'dest_cpu' ,
41
41
help = 'CPU architecture to build for. '
42
- 'Valid values are: arm, arm64, ia32, x32, x64' )
42
+ 'Valid values are: arm, arm64, ia32, mips, mipsel, x32, x64' )
43
43
44
44
parser .add_option ('--dest-os' ,
45
45
action = 'store' ,
@@ -209,6 +209,24 @@ parser.add_option('--with-arm-float-abi',
209
209
help = 'specifies which floating-point ABI to use. Valid values are: '
210
210
'soft, softfp, hard' )
211
211
212
+ parser .add_option ('--with-mips-arch-variant' ,
213
+ action = 'store' ,
214
+ dest = 'mips_arch_variant' ,
215
+ default = 'r2' ,
216
+ help = 'MIPS arch variant: loongson, r1, r2, r6, rx' )
217
+
218
+ parser .add_option ('--with-mips-fpu-mode' ,
219
+ action = 'store' ,
220
+ dest = 'mips_fpu_mode' ,
221
+ default = 'fp32' ,
222
+ help = 'MIPS FPU mode: fp32, fp64, fpxx' )
223
+
224
+ parser .add_option ('--with-mips-float-abi' ,
225
+ action = 'store' ,
226
+ dest = 'mips_float_abi' ,
227
+ default = 'hard' ,
228
+ help = 'MIPS floating-point ABI: soft, hard' )
229
+
212
230
parser .add_option ('--with-dtrace' ,
213
231
action = 'store_true' ,
214
232
dest = 'with_dtrace' ,
@@ -493,6 +511,14 @@ def configure_arm(o):
493
511
warn ('when building on ARMv6, don\' t use --with-snapshot' )
494
512
495
513
514
+ def configure_mips (o ):
515
+ can_use_fpu_instructions = (options .mips_float_abi != 'soft' )
516
+ o ['variables' ]['v8_can_use_fpu_instructions' ] = b (can_use_fpu_instructions )
517
+ o ['variables' ]['v8_use_mips_abi_hardfloat' ] = b (can_use_fpu_instructions )
518
+ o ['variables' ]['mips_arch_variant' ] = options .mips_arch_variant
519
+ o ['variables' ]['mips_fpu_mode' ] = options .mips_fpu_mode
520
+
521
+
496
522
def configure_node (o ):
497
523
if options .dest_os == 'android' :
498
524
o ['variables' ]['OS' ] = 'android'
@@ -519,6 +545,8 @@ def configure_node(o):
519
545
# deps/openssl/asm/arm-elf-gas/modes/ghash-armv4.S, which is 32 bits only.
520
546
warn ('not building openssl, arm64 not yet supported' )
521
547
options .without_ssl = True
548
+ elif target_arch in ('mips' , 'mipsel' ):
549
+ configure_mips (o )
522
550
523
551
if flavor in ('solaris' , 'mac' , 'linux' , 'freebsd' ):
524
552
use_dtrace = not options .without_dtrace
0 commit comments