emscripten_docker/povray_wasm/build.sh

50 lines
1.3 KiB
Bash
Raw Normal View History

2021-09-22 06:06:20 +00:00
#!/bin/bash -x
EMAIL="hi@mmcwilliams.com"
NAME="Matt McWilliams"
2021-09-22 06:10:58 +00:00
2021-11-10 04:54:38 +00:00
BOOST_ROOT="/opt/boost/stage/lib/"
CFLAGS="-pthread -DBOOST_THREAD_USE_LIB -s USE_BOOST_HEADERS=1 -s EXIT_RUNTIME=1 -s PTHREAD_POOL_SIZE=4"
2021-09-22 06:10:58 +00:00
LDFLAGS="$CFLAGS -s INITIAL_MEMORY=33554432" # 33554432 bytes = 32 MB
CONFIG_ARGS=(
--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
--disable-stripping # disable stripping
--disable-programs # disable programs build (incl. ffplay, ffprobe & ffmpeg)
--disable-doc # disable doc
--extra-cflags="$CFLAGS"
--extra-cxxflags="$CFLAGS"
--extra-ldflags="$LDFLAGS"
--nm="llvm-nm -g"
--ar=emar
--as=llvm-as
--ranlib=llvm-ranlib
--cc=emcc
--cxx=em++
--objcc=emcc
--dep-cc=emcc
)
ARGS=(
2021-09-22 06:19:48 +00:00
--with-boost-libdir=${BOOST_ROOT}
2021-09-22 06:45:29 +00:00
#LIBS="-lboost_system -lboost_thread -lboost_date_time" #libs breaks build earlier
2021-09-22 06:19:48 +00:00
COMPILED_BY="$NAME <$EMAIL>"
CC=emcc
CXX=em++
CFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS"
--host=wasm32
2021-09-22 06:10:58 +00:00
)
2021-09-22 06:06:20 +00:00
cd unix/
./prebuild.sh
cd ../
2021-09-22 06:10:58 +00:00
2021-12-23 06:17:03 +00:00
BOOST_ROOT=$BOOST_ROOT ./configure "${ARGS[@]}"
2021-09-22 06:10:58 +00:00
#emmake make -j CPPFLAGS="${CPPFLAGS}"
2021-09-22 06:06:20 +00:00
#make install