Added buildbot script for Emscripten port.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 24 Dec 2014 12:49:35 -0500
changeset 92836723e3e133ea
parent 9282 e3ee6ba9eae8
child 9284 f5fb020fb928
Added buildbot script for Emscripten port.
build-scripts/emscripten-buildbot.sh
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build-scripts/emscripten-buildbot.sh	Wed Dec 24 12:49:35 2014 -0500
     1.3 @@ -0,0 +1,61 @@
     1.4 +#!/bin/bash
     1.5 +
     1.6 +SDKDIR="/emsdk_portable"
     1.7 +ENVSCRIPT="$SDKDIR/emsdk_env.sh"
     1.8 +if [ ! -f "$ENVSCRIPT" ]; then
     1.9 +   echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
    1.10 +   exit 1
    1.11 +fi
    1.12 +
    1.13 +cd `dirname "$0"`
    1.14 +cd ..
    1.15 +SDLBASE=`pwd`
    1.16 +
    1.17 +if [ -z "$MAKE" ]; then
    1.18 +    OSTYPE=`uname -s`
    1.19 +    if [ "$OSTYPE" == "Linux" ]; then
    1.20 +        NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
    1.21 +        let NCPU=$NCPU+1
    1.22 +    elif [ "$OSTYPE" = "Darwin" ]; then
    1.23 +        NCPU=`sysctl -n hw.ncpu`
    1.24 +    elif [ "$OSTYPE" = "SunOS" ]; then
    1.25 +        NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
    1.26 +    else
    1.27 +        NCPU=1
    1.28 +    fi
    1.29 +
    1.30 +    if [ -z "$NCPU" ]; then
    1.31 +        NCPU=1
    1.32 +    elif [ "$NCPU" = "0" ]; then
    1.33 +        NCPU=1
    1.34 +    fi
    1.35 +
    1.36 +    MAKE="make -j$NCPU"
    1.37 +fi
    1.38 +
    1.39 +echo "\$MAKE is '$MAKE'"
    1.40 +
    1.41 +echo "Setting up Emscripten SDK environment..."
    1.42 +source "$ENVSCRIPT"
    1.43 +
    1.44 +echo "Setting up..."
    1.45 +set -e
    1.46 +set -x
    1.47 +cd "$SDLBASE"
    1.48 +rm -rf buildbot
    1.49 +mkdir buildbot
    1.50 +cd buildbot
    1.51 +
    1.52 +echo "Configuring..."
    1.53 +emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --enable-cpuinfo=false CFLAGS="-O2 -Wno-warn-absolute-paths"
    1.54 +
    1.55 +echo "Building..."
    1.56 +emmake $MAKE
    1.57 +
    1.58 +set +x
    1.59 +echo "Done! The library is in $SDLBASE/buildbot/build/.libs/libSDL2.a ..."
    1.60 +
    1.61 +exit 0
    1.62 +
    1.63 +# end of emscripten-buildbot.sh ...
    1.64 +