docs/README-emscripten.txt
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 25 Dec 2014 22:07:15 +0100
changeset 9293 d0667f0e808a
parent 9278 8900afb78a19
permissions -rw-r--r--
Fixed typos in a README.
icculus@9278
     1
Build:
icculus@9278
     2
$ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
icculus@9278
     3
$ emmake make
icculus@9278
     4
icculus@9278
     5
Or with cmake:
icculus@9278
     6
$ emconfigure cmake ..
icculus@9278
     7
$ make
icculus@9278
     8
philipp@9293
     9
To build one of the tests:
icculus@9278
    10
$ cd test/
icculus@9278
    11
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
icculus@9278
    12
icculus@9278
    13
Uses GLES2 renderer or software
icculus@9278
    14
icculus@9278
    15
tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
icculus@9278
    16
philipp@9293
    17
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
icculus@9278
    18
icculus@9278
    19
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/)
icculus@9278
    20
    $ EMCONFIGURE_JS=1 emconfigure ../configure
icculus@9278
    21
    build as usual...
icculus@9278
    22
icculus@9278
    23
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
icculus@9278
    24
    $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
icculus@9278
    25
    build as usual...
icculus@9278
    26