summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/SDL2/build-scripts/checker-buildbot.sh
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-02-27 16:28:05 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-02-27 16:53:49 +0100
commitcf6dc7d370407914020f3e623719f09c8668c692 (patch)
tree46b3416d091b4c09b50fba7ffcbd310aed032cc8 /3rdparty/SDL2/build-scripts/checker-buildbot.sh
parent64135e73f973d9b95beb0c60b65feb34fbfec64a (diff)
Placed SDL2 source since we need it on some platforms (nw)
Diffstat (limited to '3rdparty/SDL2/build-scripts/checker-buildbot.sh')
-rw-r--r--3rdparty/SDL2/build-scripts/checker-buildbot.sh93
1 files changed, 93 insertions, 0 deletions
diff --git a/3rdparty/SDL2/build-scripts/checker-buildbot.sh b/3rdparty/SDL2/build-scripts/checker-buildbot.sh
new file mode 100644
index 00000000000..682e7fbbb80
--- /dev/null
+++ b/3rdparty/SDL2/build-scripts/checker-buildbot.sh
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+# This is a script used by some Buildbot buildslaves to push the project
+# through Clang's static analyzer and prepare the output to be uploaded
+# back to the buildmaster. You might find it useful too.
+
+# Install Clang (you already have it on Mac OS X, apt-get install clang
+# on Ubuntu, etc),
+# or download checker at http://clang-analyzer.llvm.org/ and unpack it in
+# /usr/local ... update CHECKERDIR as appropriate.
+
+FINALDIR="$1"
+
+CHECKERDIR="/usr/local/checker-276"
+if [ ! -d "$CHECKERDIR" ]; then
+ echo "$CHECKERDIR not found. Trying /usr/share/clang ..." 1>&2
+ CHECKERDIR="/usr/share/clang/scan-build"
+fi
+
+if [ ! -d "$CHECKERDIR" ]; then
+ echo "$CHECKERDIR not found. Giving up." 1>&2
+ exit 1
+fi
+
+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'"
+
+set -x
+set -e
+
+cd `dirname "$0"`
+cd ..
+
+rm -rf checker-buildbot analysis
+if [ ! -z "$FINALDIR" ]; then
+ rm -rf "$FINALDIR"
+fi
+
+mkdir checker-buildbot
+cd checker-buildbot
+
+# You might want to do this for CMake-backed builds instead...
+PATH="$CHECKERDIR:$PATH" scan-build -o analysis cmake -DCMAKE_BUILD_TYPE=Debug ..
+
+# ...or run configure without the scan-build wrapper...
+#CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0" ../configure
+
+# ...but this works for our buildbots just fine (EXCEPT ON LATEST MAC OS X).
+#CFLAGS="-O0" PATH="$CHECKERDIR:$PATH" scan-build -o analysis ../configure
+
+rm -rf analysis
+PATH="$CHECKERDIR:$PATH" scan-build -o analysis $MAKE
+mv analysis/* ../analysis
+rmdir analysis # Make sure this is empty.
+cd ..
+chmod -R a+r analysis
+chmod -R go-w analysis
+find analysis -type d -exec chmod a+x {} \;
+if [ -x /usr/bin/xattr ]; then find analysis -exec /usr/bin/xattr -d com.apple.quarantine {} \; 2>/dev/null ; fi
+
+if [ ! -z "$FINALDIR" ]; then
+ mv analysis "$FINALDIR"
+else
+ FINALDIR=analysis
+fi
+
+rm -rf checker-buildbot
+
+echo "Done. Final output is in '$FINALDIR' ..."
+
+# end of checker-buildbot.sh ...
+