This got me curious about emscripten once again, and so I set it up on my mac. Actually very straight forward, but not a one-liner:
- install brew if you don't have it (if you're using macports, then you are on your own :-)
always good to update brew: brew update && brew outdated
[font=arial][background=transparent]brew install node spidermonkey closure-compiler yuicompressor[/background][/font]
[font=arial][background=transparent]?[/background][background=transparent]Of course, you can leave out any you already have installed (fx. I already had node and closure-compiler)[/background][/font]
- [font=arial][background=transparent]brew install llvm --with-clang[/background][/font]
- brew tap homebrew/versions
- brew install llvm33
- create symlinks to llvm33:
- cd /usr/bin
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/opt-3.3 opt
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-as-3.3 llvm-as
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-dis-3.3 llvm-dis
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-nm-3.3 llvm-nm
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/lli-3.3 lli
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-link-3.3 llvm-link
- sudo ln /usr/local/Cellar/llvm33/3.3/bin/llvm-ar-3.3 llvm-ar
- sudo ln opt /usr/local/Cellar/llvm33/3.3/bin/ocpt-3.3
- (you get the idea, basically emscripten will tell you if you forgot one)
- cd /usr/bin
- setup Python:
- cd /usr/bin
- sudo ln python python2
- sudo ln ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 python22.7
- cd /usr/bin
- setup emscripten:
- cd ~
- git clone https://github.com/kripken/emscripten.git
- cd emscripten
- ./em++ --help
- cd ~
- try it out:
- ./emcc tests/hello_world_gles.c -o hello_world_gles.html
- open hello_world_gles.html
- ./emcc tests/hello_world_gles.c -o hello_world_gles.html
When the browser open the html file, it should display this scene:
![Screen Shot 2013-10-20 at 01.25.23.png](https://uploads.gamedev.net/blogs/monthly_10_2013/blogentry-212941-0-72058100-1382225139.png)
And it is only 200k of js! Amazing :-P
Mkkl.
PS! I don't have access to IE11 yet, exciting times if it actually works!