From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org,
"Marc-André Lureau" <marcandre.lureau@gmail.com>,
pbonzini@redhat.com
Subject: [Qemu-devel] [PATCHv2] build-sys: keep current config.log on --help
Date: Fri, 26 Jun 2015 17:00:24 +0200 [thread overview]
Message-ID: <1435330824-30811-1-git-send-email-marcandre.lureau@gmail.com> (raw)
It's nice to keep the config.log used to configure the build.
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
---
v2 addresses Peter Maydell review, and keeps the log before help in
case --help isn't given.
configure | 42 +++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/configure b/configure
index f02510b..71dee54 100755
--- a/configure
+++ b/configure
@@ -29,14 +29,26 @@ TMPL="${TMPDIR1}/${TMPB}.lo"
TMPA="${TMPDIR1}/lib${TMPB}.la"
TMPE="${TMPDIR1}/${TMPB}.exe"
-rm -f config.log
+for i in "$@"; do
+case $i in
+ --help|-h) show_help=yes
+ ;;
+esac
+done
-# Print a helpful header at the top of config.log
-echo "# QEMU configure log $(date)" >> config.log
-printf "# Configured with:" >> config.log
-printf " '%s'" "$0" "$@" >> config.log
-echo >> config.log
-echo "#" >> config.log
+if test x"$show_help" = x"yes" ; then
+ CONFIG_LOG="/dev/null"
+else
+ rm -f config.log
+
+ # Print a helpful header at the top of config.log
+ echo "# QEMU configure log $(date)" >> config.log
+ printf "# Configured with:" >> config.log
+ printf " '%s'" "$0" "$@" >> config.log
+ echo >> config.log
+ echo "#" >> config.log
+ CONFIG_LOG="config.log"
+fi
error_exit() {
echo
@@ -54,8 +66,8 @@ do_compiler() {
# is compiler binary to execute.
local compiler="$1"
shift
- echo $compiler "$@" >> config.log
- $compiler "$@" >> config.log 2>&1 || return $?
+ echo $compiler "$@" >> "$CONFIG_LOG"
+ $compiler "$@" >> "$CONFIG_LOG" 2>&1 || return $?
# Test passed. If this is an --enable-werror build, rerun
# the test with -Werror and bail out if it fails. This
# makes warning-generating-errors in configure test code
@@ -69,8 +81,8 @@ do_compiler() {
return 0
;;
esac
- echo $compiler -Werror "$@" >> config.log
- $compiler -Werror "$@" >> config.log 2>&1 && return $?
+ echo $compiler -Werror "$@" >> "$CONFIG_LOG"
+ $compiler -Werror "$@" >> "$CONFIG_LOG" 2>&1 && return $?
error_exit "configure test passed without -Werror but failed with -Werror." \
"This is probably a bug in the configure script. The failing command" \
"will be at the bottom of config.log." \
@@ -117,8 +129,8 @@ do_libtool() {
local mode=$1
shift
# Run the compiler, capturing its output to the log.
- echo $libtool $mode --tag=CC $cc "$@" >> config.log
- $libtool $mode --tag=CC $cc "$@" >> config.log 2>&1 || return $?
+ echo $libtool $mode --tag=CC $cc "$@" >> "$CONFIG_LOG"
+ $libtool $mode --tag=CC $cc "$@" >> "$CONFIG_LOG" 2>&1 || return $?
# Test passed. If this is an --enable-werror build, rerun
# the test with -Werror and bail out if it fails. This
# makes warning-generating-errors in configure test code
@@ -132,8 +144,8 @@ do_libtool() {
return 0
;;
esac
- echo $libtool $mode --tag=CC $cc -Werror "$@" >> config.log
- $libtool $mode --tag=CC $cc -Werror "$@" >> config.log 2>&1 && return $?
+ echo $libtool $mode --tag=CC $cc -Werror "$@" >> "$CONFIG_LOG"
+ $libtool $mode --tag=CC $cc -Werror "$@" >> "$CONFIG_LOG" 2>&1 && return $?
error_exit "configure test passed without -Werror but failed with -Werror." \
"This is probably a bug in the configure script. The failing command" \
"will be at the bottom of config.log." \
--
2.4.3
reply other threads:[~2015-06-26 15:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1435330824-30811-1-git-send-email-marcandre.lureau@gmail.com \
--to=marcandre.lureau@gmail.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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).