Skip to content

Instantly share code, notes, and snippets.

@rikvermeer
Last active August 31, 2022 06:18
Show Gist options
  • Save rikvermeer/0caa80f7c507cd119a54ba0498a4ca84 to your computer and use it in GitHub Desktop.
Save rikvermeer/0caa80f7c507cd119a54ba0498a4ca84 to your computer and use it in GitHub Desktop.
Emscripten compilation
#example for making jq
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
. ~/workspace/emsdk/emsdk_env.sh
autoreconf -fi
emconfigure ./configure
emmake make LDFLAGS=-all-static
#emcc -O2 jq.obj -o jq.js -s ERROR_ON_UNDEFINED_SYMBOLS=0
emcc -O3 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE_INSTANCE=1 -s EXPORT_NAME="jq" -s WASM=1 --pre-js ./pre.js --post-js ./post.js jq.o -o ./jq.wasm.js -s ERROR_ON_UNDEFINED_SYMBOLS=0
#Is this the autoreconf -if alternative?
#Run “autoscan”.
#Rename “configure.scan” to “configure.ac”
#Run “autoheader”.
#Run “autoconf”.
#“./configure”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment