qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] configure: Avoid error messages about missing *-config-*.h files
Date: Wed, 19 May 2021 13:08:03 +0200	[thread overview]
Message-ID: <acfb4c5c-e491-f4f9-942d-f6d400372927@redhat.com> (raw)
In-Reply-To: <20210519105719.290435-1-thuth@redhat.com>

On 5/19/21 12:57 PM, Thomas Huth wrote:
> When compiling with --disable-system there is a harmless yet still
> annoying error message at the end of the "configure" step:
> 
>  sed: can't read *-config-devices.h: No such file or directory
> 
> When only building the tools or docs, without any emulator at all,
> there is even an additional message about missing *-config-target.h
> files.
> 
> Fix it by checking whether any of these files are available before
> using them.
> 
> Fixes: e0447a834d ("configure: Poison all current target-specific #defines")
> Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  configure | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/configure b/configure
> index 963e35b9a7..a8a9e78c61 100755
> --- a/configure
> +++ b/configure
> @@ -6458,10 +6458,14 @@ fi
>  
>  # Create list of config switches that should be poisoned in common code...
>  # but filter out CONFIG_TCG and CONFIG_USER_ONLY which are special.
> -sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \
> -    -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \
> -    *-config-devices.h *-config-target.h | \
> -    sort -u > config-poison.h
> +target_configs_h=$(ls *-config-devices.h *-config-target.h 2>/dev/null)
> +if test -n "$target_configs_h" ; then
> +    sed -n -e '/CONFIG_TCG/d' -e '/CONFIG_USER_ONLY/d' \
> +        -e '/^#define / { s///; s/ .*//; s/^/#pragma GCC poison /p; }' \
> +        $target_configs_h | sort -u > config-poison.h
> +else
> +    touch config-poison.h

  :> config-poison.h is safer.

> +fi
>  
>  # Save the configure command line for later reuse.
>  cat <<EOD >config.status
> 



  reply	other threads:[~2021-05-19 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 10:57 [PATCH] configure: Avoid error messages about missing *-config-*.h files Thomas Huth
2021-05-19 11:08 ` Philippe Mathieu-Daudé [this message]
2021-05-19 11:31   ` Thomas Huth

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=acfb4c5c-e491-f4f9-942d-f6d400372927@redhat.com \
    --to=philmd@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /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).