diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-28 21:29:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-28 21:29:02 -0800 |
commit | 687b8cfa3d105a634b3c9cfbc5fc287f1517fae3 (patch) | |
tree | eea2952d7673296ba6a8cd2384061fc3ad270473 /emcc | |
parent | c516fa7758636e15a7077c658db3c74533c7ee38 (diff) | |
parent | b6ebeed2cfcebb220f2ce700c7cbe484e62cd2e2 (diff) |
Merge branch 'master' into llvmopts
Diffstat (limited to 'emcc')
-rwxr-xr-x | emcc | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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() |