[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 07/39] do not pass bogus $(SRC_PATH) include pat
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 07/39] do not pass bogus $(SRC_PATH) include paths to cc during configure |
Date: |
Tue, 12 Oct 2010 19:09:00 +0000 |
On Tue, Oct 12, 2010 at 1:00 PM, Paolo Bonzini <address@hidden> wrote:
> 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 <address@hidden>
> ---
> configure | 19 +++++++++++--------
> rules.mak | 8 ++++----
> 2 files changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/configure b/configure
> index a8738db..cb76177 100755
> --- a/configure
> +++ b/configure
> @@ -224,7 +224,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"
Aren't the above also CPP flags?
> -QEMU_CFLAGS="-I. -I\$(SRC_PATH) $QEMU_CFLAGS"
> +QEMU_CPPFLAGS="-I. -I\$(SRC_PATH)"
> LDFLAGS="-g $LDFLAGS"
>
> check_define() {
> @@ -2419,7 +2419,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_CPPFLAGS="-I\$(SRC_PATH)/slirp $QEMU_CPPFLAGS"
> fi
> if test "$vde" = "yes" ; then
> echo "CONFIG_VDE=y" >> $config_host_mak
> @@ -2636,6 +2636,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_CPPFLAGS=$QEMU_CPPFLAGS" >> $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
> @@ -2944,19 +2945,20 @@ fi
> # generate QEMU_CFLAGS/LDFLAGS for targets
>
> cflags=""
> +cppflags=""
> ldflags=""
>
> if test "$ARCH" = "sparc64" ; then
> - cflags="-I\$(SRC_PATH)/tcg/sparc $cflags"
> + cppflags="-I\$(SRC_PATH)/tcg/sparc $cppflags"
> elif test "$ARCH" = "s390x" ; then
> - cflags="-I\$(SRC_PATH)/tcg/s390 $cflags"
> + cppflags="-I\$(SRC_PATH)/tcg/s390 $cppflags"
> elif test "$ARCH" = "x86_64" ; then
> - cflags="-I\$(SRC_PATH)/tcg/i386 $cflags"
> + cppflags="-I\$(SRC_PATH)/tcg/i386 $cppflags"
> else
> - cflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cflags"
> + cppflags="-I\$(SRC_PATH)/tcg/\$(ARCH) $cppflags"
> fi
> -cflags="-I\$(SRC_PATH)/tcg $cflags"
> -cflags="-I\$(SRC_PATH)/fpu $cflags"
> +cppflags="-I\$(SRC_PATH)/tcg $cppflags"
> +cppflags="-I\$(SRC_PATH)/fpu $cppflags"
>
> if test "$target_user_only" = "yes" ; then
> libdis_config_mak=libdis-user/config.mak
> @@ -3081,6 +3083,7 @@ fi
>
> echo "LDFLAGS+=$ldflags" >> $config_target_mak
> echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak
> +echo "QEMU_CPPFLAGS+=$cppflags" >> $config_target_mak
>
> done # for target in $targets
>
> diff --git a/rules.mak b/rules.mak
> index c843a13..007fc49 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -15,15 +15,15 @@ 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_CPPFLAGS)
> $(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_CPPFLAGS)
> $(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_CPPFLAGS)
> $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
>
> -LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
> $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
> +LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_CPPFLAGS) $(CFLAGS)
> $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
I don't think the linker will use any CPP flags.
- [Qemu-devel] [PATCH 02/39] default make and install to environment variables, (continued)
- [Qemu-devel] [PATCH 02/39] default make and install to environment variables, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 01/39] default compilation tools to environment variables, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 03/39] move feature variables to the top, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 04/39] fix sparse support (?), Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 06/39] include failed source file in config.log, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 05/39] test cc with the complete set of chosen flags, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 09/39] fix spelling of $pkg_config, move default together with other cross tools, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 07/39] do not pass bogus $(SRC_PATH) include paths to cc during configure, Paolo Bonzini, 2010/10/12
- Re: [Qemu-devel] [PATCH 07/39] do not pass bogus $(SRC_PATH) include paths to cc during configure,
Blue Swirl <=
- [Qemu-devel] [PATCH 10/39] do not default to non-prefixed pkg-config when cross compiling, Paolo Bonzini, 2010/10/12
- [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, Paolo Bonzini, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, malc, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, Paolo Bonzini, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, malc, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, Paolo Bonzini, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, malc, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, Paolo Bonzini, 2010/10/12
- Re: [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test, malc, 2010/10/12