Permalink
Browse files

deps: luajit: fix luajit build for gyp

- buildvm files moved to host/ fix this problem first.
- dynasm ran through minilua to generate buildvm_arch.h
- jit: re-add symlink to new location to make buildvm work
- Copy rules for each arch from src/Makefile in luajit
  • Loading branch information...
1 parent 4cd3d11 commit 1f9b9c5bd64e1179d91c4d243a65dc7ddf2d6ced @philips philips committed Jul 3, 2012
Showing with 60 additions and 13 deletions.
  1. +59 −13 deps/luajit.gyp
  2. +1 −0 jit
View
@@ -77,14 +77,14 @@
{
'destination': '<(PRODUCT_DIR)/lua/jit',
'files': [
- '../deps/luajit/lib/bc.lua',
- '../deps/luajit/lib/bcsave.lua',
- '../deps/luajit/lib/dis_arm.lua',
- '../deps/luajit/lib/dis_ppc.lua',
- '../deps/luajit/lib/dis_x86.lua',
- '../deps/luajit/lib/dis_x64.lua',
- '../deps/luajit/lib/dump.lua',
- '../deps/luajit/lib/v.lua',
+ '../deps/luajit/src/jit/bc.lua',
+ '../deps/luajit/src/jit/bcsave.lua',
+ '../deps/luajit/src/jit/dis_arm.lua',
+ '../deps/luajit/src/jit/dis_ppc.lua',
+ '../deps/luajit/src/jit/dis_x86.lua',
+ '../deps/luajit/src/jit/dis_x64.lua',
+ '../deps/luajit/src/jit/dump.lua',
+ '../deps/luajit/src/jit/v.lua',
]
}],
},
@@ -249,14 +249,33 @@
],
},
{
+ 'target_name': 'minilua',
+ 'type': 'executable',
+ 'sources': [
+ 'luajit/src/host/minilua.c',
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ 'luajit/src',
+ ],
+ },
+ {
'target_name': 'buildvm',
'type': 'executable',
+ 'dependencies': [
+ 'minilua',
+ ],
'sources': [
- 'luajit/src/buildvm.c',
- 'luajit/src/buildvm_asm.c',
- 'luajit/src/buildvm_peobj.c',
- 'luajit/src/buildvm_lib.c',
- 'luajit/src/buildvm_fold.c',
+ 'luajit/src/host/buildvm.c',
+ 'luajit/src/host/buildvm_asm.c',
+ 'luajit/src/host/buildvm_peobj.c',
+ 'luajit/src/host/buildvm_lib.c',
+ 'luajit/src/host/buildvm_fold.c',
+ '<(INTERMEDIATE_DIR)/buildvm_arch.h',
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ 'luajit/src',
],
'rules': [
{
@@ -276,6 +295,33 @@
'message': 'dynasm <(RULE_INPUT_PATH)'
}
],
+ 'actions': [
+ {
+ 'action_name': 'generate_host_buildvm_arch',
+ 'outputs': ['<(INTERMEDIATE_DIR)/buildvm_arch.h'],
+ 'inputs': [ '<(PRODUCT_DIR)/minilua' ],
+ 'variables': {
+ 'DASM_FLAGS': [ '-D', 'JIT', '-D', 'FPU' ],
+ 'conditions': [
+ ['target_arch == "ia32" or target_arch == "x86"', {
+ 'DASM_ARCH': 'x86'
+ }],
+ ['target_arch == "arm"', {
+ 'DASM_ARCH': 'arm'
+ }],
+ ['target_arch == "x64" and OS == "win"', {
+ 'DASM_FLAGS': ['-D', 'X64WIN']
+ }],
+ ['target_arch == "x64" and OS != "win"', {
+ 'DASM_FLAGS': ['-D', 'X64']
+ }],
+ ]
+ },
+ 'action': [
+ '<(PRODUCT_DIR)/minilua', 'luajit/dynasm/dynasm.lua', '<@(DASM_FLAGS)', '-o', '<(INTERMEDIATE_DIR)/buildvm_arch.h', 'luajit/src/vm_<(DASM_ARCH).dasc'
+ ]
+ },
+ ],
},
],
}
View
1 jit

0 comments on commit 1f9b9c5

Please sign in to comment.