Skip to content

Commit

Permalink
Start on web build
Browse files Browse the repository at this point in the history
  • Loading branch information
zenflow committed Jun 9, 2019
1 parent 246b86c commit 7ec51f4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
language: c

before_install:
- chmod +x web/install_emsdk.sh web/build.sh

install:
- sudo apt-get update
- sudo apt-get install -y make m4 gcc g++ autoconf autoconf-archive pkg-config libtool # link-grammar required dependencies
- sudo apt-get install -y swig flex ant graphviz # link-grammar optional dependencies
- sudo ./web/install_emsdk.sh

script:
- ./autogen.sh
Expand All @@ -14,6 +18,7 @@ script:
- sudo ldconfig
- make installcheck
- echo "The needs of the many outweigh the needs of the few." | /usr/local/bin/link-parser
- sudo ./web/build.sh

notifications:
email: false
21 changes: 21 additions & 0 deletions web/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -ex
pushd "$(dirname "$0")"

pushd emsdk
source ./emsdk_env.sh
popd

pushd ..
emconfigure configure --disable-sat-solver --disable-java-bindings --disable-python-bindings
emmake make
emcc -O3 /usr/local/lib/liblink-grammar.so -o liblink-grammar.js
cat liblink-grammar.js
popd

# file PATHTO/.libs/link-parser # result: LLVM IR bitcode
# mv link-parser link-parser.bc
# emcc -O3 link-parser.bc PATHTO/liblink-grammar.so -o link-parser.js
# emcc -O3 link-parser.bc PATHTO/liblink-grammar.so -o link-parser.html

popd
13 changes: 13 additions & 0 deletions web/install_emsdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -ex

pushd "$(dirname "$0")"

git clone https://github.com/emscripten-core/emsdk.git
pushd emsdk
git pull
./emsdk install 1.38.34
./emsdk activate 1.38.34
popd

popd
4 changes: 4 additions & 0 deletions web/uninstall_emsdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -ex

rm -rf emsdk

0 comments on commit 7ec51f4

Please sign in to comment.