Permalink
Browse files

Updated build script.

  • Loading branch information...
1 parent 48f9d33 commit 0a43bed0c707897dfd634f371640f964e8e94d1d @max99x max99x committed Sep 13, 2011
Showing with 14 additions and 15 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 emscripten
  3. +1 −7 entry_point.js
  4. +9 −8 makeruby
View
3 .gitmodules
@@ -0,0 +1,3 @@
+[submodule "emscripten"]
+ path = emscripten
+ url = git@github.com:max99x/emscripten.git
1 emscripten
@@ -0,0 +1 @@
+Subproject commit c5e5c90cd111c08b3d91d1bc89ba7d33a308cbc7
View
8 entry_point.js
@@ -23,13 +23,7 @@ this['Ruby'] = {
'eval': function(command) {
if (!this.isInitialized) throw new Error('Ruby runtime not initialized.');
var commandPtr = this.allocateString(command);
- try {
- var result = _rb_eval_string(commandPtr);
- } catch (e) {
- // Null exceptions are side effects from the setjmp conversion and are
- // used just to unwind the stack. We can ignore them.
- if (e !== 0) throw e;
- }
+ var result = _rb_eval_string(commandPtr);
_free(commandPtr);
return result;
},
View
17 makeruby
@@ -1,12 +1,13 @@
#!/bin/bash
-EMSCRIPTEN_ROOT=/home/max/emscripten-workspace/emscripten
-EMMAKEN=$EMSCRIPTEN_ROOT/tools/emmakenxx.py
-LLVM_DIS=/home/max/emscripten-workspace/llvm-build/Release/bin/llvm-dis
CLOSURE_JAR=/home/max/emscripten-workspace/closure/build/compiler.jar
FLAGS=" -fno-operator-names -fpermissive"
RUBY_LIB_PATH=lib
-RUN_CLOSURE=0
+RUN_CLOSURE=1
+RELOOP=0
+
+EMMAKEN=`pwd`/emscripten/tools/emmakenxx.py
+EMSCRIPTEN=`pwd`/emscripten/emscripten.py
set -e
@@ -16,11 +17,10 @@ echo 'Compiling to LLVM...'
CFLAGS=$FLAGS RANLIB=$EMMAKEN AR=$EMMAKEN CXX=$EMMAKEN CC=$EMMAKEN ./configure --without-pthread
patch config.h < ../config.h.patch
make miniruby
-$LLVM_DIS --show-annotations libruby-static.a
echo 'Running Emscripten...'
-$EMSCRIPTEN_ROOT/emscripten.py \
- libruby-static.a.ll \
+$EMSCRIPTEN \
+ libruby-static.a.bc \
-m \
-O \
-o ruby.js \
@@ -30,7 +30,8 @@ $EMSCRIPTEN_ROOT/emscripten.py \
-s INVOKE_RUN=0 \
-s SAFE_HEAP=0 \
-s ASSERTIONS=0 \
- -s OPTIMIZE=1
+ -s OPTIMIZE=1 \
+ -s RELOOP=$RELOOP
echo 'Touching up...'
mkdir -p ../dist

0 comments on commit 0a43bed

Please sign in to comment.