Skip to content

Instantly share code, notes, and snippets.

@jeromewu
Last active November 27, 2020 01:27
Show Gist options
  • Select an option

  • Save jeromewu/8a4b13ecb0c23aa826b68d9814102aee to your computer and use it in GitHub Desktop.

Select an option

Save jeromewu/8a4b13ecb0c23aa826b68d9814102aee to your computer and use it in GitHub Desktop.
#!/bin/bash -x
# verify Emscripten version
emcc -v
# configure FFMpeg with Emscripten
CFLAGS="-s USE_PTHREADS"
LDFLAGS="$CFLAGS -s INITIAL_MEMORY=33554432" # 33554432 bytes = 32 MB
ARGS=(
--target-os=none # use none to prevent any os specific configurations
--arch=x86_32 # use x86_32 to achieve minimal architectural optimization
--enable-cross-compile # enable cross compile
--disable-x86asm # disable x86 asm
--disable-inline-asm # disable inline asm
--extra-cflags="$CFLAGS"
--extra-cxxflags="$CFLAGS"
--extra-ldflags="$LDFLAGS"
--nm="llvm-nm"
--ar=emar
--ranlib=emranlib
--cc=emcc
--cxx=em++
--objcc=emcc
--dep-cc=emcc
)
emconfigure ./configure "${ARGS[@]}"
# build ffmpeg.wasm
emmake make -j4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment