From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KnI2g-0001N3-J0 for qemu-devel@nongnu.org; Tue, 07 Oct 2008 15:16:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KnI2e-0001MD-Ul for qemu-devel@nongnu.org; Tue, 07 Oct 2008 15:16:22 -0400 Received: from [199.232.76.173] (port=34944 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KnI2e-0001Lc-IE for qemu-devel@nongnu.org; Tue, 07 Oct 2008 15:16:20 -0400 Received: from savannah.gnu.org ([199.232.41.3]:46483 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KnI2c-0005Xy-US for qemu-devel@nongnu.org; Tue, 07 Oct 2008 15:16:19 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KnI2c-0004mB-BX for qemu-devel@nongnu.org; Tue, 07 Oct 2008 19:16:18 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KnI2c-0004m7-5K for qemu-devel@nongnu.org; Tue, 07 Oct 2008 19:16:18 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Tue, 07 Oct 2008 19:16:18 +0000 Subject: [Qemu-devel] [5440] Add sparse checker support to the build system (Gerd Hoffman) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5440 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5440 Author: aliguori Date: 2008-10-07 19:16:17 +0000 (Tue, 07 Oct 2008) Log Message: ----------- 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 Modified Paths: -------------- trunk/configure Modified: trunk/configure =================================================================== --- trunk/configure 2008-10-07 19:12:13 UTC (rev 5439) +++ trunk/configure 2008-10-07 19:16:17 UTC (rev 5440) @@ -85,6 +85,7 @@ ;; esac gprof="no" +sparse="no" bigendian="no" mingw32="no" EXESUF="" @@ -285,6 +286,10 @@ ;; --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 " --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 @@ 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 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 @@ 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