Browse Source

Document fastcomp setup

pull/222/head
Sami Vaarala 10 years ago
parent
commit
1f6a739737
  1. 4
      README.md
  2. 37
      doc/emscripten-status.rst

4
README.md

@ -82,6 +82,10 @@ the website, run test cases, etc:
$ cd duktape
$ make
# If you want to build dukweb.js or run Emscripten targets, you need
# to setup Emscripten fastcomp manually, see doc/emscripten-status.rst
# for step-by-step instructions.
# Run Ecmascript and API testcases, and some other tests
$ make ecmatest
$ make apitest

37
doc/emscripten-status.rst

@ -31,3 +31,40 @@ following additional options:
Since Duktape 1.3 there is support for Khronos/ES6 TypedArrays which allow
Emscripten to run better than with Duktape 1.2, and also allows use of
Emscripten fastcomp.
Setting up fastcomp for Duktape
===============================
To build dukweb.js and to use Makefile targets like ``emscriptentest`` you
need Emscripten "fastcomp". Example steps to setup emscripten:
* Compile fastcomp manually:
- https://kripken.github.io/emscripten-site/docs/building_from_source/building_fastcomp_manually_from_source.html
* Checkout emscripten::
$ cd (duktape)
$ make emscripten # duktape checkouts emscripten master
* Create a ``~/.emscripten`` file which uses your manually compiled fastcomp.
You can create a default configuration as follows::
$ cd (duktape)/emscripten
$ ./emcc # creates ~/.emscripten if it doesn't exist
Then change Emscripten to use the manually compiled fastcomp by changing
the LLVM_ROOT line in ``~/.emscripten`` to point to your fastcomp build::
LLVM_ROOT = '/home/user/myfastcomp/emscripten-fastcomp/build/Release/bin'
You should now be able to build dukweb.js and run Emscripten Makefile
targets::
$ make emscripteninceptiontest
[...]
emscripten/emcc -O2 -std=c99 -Wall --memory-init-file 0 -Idist/src dist/src/duktape.c dist/examples/hello/hello.c -o /tmp/duk-emcc-test.js
[...]
./duk /tmp/duk-emcc-test-fixed.js
Hello world!
2+3=5

Loading…
Cancel
Save