Outdated Docs > Emscripten > Setup Emscripten on Mac OS X Mountain Lion

Setup Emscripten on Mac OS X Mountain Lion

Manual for emscripten on MAC OS Mountain Lion

Default python instalation on Mountain Lion is python 2.7.2

edit cocos2d-x/external/emscripten/emcc
change
#![](/usr/bin/env python2
for

)/usr/bin/env python

or make a softlink
sudo ln -s /usr/bin/python /usr/bin/python2
Install macports
http://www.macports.org/install.php
https://distfiles.macports.org/MacPorts/MacPorts-2.1.3-10.8-MountainLion.pkg
On terminal, update macports
sudo port-v selfupdate

Install llvm-3.2
sudo port install llvm-3.2

exec on cocos2d-x dir
make -f Makefile.emscripten
And error happens
modify \$HOME/.emscripten
LLVM_ROOT = os.path.expanduser or β€˜/opt/local/bin’) # directory
make soft-link
cd /opt/local/bin
sudo ln-s llvm-nm-mp-3.2 llvm-nm
sudo ln -s llvm-dis-mp-3.2 llvm-dis
sudo ln-s llvm-as-mp-3.2 llvm-as
sudo ln -s opt-mp-3.2 opt
sudo ln-s llvm-ar-mp-3.2 llvm-ar
sudo ln -s llvm-link-mp-3.2 llvm-link
sudo ln-s clang-mp-3.2 clang
sudo ln -s clang++~~mp-3.2 clang++

Compile cocos2d-x with emscripten
rerun make -f Makefile.emscripten on cocos2d-x

Install XAMPP or MAMPP
make a link of samples/Cpp/Project/proj.emscripten/bin/release to htdocs

Congrats!

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.