qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <AANLkTim4WDXCCi5WZTb50QdAyHXQkh9owd0eoDLcbhbp@mail.gmail.com> (raw)
In-Reply-To: <1286888457-5033-8-git-send-email-pbonzini@redhat.com>

On Tue, Oct 12, 2010 at 1:00 PM, Paolo Bonzini <pbonzini@redhat.com> 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 <pbonzini@redhat.com>
> ---
>  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.

  reply	other threads:[~2010-10-12 19:09 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 13:00 [Qemu-devel] [PATCH 00/39] Make configure command line autoconf-compatible Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 01/39] default compilation tools to environment variables Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 02/39] default make and install " Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 03/39] move feature variables to the top Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 04/39] fix sparse support (?) Paolo Bonzini
2010-10-12 19:02   ` Blue Swirl
2010-10-13  7:15     ` Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 05/39] test cc with the complete set of chosen flags Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 06/39] include failed source file in config.log Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 07/39] do not pass bogus $(SRC_PATH) include paths to cc during configure Paolo Bonzini
2010-10-12 19:09   ` Blue Swirl [this message]
2010-10-13  7:25     ` Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 08/39] provide portable sizeof(long) test Paolo Bonzini
2010-10-12 13:47   ` malc
2010-10-12 14:31     ` Paolo Bonzini
2010-10-12 14:38       ` malc
2010-10-12 14:40         ` Paolo Bonzini
2010-10-12 14:41           ` malc
2010-10-12 14:58             ` Paolo Bonzini
2010-10-12 15:12               ` malc
2010-10-12 15:32                 ` Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 09/39] fix spelling of $pkg_config, move default together with other cross tools Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 10/39] do not default to non-prefixed pkg-config when cross compiling Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 11/39] reorganize sdl-config tests Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 12/39] move --srcdir detection earlier Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 13/39] properly detect compiler in tests/Makefile Paolo Bonzini
2010-10-12 19:04   ` Blue Swirl
2010-10-13  7:19     ` Paolo Bonzini
2010-10-13 19:05       ` Blue Swirl
2010-10-12 13:00 ` [Qemu-devel] [PATCH 14/39] remove HOST_CC mention from roms/{sea, vga}bios/config.mak Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 15/39] let --host-cc slide into oblivion Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 16/39] introduce CFLAGS= and LDFLAGS= configure command-line options Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 17/39] introduce CPPFLAGS configure variable Paolo Bonzini
2010-10-12 19:11   ` Blue Swirl
2010-10-12 13:00 ` [Qemu-devel] [PATCH 18/39] add autoconfy alias CC= for --cc Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 19/39] add CPP variable Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 20/39] add autoconfy aliases MAKE=/INSTALL= for --make and --install Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 21/39] add autoconfy aliases --with-* for audio library options Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 22/39] make trace options use autoconfy names Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 23/39] deprecate --audio-card-list Paolo Bonzini
2010-10-12 13:49   ` malc
2010-10-12 14:30     ` Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 24/39] add autoconfy alias --enable-audio-drivers alias for --audio-drv-list Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 25/39] add autoconfy alias --enable-block-drivers for --block-drv-whitelist Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 26/39] add libtooly alias --enable-static for --static Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 27/39] add autoconfy alias --with-sysroot for --interp-prefix Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 28/39] rename interp_prefix to sysroot Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 29/39] add autoconfy alias --enable-targets for --target-list Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 30/39] add autoconfy alias --with-headers for --kerneldir Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 31/39] add autoconfy alias --srcdir= for --source-path Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 32/39] rename SRC_PATH to srcdir Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 33/39] rename source_path " Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 34/39] add autoconfy --host= option deprecating --cross-prefix Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 35/39] add autoconfy --build= option to be used instead of undocumented --cpu Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 36/39] add autoconfy --with-arch= option, compatible with --sparc-cpu Paolo Bonzini
2010-10-12 19:47   ` Blue Swirl
2010-10-13  7:32     ` Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 37/39] make more options "standard" Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 38/39] provide a more gnuish default sysroot Paolo Bonzini
2010-10-12 13:00 ` [Qemu-devel] [PATCH 39/39] use host triplets for feature detection Paolo Bonzini
2010-10-12 13:22 ` [Qemu-devel] [PATCH 00/39] Make configure command line autoconf-compatible malc
2010-10-12 13:26   ` Paolo Bonzini
2010-10-12 13:32     ` malc
2010-10-12 14:30       ` Anthony Liguori
2010-10-12 14:34         ` Paolo Bonzini

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=AANLkTim4WDXCCi5WZTb50QdAyHXQkh9owd0eoDLcbhbp@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=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).