Browse Source

buildsys: add cppcheck wrapper script

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Bernhard Reutner-Fischer 13 years ago
parent
commit
9617bbc95b
1 changed files with 23 additions and 0 deletions
  1. 23 0
      extra/scripts/cppcheck.sh

+ 23 - 0
extra/scripts/cppcheck.sh

@@ -0,0 +1,23 @@
+#! /bin/sh
+
+${REAL_CC-gcc} $*
+
+args=""
+add_next=0
+
+for i in $*
+do
+  if [ $add_next -eq 1 ] ; then
+    [ "x$args" = "x" ] && args="$i" || args="$args $i"
+	add_next=0
+	continue
+  fi
+  case "/$i" in
+  /-c) add_next=1 ;;
+  /-D*|/-I*|/-inc) [ "x$args" = "x" ] && args="$i" || args="$args $i" ;;
+  /-dumpversion|/--print*) ${CC-gcc} $i ; exit 0 ;;
+  *) ;;
+  esac
+done
+
+cppcheck $args