[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] build: compile gtk.c with special CFLAGS
From: |
Blue Swirl |
Subject: |
[Qemu-devel] [PATCH] build: compile gtk.c with special CFLAGS |
Date: |
Sun, 3 Mar 2013 09:36:23 +0000 |
Compile gtk.c with special CFLAGS instead of disabling -Werror globally.
Signed-off-by: Blue Swirl <address@hidden>
---
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
- [Qemu-devel] [PATCH] build: compile gtk.c with special CFLAGS,
Blue Swirl <=