qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] configure: Avoid error messages about missing *-config-*.h files
@ 2021-05-19 11:38 Thomas Huth
  2021-05-19 12:35 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2021-05-19 11:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Philippe Mathieu-Daudé

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>
---
 v2: Use ":>" instead of "touch" as suggested by Philippe

 configure | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 963e35b9a7..bf1c740494 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
+    :> config-poison.h
+fi
 
 # Save the configure command line for later reuse.
 cat <<EOD >config.status
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] configure: Avoid error messages about missing *-config-*.h files
  2021-05-19 11:38 [PATCH v2] configure: Avoid error messages about missing *-config-*.h files Thomas Huth
@ 2021-05-19 12:35 ` Philippe Mathieu-Daudé
  2021-05-19 14:45   ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-19 12:35 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: qemu-trivial, Paolo Bonzini

On 5/19/21 1:38 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>
> ---
>  v2: Use ":>" instead of "touch" as suggested by Philippe
> 
>  configure | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] configure: Avoid error messages about missing *-config-*.h files
  2021-05-19 12:35 ` Philippe Mathieu-Daudé
@ 2021-05-19 14:45   ` Paolo Bonzini
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2021-05-19 14:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Thomas Huth, qemu-devel; +Cc: qemu-trivial

On 19/05/21 14:35, Philippe Mathieu-Daudé wrote:
> On 5/19/21 1:38 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>
>> ---
>>   v2: Use ":>" instead of "touch" as suggested by Philippe
>>
>>   configure | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 

Queued, thanks.

Paolo



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-19 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19 11:38 [PATCH v2] configure: Avoid error messages about missing *-config-*.h files Thomas Huth
2021-05-19 12:35 ` Philippe Mathieu-Daudé
2021-05-19 14:45   ` Paolo Bonzini

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).