TeaWeb/asm/make_opus.sh

16 lines
696 B
Bash
Raw Normal View History

2018-04-24 13:24:05 +00:00
#!/usr/bin/env bash
2018-08-04 17:12:23 +00:00
if ! [ -d generated ]; then
mkdir generated
fi
2018-04-24 13:24:05 +00:00
OPUS_FN="'_free','_malloc','_opus_strerror','_opus_get_version_string','_opus_encoder_get_size','_opus_encoder_init','_opus_encode','_opus_encode_float','_opus_encoder_ctl','_opus_decoder_get_size','_opus_decoder_init','_opus_decode','_opus_decode_float','_opus_decoder_ctl','_opus_packet_get_nb_samples'"
2018-05-07 09:51:50 +00:00
cd libraries/opus/
2018-04-24 13:24:05 +00:00
git checkout v1.1.2
./autogen.sh
emconfigure ./configure --disable-extra-programs --disable-doc --disable-rtcd
emmake make
cd ../../
2018-05-07 09:51:50 +00:00
emcc -o generated/libopus.js -O3 --memory-init-file 0 --closure 1 -s NO_FILESYSTEM=1 -s MODULARIZE=1 -s EXPORTED_FUNCTIONS="[$OPUS_FN]" libraries/opus/.libs/libopus.a
2018-04-24 13:24:05 +00:00