| 1 |
#!/bin/bash |
| 2 |
set +e |
| 3 |
|
| 4 |
export CFLAGS="-O2 -fPIC -DWASM_BIGINT" |
| 5 |
export CXXFLAGS="$CFLAGS" |
| 6 |
|
| 7 |
# Build paths |
| 8 |
export CPATH="$PREFIX/include" |
| 9 |
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" |
| 10 |
export EM_PKG_CONFIG_PATH="$PKG_CONFIG_PATH" |
| 11 |
|
| 12 |
# Specific variables for cross-compilation |
| 13 |
export CHOST="wasm32-unknown-linux" # wasm32-unknown-emscripten |
| 14 |
|
| 15 |
emconfigure ./configure --host=$CHOST --prefix="$PREFIX" --enable-static --disable-shared --disable-dependency-tracking \ |
| 16 |
--disable-builddir --disable-multi-os-directory --disable-raw-api --disable-docs |
| 17 |
|
| 18 |
make install |
| 19 |
# Some forgotten headers? |
| 20 |
cp fficonfig.h $PREFIX/include/ |
| 21 |
cp include/ffi_common.h $PREFIX/include/ |