docs/README-emscripten.md
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 26 Jun 2015 20:11:41 +0200
changeset 9782 fcf237e5e834
parent 9302 2ddb65f75084
child 10486 5bf595c48fd4
permissions -rw-r--r--
Emscripten: Corrected build instructions in documentation.

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