2017-07-09 02:52:12 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$SDKDIR" ]; then
|
2020-05-17 05:30:16 +02:00
|
|
|
SDKDIR="/emsdk"
|
2017-07-09 02:52:12 +02:00
|
|
|
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`
|
|
|
|
|
|
|
|
echo "Setting up Emscripten SDK environment..."
|
|
|
|
source "$ENVSCRIPT"
|
|
|
|
|
|
|
|
echo "Setting up..."
|
|
|
|
cd "$PHYSFSBASE"
|
|
|
|
rm -rf buildbot
|
|
|
|
mkdir buildbot
|
|
|
|
cd buildbot
|
|
|
|
|
|
|
|
echo "Configuring..."
|
2020-05-12 06:32:00 +02:00
|
|
|
emcmake cmake -G "Ninja" -DPHYSFS_BUILD_SHARED=False -DCMAKE_BUILD_TYPE=MinSizeRel .. || exit $?
|
2017-07-09 02:52:12 +02:00
|
|
|
|
|
|
|
echo "Building..."
|
2020-05-12 19:49:46 +02:00
|
|
|
emmake cmake --build . --config MinSizeRel || exit $?
|
2017-07-09 02:52:12 +02:00
|
|
|
|
2017-07-09 04:20:43 +02:00
|
|
|
set -e
|
2017-07-09 02:52:12 +02:00
|
|
|
rm -rf "$TARBALL" physfs-emscripten
|
|
|
|
mkdir -p physfs-emscripten
|
|
|
|
echo "Archiving to '$TARBALL' ..."
|
2017-07-09 04:20:43 +02:00
|
|
|
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
|
2017-07-09 02:52:12 +02:00
|
|
|
echo "Done."
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
# end of emscripten-buildbot.sh ...
|
|
|
|
|