|
@@ -1,23 +1,56 @@
|
|
|
|
|
|
|
|
|
-${REAL_CC-gcc} $*
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+: ${REAL_CC:=gcc}
|
|
|
+${REAL_CC} $@
|
|
|
args=""
|
|
|
-add_next=0
|
|
|
+limits=""
|
|
|
+next_arg=0
|
|
|
+next_limit=0
|
|
|
|
|
|
-for i in $*
|
|
|
+for i in $@
|
|
|
do
|
|
|
- if [ $add_next -eq 1 ] ; then
|
|
|
+ if [ $next_arg -eq 1 ] ; then
|
|
|
+ next_arg=0
|
|
|
+ case "/$i" in
|
|
|
+ /-*) exit 0 ;;
|
|
|
+ esac
|
|
|
[ "x$args" = "x" ] && args="$i" || args="$args $i"
|
|
|
- add_next=0
|
|
|
+ continue
|
|
|
+ fi
|
|
|
+ if [ $next_limit -eq 1 ] ; then
|
|
|
+ next_limit=0
|
|
|
+ [ "x$limits" = "x" ] && limits="$i" || limits="$limits $i"
|
|
|
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 ;;
|
|
|
+ /-c) next_arg=1 ;;
|
|
|
+ /-isystem)
|
|
|
+ next_arg=1;
|
|
|
+ [ "x$args" = "x" ] && args="-I" || args="$args -I" ;;
|
|
|
+ /-I)
|
|
|
+ next_arg=1;
|
|
|
+ [ "x$args" = "x" ] && args="$i" || args="$args $i" ;;
|
|
|
+ /-I*) [ "x$args" = "x" ] && args="$i" || args="$args $i" ;;
|
|
|
+ /-D|/-U)
|
|
|
+ next_limit=1;
|
|
|
+ [ "x$limit" = "x" ] && limit="$i" || limit="$limit $i" ;;
|
|
|
+ /-D*) [ "x$limits" = "x" ] && limits="$i" || limits="$limits $i" ;;
|
|
|
+ /-s|/-S|/-dump*|/--print*|/-print*) exit 0 ;;
|
|
|
*) ;;
|
|
|
esac
|
|
|
done
|
|
|
-
|
|
|
-cppcheck $args
|
|
|
+[ -z "${CPPCHECK_LIMIT}" ] && limits=""
|
|
|
+[ -z "${args}" ] || exec cppcheck ${CPPCHECK_FLAGS} ${args} ${limits}
|