3 if [ -z "$SDKDIR" ]; then
7 ENVSCRIPT="$SDKDIR/emsdk_env.sh"
8 if [ ! -f "$ENVSCRIPT" ]; then
9 echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
10 echo "ERROR: Set the \$SDKDIR environment variable to override this." 1>&2
16 TARBALL=sdl-emscripten.tar.xz
23 if [ -z "$MAKE" ]; then
25 if [ "$OSTYPE" == "Linux" ]; then
26 NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
28 elif [ "$OSTYPE" = "Darwin" ]; then
29 NCPU=`sysctl -n hw.ncpu`
30 elif [ "$OSTYPE" = "SunOS" ]; then
31 NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
36 if [ -z "$NCPU" ]; then
38 elif [ "$NCPU" = "0" ]; then
45 echo "\$MAKE is '$MAKE'"
47 echo "Setting up Emscripten SDK environment..."
58 emconfigure ../configure --host=wasm32-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$PWD/emscripten-sdl2-installed" || exit $?
61 emmake $MAKE || exit $?
63 echo "Moving things around..."
64 emmake $MAKE install || exit $?
66 # Fix up a few things to a real install path
67 perl -w -pi -e "s#$PWD/emscripten-sdl2-installed#/usr/local#g;" ./emscripten-sdl2-installed/lib/libSDL2.la ./emscripten-sdl2-installed/lib/pkgconfig/sdl2.pc ./emscripten-sdl2-installed/bin/sdl2-config
69 mv ./emscripten-sdl2-installed ./usr/local
70 tar -cJvvf $TARBALL usr
75 # end of emscripten-buildbot.sh ...