Skip to content

Latest commit

 

History

History
executable file
·
77 lines (60 loc) · 1.87 KB

emscripten-buildbot.sh

File metadata and controls

executable file
·
77 lines (60 loc) · 1.87 KB
 
Jan 7, 2017
Jan 7, 2017
3
4
5
6
if [ -z "$SDKDIR" ]; then
SDKDIR="/emsdk_portable"
fi
7
8
9
ENVSCRIPT="$SDKDIR/emsdk_env.sh"
if [ ! -f "$ENVSCRIPT" ]; then
echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
Jan 7, 2017
Jan 7, 2017
10
echo "ERROR: Set the \$SDKDIR environment variable to override this." 1>&2
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
exit 1
fi
TARBALL="$1"
if [ -z $1 ]; then
TARBALL=sdl-emscripten.tar.xz
fi
cd `dirname "$0"`
cd ..
SDLBASE=`pwd`
if [ -z "$MAKE" ]; then
OSTYPE=`uname -s`
if [ "$OSTYPE" == "Linux" ]; then
NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
let NCPU=$NCPU+1
elif [ "$OSTYPE" = "Darwin" ]; then
NCPU=`sysctl -n hw.ncpu`
elif [ "$OSTYPE" = "SunOS" ]; then
NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
else
NCPU=1
fi
if [ -z "$NCPU" ]; then
NCPU=1
elif [ "$NCPU" = "0" ]; then
NCPU=1
fi
MAKE="make -j$NCPU"
fi
echo "\$MAKE is '$MAKE'"
echo "Setting up Emscripten SDK environment..."
source "$ENVSCRIPT"
echo "Setting up..."
set -x
cd "$SDLBASE"
rm -rf buildbot
mkdir buildbot
pushd buildbot
echo "Configuring..."
Apr 2, 2017
Apr 2, 2017
58
emconfigure ../configure --host=asmjs-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 $?
59
60
echo "Building..."
Sep 6, 2016
Sep 6, 2016
61
emmake $MAKE || exit $?
62
63
echo "Moving things around..."
Sep 6, 2016
Sep 6, 2016
64
65
emmake $MAKE install || exit $?
66
67
68
69
70
71
72
73
74
75
76
# Fix up a few things to a real install path
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
mkdir -p ./usr
mv ./emscripten-sdl2-installed ./usr/local
popd
tar -cJvvf $TARBALL -C buildbot usr
rm -rf buildbot
exit 0
# end of emscripten-buildbot.sh ...