@@ -39,7 +39,7 @@ parser.add_option('--dest-cpu',
3939 action = 'store' ,
4040 dest = 'dest_cpu' ,
4141 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' )
4343
4444parser .add_option ('--dest-os' ,
4545 action = 'store' ,
@@ -209,6 +209,24 @@ parser.add_option('--with-arm-float-abi',
209209 help = 'specifies which floating-point ABI to use. Valid values are: '
210210 'soft, softfp, hard' )
211211
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+
212230parser .add_option ('--with-dtrace' ,
213231 action = 'store_true' ,
214232 dest = 'with_dtrace' ,
@@ -493,6 +511,14 @@ def configure_arm(o):
493511 warn ('when building on ARMv6, don\' t use --with-snapshot' )
494512
495513
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+
496522def configure_node (o ):
497523 if options .dest_os == 'android' :
498524 o ['variables' ]['OS' ] = 'android'
@@ -519,6 +545,8 @@ def configure_node(o):
519545 # deps/openssl/asm/arm-elf-gas/modes/ghash-armv4.S, which is 32 bits only.
520546 warn ('not building openssl, arm64 not yet supported' )
521547 options .without_ssl = True
548+ elif target_arch in ('mips' , 'mipsel' ):
549+ configure_mips (o )
522550
523551 if flavor in ('solaris' , 'mac' , 'linux' , 'freebsd' ):
524552 use_dtrace = not options .without_dtrace
0 commit comments