Skip to content

Latest commit

 

History

History
executable file
·
78 lines (62 loc) · 1.65 KB

buildbot-emscripten.sh

File metadata and controls

executable file
·
78 lines (62 loc) · 1.65 KB
 
1
2
3
4
5
6
7
8
9
10
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
#!/bin/bash
if [ -z "$SDKDIR" ]; then
SDKDIR="/emsdk_portable"
fi
ENVSCRIPT="$SDKDIR/emsdk_env.sh"
if [ ! -f "$ENVSCRIPT" ]; then
echo "ERROR: This script expects the Emscripten SDK to be in '$SDKDIR'." 1>&2
echo "ERROR: Set the \$SDKDIR environment variable to override this." 1>&2
exit 1
fi
TARBALL="$1"
if [ -z $1 ]; then
TARBALL=physfs-emscripten.tar.xz
fi
cd `dirname "$0"`
cd ..
PHYSFSBASE=`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'"
Jul 9, 2017
Jul 9, 2017
46
47
MAKECMD="$MAKE"
unset MAKE # prevent warnings about jobserver mode.
48
49
50
51
52
53
54
55
56
57
58
59
60
61
echo "Setting up Emscripten SDK environment..."
source "$ENVSCRIPT"
echo "Setting up..."
cd "$PHYSFSBASE"
rm -rf buildbot
mkdir buildbot
cd buildbot
echo "Configuring..."
emcmake cmake -G "Unix Makefiles" -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=MinSizeRel .. || exit $?
echo "Building..."
Jul 9, 2017
Jul 9, 2017
62
emmake $MAKECMD || exit $?
Jul 9, 2017
Jul 9, 2017
64
set -e
65
66
67
rm -rf "$TARBALL" physfs-emscripten
mkdir -p physfs-emscripten
echo "Archiving to '$TARBALL' ..."
Jul 9, 2017
Jul 9, 2017
68
69
70
71
72
cp ../src/physfs.h libphysfs.a physfs-emscripten
chmod -R a+r physfs-emscripten
chmod a+x physfs-emscripten
chmod -R go-w physfs-emscripten
tar -cJvvf "$TARBALL" physfs-emscripten
73
74
75
76
77
echo "Done."
exit 0
# end of emscripten-buildbot.sh ...