docs/README-emscripten.md
author Ryan C. Gordon <icculus@icculus.org>
Thu, 09 Apr 2015 22:33:39 -0400
branchiOS-improvements
changeset 9542 618662dc9e82
parent 9302 2ddb65f75084
child 9782 fcf237e5e834
permissions -rw-r--r--
Closing the iOS-improvements branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     1
Emscripten
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     2
================================================================================
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     3
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     4
Build:
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     5
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     6
    $ emconfigure ./configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2"
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
     7
    $ emmake make
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     8
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
     9
Or with cmake:
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    10
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    11
    $ emconfigure cmake ..
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    12
    $ make
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    13
9293
d0667f0e808a Fixed typos in a README.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9278
diff changeset
    14
To build one of the tests:
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    15
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    16
    $ cd test/
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    17
    $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
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
Uses GLES2 renderer or software
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    20
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    21
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
    22
9293
d0667f0e808a Fixed typos in a README.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9278
diff changeset
    23
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
    24
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    25
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/)
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    26
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    27
    $ EMCONFIGURE_JS=1 emconfigure ../configure
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    28
    build as usual...
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    29
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    30
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
9302
2ddb65f75084 Linked README-emscripten.md in README.md and added markdown formatting.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 9301
diff changeset
    31
9278
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    32
    $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
8900afb78a19 Initial merge of Emscripten port!
Ryan C. Gordon <icculus@icculus.org>
parents:
diff changeset
    33
    build as usual...