From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCG4h-0004a3-SV for qemu-devel@nongnu.org; Sun, 03 Mar 2013 16:04:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCG4g-00058r-N7 for qemu-devel@nongnu.org; Sun, 03 Mar 2013 16:04:03 -0500 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:34097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCG4g-00058X-5i for qemu-devel@nongnu.org; Sun, 03 Mar 2013 16:04:02 -0500 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Mar 2013 06:59:43 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 9F2692CE804A for ; Mon, 4 Mar 2013 08:03:46 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r23Kp0J846334036 for ; Mon, 4 Mar 2013 07:51:04 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r23L3gsL031009 for ; Mon, 4 Mar 2013 08:03:42 +1100 From: Anthony Liguori In-Reply-To: <7aa6a5e5b2f013994380033374deec4370dea9e5.1362303363.git.blauwirbel@gmail.com> References: <7aa6a5e5b2f013994380033374deec4370dea9e5.1362303363.git.blauwirbel@gmail.com> Date: Sun, 03 Mar 2013 15:03:32 -0600 Message-ID: <877glo9owr.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] build: compile gtk.c with special CFLAGS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl , qemu-devel@nongnu.org Blue Swirl writes: > Compile gtk.c with special CFLAGS instead of disabling -Werror globally. > > Signed-off-by: Blue Swirl I thought Kevin's pragma trick solved this problem? Are you attempting to avoid disabling Werror when prgram isn't available? That seems to defeat the purpose of doing the pragma thing to begin with. Regards, Anthony Liguori > --- > configure | 12 +++++++++++- > ui/Makefile.objs | 2 +- > 2 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 19738ac..2a043d6 100755 > --- a/configure > +++ b/configure > @@ -3139,6 +3139,7 @@ fi > # the build doesn't fail anyway. > > pragma_disable_unused_but_set=no > +gtk_special_cflags=no > cat > $TMPC << EOF > #pragma GCC diagnostic ignored "-Wunused-but-set-variable" > #pragma GCC diagnostic ignored "-Wstrict-prototypes" > @@ -3150,7 +3151,7 @@ EOF > if compile_prog "-Werror" "" ; then > pragma_diagnostic_available=yes > else > - werror=no > + gtk_special_cflags=yes > fi > > ######################################## > @@ -3845,6 +3846,15 @@ echo "WINDRES=$windres" >> $config_host_mak > echo "LIBTOOL=$libtool" >> $config_host_mak > echo "CFLAGS=$CFLAGS" >> $config_host_mak > echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak > +if test "$gtk_special_cflags" = "yes"; then > + # Our compiler doesn't support #pragmas to suppress warnings and GTK > + # can't be fixed, so compile GTK files with special CFLAGS > + echo "GTK_SPECIAL_CFLAGS=$QEMU_CFLAGS" | \ > + sed -e 's/-Wstrict-prototypes//g' \ > + -e 's/-Wunused-but-set-variable//g' >> $config_host_mak > +else > + echo "GTK_SPECIAL_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak > +fi > echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak > if test "$sparse" = "yes" ; then > echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak > diff --git a/ui/Makefile.objs b/ui/Makefile.objs > index 6ddc0de..c9aa1e6 100644 > --- a/ui/Makefile.objs > +++ b/ui/Makefile.objs > @@ -19,4 +19,4 @@ $(obj)/sdl.o $(obj)/sdl_zoom.o: QEMU_CFLAGS += $(SDL_CFLAGS) > > $(obj)/cocoa.o: $(SRC_PATH)/$(obj)/cocoa.m > > -$(obj)/gtk.o: QEMU_CFLAGS += $(GTK_CFLAGS) $(VTE_CFLAGS) > +$(obj)/gtk.o: QEMU_CFLAGS = $(GTK_SPECIAL_CFLAGS) $(GTK_CFLAGS) $(VTE_CFLAGS) > -- > 1.7.2.5