docs/README-emscripten.md
changeset 9302 2ddb65f75084
parent 9301 7377a9a3aed6
child 9782 fcf237e5e834
equal deleted inserted replaced
9301:7377a9a3aed6 9302:2ddb65f75084
       
     1 Emscripten
       
     2 ================================================================================
       
     3 
     1 Build:
     4 Build:
     2 $ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
     5 
     3 $ emmake make
     6     $ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
       
     7     $ emmake make
     4 
     8 
     5 Or with cmake:
     9 Or with cmake:
     6 $ emconfigure cmake ..
    10 
     7 $ make
    11     $ emconfigure cmake ..
       
    12     $ make
     8 
    13 
     9 To build one of the tests:
    14 To build one of the tests:
    10 $ cd test/
    15 
    11 $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    16     $ cd test/
       
    17     $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    12 
    18 
    13 Uses GLES2 renderer or software
    19 Uses GLES2 renderer or software
    14 
    20 
    15 tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
    21 tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
    16 
    22 
    17 Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    23 Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    18 
    24 
    19 SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/)
    25 SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/)
       
    26 
    20     $ EMCONFIGURE_JS=1 emconfigure ../configure
    27     $ EMCONFIGURE_JS=1 emconfigure ../configure
    21     build as usual...
    28     build as usual...
    22 
    29 
    23 SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
    30 SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
       
    31 
    24     $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    32     $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    25     build as usual...
    33     build as usual...
    26