From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH v3 06/15] do not pass bogus $(SRC_PATH) include paths to cc during configure
Date: Thu, 23 Dec 2010 11:43:53 +0100 [thread overview]
Message-ID: <1293101042-13121-7-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1293101042-13121-1-git-send-email-pbonzini@redhat.com>
Non-existent -I paths are dropped silently by the compiler, but still
it is not polite to pass bogus options. Configure-time tests do not
need any include files from the source path, so only include -I flags
at make time (when they're properly expanded).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 19 +++++++++++--------
rules.mak | 6 +++---
tests/Makefile | 3 ++-
3 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/configure b/configure
index 93b5765..d5ae996 100755
--- a/configure
+++ b/configure
@@ -217,7 +217,7 @@ QEMU_CFLAGS="-Wall -Wundef -Wendif-labels -Wwrite-strings -Wmissing-prototypes $
QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS"
QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS"
QEMU_CFLAGS="-D_FORTIFY_SOURCE=2 $QEMU_CFLAGS"
-QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
+QEMU_INCLUDES="-I. -I\$(SRC_PATH)"
LDFLAGS="-g $LDFLAGS"
check_define() {
@@ -2513,7 +2513,7 @@ if test $profiler = "yes" ; then
fi
if test "$slirp" = "yes" ; then
echo "CONFIG_SLIRP=y" >> $config_host_mak
- QEMU_CFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CFLAGS"
+ QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES"
fi
if test "$vde" = "yes" ; then
echo "CONFIG_VDE=y" >> $config_host_mak
@@ -2743,6 +2743,7 @@ echo "LD=$ld" >> $config_host_mak
echo "WINDRES=$windres" >> $config_host_mak
echo "CFLAGS=$CFLAGS" >> $config_host_mak
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
+echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
if test "$sparse" = "yes" ; then
echo "CC := REAL_CC=\"\$(CC)\" cgcc" >> $config_host_mak
echo "HOST_CC := REAL_CC=\"\$(HOST_CC)\" cgcc" >> $config_host_mak
@@ -3051,19 +3052,20 @@ fi
# generate QEMU_CFLAGS/LDFLAGS for targets
cflags=""
+includes=""
ldflags=""
if test "$ARCH" = "sparc64" ; then
- cflags="-I\$(SRC_PATH)/tcg/sparc $cflags"
+ includes="-I\$(SRC_PATH)/tcg/sparc $includes"
elif test "$ARCH" = "s390x" ; then
- cflags="-I\$(SRC_PATH)/tcg/s390 $cflags"
+ includes="-I\$(SRC_PATH)/tcg/s390 $includes"
elif test "$ARCH" = "x86_64" ; then
- cflags="-I\$(SRC_PATH)/tcg/i386 $cflags"
+ includes="-I\$(SRC_PATH)/tcg/i386 $includes"
else
- cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
+ includes="-I\$(SRC_PATH)/tcg/\$(ARCH) $includes"
fi
-cflags="-I\$(SRC_PATH)/tcg $cflags"
-cflags="-I\$(SRC_PATH)/fpu $cflags"
+includes="-I\$(SRC_PATH)/tcg $includes"
+includes="-I\$(SRC_PATH)/fpu $includes"
if test "$target_user_only" = "yes" ; then
libdis_config_mak=libdis-user/config.mak
@@ -3188,6 +3190,7 @@ fi
echo "LDFLAGS+=$ldflags" >> $config_target_mak
echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
+echo "QEMU_INCLUDES+=$includes" >> $config_target_mak
done # for target in $targets
diff --git a/rules.mak b/rules.mak
index 6dac777..738eec3 100644
--- a/rules.mak
+++ b/rules.mak
@@ -15,13 +15,13 @@ MAKEFLAGS += -rR
QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
%.o: %.c
- $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
+ $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
%.o: %.S
- $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
+ $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
%.o: %.m
- $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
+ $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
diff --git a/tests/Makefile b/tests/Makefile
index e43ec70..9ded4b7 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -7,7 +7,8 @@ QEMU=../i386-linux-user/qemu-i386
QEMU_X86_64=../x86_64-linux-user/qemu-x86_64
CC_X86_64=$(CC_I386) -m64
-CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I..
+QEMU_INCLUDES += -I..
+CFLAGS=-Wall -O2 -g -fno-strict-aliasing
#CFLAGS+=-msse2
LDFLAGS=
--
1.7.3.2
next prev parent reply other threads:[~2010-12-23 10:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-23 10:43 [Qemu-devel] [PATCH v3 00/15] preparation for autoconfy configure script Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 01/15] default compilation tools to environment variables Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 02/15] default make and install " Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 03/15] move feature variables to the top Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 04/15] fix sparse support (?) Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 05/15] test cc with the complete set of chosen flags Paolo Bonzini
2010-12-23 10:43 ` Paolo Bonzini [this message]
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 07/15] provide portable HOST_LONG_BITS test Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 08/15] fix spelling of $pkg_config, move default together with other cross tools Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 09/15] do not default to non-prefixed pkg-config when cross compiling Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 10/15] reorganize sdl-config tests Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 11/15] move "ln -sf" emulation to a function Paolo Bonzini
2010-12-23 10:43 ` [Qemu-devel] [PATCH v3 12/15] remove source_path_used Paolo Bonzini
2010-12-23 10:44 ` [Qemu-devel] [PATCH v3 13/15] move --srcdir detection earlier Paolo Bonzini
2010-12-23 10:44 ` [Qemu-devel] [PATCH v3 14/15] remove HOST_CC mention from roms/{sea, vga}bios/config.mak Paolo Bonzini
2010-12-23 10:44 ` [Qemu-devel] [PATCH v3 15/15] make trace options use autoconfy names Paolo Bonzini
2011-01-14 9:58 ` [Qemu-devel] Re: [PATCH v3 00/15] preparation for autoconfy configure script Paolo Bonzini
2011-01-14 17:57 ` Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293101042-13121-7-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).