From patchwork Fri Jun 26 15:00:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 488883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EE7C81400A0 for ; Sat, 27 Jun 2015 01:10:36 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=MdXgxyqu; dkim-atps=neutral Received: from localhost ([::1]:60597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8VH0-0005w3-Pz for incoming@patchwork.ozlabs.org; Fri, 26 Jun 2015 11:10:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8V7M-00059N-M9 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:00:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8V7H-0007oB-Dy for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:00:36 -0400 Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:35424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8V7H-0007o4-Ar for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:00:31 -0400 Received: by qkbp125 with SMTP id p125so56444384qkb.2 for ; Fri, 26 Jun 2015 08:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=PREIYt/v8pQ2x9LYbUyQz7cS/xr2uoj+h3b/kg/d7SQ=; b=MdXgxyquWPldY+sjv2ZED9t1Jtikdj0mQmJtbC9OMdcJd9ouAPp7O9zOIJzt+dq6TD sMCH5HO1vP9Y10whfmevFO+vKJKW+5xecxT1+Dv9T+aYpCt0Hg+wlTp29ZyQnJ06hYaY 8ouQeaQjL+qkVRjHj2SiuYtrkY3X8f72YeSOFnVmOoVMBui7IsAuTY1Hgl9PZYYWVfAo T+gEvtT0NrT3xyLL6cC9l9x5J/x1lY1rhkPAmQrOr55Mngnbv2oUvHMcMtcQzLVhihOA jPInj0LOW9l2ka/fYbaEjxIm3Z+NuBKRrlo2ReLCV4BKa+/Yqwlds1b6yQSNDRGGG3d6 m7Gg== X-Received: by 10.140.237.136 with SMTP id i130mr2953875qhc.87.1435330830649; Fri, 26 Jun 2015 08:00:30 -0700 (PDT) Received: from localhost (bne75-h02-31-39-163-232.dsl.sta.abo.bbox.fr. [31.39.163.232]) by mx.google.com with ESMTPSA id n132sm6916768qhb.12.2015.06.26.08.00.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jun 2015 08:00:29 -0700 (PDT) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Fri, 26 Jun 2015 17:00:24 +0200 Message-Id: <1435330824-30811-1-git-send-email-marcandre.lureau@gmail.com> X-Mailer: git-send-email 2.4.3 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400d:c09::230 Cc: peter.maydell@linaro.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , pbonzini@redhat.com Subject: [Qemu-devel] [PATCHv2] build-sys: keep current config.log on --help X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It's nice to keep the config.log used to configure the build. Signed-off-by: Marc-André Lureau --- 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." \