build-scripts/emscripten-buildbot.sh
changeset 9284 f5fb020fb928
parent 9283 6723e3e133ea
child 9285 559ac7dd4ee4
equal deleted inserted replaced
9283:6723e3e133ea 9284:f5fb020fb928
     3 SDKDIR="/emsdk_portable"
     3 SDKDIR="/emsdk_portable"
     4 ENVSCRIPT="$SDKDIR/emsdk_env.sh"
     4 ENVSCRIPT="$SDKDIR/emsdk_env.sh"
     5 if [ ! -f "$ENVSCRIPT" ]; then
     5 if [ ! -f "$ENVSCRIPT" ]; then
     6    echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
     6    echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
     7    exit 1
     7    exit 1
       
     8 fi
       
     9 
       
    10 TARBALL="$1"
       
    11 if [ -z $1 ]; then
       
    12     TARBALL=sdl-emscripten.tar.xz
     8 fi
    13 fi
     9 
    14 
    10 cd `dirname "$0"`
    15 cd `dirname "$0"`
    11 cd ..
    16 cd ..
    12 SDLBASE=`pwd`
    17 SDLBASE=`pwd`
    37 
    42 
    38 echo "Setting up Emscripten SDK environment..."
    43 echo "Setting up Emscripten SDK environment..."
    39 source "$ENVSCRIPT"
    44 source "$ENVSCRIPT"
    40 
    45 
    41 echo "Setting up..."
    46 echo "Setting up..."
    42 set -e
       
    43 set -x
    47 set -x
    44 cd "$SDLBASE"
    48 cd "$SDLBASE"
    45 rm -rf buildbot
    49 rm -rf buildbot
       
    50 rm -rf emscripten-sdl2-installed
    46 mkdir buildbot
    51 mkdir buildbot
    47 cd buildbot
    52 pushd buildbot
    48 
    53 
    49 echo "Configuring..."
    54 echo "Configuring..."
    50 emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths"
    55 emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths -Wdeclaration-after-statement -Werror=declaration-after-statement" --prefix="$SDLBASE/emscripten-sdl2-installed"
    51 
    56 
    52 echo "Building..."
    57 echo "Building..."
    53 emmake $MAKE
    58 emmake $MAKE
    54 
    59 
    55 set +x
    60 echo "Moving things around..."
    56 echo "Done! The library is in $SDLBASE/buildbot/build/.libs/libSDL2.a ..."
    61 emmake $MAKE install
       
    62 mkdir -p ./usr
       
    63 mv "$SDLBASE/emscripten-sdl2-installed" ./usr/local
       
    64 popd
       
    65 tar -cJvvf $TARBALL -C buildbot usr
       
    66 rm -rf buildbot
    57 
    67 
    58 exit 0
    68 exit 0
    59 
    69 
    60 # end of emscripten-buildbot.sh ...
    70 # end of emscripten-buildbot.sh ...
    61 
    71