Browse Source

incorporate scan_build.sh in meta_builds.sh

Steffen Jaeckel 8 years ago
parent
commit
91e1d04831
2 changed files with 4 additions and 24 deletions
  1. 4 1
      meta_builds.sh
  2. 0 23
      scan_build.sh

+ 4 - 1
meta_builds.sh

@@ -33,7 +33,10 @@ function run_gcc() {
 }
 }
 
 
 function run_clang() {
 function run_clang() {
-   bash scan_build.sh "SCAN_BUILD" "$2" "$3" "$4" "$5"
+   scan_build=$(which scan-build)
+   [ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true
+   [ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build"
+   $scan_build --status-bugs make all CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5"
 
 
    make clean &>/dev/null
    make clean &>/dev/null
 
 

+ 0 - 23
scan_build.sh

@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-if [ "$TRAVIS_CI" != "" ] && [ -z "$(echo $CC | grep "clang")" ]; then
-    echo "no clang detected, early exit success"
-    exit 0
-fi
-
-if [ "$#" = "5" -a "$(echo $3 | grep -v 'makefile[.]')" = "" ]; then
-    echo "only run $0 for the regular makefile, early exit success"
-    exit 0
-fi
-
-# output version
-bash printinfo.sh
-
-make clean > /dev/null
-
-scan_build=$(which scan-build)
-[ -z "$scan_build" ] && scan_build=$(find /usr/bin/ -name 'scan-build-*' | sort -nr | head -n1) || true
-[ -z "$scan_build" ] && { echo "couldn't find clang scan-build"; exit 1; } || echo "run $scan_build"
-$scan_build --status-bugs make all CFLAGS="$2 $CFLAGS $4" EXTRALIBS="$5"