aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-05-15 19:07:12 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-05-15 19:07:12 -0700
commit1be1268669d2a253312dd7b9f2da564e4dfc8e24 (patch)
treec4f2512ed5e4b13614f4988a4078f04d3e1e56be /emscripten.py
parent798e635cf912d778f08f8107d6d59fcd11b20082 (diff)
remove compiler argument to emscripten.py - use ~/.emscripten instead
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/emscripten.py b/emscripten.py
index 5bd245eb..ec2c1662 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -2,8 +2,6 @@
import os, sys, subprocess
-COMPILER_ENGINE = None
-
abspath = os.path.abspath(os.path.dirname(__file__))
def path_from_root(*pathelems):
return os.path.join(os.path.sep, *(abspath.split(os.sep) + list(pathelems)))
@@ -26,23 +24,20 @@ def emscripten(filename, settings, outfile):
if __name__ == '__main__':
if sys.argv.__len__() not in range(2,6):
print '''
-Emscripten usage: emscripten.py INFILE [PATH-TO-JS-ENGINE] [SETTINGS] [OUTPUT_FILE]
+Emscripten usage: emscripten.py INFILE [SETTINGS] [OUTPUT_FILE]
INFILE must be in human-readable LLVM disassembly form (i.e., as text,
not binary).
- PATH-TO-JS-ENGINE should be a path to the JavaScript engine used to
- run the compiler (which is in JavaScript itself). You can later use
- the same engine to run the code, or another one, that is a separate
- issue. If you do not provide this parameter, you should define
- COMPILER_ENGINE = ... in a file at ~/.emscripten.
- SETTINGS is an optional set of compiler settings, overriding the defaults.
+ SETTINGS is an optional set of compiler settings, overriding the defaults,
+ in JSON format. See src/settings.js.
OUTPUT_FILE is the file to create with the output. If not given, we write
- to stdout
+ to stdout.
+
+ You should have an ~/.emscripten file set up, see tests/settings.py, which
+ in particular includes COMPILER_ENGINE.
'''
else:
- if len(sys.argv) >= 3:
- COMPILER_ENGINE = [sys.argv[2]]
- settings = sys.argv[3] if len(sys.argv) >= 4 else "{}"
- outfile = open(sys.argv[4], 'w') if len(sys.argv) >= 5 else None
+ settings = sys.argv[2] if len(sys.argv) >= 3 else "{}"
+ outfile = open(sys.argv[3], 'w') if len(sys.argv) >= 4 else None
emscripten(sys.argv[1], settings, outfile)