Created
January 3, 2018 08:32
-
-
Save umeboshi2/14c321c520e801e6493c8d75f4682dde to your computer and use it in GitHub Desktop.
Porting bible-kjv to emscripten
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
# run this script with bash ./build-bible-kjv.sh | |
if ! [ -d editline ]; then | |
git clone https://github.com/umeboshi2/editline.git | |
fi | |
if ! [ -d bible-kjv ]; then | |
git clone https://github.com/umeboshi2/bible-kjv.git | |
fi | |
# build editline first | |
pushd editline | |
if ! [ -r configure ]; then | |
./autogen.sh | |
fi | |
if ! [ -r Makefile ]; then | |
PREFIX=`pwd`/../libs | |
emconfigure ./configure --disable-shared --enable-static --prefix=$PREFIX | |
fi | |
make | |
make install | |
popd | |
# build bible-kjv | |
pushd bible-kjv | |
# build things that need host tools | |
make bible.data bible.data.conc makeindex | |
# remove host objects already used but also | |
# needed in target | |
for objfile in util.o compresslib.o; do | |
if [ -r $objfile ]; then | |
rm $objfile | |
fi | |
done | |
emmake make bible | |
# we need an extension for emcc | |
cp bible bible.bc | |
# prepare files | |
mkdir -p usr/lib | |
cp bible.data bible.data.conc usr/lib | |
echo "Running emcc..." | |
emcc bible.bc ../libs/lib/libeditline.a --preload-file usr -o bible-kjv.html -s ASSERTIONS=1 | |
popd | |
# the target should be at bible-kjv/bible-kjv.html |
Author
umeboshi2
commented
Jan 3, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment