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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     1
Build:
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     2
$ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     3
$ emmake make
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     5
Or with cmake:
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     6
$ emconfigure cmake ..
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     7
$ make
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
9293
d0667f0e808a Fixed typos in a README.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9278
diff changeset
     9
To build one of the tests:
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    10
$ cd test/
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    11
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    12
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
Uses GLES2 renderer or software
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    14
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    15
tests: https://dl.dropboxusercontent.com/u/17360362/SDL2-em/index.html
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    16
9293
d0667f0e808a Fixed typos in a README.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9278
diff changeset
    17
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    18
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    19
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/)
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
    $ EMCONFIGURE_JS=1 emconfigure ../configure
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
    build as usual...
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    22
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    23
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    24
    $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
    build as usual...
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    26