docs/README-emscripten.md
author Sam Lantinga
Sun, 13 Aug 2017 18:12:06 -0700
changeset 11263 f85618f8ba81
parent 10958 92d837180433
permissions -rw-r--r--
Fixed bug 2812 - Make libSDL2main.a usable on Android via a dummy symbol

Jonas Kulla

This eliminates the need to manually compile in SDL_main_android.c.
Instead, add "-lSDL2main -Wl,-u,SDL_main_dummy" when linking.

I don't know how the nkd-build process works, but unless it was
for some reason linking libSDL2main.a it should be unaffected.
     1 Emscripten
     2 ================================================================================
     3 
     4 Build:
     5 
     6     $ mkdir build
     7     $ cd build
     8     $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2"
     9     $ emmake make
    10 
    11 Or with cmake:
    12 
    13     $ mkdir build
    14     $ cd build
    15     $ emcmake cmake ..
    16     $ emmake make
    17 
    18 To build one of the tests:
    19 
    20     $ cd test/
    21     $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
    22 
    23 Uses GLES2 renderer or software
    24 
    25 Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
    26 
    27 SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
    28 
    29     $ EMCONFIGURE_JS=1 emconfigure ../configure
    30     build as usual...
    31 
    32 SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
    33 
    34     $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
    35     build as usual...