Skip to content

Commit

Permalink
Merge pull request #1377 from linas/maybe-js-fix
Browse files Browse the repository at this point in the history
Hacks to try to get javascript build to not spew errors
  • Loading branch information
linas authored Mar 12, 2024
2 parents bfb73d2 + 2e3b63d commit ff1df93
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bindings/js/build_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ emmake make clean
emmake make
popd

# TODO: Build link-grammar
# emcc -O3 ../../link-grammar/.libs/liblink-grammar.so -o liblink-grammar.js

# Build link-parser
./link-parser/build.sh

# TODO: Build link-grammar
# emcc -O3 link-grammar/.libs/liblink-grammar.so -o liblink-grammar.js

popd
4 changes: 2 additions & 2 deletions bindings/js/install_emsdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ pushd "$(dirname "$0")"
git clone https://github.com/emscripten-core/emsdk.git || true
pushd emsdk
git pull
./emsdk install 1.38.41
./emsdk activate 1.38.41
./emsdk install latest
./emsdk activate latest
popd

popd
11 changes: 9 additions & 2 deletions bindings/js/link-parser/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ rm -rf dist
mkdir dist

# Compile link-parser.js & link-parser.wasm
cp ../../../link-parser/.libs/link-parser link-parser.bc
# XXX Do we really need to do this?? It seems that a link-parser.wasm
# file was already created in the ../../../link-parser/.libs directory;
# can't we just use that? Someone who knows jas & wasm needs to fix this...
cp ../../../link-parser/link_parser-command-line.o command-line.bc
cp ../../../link-parser/link_parser-lg_readline.o lg_readline.bc
cp ../../../link-parser/link_parser-parser-utilities.o parser-utilities.bc
cp ../../../link-parser/link_parser-link-parser.o link-parser.bc
# Originally, this had `emcc liblink-grammar.so` but the .so
# is not available on Apple Mac's (I guess it's called .shlib ??)
# So change to .a which should work for all OS'es.
emcc -O3 link-parser.bc ../../../link-grammar/.libs/liblink-grammar.a \
emcc -O3 link-parser.bc command-line.bc lg_readline.bc parser-utilities.bc \
../../../link-grammar/.libs/liblink-grammar.a \
--pre-js pre.js \
-s WASM=1 \
-s ALLOW_MEMORY_GROWTH=1 \
Expand Down

0 comments on commit ff1df93

Please sign in to comment.