diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-07 19:16:17 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-10-07 19:16:17 +0000 |
commit | 03b4fe7de226a54540a487a0dbd4c749c5d1c2af (patch) | |
tree | 685cba37bb3d7362238395236e4d11f9c8897ca6 | |
parent | 797d5db002ad4c16b957bae3192e3d819c5c792b (diff) |
Add sparse checker support to the build system (Gerd Hoffman)
This adds support for running the sparse checker during the build
process. Left it off by default for now, build becomes very noisy with
sparse checking turned on as it has to complain alot (partly even in the
system headers!). The qemu code base needs quite some cleanups before
we should consider turning it on by default.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5440 c046a42c-6fe2-441c-8c8c-71466251a162
-rwxr-xr-x | configure | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -85,6 +85,7 @@ case "$cpu" in ;; esac gprof="no" +sparse="no" bigendian="no" mingw32="no" EXESUF="" @@ -285,6 +286,10 @@ for opt do ;; --audio-drv-list=*) audio_drv_list="$optarg" ;; + --enable-sparse) sparse="yes" + ;; + --disable-sparse) sparse="no" + ;; --disable-vnc-tls) vnc_tls="no" ;; --disable-slirp) slirp="no" @@ -422,6 +427,7 @@ echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" +echo " --disable-sparse disable sparse checker" echo " --disable-werror disable compilation abort on warning" echo " --disable-sdl disable SDL" echo " --enable-cocoa enable COCOA (Mac OS X only)" @@ -532,6 +538,10 @@ EOF fi fi +if test ! -x "$(which cgcc 2>/dev/null)"; then + sparse="no" +fi + # # Solaris specific configure tool chain decisions # @@ -987,6 +997,7 @@ echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" echo "gprof enabled $gprof" +echo "sparse enabled $sparse" echo "profiler $profiler" echo "static build $static" echo "-Werror enabled $werror" @@ -1135,6 +1146,11 @@ case "$cpu" in exit 1 ;; esac +if test "$sparse" = "yes" ; then + echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_mak + echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_mak + echo "CFLAGS += -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-non-pointer-null" >> $config_mak +fi if test "$bigendian" = "yes" ; then echo "WORDS_BIGENDIAN=yes" >> $config_mak echo "#define WORDS_BIGENDIAN 1" >> $config_h |