emscripten/emlink.py

34 строки
658 B
Python
Исходник Обычный вид История

2013-06-25 03:00:24 +04:00
#!/usr/bin/env python2
'''
Fast static linker for emscripten outputs. Specifically this links asm.js modules.
See https://github.com/kripken/emscripten/wiki/Linking
2013-06-25 03:00:24 +04:00
'''
import sys
2013-06-25 03:00:24 +04:00
from tools import shared
from tools.asm_module import AsmModule
2013-06-25 03:00:24 +04:00
def run():
try:
me, main, side, out = sys.argv[:4]
except:
print >> sys.stderr, 'usage: emlink.py [main module] [side module] [output name]'
sys.exit(1)
2013-06-25 03:00:24 +04:00
print 'Main module:', main
print 'Side module:', side
print 'Output:', out
2013-06-25 03:00:24 +04:00
shared.try_delete(out)
main = AsmModule(main)
side = AsmModule(side)
2013-06-25 03:36:05 +04:00
side.relocate_into(main)
main.write(out)
2013-06-25 03:36:05 +04:00
if __name__ == '__main__':
run()