Skip to content

Commit

Permalink
configure: Avoid error messages about missing *-config-*.h files
Browse files Browse the repository at this point in the history
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: e0447a8 ("configure: Poison all current target-specific #defines")
Reported-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210519113840.298174-1-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
huth authored and bonzini committed May 26, 2021
1 parent 16b3f3b commit 54b0306
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions configure
Expand Up @@ -6503,10 +6503,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
Expand Down

0 comments on commit 54b0306

Please sign in to comment.