buildwasm.sh 443 B

12345678910111213141516171819202122232425
  1. export TOTAL_MEMORY=10485760
  2. rm *.js *.wasm
  3. export EXPORTED_FUNCTIONS="[ \
  4. '_malloc' \
  5. ,'_free' \
  6. ,'_destroyDecoder' \
  7. ,'_feedData' \
  8. ]"
  9. export LIBRARY_FUNCTIONS="[\
  10. 'malloc', \
  11. 'free' \
  12. ]"
  13. #
  14. emcc aac.c \
  15. -O3 \
  16. -s WASM=1 \
  17. -I /usr/local -lfaad -lm -L/usr/local/lib \
  18. -s TOTAL_MEMORY=${TOTAL_MEMORY} \
  19. -s DEFAULT_LIBRARY_FUNCS_TO_INCLUDE="${LIBRARY_FUNCTIONS}" \
  20. -s EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS}" \
  21. -o aac.js