diff -r 6b25660d5bbf -r 122b02f4f292 GettingEmscriptenToWork.wiki --- a/GettingEmscriptenToWork.wiki Fri May 11 16:20:36 2012 +0000 +++ b/GettingEmscriptenToWork.wiki Fri May 11 16:29:45 2012 +0000 @@ -12,23 +12,25 @@ Be sure to set up the correct path in ~/.emscripten. The default paths are mostly not suitable for you. -Building llvm 3.0 from source has one big advantage since you can point the LLVM_ROOT to where you built it, which won't affect your local version (if it is not 3.0). +Building llvm 3.0 from source has one big advantage since you can point the LLVM_ROOT to where you build it, which won't affect your local version (if it is not 3.0). = Potential problems = -#1 Make sure your node.js is the latest version, earlier versions won't work for some reasons; - -#2 Make sure the version of your llvm and clang is exactly 3.0. Lower versions won't compile and higher versions may fail in some cases due to the removal of llvm-ld. For Ubuntu users, 11.10 doesn't have pre-built llvm 3.0 packages so you have to build from source files. I haven't tried llvm 3.1 (which should work in theory), but to make it less troublesome, llvm 3.0 is recommended. + # Make sure your node.js is the latest version, earlier versions won't work for some reasons; + # Make sure the version of your llvm and clang is exactly 3.0. Lower versions won't compile and higher versions may fail in some cases due to the removal of llvm-ld. For Ubuntu users, 11.10 doesn't have pre-built llvm 3.0 packages so you have to build from source files. I haven't tried llvm 3.1 (which should work in theory), but to make it less troublesome, llvm 3.0 is recommended. = How to get llvm and clang 3.0 = -If you can checkout through svn, follow the official guide (be sure the checkout release_30 branch): -http://llvm.org/docs/GettingStarted.html +If you can checkout through svn, follow the official guide (checkout release_30 branch): + +http://llvm.org/docs/GettingStarted.htm If you cannot checkout through svn for some network issues, you can find git mirrors in github here (which should work for everyone): https://github.com/llvm-mirror/llvm (checkout release_30 branch) + https://github.com/llvm-mirror/clang (checkout release_30 branch) + https://github.com/llvm-mirror/compiler-rt (checkout release_30 branch) Follow the official guide to build from source code (http://llvm.org/docs/GettingStarted.html). @@ -41,7 +43,7 @@ (Assume that you are in the emscripten root directory, where you can see the 'emcc' file) -#1 hello world +1. *hello world* ./emcc tests/hello_world.cpp node a.out.js @@ -51,13 +53,13 @@ If you want to have it run in browsers, you can type this (as in official tutorial): ./emcc tests/hello_world_sdl.cpp -o hello.html -#2 get the glgears to work in browsers +2. *get the glgears to work in browsers* ./emcc tests/hello_world_gles.c -o hello_world_gles.html llvm 3.1+ won't compile this demo. The reason is that this demo uses malloc which has to been compiled first from dlmalloc. However emscripten uses llvm-ld as the linker, which has been removed in llvm 3.1+, and the result is that you will encounter some strange error messages saying that "no such file or directory". If you got this message, check your llvm and clang version. -#3 get the file system to work +3. *get the file system to work* ./emcc --preload-file hello_world_file.txt tests/hello_world_file.c -o hello_world_file.html