Preliminary build script for Emscripten
This commit is contained in:
parent
394e654c40
commit
d33d0f08e0
@ -4,6 +4,7 @@ EXTRA_DIST = \
|
|||||||
android-arm.sh \
|
android-arm.sh \
|
||||||
android-x86.sh \
|
android-x86.sh \
|
||||||
android-mips.sh \
|
android-mips.sh \
|
||||||
|
emscripten.sh \
|
||||||
ios.sh \
|
ios.sh \
|
||||||
msys2-win32.sh \
|
msys2-win32.sh \
|
||||||
msys2-win64.sh
|
msys2-win64.sh
|
||||||
|
13
dist-build/emscripten.sh
Executable file
13
dist-build/emscripten.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
export PREFIX="$(pwd)/libsodium-js"
|
||||||
|
export EXPORTED_FUNCTIONS='["_sodium_version_string"]'
|
||||||
|
export OPTFLAGS="--llvm-lto 3 -Oz"
|
||||||
|
export CFLAGS="$OPTFLAGS --pre-js=test/default/pre.js "
|
||||||
|
export LDFLAGS="-s EXPORTED_FUNCTIONS=${EXPORTED_FUNCTIONS}"
|
||||||
|
|
||||||
|
emconfigure ./configure --disable-shared --prefix="$PREFIX" && \
|
||||||
|
emmake make clean &&
|
||||||
|
emmake make install &&
|
||||||
|
emcc --closure 1 $OPTFLAGS $LDFLAGS \
|
||||||
|
"${PREFIX}/lib/libsodium.a" -o "${PREFIX}/lib/libsodium.js"
|
Loading…
Reference in New Issue
Block a user