immunio 0.15.4 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +0 -27
- data/ext/immunio/Rakefile +9 -0
- data/lib/immunio/plugins/active_record.rb +1 -1
- data/lib/immunio/plugins/active_record_relation.rb +1 -1
- data/lib/immunio/plugins/environment_reporter.rb +20 -0
- data/lib/immunio/rufus_lua_ext/ref.rb +1 -3
- data/lib/immunio/version.rb +1 -1
- data/lib/immunio/vm.rb +1 -2
- data/lua-hooks/Makefile +97 -0
- data/lua-hooks/ext/all.c +41 -52
- data/lua-hooks/ext/all.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_html5.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_sqli.o +0 -0
- data/lua-hooks/ext/libinjection/libinjection_xss.o +0 -0
- data/lua-hooks/ext/libinjection/lualib.c +2 -2
- data/lua-hooks/ext/lpeg/lpcap.c +2 -2
- data/lua-hooks/ext/lpeg/lpcap.o +0 -0
- data/lua-hooks/ext/lpeg/lpcode.c +2 -2
- data/lua-hooks/ext/lpeg/lpcode.h +1 -1
- data/lua-hooks/ext/lpeg/lpcode.o +0 -0
- data/lua-hooks/ext/lpeg/lpprint.o +0 -0
- data/lua-hooks/ext/lpeg/lptree.c +2 -2
- data/lua-hooks/ext/lpeg/lptypes.h +1 -1
- data/lua-hooks/ext/lpeg/lpvm.c +2 -2
- data/lua-hooks/ext/lpeg/lpvm.o +0 -0
- data/lua-hooks/ext/lua-cmsgpack/lua_cmsgpack.c +16 -3
- data/lua-hooks/ext/lua-snapshot/snapshot.c +14 -7
- data/lua-hooks/ext/luajit/COPYRIGHT +56 -0
- data/lua-hooks/ext/luajit/Makefile +159 -0
- data/lua-hooks/ext/luajit/README +16 -0
- data/lua-hooks/ext/luajit/doc/bluequad-print.css +166 -0
- data/lua-hooks/ext/luajit/doc/bluequad.css +325 -0
- data/lua-hooks/ext/luajit/doc/changes.html +804 -0
- data/lua-hooks/ext/luajit/doc/contact.html +104 -0
- data/lua-hooks/ext/luajit/doc/ext_c_api.html +189 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi.html +332 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_api.html +570 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_semantics.html +1261 -0
- data/lua-hooks/ext/luajit/doc/ext_ffi_tutorial.html +603 -0
- data/lua-hooks/ext/luajit/doc/ext_jit.html +201 -0
- data/lua-hooks/ext/luajit/doc/ext_profiler.html +365 -0
- data/lua-hooks/ext/luajit/doc/extensions.html +448 -0
- data/lua-hooks/ext/luajit/doc/faq.html +186 -0
- data/lua-hooks/ext/luajit/doc/img/contact.png +0 -0
- data/lua-hooks/ext/luajit/doc/install.html +659 -0
- data/lua-hooks/ext/luajit/doc/luajit.html +236 -0
- data/lua-hooks/ext/luajit/doc/running.html +309 -0
- data/lua-hooks/ext/luajit/doc/status.html +118 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.h +456 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm.lua +1125 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.h +518 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_arm64.lua +1166 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.h +416 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_mips.lua +953 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.h +419 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_ppc.lua +1919 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_proto.h +83 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x64.lua +12 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.h +471 -0
- data/lua-hooks/ext/luajit/dynasm/dasm_x86.lua +1945 -0
- data/lua-hooks/ext/luajit/dynasm/dynasm.lua +1094 -0
- data/lua-hooks/ext/luajit/etc/luajit.1 +88 -0
- data/lua-hooks/ext/luajit/etc/luajit.pc +25 -0
- data/lua-hooks/ext/luajit/src/Makefile +697 -0
- data/lua-hooks/ext/luajit/src/Makefile.dep +244 -0
- data/lua-hooks/ext/luajit/src/host/README +4 -0
- data/lua-hooks/ext/luajit/src/host/buildvm +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.c +518 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.h +105 -0
- data/lua-hooks/ext/luajit/src/host/buildvm.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_arch.h +7449 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.c +345 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_asm.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.c +229 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_fold.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.c +457 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_lib.o +0 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_libbc.h +45 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.c +368 -0
- data/lua-hooks/ext/luajit/src/host/buildvm_peobj.o +0 -0
- data/lua-hooks/ext/luajit/src/host/genlibbc.lua +197 -0
- data/lua-hooks/ext/luajit/src/host/genminilua.lua +428 -0
- data/lua-hooks/ext/luajit/src/host/minilua +0 -0
- data/lua-hooks/ext/luajit/src/host/minilua.c +7770 -0
- data/lua-hooks/ext/luajit/src/host/minilua.o +0 -0
- data/lua-hooks/ext/luajit/src/jit/bc.lua +190 -0
- data/lua-hooks/ext/luajit/src/jit/bcsave.lua +661 -0
- data/lua-hooks/ext/luajit/src/jit/dis_arm.lua +689 -0
- data/lua-hooks/ext/luajit/src/jit/dis_mips.lua +428 -0
- data/lua-hooks/ext/luajit/src/jit/dis_mipsel.lua +17 -0
- data/lua-hooks/ext/luajit/src/jit/dis_ppc.lua +591 -0
- data/lua-hooks/ext/luajit/src/jit/dis_x64.lua +17 -0
- data/lua-hooks/ext/luajit/src/jit/dis_x86.lua +838 -0
- data/lua-hooks/ext/luajit/src/jit/dump.lua +706 -0
- data/lua-hooks/ext/luajit/src/jit/p.lua +310 -0
- data/lua-hooks/ext/luajit/src/jit/v.lua +170 -0
- data/lua-hooks/ext/luajit/src/jit/vmdef.lua +362 -0
- data/lua-hooks/ext/luajit/src/jit/zone.lua +45 -0
- data/lua-hooks/ext/{lua → luajit/src}/lauxlib.h +10 -17
- data/lua-hooks/ext/luajit/src/lib_aux.c +356 -0
- data/lua-hooks/ext/luajit/src/lib_aux.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_aux_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_base.c +664 -0
- data/lua-hooks/ext/luajit/src/lib_base.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_base_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_bit.c +180 -0
- data/lua-hooks/ext/luajit/src/lib_bit.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_bit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_debug.c +405 -0
- data/lua-hooks/ext/luajit/src/lib_debug.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_debug_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_ffi.c +872 -0
- data/lua-hooks/ext/luajit/src/lib_ffi.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_ffi_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_init.c +55 -0
- data/lua-hooks/ext/luajit/src/lib_init.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_init_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_io.c +541 -0
- data/lua-hooks/ext/luajit/src/lib_io.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_io_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_jit.c +767 -0
- data/lua-hooks/ext/luajit/src/lib_jit.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_jit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_math.c +230 -0
- data/lua-hooks/ext/luajit/src/lib_math.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_math_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_os.c +292 -0
- data/lua-hooks/ext/luajit/src/lib_os.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_os_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_package.c +610 -0
- data/lua-hooks/ext/luajit/src/lib_package.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_package_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_string.c +752 -0
- data/lua-hooks/ext/luajit/src/lib_string.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_string_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_table.c +307 -0
- data/lua-hooks/ext/luajit/src/lib_table.o +0 -0
- data/lua-hooks/ext/luajit/src/lib_table_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/libluajit.a +0 -0
- data/lua-hooks/ext/luajit/src/libluajit.so +0 -0
- data/lua-hooks/ext/luajit/src/lj.supp +26 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.c +1398 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.h +17 -0
- data/lua-hooks/ext/luajit/src/lj_alloc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_alloc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_api.c +1210 -0
- data/lua-hooks/ext/luajit/src/lj_api.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_api_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_arch.h +509 -0
- data/lua-hooks/ext/luajit/src/lj_asm.c +2278 -0
- data/lua-hooks/ext/luajit/src/lj_asm.h +17 -0
- data/lua-hooks/ext/luajit/src/lj_asm.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_asm_arm.h +2217 -0
- data/lua-hooks/ext/luajit/src/lj_asm_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_asm_mips.h +1833 -0
- data/lua-hooks/ext/luajit/src/lj_asm_ppc.h +2015 -0
- data/lua-hooks/ext/luajit/src/lj_asm_x86.h +2634 -0
- data/lua-hooks/ext/luajit/src/lj_bc.c +14 -0
- data/lua-hooks/ext/luajit/src/lj_bc.h +265 -0
- data/lua-hooks/ext/luajit/src/lj_bc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcdef.h +220 -0
- data/lua-hooks/ext/luajit/src/lj_bcdump.h +68 -0
- data/lua-hooks/ext/luajit/src/lj_bcread.c +457 -0
- data/lua-hooks/ext/luajit/src/lj_bcread.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcread_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite.c +361 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_bcwrite_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_buf.c +234 -0
- data/lua-hooks/ext/luajit/src/lj_buf.h +105 -0
- data/lua-hooks/ext/luajit/src/lj_buf.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_buf_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_carith.c +429 -0
- data/lua-hooks/ext/luajit/src/lj_carith.h +37 -0
- data/lua-hooks/ext/luajit/src/lj_carith.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_carith_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.c +984 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.h +178 -0
- data/lua-hooks/ext/luajit/src/lj_ccall.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccall_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.c +712 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.h +25 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ccallback_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.c +752 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.h +70 -0
- data/lua-hooks/ext/luajit/src/lj_cconv.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cconv_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.c +288 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.h +76 -0
- data/lua-hooks/ext/luajit/src/lj_cdata.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cdata_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_char.c +43 -0
- data/lua-hooks/ext/luajit/src/lj_char.h +42 -0
- data/lua-hooks/ext/luajit/src/lj_char.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_char_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_clib.c +418 -0
- data/lua-hooks/ext/luajit/src/lj_clib.h +29 -0
- data/lua-hooks/ext/luajit/src/lj_clib.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_clib_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.c +1862 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.h +65 -0
- data/lua-hooks/ext/luajit/src/lj_cparse.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_cparse_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.c +1834 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.h +38 -0
- data/lua-hooks/ext/luajit/src/lj_crecord.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_crecord_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.c +635 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.h +461 -0
- data/lua-hooks/ext/luajit/src/lj_ctype.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ctype_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_debug.c +699 -0
- data/lua-hooks/ext/luajit/src/lj_debug.h +65 -0
- data/lua-hooks/ext/luajit/src/lj_debug.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_debug_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_def.h +365 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.c +557 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.h +138 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_dispatch_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_emit_arm.h +356 -0
- data/lua-hooks/ext/luajit/src/lj_emit_mips.h +211 -0
- data/lua-hooks/ext/luajit/src/lj_emit_ppc.h +238 -0
- data/lua-hooks/ext/luajit/src/lj_emit_x86.h +462 -0
- data/lua-hooks/ext/luajit/src/lj_err.c +794 -0
- data/lua-hooks/ext/luajit/src/lj_err.h +41 -0
- data/lua-hooks/ext/luajit/src/lj_err.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_err_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_errmsg.h +190 -0
- data/lua-hooks/ext/luajit/src/lj_ff.h +18 -0
- data/lua-hooks/ext/luajit/src/lj_ffdef.h +209 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.c +1247 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.h +24 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ffrecord_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_folddef.h +1138 -0
- data/lua-hooks/ext/luajit/src/lj_frame.h +259 -0
- data/lua-hooks/ext/luajit/src/lj_func.c +185 -0
- data/lua-hooks/ext/luajit/src/lj_func.h +24 -0
- data/lua-hooks/ext/luajit/src/lj_func.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_func_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gc.c +845 -0
- data/lua-hooks/ext/luajit/src/lj_gc.h +134 -0
- data/lua-hooks/ext/luajit/src/lj_gc.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gc_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.c +787 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.h +22 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_gdbjit_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ir.c +505 -0
- data/lua-hooks/ext/luajit/src/lj_ir.h +577 -0
- data/lua-hooks/ext/luajit/src/lj_ir.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ir_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_ircall.h +321 -0
- data/lua-hooks/ext/luajit/src/lj_iropt.h +161 -0
- data/lua-hooks/ext/luajit/src/lj_jit.h +440 -0
- data/lua-hooks/ext/luajit/src/lj_lex.c +482 -0
- data/lua-hooks/ext/luajit/src/lj_lex.h +86 -0
- data/lua-hooks/ext/luajit/src/lj_lex.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lex_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lib.c +303 -0
- data/lua-hooks/ext/luajit/src/lj_lib.h +115 -0
- data/lua-hooks/ext/luajit/src/lj_lib.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_lib_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_libdef.h +414 -0
- data/lua-hooks/ext/luajit/src/lj_load.c +168 -0
- data/lua-hooks/ext/luajit/src/lj_load.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_load_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.c +386 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.h +30 -0
- data/lua-hooks/ext/luajit/src/lj_mcode.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_mcode_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_meta.c +477 -0
- data/lua-hooks/ext/luajit/src/lj_meta.h +38 -0
- data/lua-hooks/ext/luajit/src/lj_meta.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_meta_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_obj.c +50 -0
- data/lua-hooks/ext/luajit/src/lj_obj.h +976 -0
- data/lua-hooks/ext/luajit/src/lj_obj.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_obj_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce.c +78 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_dce_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold.c +2488 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_fold_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop.c +449 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_loop_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem.c +935 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_mem_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.c +652 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_narrow_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink.c +245 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_sink_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split.c +856 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_opt_split_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_parse.c +2725 -0
- data/lua-hooks/ext/luajit/src/lj_parse.h +18 -0
- data/lua-hooks/ext/luajit/src/lj_parse.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_parse_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_profile.c +368 -0
- data/lua-hooks/ext/luajit/src/lj_profile.h +21 -0
- data/lua-hooks/ext/luajit/src/lj_profile.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_profile_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_recdef.h +270 -0
- data/lua-hooks/ext/luajit/src/lj_record.c +2554 -0
- data/lua-hooks/ext/luajit/src/lj_record.h +45 -0
- data/lua-hooks/ext/luajit/src/lj_record.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_record_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_snap.c +870 -0
- data/lua-hooks/ext/luajit/src/lj_snap.h +34 -0
- data/lua-hooks/ext/luajit/src/lj_snap.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_snap_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_state.c +300 -0
- data/lua-hooks/ext/luajit/src/lj_state.h +35 -0
- data/lua-hooks/ext/luajit/src/lj_state.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_state_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_str.c +197 -0
- data/lua-hooks/ext/luajit/src/lj_str.h +27 -0
- data/lua-hooks/ext/luajit/src/lj_str.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_str_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.c +554 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.h +125 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strfmt_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.c +547 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.h +39 -0
- data/lua-hooks/ext/luajit/src/lj_strscan.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_strscan_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_tab.c +666 -0
- data/lua-hooks/ext/luajit/src/lj_tab.h +73 -0
- data/lua-hooks/ext/luajit/src/lj_tab.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_tab_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_target.h +164 -0
- data/lua-hooks/ext/luajit/src/lj_target_arm.h +270 -0
- data/lua-hooks/ext/luajit/src/lj_target_arm64.h +97 -0
- data/lua-hooks/ext/luajit/src/lj_target_mips.h +260 -0
- data/lua-hooks/ext/luajit/src/lj_target_ppc.h +280 -0
- data/lua-hooks/ext/luajit/src/lj_target_x86.h +345 -0
- data/lua-hooks/ext/luajit/src/lj_trace.c +859 -0
- data/lua-hooks/ext/luajit/src/lj_trace.h +54 -0
- data/lua-hooks/ext/luajit/src/lj_trace.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_trace_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_traceerr.h +63 -0
- data/lua-hooks/ext/luajit/src/lj_udata.c +34 -0
- data/lua-hooks/ext/luajit/src/lj_udata.h +14 -0
- data/lua-hooks/ext/luajit/src/lj_udata.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_udata_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vm.S +2730 -0
- data/lua-hooks/ext/luajit/src/lj_vm.h +114 -0
- data/lua-hooks/ext/luajit/src/lj_vm.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vm_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.c +58 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.h +59 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmevent_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath.c +152 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath.o +0 -0
- data/lua-hooks/ext/luajit/src/lj_vmmath_dyn.o +0 -0
- data/lua-hooks/ext/luajit/src/ljamalg.c +96 -0
- data/lua-hooks/ext/{lua → luajit/src}/lua.h +12 -7
- data/lua-hooks/ext/luajit/src/lua.hpp +9 -0
- data/lua-hooks/ext/luajit/src/luaconf.h +156 -0
- data/lua-hooks/ext/luajit/src/luajit +0 -0
- data/lua-hooks/ext/luajit/src/luajit.c +570 -0
- data/lua-hooks/ext/luajit/src/luajit.h +79 -0
- data/lua-hooks/ext/luajit/src/luajit.o +0 -0
- data/lua-hooks/ext/luajit/src/lualib.h +43 -0
- data/lua-hooks/ext/luajit/src/msvcbuild.bat +114 -0
- data/lua-hooks/ext/luajit/src/ps4build.bat +103 -0
- data/lua-hooks/ext/luajit/src/psvitabuild.bat +93 -0
- data/lua-hooks/ext/luajit/src/vm_arm.dasc +4585 -0
- data/lua-hooks/ext/luajit/src/vm_arm64.dasc +3764 -0
- data/lua-hooks/ext/luajit/src/vm_mips.dasc +4355 -0
- data/lua-hooks/ext/luajit/src/vm_ppc.dasc +5252 -0
- data/lua-hooks/ext/luajit/src/vm_x64.dasc +4902 -0
- data/lua-hooks/ext/luajit/src/vm_x86.dasc +5710 -0
- data/lua-hooks/ext/luajit/src/xb1build.bat +101 -0
- data/lua-hooks/ext/luajit/src/xedkbuild.bat +92 -0
- data/lua-hooks/ext/luautf8/lutf8lib.c +3 -3
- data/lua-hooks/lib/boot.lua +37 -2
- metadata +372 -69
- data/lua-hooks/ext/bitop/README +0 -22
- data/lua-hooks/ext/bitop/bit.c +0 -189
- data/lua-hooks/ext/extconf.rb +0 -38
- data/lua-hooks/ext/lua/COPYRIGHT +0 -34
- data/lua-hooks/ext/lua/lapi.c +0 -1087
- data/lua-hooks/ext/lua/lapi.h +0 -16
- data/lua-hooks/ext/lua/lauxlib.c +0 -652
- data/lua-hooks/ext/lua/lbaselib.c +0 -659
- data/lua-hooks/ext/lua/lcode.c +0 -831
- data/lua-hooks/ext/lua/lcode.h +0 -76
- data/lua-hooks/ext/lua/ldblib.c +0 -398
- data/lua-hooks/ext/lua/ldebug.c +0 -638
- data/lua-hooks/ext/lua/ldebug.h +0 -33
- data/lua-hooks/ext/lua/ldo.c +0 -519
- data/lua-hooks/ext/lua/ldo.h +0 -57
- data/lua-hooks/ext/lua/ldump.c +0 -164
- data/lua-hooks/ext/lua/lfunc.c +0 -174
- data/lua-hooks/ext/lua/lfunc.h +0 -34
- data/lua-hooks/ext/lua/lgc.c +0 -710
- data/lua-hooks/ext/lua/lgc.h +0 -110
- data/lua-hooks/ext/lua/linit.c +0 -38
- data/lua-hooks/ext/lua/liolib.c +0 -556
- data/lua-hooks/ext/lua/llex.c +0 -463
- data/lua-hooks/ext/lua/llex.h +0 -81
- data/lua-hooks/ext/lua/llimits.h +0 -128
- data/lua-hooks/ext/lua/lmathlib.c +0 -263
- data/lua-hooks/ext/lua/lmem.c +0 -86
- data/lua-hooks/ext/lua/lmem.h +0 -49
- data/lua-hooks/ext/lua/loadlib.c +0 -705
- data/lua-hooks/ext/lua/loadlib_rel.c +0 -760
- data/lua-hooks/ext/lua/lobject.c +0 -214
- data/lua-hooks/ext/lua/lobject.h +0 -381
- data/lua-hooks/ext/lua/lopcodes.c +0 -102
- data/lua-hooks/ext/lua/lopcodes.h +0 -268
- data/lua-hooks/ext/lua/loslib.c +0 -243
- data/lua-hooks/ext/lua/lparser.c +0 -1339
- data/lua-hooks/ext/lua/lparser.h +0 -82
- data/lua-hooks/ext/lua/lstate.c +0 -214
- data/lua-hooks/ext/lua/lstate.h +0 -169
- data/lua-hooks/ext/lua/lstring.c +0 -111
- data/lua-hooks/ext/lua/lstring.h +0 -31
- data/lua-hooks/ext/lua/lstrlib.c +0 -871
- data/lua-hooks/ext/lua/ltable.c +0 -588
- data/lua-hooks/ext/lua/ltable.h +0 -40
- data/lua-hooks/ext/lua/ltablib.c +0 -287
- data/lua-hooks/ext/lua/ltm.c +0 -75
- data/lua-hooks/ext/lua/ltm.h +0 -54
- data/lua-hooks/ext/lua/lua.c +0 -392
- data/lua-hooks/ext/lua/lua.def +0 -131
- data/lua-hooks/ext/lua/lua.rc +0 -28
- data/lua-hooks/ext/lua/lua_dll.rc +0 -26
- data/lua-hooks/ext/lua/luac.c +0 -200
- data/lua-hooks/ext/lua/luac.rc +0 -1
- data/lua-hooks/ext/lua/luaconf.h +0 -763
- data/lua-hooks/ext/lua/luaconf.h.in +0 -724
- data/lua-hooks/ext/lua/luaconf.h.orig +0 -763
- data/lua-hooks/ext/lua/lualib.h +0 -53
- data/lua-hooks/ext/lua/lundump.c +0 -227
- data/lua-hooks/ext/lua/lundump.h +0 -36
- data/lua-hooks/ext/lua/lvm.c +0 -767
- data/lua-hooks/ext/lua/lvm.h +0 -36
- data/lua-hooks/ext/lua/lzio.c +0 -82
- data/lua-hooks/ext/lua/lzio.h +0 -67
- data/lua-hooks/ext/lua/print.c +0 -227
@@ -0,0 +1,88 @@
|
|
1
|
+
.TH luajit 1 "" "" "LuaJIT documentation"
|
2
|
+
.SH NAME
|
3
|
+
luajit \- Just-In-Time Compiler for the Lua Language
|
4
|
+
\fB
|
5
|
+
.SH SYNOPSIS
|
6
|
+
.B luajit
|
7
|
+
[\fIoptions\fR]... [\fIscript\fR [\fIargs\fR]...]
|
8
|
+
.SH "WEB SITE"
|
9
|
+
.IR http://luajit.org
|
10
|
+
.SH DESCRIPTION
|
11
|
+
.PP
|
12
|
+
This is the command-line program to run Lua programs with \fBLuaJIT\fR.
|
13
|
+
.PP
|
14
|
+
\fBLuaJIT\fR is a just-in-time (JIT) compiler for the Lua language.
|
15
|
+
The virtual machine (VM) is based on a fast interpreter combined with
|
16
|
+
a trace compiler. It can significantly improve the performance of Lua programs.
|
17
|
+
.PP
|
18
|
+
\fBLuaJIT\fR is API\- and ABI-compatible with the VM of the standard
|
19
|
+
Lua\ 5.1 interpreter. When embedding the VM into an application,
|
20
|
+
the built library can be used as a drop-in replacement.
|
21
|
+
.SH OPTIONS
|
22
|
+
.TP
|
23
|
+
.BI "\-e " chunk
|
24
|
+
Run the given chunk of Lua code.
|
25
|
+
.TP
|
26
|
+
.BI "\-l " library
|
27
|
+
Load the named library, just like \fBrequire("\fR\fIlibrary\fR\fB")\fR.
|
28
|
+
.TP
|
29
|
+
.BI "\-b " ...
|
30
|
+
Save or list bytecode. Run without arguments to get help on options.
|
31
|
+
.TP
|
32
|
+
.BI "\-j " command
|
33
|
+
Perform LuaJIT control command (optional space after \fB\-j\fR).
|
34
|
+
.TP
|
35
|
+
.BI "\-O" [opt]
|
36
|
+
Control LuaJIT optimizations.
|
37
|
+
.TP
|
38
|
+
.B "\-i"
|
39
|
+
Run in interactive mode.
|
40
|
+
.TP
|
41
|
+
.B "\-v"
|
42
|
+
Show \fBLuaJIT\fR version.
|
43
|
+
.TP
|
44
|
+
.B "\-E"
|
45
|
+
Ignore environment variables.
|
46
|
+
.TP
|
47
|
+
.B "\-\-"
|
48
|
+
Stop processing options.
|
49
|
+
.TP
|
50
|
+
.B "\-"
|
51
|
+
Read script from stdin instead.
|
52
|
+
.PP
|
53
|
+
After all options are processed, the given \fIscript\fR is run.
|
54
|
+
The arguments are passed in the global \fIarg\fR table.
|
55
|
+
.PP
|
56
|
+
Interactive mode is only entered, if no \fIscript\fR and no \fB\-e\fR
|
57
|
+
option is given. Interactive mode can be left with EOF (\fICtrl\-Z\fB).
|
58
|
+
.SH EXAMPLES
|
59
|
+
.TP
|
60
|
+
luajit hello.lua world
|
61
|
+
|
62
|
+
Prints "Hello world", assuming \fIhello.lua\fR contains:
|
63
|
+
.br
|
64
|
+
print("Hello", arg[1])
|
65
|
+
.TP
|
66
|
+
luajit \-e "local x=0; for i=1,1e9 do x=x+i end; print(x)"
|
67
|
+
|
68
|
+
Calculates the sum of the numbers from 1 to 1000000000.
|
69
|
+
.br
|
70
|
+
And finishes in a reasonable amount of time, too.
|
71
|
+
.TP
|
72
|
+
luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end"
|
73
|
+
|
74
|
+
Runs some nested loops and shows the resulting traces.
|
75
|
+
.SH COPYRIGHT
|
76
|
+
.PP
|
77
|
+
\fBLuaJIT\fR is Copyright \(co 2005-2015 Mike Pall.
|
78
|
+
.br
|
79
|
+
\fBLuaJIT\fR is open source software, released under the MIT license.
|
80
|
+
.SH SEE ALSO
|
81
|
+
.PP
|
82
|
+
More details in the provided HTML docs or at:
|
83
|
+
.IR http://luajit.org
|
84
|
+
.br
|
85
|
+
More about the Lua language can be found at:
|
86
|
+
.IR http://lua.org/docs.html
|
87
|
+
.PP
|
88
|
+
lua(1)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Package information for LuaJIT to be used by pkg-config.
|
2
|
+
majver=2
|
3
|
+
minver=1
|
4
|
+
relver=0
|
5
|
+
version=${majver}.${minver}.${relver}-beta1
|
6
|
+
abiver=5.1
|
7
|
+
|
8
|
+
prefix=/usr/local
|
9
|
+
multilib=lib
|
10
|
+
exec_prefix=${prefix}
|
11
|
+
libdir=${exec_prefix}/${multilib}
|
12
|
+
libname=luajit-${abiver}
|
13
|
+
includedir=${prefix}/include/luajit-${majver}.${minver}
|
14
|
+
|
15
|
+
INSTALL_LMOD=${prefix}/share/lua/${abiver}
|
16
|
+
INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver}
|
17
|
+
|
18
|
+
Name: LuaJIT
|
19
|
+
Description: Just-in-time compiler for Lua
|
20
|
+
URL: http://luajit.org
|
21
|
+
Version: ${version}
|
22
|
+
Requires:
|
23
|
+
Libs: -L${libdir} -l${libname}
|
24
|
+
Libs.private: -Wl,-E -lm -ldl
|
25
|
+
Cflags: -I${includedir}
|
@@ -0,0 +1,697 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# LuaJIT Makefile. Requires GNU Make.
|
3
|
+
#
|
4
|
+
# Please read doc/install.html before changing any variables!
|
5
|
+
#
|
6
|
+
# Suitable for POSIX platforms (Linux, *BSD, OSX etc.).
|
7
|
+
# Also works with MinGW and Cygwin on Windows.
|
8
|
+
# Please check msvcbuild.bat for building with MSVC on Windows.
|
9
|
+
#
|
10
|
+
# Copyright (C) 2005-2015 Mike Pall. See Copyright Notice in luajit.h
|
11
|
+
##############################################################################
|
12
|
+
|
13
|
+
MAJVER= 2
|
14
|
+
MINVER= 1
|
15
|
+
RELVER= 0
|
16
|
+
ABIVER= 5.1
|
17
|
+
NODOTABIVER= 51
|
18
|
+
|
19
|
+
##############################################################################
|
20
|
+
############################# COMPILER OPTIONS #############################
|
21
|
+
##############################################################################
|
22
|
+
# These options mainly affect the speed of the JIT compiler itself, not the
|
23
|
+
# speed of the JIT-compiled code. Turn any of the optional settings on by
|
24
|
+
# removing the '#' in front of them. Make sure you force a full recompile
|
25
|
+
# with "make clean", followed by "make" if you change any options.
|
26
|
+
#
|
27
|
+
# LuaJIT builds as a native 32 or 64 bit binary by default.
|
28
|
+
CC= gcc
|
29
|
+
#
|
30
|
+
# Use this if you want to force a 32 bit build on a 64 bit multilib OS.
|
31
|
+
#CC= gcc -m32
|
32
|
+
#
|
33
|
+
# Since the assembler part does NOT maintain a frame pointer, it's pointless
|
34
|
+
# to slow down the C part by not omitting it. Debugging, tracebacks and
|
35
|
+
# unwinding are not affected -- the assembler part has frame unwind
|
36
|
+
# information and GCC emits it where needed (x64) or with -g (see CCDEBUG).
|
37
|
+
CCOPT= -O2 -fomit-frame-pointer
|
38
|
+
# Use this if you want to generate a smaller binary (but it's slower):
|
39
|
+
#CCOPT= -Os -fomit-frame-pointer
|
40
|
+
# Note: it's no longer recommended to use -O3 with GCC 4.x.
|
41
|
+
# The I-Cache bloat usually outweighs the benefits from aggressive inlining.
|
42
|
+
#
|
43
|
+
# Target-specific compiler options:
|
44
|
+
#
|
45
|
+
# x86/x64 only: For GCC 4.2 or higher and if you don't intend to distribute
|
46
|
+
# the binaries to a different machine you could also use: -march=native
|
47
|
+
#
|
48
|
+
CCOPT_x86= -march=i686 -msse -msse2 -mfpmath=sse
|
49
|
+
CCOPT_x64=
|
50
|
+
CCOPT_arm=
|
51
|
+
CCOPT_arm64=
|
52
|
+
CCOPT_ppc=
|
53
|
+
CCOPT_mips=
|
54
|
+
#
|
55
|
+
CCDEBUG=
|
56
|
+
# Uncomment the next line to generate debug information:
|
57
|
+
#CCDEBUG= -g
|
58
|
+
#
|
59
|
+
CCWARN= -Wall
|
60
|
+
# Uncomment the next line to enable more warnings:
|
61
|
+
#CCWARN+= -Wextra -Wdeclaration-after-statement -Wredundant-decls -Wshadow -Wpointer-arith
|
62
|
+
#
|
63
|
+
##############################################################################
|
64
|
+
|
65
|
+
##############################################################################
|
66
|
+
################################ BUILD MODE ################################
|
67
|
+
##############################################################################
|
68
|
+
# The default build mode is mixed mode on POSIX. On Windows this is the same
|
69
|
+
# as dynamic mode.
|
70
|
+
#
|
71
|
+
# Mixed mode creates a static + dynamic library and a statically linked luajit.
|
72
|
+
BUILDMODE= mixed
|
73
|
+
#
|
74
|
+
# Static mode creates a static library and a statically linked luajit.
|
75
|
+
#BUILDMODE= static
|
76
|
+
#
|
77
|
+
# Dynamic mode creates a dynamic library and a dynamically linked luajit.
|
78
|
+
# Note: this executable will only run when the library is installed!
|
79
|
+
#BUILDMODE= dynamic
|
80
|
+
#
|
81
|
+
##############################################################################
|
82
|
+
|
83
|
+
##############################################################################
|
84
|
+
################################# FEATURES #################################
|
85
|
+
##############################################################################
|
86
|
+
# Enable/disable these features as needed, but make sure you force a full
|
87
|
+
# recompile with "make clean", followed by "make".
|
88
|
+
XCFLAGS=
|
89
|
+
#
|
90
|
+
# Permanently disable the FFI extension to reduce the size of the LuaJIT
|
91
|
+
# executable. But please consider that the FFI library is compiled-in,
|
92
|
+
# but NOT loaded by default. It only allocates any memory, if you actually
|
93
|
+
# make use of it.
|
94
|
+
#XCFLAGS+= -DLUAJIT_DISABLE_FFI
|
95
|
+
#
|
96
|
+
# Features from Lua 5.2 that are unlikely to break existing code are
|
97
|
+
# enabled by default. Some other features that *might* break some existing
|
98
|
+
# code (e.g. __pairs or os.execute() return values) can be enabled here.
|
99
|
+
# Note: this does not provide full compatibility with Lua 5.2 at this time.
|
100
|
+
#XCFLAGS+= -DLUAJIT_ENABLE_LUA52COMPAT
|
101
|
+
#
|
102
|
+
# Disable the JIT compiler, i.e. turn LuaJIT into a pure interpreter.
|
103
|
+
#XCFLAGS+= -DLUAJIT_DISABLE_JIT
|
104
|
+
#
|
105
|
+
# Some architectures (e.g. PPC) can use either single-number (1) or
|
106
|
+
# dual-number (2) mode. Uncomment one of these lines to override the
|
107
|
+
# default mode. Please see LJ_ARCH_NUMMODE in lj_arch.h for details.
|
108
|
+
#XCFLAGS+= -DLUAJIT_NUMMODE=1
|
109
|
+
#XCFLAGS+= -DLUAJIT_NUMMODE=2
|
110
|
+
#
|
111
|
+
##############################################################################
|
112
|
+
|
113
|
+
##############################################################################
|
114
|
+
############################ DEBUGGING SUPPORT #############################
|
115
|
+
##############################################################################
|
116
|
+
# Enable these options as needed, but make sure you force a full recompile
|
117
|
+
# with "make clean", followed by "make".
|
118
|
+
# Note that most of these are NOT suitable for benchmarking or release mode!
|
119
|
+
#
|
120
|
+
# Use the system provided memory allocator (realloc) instead of the
|
121
|
+
# bundled memory allocator. This is slower, but sometimes helpful for
|
122
|
+
# debugging. This option cannot be enabled on x64, since realloc usually
|
123
|
+
# doesn't return addresses in the right address range.
|
124
|
+
# OTOH this option is mandatory for Valgrind's memcheck tool on x64 and
|
125
|
+
# the only way to get useful results from it for all other architectures.
|
126
|
+
#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
|
127
|
+
#
|
128
|
+
# This define is required to run LuaJIT under Valgrind. The Valgrind
|
129
|
+
# header files must be installed. You should enable debug information, too.
|
130
|
+
# Use --suppressions=lj.supp to avoid some false positives.
|
131
|
+
#XCFLAGS+= -DLUAJIT_USE_VALGRIND
|
132
|
+
#
|
133
|
+
# This is the client for the GDB JIT API. GDB 7.0 or higher is required
|
134
|
+
# to make use of it. See lj_gdbjit.c for details. Enabling this causes
|
135
|
+
# a non-negligible overhead, even when not running under GDB.
|
136
|
+
#XCFLAGS+= -DLUAJIT_USE_GDBJIT
|
137
|
+
#
|
138
|
+
# Turn on assertions for the Lua/C API to debug problems with lua_* calls.
|
139
|
+
# This is rather slow -- use only while developing C libraries/embeddings.
|
140
|
+
#XCFLAGS+= -DLUA_USE_APICHECK
|
141
|
+
#
|
142
|
+
# Turn on assertions for the whole LuaJIT VM. This significantly slows down
|
143
|
+
# everything. Use only if you suspect a problem with LuaJIT itself.
|
144
|
+
#XCFLAGS+= -DLUA_USE_ASSERT
|
145
|
+
#
|
146
|
+
##############################################################################
|
147
|
+
# You probably don't need to change anything below this line!
|
148
|
+
##############################################################################
|
149
|
+
|
150
|
+
##############################################################################
|
151
|
+
# Flags and options for host and target.
|
152
|
+
##############################################################################
|
153
|
+
|
154
|
+
# You can override the following variables at the make command line:
|
155
|
+
# CC HOST_CC STATIC_CC DYNAMIC_CC
|
156
|
+
# CFLAGS HOST_CFLAGS TARGET_CFLAGS
|
157
|
+
# LDFLAGS HOST_LDFLAGS TARGET_LDFLAGS TARGET_SHLDFLAGS
|
158
|
+
# LIBS HOST_LIBS TARGET_LIBS
|
159
|
+
# CROSS HOST_SYS TARGET_SYS TARGET_FLAGS
|
160
|
+
#
|
161
|
+
# Cross-compilation examples:
|
162
|
+
# make HOST_CC="gcc -m32" CROSS=i586-mingw32msvc- TARGET_SYS=Windows
|
163
|
+
# make HOST_CC="gcc -m32" CROSS=powerpc-linux-gnu-
|
164
|
+
|
165
|
+
ASOPTIONS= $(CCOPT) $(CCWARN) $(XCFLAGS) $(CFLAGS)
|
166
|
+
CCOPTIONS= $(CCDEBUG) $(ASOPTIONS)
|
167
|
+
LDOPTIONS= $(CCDEBUG) $(LDFLAGS)
|
168
|
+
|
169
|
+
HOST_CC= $(CC)
|
170
|
+
HOST_RM= rm -f
|
171
|
+
# If left blank, minilua is built and used. You can supply an installed
|
172
|
+
# copy of (plain) Lua 5.1 or 5.2, plus Lua BitOp. E.g. with: HOST_LUA=lua
|
173
|
+
HOST_LUA=
|
174
|
+
|
175
|
+
HOST_XCFLAGS= -I.
|
176
|
+
HOST_XLDFLAGS=
|
177
|
+
HOST_XLIBS=
|
178
|
+
HOST_ACFLAGS= $(CCOPTIONS) $(HOST_XCFLAGS) $(TARGET_ARCH) $(HOST_CFLAGS)
|
179
|
+
HOST_ALDFLAGS= $(LDOPTIONS) $(HOST_XLDFLAGS) $(HOST_LDFLAGS)
|
180
|
+
HOST_ALIBS= $(HOST_XLIBS) $(LIBS) $(HOST_LIBS)
|
181
|
+
|
182
|
+
STATIC_CC = $(CROSS)$(CC)
|
183
|
+
DYNAMIC_CC = $(CROSS)$(CC) -fPIC
|
184
|
+
TARGET_CC= $(STATIC_CC)
|
185
|
+
TARGET_STCC= $(STATIC_CC)
|
186
|
+
TARGET_DYNCC= $(DYNAMIC_CC)
|
187
|
+
TARGET_LD= $(CROSS)$(CC)
|
188
|
+
TARGET_AR= $(CROSS)ar rcus
|
189
|
+
TARGET_STRIP= $(CROSS)strip
|
190
|
+
|
191
|
+
TARGET_LIBPATH= $(or $(PREFIX),/usr/local)/$(or $(MULTILIB),lib)
|
192
|
+
TARGET_SONAME= libluajit-$(ABIVER).so.$(MAJVER)
|
193
|
+
TARGET_DYLIBNAME= libluajit-$(ABIVER).$(MAJVER).dylib
|
194
|
+
TARGET_DYLIBPATH= $(TARGET_LIBPATH)/$(TARGET_DYLIBNAME)
|
195
|
+
TARGET_DLLNAME= lua$(NODOTABIVER).dll
|
196
|
+
TARGET_XSHLDFLAGS= -shared -fPIC -Wl,-soname,$(TARGET_SONAME)
|
197
|
+
TARGET_DYNXLDOPTS=
|
198
|
+
|
199
|
+
TARGET_LFSFLAGS= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
200
|
+
TARGET_XCFLAGS= $(TARGET_LFSFLAGS) -U_FORTIFY_SOURCE
|
201
|
+
TARGET_XLDFLAGS=
|
202
|
+
TARGET_XLIBS= -lm
|
203
|
+
TARGET_TCFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)
|
204
|
+
TARGET_ACFLAGS= $(CCOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)
|
205
|
+
TARGET_ASFLAGS= $(ASOPTIONS) $(TARGET_XCFLAGS) $(TARGET_FLAGS) $(TARGET_CFLAGS)
|
206
|
+
TARGET_ALDFLAGS= $(LDOPTIONS) $(TARGET_XLDFLAGS) $(TARGET_FLAGS) $(TARGET_LDFLAGS)
|
207
|
+
TARGET_ASHLDFLAGS= $(LDOPTIONS) $(TARGET_XSHLDFLAGS) $(TARGET_FLAGS) $(TARGET_SHLDFLAGS)
|
208
|
+
TARGET_ALIBS= $(TARGET_XLIBS) $(LIBS) $(TARGET_LIBS)
|
209
|
+
|
210
|
+
TARGET_TESTARCH=$(shell $(TARGET_CC) $(TARGET_TCFLAGS) -E lj_arch.h -dM)
|
211
|
+
ifneq (,$(findstring LJ_TARGET_X64 ,$(TARGET_TESTARCH)))
|
212
|
+
TARGET_LJARCH= x64
|
213
|
+
else
|
214
|
+
ifneq (,$(findstring LJ_TARGET_X86 ,$(TARGET_TESTARCH)))
|
215
|
+
TARGET_LJARCH= x86
|
216
|
+
else
|
217
|
+
ifneq (,$(findstring LJ_TARGET_ARM ,$(TARGET_TESTARCH)))
|
218
|
+
TARGET_LJARCH= arm
|
219
|
+
else
|
220
|
+
ifneq (,$(findstring LJ_TARGET_ARM64 ,$(TARGET_TESTARCH)))
|
221
|
+
TARGET_LJARCH= arm64
|
222
|
+
else
|
223
|
+
ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH)))
|
224
|
+
ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH)))
|
225
|
+
TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_LE
|
226
|
+
else
|
227
|
+
TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_BE
|
228
|
+
endif
|
229
|
+
TARGET_LJARCH= ppc
|
230
|
+
else
|
231
|
+
ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH)))
|
232
|
+
ifneq (,$(findstring MIPSEL ,$(TARGET_TESTARCH)))
|
233
|
+
TARGET_ARCH= -D__MIPSEL__=1
|
234
|
+
endif
|
235
|
+
TARGET_LJARCH= mips
|
236
|
+
else
|
237
|
+
$(error Unsupported target architecture)
|
238
|
+
endif
|
239
|
+
endif
|
240
|
+
endif
|
241
|
+
endif
|
242
|
+
endif
|
243
|
+
endif
|
244
|
+
|
245
|
+
ifneq (,$(findstring LJ_TARGET_PS3 1,$(TARGET_TESTARCH)))
|
246
|
+
TARGET_SYS= PS3
|
247
|
+
TARGET_ARCH+= -D__CELLOS_LV2__
|
248
|
+
TARGET_XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
|
249
|
+
TARGET_XLIBS+= -lpthread
|
250
|
+
endif
|
251
|
+
|
252
|
+
TARGET_XCFLAGS+= $(CCOPT_$(TARGET_LJARCH))
|
253
|
+
TARGET_ARCH+= $(patsubst %,-DLUAJIT_TARGET=LUAJIT_ARCH_%,$(TARGET_LJARCH))
|
254
|
+
|
255
|
+
ifneq (,$(PREFIX))
|
256
|
+
ifneq (/usr/local,$(PREFIX))
|
257
|
+
TARGET_XCFLAGS+= -DLUA_ROOT=\"$(PREFIX)\"
|
258
|
+
ifneq (/usr,$(PREFIX))
|
259
|
+
TARGET_DYNXLDOPTS= -Wl,-rpath,$(TARGET_LIBPATH)
|
260
|
+
endif
|
261
|
+
endif
|
262
|
+
endif
|
263
|
+
ifneq (,$(MULTILIB))
|
264
|
+
TARGET_XCFLAGS+= -DLUA_MULTILIB=\"$(MULTILIB)\"
|
265
|
+
endif
|
266
|
+
ifneq (,$(LMULTILIB))
|
267
|
+
TARGET_XCFLAGS+= -DLUA_LMULTILIB=\"$(LMULTILIB)\"
|
268
|
+
endif
|
269
|
+
|
270
|
+
##############################################################################
|
271
|
+
# System detection.
|
272
|
+
##############################################################################
|
273
|
+
|
274
|
+
ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))
|
275
|
+
HOST_SYS= Windows
|
276
|
+
HOST_RM= del
|
277
|
+
else
|
278
|
+
HOST_SYS:= $(shell uname -s)
|
279
|
+
ifneq (,$(findstring MINGW,$(HOST_SYS)))
|
280
|
+
HOST_SYS= Windows
|
281
|
+
HOST_MSYS= mingw
|
282
|
+
endif
|
283
|
+
ifneq (,$(findstring CYGWIN,$(HOST_SYS)))
|
284
|
+
HOST_SYS= Windows
|
285
|
+
HOST_MSYS= cygwin
|
286
|
+
endif
|
287
|
+
endif
|
288
|
+
|
289
|
+
TARGET_SYS?= $(HOST_SYS)
|
290
|
+
ifeq (Windows,$(TARGET_SYS))
|
291
|
+
TARGET_STRIP+= --strip-unneeded
|
292
|
+
TARGET_XSHLDFLAGS= -shared
|
293
|
+
TARGET_DYNXLDOPTS=
|
294
|
+
else
|
295
|
+
ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector 2>/dev/null || echo 1))
|
296
|
+
TARGET_XCFLAGS+= -fno-stack-protector
|
297
|
+
endif
|
298
|
+
ifeq (Darwin,$(TARGET_SYS))
|
299
|
+
ifeq (,$(MACOSX_DEPLOYMENT_TARGET))
|
300
|
+
export MACOSX_DEPLOYMENT_TARGET=10.4
|
301
|
+
endif
|
302
|
+
TARGET_STRIP+= -x
|
303
|
+
TARGET_AR+= 2>/dev/null
|
304
|
+
TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
|
305
|
+
TARGET_DYNXLDOPTS=
|
306
|
+
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)
|
307
|
+
ifeq (x64,$(TARGET_LJARCH))
|
308
|
+
TARGET_XLDFLAGS+= -pagezero_size 10000 -image_base 100000000
|
309
|
+
TARGET_XSHLDFLAGS+= -image_base 7fff04c4a000
|
310
|
+
endif
|
311
|
+
else
|
312
|
+
ifeq (iOS,$(TARGET_SYS))
|
313
|
+
TARGET_STRIP+= -x
|
314
|
+
TARGET_AR+= 2>/dev/null
|
315
|
+
TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC
|
316
|
+
TARGET_DYNXLDOPTS=
|
317
|
+
TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)
|
318
|
+
ifeq (arm64,$(TARGET_LJARCH))
|
319
|
+
TARGET_XCFLAGS+= -fno-omit-frame-pointer
|
320
|
+
endif
|
321
|
+
else
|
322
|
+
ifneq (SunOS,$(TARGET_SYS))
|
323
|
+
ifneq (PS3,$(TARGET_SYS))
|
324
|
+
TARGET_XLDFLAGS+= -Wl,-E
|
325
|
+
endif
|
326
|
+
endif
|
327
|
+
ifeq (Linux,$(TARGET_SYS))
|
328
|
+
TARGET_XLIBS+= -ldl
|
329
|
+
endif
|
330
|
+
ifeq (GNU/kFreeBSD,$(TARGET_SYS))
|
331
|
+
TARGET_XLIBS+= -ldl
|
332
|
+
endif
|
333
|
+
endif
|
334
|
+
endif
|
335
|
+
endif
|
336
|
+
|
337
|
+
ifneq ($(HOST_SYS),$(TARGET_SYS))
|
338
|
+
ifeq (Windows,$(TARGET_SYS))
|
339
|
+
HOST_XCFLAGS+= -malign-double -DLUAJIT_OS=LUAJIT_OS_WINDOWS
|
340
|
+
else
|
341
|
+
ifeq (Linux,$(TARGET_SYS))
|
342
|
+
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_LINUX
|
343
|
+
else
|
344
|
+
ifeq (Darwin,$(TARGET_SYS))
|
345
|
+
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX
|
346
|
+
else
|
347
|
+
ifeq (iOS,$(TARGET_SYS))
|
348
|
+
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OSX
|
349
|
+
else
|
350
|
+
HOST_XCFLAGS+= -DLUAJIT_OS=LUAJIT_OS_OTHER
|
351
|
+
endif
|
352
|
+
endif
|
353
|
+
endif
|
354
|
+
endif
|
355
|
+
endif
|
356
|
+
|
357
|
+
ifneq (,$(CCDEBUG))
|
358
|
+
TARGET_STRIP= @:
|
359
|
+
endif
|
360
|
+
|
361
|
+
##############################################################################
|
362
|
+
# Files and pathnames.
|
363
|
+
##############################################################################
|
364
|
+
|
365
|
+
MINILUA_O= host/minilua.o
|
366
|
+
MINILUA_LIBS= -lm
|
367
|
+
MINILUA_T= host/minilua
|
368
|
+
MINILUA_X= $(MINILUA_T)
|
369
|
+
|
370
|
+
ifeq (,$(HOST_LUA))
|
371
|
+
HOST_LUA= $(MINILUA_X)
|
372
|
+
DASM_DEP= $(MINILUA_T)
|
373
|
+
endif
|
374
|
+
|
375
|
+
DASM_DIR= ../dynasm
|
376
|
+
DASM= $(HOST_LUA) $(DASM_DIR)/dynasm.lua
|
377
|
+
DASM_XFLAGS=
|
378
|
+
DASM_AFLAGS=
|
379
|
+
DASM_ARCH= $(TARGET_LJARCH)
|
380
|
+
|
381
|
+
ifneq (,$(findstring LJ_ARCH_BITS 64,$(TARGET_TESTARCH)))
|
382
|
+
DASM_AFLAGS+= -D P64
|
383
|
+
endif
|
384
|
+
ifneq (,$(findstring LJ_HASJIT 1,$(TARGET_TESTARCH)))
|
385
|
+
DASM_AFLAGS+= -D JIT
|
386
|
+
endif
|
387
|
+
ifneq (,$(findstring LJ_HASFFI 1,$(TARGET_TESTARCH)))
|
388
|
+
DASM_AFLAGS+= -D FFI
|
389
|
+
endif
|
390
|
+
ifneq (,$(findstring LJ_DUALNUM 1,$(TARGET_TESTARCH)))
|
391
|
+
DASM_AFLAGS+= -D DUALNUM
|
392
|
+
endif
|
393
|
+
ifneq (,$(findstring LJ_ARCH_HASFPU 1,$(TARGET_TESTARCH)))
|
394
|
+
DASM_AFLAGS+= -D FPU
|
395
|
+
TARGET_ARCH+= -DLJ_ARCH_HASFPU=1
|
396
|
+
else
|
397
|
+
TARGET_ARCH+= -DLJ_ARCH_HASFPU=0
|
398
|
+
endif
|
399
|
+
ifeq (,$(findstring LJ_ABI_SOFTFP 1,$(TARGET_TESTARCH)))
|
400
|
+
DASM_AFLAGS+= -D HFABI
|
401
|
+
TARGET_ARCH+= -DLJ_ABI_SOFTFP=0
|
402
|
+
else
|
403
|
+
TARGET_ARCH+= -DLJ_ABI_SOFTFP=1
|
404
|
+
endif
|
405
|
+
ifneq (,$(findstring LJ_NO_UNWIND 1,$(TARGET_TESTARCH)))
|
406
|
+
DASM_AFLAGS+= -D NO_UNWIND
|
407
|
+
TARGET_ARCH+= -DLUAJIT_NO_UNWIND
|
408
|
+
endif
|
409
|
+
DASM_AFLAGS+= -D VER=$(subst LJ_ARCH_VERSION_,,$(filter LJ_ARCH_VERSION_%,$(subst LJ_ARCH_VERSION ,LJ_ARCH_VERSION_,$(TARGET_TESTARCH))))
|
410
|
+
ifeq (Windows,$(TARGET_SYS))
|
411
|
+
DASM_AFLAGS+= -D WIN
|
412
|
+
endif
|
413
|
+
ifeq (x64,$(TARGET_LJARCH))
|
414
|
+
ifeq (,$(findstring LJ_FR2 1,$(TARGET_TESTARCH)))
|
415
|
+
DASM_ARCH= x86
|
416
|
+
endif
|
417
|
+
else
|
418
|
+
ifeq (arm,$(TARGET_LJARCH))
|
419
|
+
ifeq (iOS,$(TARGET_SYS))
|
420
|
+
DASM_AFLAGS+= -D IOS
|
421
|
+
endif
|
422
|
+
else
|
423
|
+
ifeq (ppc,$(TARGET_LJARCH))
|
424
|
+
ifneq (,$(findstring LJ_ARCH_SQRT 1,$(TARGET_TESTARCH)))
|
425
|
+
DASM_AFLAGS+= -D SQRT
|
426
|
+
endif
|
427
|
+
ifneq (,$(findstring LJ_ARCH_ROUND 1,$(TARGET_TESTARCH)))
|
428
|
+
DASM_AFLAGS+= -D ROUND
|
429
|
+
endif
|
430
|
+
ifneq (,$(findstring LJ_ARCH_PPC32ON64 1,$(TARGET_TESTARCH)))
|
431
|
+
DASM_AFLAGS+= -D GPR64
|
432
|
+
endif
|
433
|
+
ifeq (PS3,$(TARGET_SYS))
|
434
|
+
DASM_AFLAGS+= -D PPE -D TOC
|
435
|
+
endif
|
436
|
+
ifneq (,$(findstring LJ_ARCH_PPC64 ,$(TARGET_TESTARCH)))
|
437
|
+
DASM_ARCH= ppc64
|
438
|
+
endif
|
439
|
+
endif
|
440
|
+
endif
|
441
|
+
endif
|
442
|
+
|
443
|
+
DASM_FLAGS= $(DASM_XFLAGS) $(DASM_AFLAGS)
|
444
|
+
DASM_DASC= vm_$(DASM_ARCH).dasc
|
445
|
+
|
446
|
+
BUILDVM_O= host/buildvm.o host/buildvm_asm.o host/buildvm_peobj.o \
|
447
|
+
host/buildvm_lib.o host/buildvm_fold.o
|
448
|
+
BUILDVM_T= host/buildvm
|
449
|
+
BUILDVM_X= $(BUILDVM_T)
|
450
|
+
|
451
|
+
HOST_O= $(MINILUA_O) $(BUILDVM_O)
|
452
|
+
HOST_T= $(MINILUA_T) $(BUILDVM_T)
|
453
|
+
|
454
|
+
LJVM_S= lj_vm.S
|
455
|
+
LJVM_O= lj_vm.o
|
456
|
+
LJVM_BOUT= $(LJVM_S)
|
457
|
+
LJVM_MODE= elfasm
|
458
|
+
|
459
|
+
LJLIB_O= lib_base.o lib_math.o lib_bit.o lib_string.o lib_table.o \
|
460
|
+
lib_io.o lib_os.o lib_package.o lib_debug.o lib_jit.o lib_ffi.o
|
461
|
+
LJLIB_C= $(LJLIB_O:.o=.c)
|
462
|
+
|
463
|
+
LJCORE_O= lj_gc.o lj_err.o lj_char.o lj_bc.o lj_obj.o lj_buf.o \
|
464
|
+
lj_str.o lj_tab.o lj_func.o lj_udata.o lj_meta.o lj_debug.o \
|
465
|
+
lj_state.o lj_dispatch.o lj_vmevent.o lj_vmmath.o lj_strscan.o \
|
466
|
+
lj_strfmt.o lj_api.o lj_profile.o \
|
467
|
+
lj_lex.o lj_parse.o lj_bcread.o lj_bcwrite.o lj_load.o \
|
468
|
+
lj_ir.o lj_opt_mem.o lj_opt_fold.o lj_opt_narrow.o \
|
469
|
+
lj_opt_dce.o lj_opt_loop.o lj_opt_split.o lj_opt_sink.o \
|
470
|
+
lj_mcode.o lj_snap.o lj_record.o lj_crecord.o lj_ffrecord.o \
|
471
|
+
lj_asm.o lj_trace.o lj_gdbjit.o \
|
472
|
+
lj_ctype.o lj_cdata.o lj_cconv.o lj_ccall.o lj_ccallback.o \
|
473
|
+
lj_carith.o lj_clib.o lj_cparse.o \
|
474
|
+
lj_lib.o lj_alloc.o lib_aux.o \
|
475
|
+
$(LJLIB_O) lib_init.o
|
476
|
+
|
477
|
+
LJVMCORE_O= $(LJVM_O) $(LJCORE_O)
|
478
|
+
LJVMCORE_DYNO= $(LJVMCORE_O:.o=_dyn.o)
|
479
|
+
|
480
|
+
LIB_VMDEF= jit/vmdef.lua
|
481
|
+
LIB_VMDEFP= $(LIB_VMDEF)
|
482
|
+
|
483
|
+
LUAJIT_O= luajit.o
|
484
|
+
LUAJIT_A= libluajit.a
|
485
|
+
LUAJIT_SO= libluajit.so
|
486
|
+
LUAJIT_T= luajit
|
487
|
+
|
488
|
+
ALL_T= $(LUAJIT_T) $(LUAJIT_A) $(LUAJIT_SO) $(HOST_T)
|
489
|
+
ALL_HDRGEN= lj_bcdef.h lj_ffdef.h lj_libdef.h lj_recdef.h lj_folddef.h \
|
490
|
+
host/buildvm_arch.h
|
491
|
+
ALL_GEN= $(LJVM_S) $(ALL_HDRGEN) $(LIB_VMDEFP)
|
492
|
+
WIN_RM= *.obj *.lib *.exp *.dll *.exe *.manifest *.pdb *.ilk
|
493
|
+
ALL_RM= $(ALL_T) $(ALL_GEN) *.o host/*.o $(WIN_RM)
|
494
|
+
|
495
|
+
##############################################################################
|
496
|
+
# Build mode handling.
|
497
|
+
##############################################################################
|
498
|
+
|
499
|
+
# Mixed mode defaults.
|
500
|
+
TARGET_O= $(LUAJIT_A)
|
501
|
+
TARGET_T= $(LUAJIT_T) $(LUAJIT_SO)
|
502
|
+
TARGET_DEP= $(LIB_VMDEF) $(LUAJIT_SO)
|
503
|
+
|
504
|
+
ifeq (Windows,$(TARGET_SYS))
|
505
|
+
TARGET_DYNCC= $(STATIC_CC)
|
506
|
+
LJVM_MODE= peobj
|
507
|
+
LJVM_BOUT= $(LJVM_O)
|
508
|
+
LUAJIT_T= luajit.exe
|
509
|
+
ifeq (cygwin,$(HOST_MSYS))
|
510
|
+
LUAJIT_SO= cyg$(TARGET_DLLNAME)
|
511
|
+
else
|
512
|
+
LUAJIT_SO= $(TARGET_DLLNAME)
|
513
|
+
endif
|
514
|
+
# Mixed mode is not supported on Windows. And static mode doesn't work well.
|
515
|
+
# C modules cannot be loaded, because they bind to lua51.dll.
|
516
|
+
ifneq (static,$(BUILDMODE))
|
517
|
+
BUILDMODE= dynamic
|
518
|
+
TARGET_XCFLAGS+= -DLUA_BUILD_AS_DLL
|
519
|
+
endif
|
520
|
+
endif
|
521
|
+
ifeq (Darwin,$(TARGET_SYS))
|
522
|
+
LJVM_MODE= machasm
|
523
|
+
endif
|
524
|
+
ifeq (iOS,$(TARGET_SYS))
|
525
|
+
LJVM_MODE= machasm
|
526
|
+
endif
|
527
|
+
ifeq (SunOS,$(TARGET_SYS))
|
528
|
+
BUILDMODE= static
|
529
|
+
endif
|
530
|
+
ifeq (PS3,$(TARGET_SYS))
|
531
|
+
BUILDMODE= static
|
532
|
+
endif
|
533
|
+
|
534
|
+
ifeq (Windows,$(HOST_SYS))
|
535
|
+
MINILUA_T= host/minilua.exe
|
536
|
+
BUILDVM_T= host/buildvm.exe
|
537
|
+
ifeq (,$(HOST_MSYS))
|
538
|
+
MINILUA_X= host\minilua
|
539
|
+
BUILDVM_X= host\buildvm
|
540
|
+
ALL_RM:= $(subst /,\,$(ALL_RM))
|
541
|
+
endif
|
542
|
+
endif
|
543
|
+
|
544
|
+
ifeq (static,$(BUILDMODE))
|
545
|
+
TARGET_DYNCC= @:
|
546
|
+
TARGET_T= $(LUAJIT_T)
|
547
|
+
TARGET_DEP= $(LIB_VMDEF)
|
548
|
+
else
|
549
|
+
ifeq (dynamic,$(BUILDMODE))
|
550
|
+
ifneq (Windows,$(TARGET_SYS))
|
551
|
+
TARGET_CC= $(DYNAMIC_CC)
|
552
|
+
endif
|
553
|
+
TARGET_DYNCC= @:
|
554
|
+
LJVMCORE_DYNO= $(LJVMCORE_O)
|
555
|
+
TARGET_O= $(LUAJIT_SO)
|
556
|
+
TARGET_XLDFLAGS+= $(TARGET_DYNXLDOPTS)
|
557
|
+
else
|
558
|
+
ifeq (Darwin,$(TARGET_SYS))
|
559
|
+
TARGET_DYNCC= @:
|
560
|
+
LJVMCORE_DYNO= $(LJVMCORE_O)
|
561
|
+
endif
|
562
|
+
ifeq (iOS,$(TARGET_SYS))
|
563
|
+
TARGET_DYNCC= @:
|
564
|
+
LJVMCORE_DYNO= $(LJVMCORE_O)
|
565
|
+
endif
|
566
|
+
endif
|
567
|
+
endif
|
568
|
+
|
569
|
+
Q= @
|
570
|
+
E= @echo
|
571
|
+
#Q=
|
572
|
+
#E= @:
|
573
|
+
|
574
|
+
##############################################################################
|
575
|
+
# Make targets.
|
576
|
+
##############################################################################
|
577
|
+
|
578
|
+
default all: $(TARGET_T)
|
579
|
+
|
580
|
+
amalg:
|
581
|
+
@grep "^[+|]" ljamalg.c
|
582
|
+
$(MAKE) all "LJCORE_O=ljamalg.o"
|
583
|
+
|
584
|
+
clean:
|
585
|
+
$(HOST_RM) $(ALL_RM)
|
586
|
+
|
587
|
+
libbc:
|
588
|
+
./$(LUAJIT_T) host/genlibbc.lua -o host/buildvm_libbc.h $(LJLIB_C)
|
589
|
+
$(MAKE) all
|
590
|
+
|
591
|
+
depend:
|
592
|
+
@for file in $(ALL_HDRGEN); do \
|
593
|
+
test -f $$file || touch $$file; \
|
594
|
+
done
|
595
|
+
@$(HOST_CC) $(HOST_ACFLAGS) -MM *.c host/*.c | \
|
596
|
+
sed -e "s| [^ ]*/dasm_\S*\.h||g" \
|
597
|
+
-e "s|^\([^l ]\)|host/\1|" \
|
598
|
+
-e "s| lj_target_\S*\.h| lj_target_*.h|g" \
|
599
|
+
-e "s| lj_emit_\S*\.h| lj_emit_*.h|g" \
|
600
|
+
-e "s| lj_asm_\S*\.h| lj_asm_*.h|g" >Makefile.dep
|
601
|
+
@for file in $(ALL_HDRGEN); do \
|
602
|
+
test -s $$file || $(HOST_RM) $$file; \
|
603
|
+
done
|
604
|
+
|
605
|
+
.PHONY: default all amalg clean libbc depend
|
606
|
+
|
607
|
+
##############################################################################
|
608
|
+
# Rules for generated files.
|
609
|
+
##############################################################################
|
610
|
+
|
611
|
+
$(MINILUA_T): $(MINILUA_O)
|
612
|
+
$(E) "HOSTLINK $@"
|
613
|
+
$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(MINILUA_O) $(MINILUA_LIBS) $(HOST_ALIBS)
|
614
|
+
|
615
|
+
host/buildvm_arch.h: $(DASM_DASC) $(DASM_DEP)
|
616
|
+
$(E) "DYNASM $@"
|
617
|
+
$(Q)$(DASM) $(DASM_FLAGS) -o $@ $(DASM_DASC)
|
618
|
+
|
619
|
+
host/buildvm.o: $(DASM_DIR)/dasm_*.h
|
620
|
+
|
621
|
+
$(BUILDVM_T): $(BUILDVM_O)
|
622
|
+
$(E) "HOSTLINK $@"
|
623
|
+
$(Q)$(HOST_CC) $(HOST_ALDFLAGS) -o $@ $(BUILDVM_O) $(HOST_ALIBS)
|
624
|
+
|
625
|
+
$(LJVM_BOUT): $(BUILDVM_T)
|
626
|
+
$(E) "BUILDVM $@"
|
627
|
+
$(Q)$(BUILDVM_X) -m $(LJVM_MODE) -o $@
|
628
|
+
|
629
|
+
lj_bcdef.h: $(BUILDVM_T) $(LJLIB_C)
|
630
|
+
$(E) "BUILDVM $@"
|
631
|
+
$(Q)$(BUILDVM_X) -m bcdef -o $@ $(LJLIB_C)
|
632
|
+
|
633
|
+
lj_ffdef.h: $(BUILDVM_T) $(LJLIB_C)
|
634
|
+
$(E) "BUILDVM $@"
|
635
|
+
$(Q)$(BUILDVM_X) -m ffdef -o $@ $(LJLIB_C)
|
636
|
+
|
637
|
+
lj_libdef.h: $(BUILDVM_T) $(LJLIB_C)
|
638
|
+
$(E) "BUILDVM $@"
|
639
|
+
$(Q)$(BUILDVM_X) -m libdef -o $@ $(LJLIB_C)
|
640
|
+
|
641
|
+
lj_recdef.h: $(BUILDVM_T) $(LJLIB_C)
|
642
|
+
$(E) "BUILDVM $@"
|
643
|
+
$(Q)$(BUILDVM_X) -m recdef -o $@ $(LJLIB_C)
|
644
|
+
|
645
|
+
$(LIB_VMDEF): $(BUILDVM_T) $(LJLIB_C)
|
646
|
+
$(E) "BUILDVM $@"
|
647
|
+
$(Q)$(BUILDVM_X) -m vmdef -o $(LIB_VMDEFP) $(LJLIB_C)
|
648
|
+
|
649
|
+
lj_folddef.h: $(BUILDVM_T) lj_opt_fold.c
|
650
|
+
$(E) "BUILDVM $@"
|
651
|
+
$(Q)$(BUILDVM_X) -m folddef -o $@ lj_opt_fold.c
|
652
|
+
|
653
|
+
##############################################################################
|
654
|
+
# Object file rules.
|
655
|
+
##############################################################################
|
656
|
+
|
657
|
+
%.o: %.c
|
658
|
+
$(E) "CC $@"
|
659
|
+
$(Q)$(TARGET_DYNCC) $(TARGET_ACFLAGS) -c -o $(@:.o=_dyn.o) $<
|
660
|
+
$(Q)$(TARGET_CC) $(TARGET_ACFLAGS) -c -o $@ $<
|
661
|
+
|
662
|
+
%.o: %.S
|
663
|
+
$(E) "ASM $@"
|
664
|
+
$(Q)$(TARGET_DYNCC) $(TARGET_ASFLAGS) -c -o $(@:.o=_dyn.o) $<
|
665
|
+
$(Q)$(TARGET_CC) $(TARGET_ASFLAGS) -c -o $@ $<
|
666
|
+
|
667
|
+
$(LUAJIT_O):
|
668
|
+
$(E) "CC $@"
|
669
|
+
$(Q)$(TARGET_STCC) $(TARGET_ACFLAGS) -c -o $@ $<
|
670
|
+
|
671
|
+
$(HOST_O): %.o: %.c
|
672
|
+
$(E) "HOSTCC $@"
|
673
|
+
$(Q)$(HOST_CC) $(HOST_ACFLAGS) -c -o $@ $<
|
674
|
+
|
675
|
+
include Makefile.dep
|
676
|
+
|
677
|
+
##############################################################################
|
678
|
+
# Target file rules.
|
679
|
+
##############################################################################
|
680
|
+
|
681
|
+
$(LUAJIT_A): $(LJVMCORE_O)
|
682
|
+
$(E) "AR $@"
|
683
|
+
$(Q)$(TARGET_AR) $@ $(LJVMCORE_O)
|
684
|
+
|
685
|
+
# The dependency on _O, but linking with _DYNO is intentional.
|
686
|
+
$(LUAJIT_SO): $(LJVMCORE_O)
|
687
|
+
$(E) "DYNLINK $@"
|
688
|
+
$(Q)$(TARGET_LD) $(TARGET_ASHLDFLAGS) -o $@ $(LJVMCORE_DYNO) $(TARGET_ALIBS)
|
689
|
+
$(Q)$(TARGET_STRIP) $@
|
690
|
+
|
691
|
+
$(LUAJIT_T): $(TARGET_O) $(LUAJIT_O) $(TARGET_DEP)
|
692
|
+
$(E) "LINK $@"
|
693
|
+
$(Q)$(TARGET_LD) $(TARGET_ALDFLAGS) -o $@ $(LUAJIT_O) $(TARGET_O) $(TARGET_ALIBS)
|
694
|
+
$(Q)$(TARGET_STRIP) $@
|
695
|
+
$(E) "OK Successfully built LuaJIT"
|
696
|
+
|
697
|
+
##############################################################################
|