Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added buildbot-emscripten.sh, fixed up some minor things in buildbot-…
…os2.sh.
  • Loading branch information
icculus committed Jul 9, 2017
1 parent d1f8c9d commit bbd1fd4
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 7 deletions.
72 changes: 72 additions & 0 deletions extras/buildbot-emscripten.sh
@@ -0,0 +1,72 @@
#!/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'"

echo "Setting up Emscripten SDK environment..."
source "$ENVSCRIPT"

echo "Setting up..."
set -x
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..."
emmake $MAKE || exit $?

rm -rf "$TARBALL" physfs-emscripten
mkdir -p physfs-emscripten
echo "Archiving to '$TARBALL' ..."
( cp ../src/physfs.h libphysfs.a physfs-emscripten && tar -cJvvf "$TARBALL" physfs-emscripten ) || exit 1
echo "Done."

exit 0

# end of emscripten-buildbot.sh ...

15 changes: 8 additions & 7 deletions extras/buildbot-os2.sh
Expand Up @@ -21,6 +21,9 @@
set -e

ZIPFILE="$1"
if [ -z $ZIPFILE ]; then
ZIPFILE=physfs-os2.zip
fi

export WATCOM="/usr/local/share/watcom"
export PATH="$PATH:$WATCOM/binl"
Expand Down Expand Up @@ -66,13 +69,11 @@ fi

if [ "$OKAY" == "1" ]; then
echo 1>&2 "Build succeeded."
if [ ! -z "$ZIPFILE" ]; then
rm -rf "$ZIPFILE" physfs-os2
mkdir -p physfs-os2
echo "Zipping to '$ZIPFILE' ..."
( cp ../src/physfs.h physfs.lib physfs-os2 && zip -9r "$ZIPFILE" physfs-os2 ) || exit 1
echo "Done."
fi
rm -rf "$ZIPFILE" physfs-os2
mkdir -p physfs-os2
echo "Zipping to '$ZIPFILE' ..."
( cp ../src/physfs.h physfs.lib physfs-os2 && zip -9r "$ZIPFILE" physfs-os2 ) || exit 1
echo "Done."
exit 0
else
echo 1>&2 "Build failed."
Expand Down

0 comments on commit bbd1fd4

Please sign in to comment.