checker-buildbot.sh: Use Ninja, not GNU make, and expect scan-build in $PATH.
authorRyan C. Gordon
Mon, 18 May 2020 15:52:51 -0400
changeset 138158c7bf8f29b8c
parent 13814 dc7142e7b47e
child 13816 e36f5ba110be
checker-buildbot.sh: Use Ninja, not GNU make, and expect scan-build in $PATH.
build-scripts/checker-buildbot.sh
     1.1 --- a/build-scripts/checker-buildbot.sh	Mon May 18 12:00:22 2020 -0400
     1.2 +++ b/build-scripts/checker-buildbot.sh	Mon May 18 15:52:51 2020 -0400
     1.3 @@ -5,51 +5,10 @@
     1.4  #  back to the buildmaster. You might find it useful too.
     1.5  
     1.6  # Install Clang (you already have it on Mac OS X, apt-get install clang
     1.7 -#  on Ubuntu, etc),
     1.8 -# or download checker at http://clang-analyzer.llvm.org/ and unpack it in
     1.9 -#  /usr/local ... update CHECKERDIR as appropriate.
    1.10 +#  on Ubuntu, etc), and make sure scan-build is in your $PATH.
    1.11  
    1.12  FINALDIR="$1"
    1.13  
    1.14 -CHECKERDIR="/usr/local/checker-279"
    1.15 -if [ ! -d "$CHECKERDIR" ]; then
    1.16 -    echo "$CHECKERDIR not found. Trying /usr/share/clang ..." 1>&2
    1.17 -    CHECKERDIR="/usr/share/clang/scan-build"
    1.18 -fi
    1.19 -
    1.20 -if [ ! -d "$CHECKERDIR" ]; then
    1.21 -    echo "$CHECKERDIR not found. Giving up." 1>&2
    1.22 -    exit 1
    1.23 -fi
    1.24 -
    1.25 -if [ -z "$MAKE" ]; then
    1.26 -    OSTYPE=`uname -s`
    1.27 -    if [ "$OSTYPE" == "Linux" ]; then
    1.28 -        NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
    1.29 -        let NCPU=$NCPU+1
    1.30 -    elif [ "$OSTYPE" = "Darwin" ]; then
    1.31 -        NCPU=`sysctl -n hw.ncpu`
    1.32 -    elif [ "$OSTYPE" = "SunOS" ]; then
    1.33 -        NCPU=`/usr/sbin/psrinfo |wc -l |sed -e 's/^ *//g;s/ *$//g'`
    1.34 -    else
    1.35 -        NCPU=1
    1.36 -    fi
    1.37 -
    1.38 -    if [ -z "$NCPU" ]; then
    1.39 -        NCPU=1
    1.40 -    elif [ "$NCPU" = "0" ]; then
    1.41 -        NCPU=1
    1.42 -    fi
    1.43 -
    1.44 -    MAKE="make -j$NCPU"
    1.45 -fi
    1.46 -
    1.47 -echo "\$MAKE is '$MAKE'"
    1.48 -
    1.49 -# Unset $MAKE so submakes don't use it.
    1.50 -MAKECOMMAND="$MAKE"
    1.51 -unset MAKE
    1.52 -
    1.53  set -x
    1.54  set -e
    1.55  
    1.56 @@ -68,13 +27,13 @@
    1.57  # The -Wno-liblto is new since our checker-279 upgrade, I think; checker otherwise warns "libLTO.dylib relative to clang installed dir not found"
    1.58  
    1.59  # You might want to do this for CMake-backed builds instead...
    1.60 -PATH="$CHECKERDIR/bin:$PATH" scan-build -o analysis cmake -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
    1.61 +scan-build -o analysis cmake -G Ninja -Wno-dev -DSDL_STATIC=OFF -DCMAKE_BUILD_TYPE=Debug -DASSERTIONS=enabled -DCMAKE_C_FLAGS="-Wno-deprecated-declarations" -DCMAKE_SHARED_LINKER_FLAGS="-Wno-liblto" ..
    1.62  
    1.63  # ...or run configure without the scan-build wrapper...
    1.64  #CC="$CHECKERDIR/libexec/ccc-analyzer" CFLAGS="-O0 -Wno-deprecated-declarations" LDFLAGS="-Wno-liblto" ../configure --enable-assertions=enabled
    1.65  
    1.66  rm -rf analysis
    1.67 -PATH="$CHECKERDIR/bin:$PATH" scan-build -o analysis $MAKECOMMAND
    1.68 +scan-build -o analysis ninja
    1.69  
    1.70  if [ `ls -A analysis |wc -l` == 0 ] ; then
    1.71      mkdir analysis/zarro