aboutsummaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc15
1 files changed, 14 insertions, 1 deletions
diff --git a/emcc b/emcc
index 42200428..8d4a3205 100755
--- a/emcc
+++ b/emcc
@@ -169,6 +169,13 @@ Options that are modified or new in %s include:
will be run). Note that this by itself
will not minify the code (closure does
that)
+ --shell-path <path> The path name to a skeleton HTML file used
+ when generating HTML output. The shell file
+ used needs to have this token inside it:
+ {{{ SCRIPT_CODE }}}
+ Note that this argument is ignored if a
+ target other than HTML is specified using
+ the -o option.
The target file, if specified (-o <target>), defines what will
be generated:
@@ -285,6 +292,7 @@ try:
closure = None
js_transform = None
compress_whitespace = None
+ shell_path = shared.path_from_root('src', 'shell.html')
def check_bad_eq(arg):
assert '=' not in arg, 'Invalid parameter (do not use "=" with "--" options)'
@@ -323,6 +331,11 @@ try:
f.close()
newargs[i] = ''
newargs[i+1] = ''
+ elif newargs[i].startswith('--shell-file'):
+ check_bad_eq(newargs[i])
+ shell_path = newargs[i+1]
+ newargs[i] = ''
+ newargs[i+1] = ''
newargs = [ arg for arg in newargs if arg is not '' ]
if llvm_opts is None: llvm_opts = 1 if opt_level >= 1 else 0
@@ -634,7 +647,7 @@ try:
# If we were asked to also generate HTML, do that
if final_suffix == 'html':
if DEBUG: print >> sys.stderr, 'emcc: generating HTML'
- shell = open(shared.path_from_root('src', 'shell.html')).read()
+ shell = open(shell_path).read()
html = open(target, 'w')
html.write(shell.replace('{{{ SCRIPT_CODE }}}', open(final).read()))
html.close()