Make checker-buildbot.sh work just about anywhere Clang is installed.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 19 Mar 2014 15:25:27 -0400
changeset 8639 21093d07b958
parent 8638 d7a5c452411b
child 8640 89bab8249c74
Make checker-buildbot.sh work just about anywhere Clang is installed.
build-scripts/checker-buildbot.sh
--- a/build-scripts/checker-buildbot.sh	Wed Mar 19 13:22:09 2014 -0400
+++ b/build-scripts/checker-buildbot.sh	Wed Mar 19 15:25:27 2014 -0400
@@ -10,12 +10,16 @@
 
 # this currently expects a mercurial working copy that it can modify a little.
 
-CHECKERDIR="/usr/local/checker-276"
-
 FINALDIR="$1"
 
+CHECKERDIR="/usr/local/checker-276"
 if [ ! -d "$CHECKERDIR" ]; then
-    echo "$CHECKERDIR not found." 1>&2
+    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
 
@@ -61,7 +65,9 @@
 mkdir checker-buildbot
 cd checker-buildbot
 #cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER="$CHECKERDIR/libexec/ccc-analyzer" -DSDL_STATIC=OFF ..
-CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0" ../configure
+#CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0" ../configure
+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.