From nobody Mon Feb 9 09:34:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499099812424244.4901073639835; Mon, 3 Jul 2017 09:36:52 -0700 (PDT) Received: from localhost ([::1]:36274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4LD-0001Gr-1l for importer@patchew.org; Mon, 03 Jul 2017 12:36:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4JU-0008OZ-3p for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4JS-0007JG-40 for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:04 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36530) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4JR-0007Hh-TY for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:02 -0400 Received: by mail-wm0-x244.google.com with SMTP id y5so21469462wmh.3 for ; Mon, 03 Jul 2017 09:35:01 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id r5sm4867459wmr.9.2017.07.03.09.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:34:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=4iUu8KuUFNH07lIaBwU7yaIz/PFfBbJ9/W0L9BSOrJ4=; b=rS0N329/Jtr/AM5RAD942iaVdCDpmEZ49tOThV4sFWZKjbmDvNumeVh+r5da2jUPe+ NfRySCERvP5WnFpEmQFn5co8gToQStB6OQ9/i3vHmjpwwinEZPVh1B9CNrrXcZKQk+xi ER9a+bA4xrdvFHFp9ymKf93TNgyrHD8rtm5lXTbop6bKBH+i2BkVKadTfASiDSIXlM0/ 8XClVSO/Ql9MN8XQqsI7kxujLhEpM4KLqPgA4RZSul1N8l/SE3BGlWM/7pid7KbKb/el R1zLutW+0MVDXODowFWFlNzUEbcxVTobDaSkiBPAK4ef2cTF0jApAjr5c0pM9+BQmb/F J9pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=4iUu8KuUFNH07lIaBwU7yaIz/PFfBbJ9/W0L9BSOrJ4=; b=hHPgnmwttzD7NEZ7vdWhKQtZczb79UiKbDaXDob8RtHG+Kl64D8DMGr2A2A+lABRfY fJ7mb7YLUrLj3djf3uS8dxBCaS41HrrIbHrolP+4qC1DohnZGbQ8natA7Afn6YWsJyyu T27fvxSzEfwQSkW4EsyUTyHuZ83INQ486R1NnUB5XdycgVrobq3N8YkBLlVE0JghgNpW k8KKO7B5K2w/w+RQjQJJRHbZ4jxU4E2C1xJpGeOBa4+OzxrdgBp0mtQ2VflKBYh3o1Uu r/QG6TNC0VsJUv+Qd06DDqAK+vir39DCoyPnpKL6rmbYkAl917vemqrGOMpxRfFfORSb 1gTA== X-Gm-Message-State: AIVw111cF+lSbyvCjkBHNRDxgkMKep4lKdD/5bLLnSB36tCDlxsRdXyN 6Yr7NmQuaFovk4cEEq8= X-Received: by 10.28.88.3 with SMTP id m3mr10487775wmb.28.1499099700708; Mon, 03 Jul 2017 09:35:00 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:33 +0200 Message-Id: <1499099693-22903-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH 02/22] configure: early test for supported targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhong@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Check for unsupported targets in target_list, and print an error early in the configuration process. Signed-off-by: Paolo Bonzini Reviewed-by: Richard Henderson --- configure | 65 ++++++++++++++++++++++++++++++++++++++++++-----------------= ---- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/configure b/configure index 0f14e79..6d1a6a9 100755 --- a/configure +++ b/configure @@ -40,14 +40,18 @@ printf " '%s'" "$0" "$@" >> config.log echo >> config.log echo "#" >> config.log =20 -error_exit() { - echo +print_error() { + (echo echo "ERROR: $1" while test -n "$2"; do echo " $2" shift done - echo + echo) >&2 +} + +error_exit() { + print_error "$@" exit 1 } =20 @@ -207,6 +211,25 @@ supported_xen_target() { return 1 } =20 +supported_target() { + case "$1" in + ${target_name}-softmmu) ;; + ${target_name}-linux-user) + if test "$linux" !=3D "yes"; then + print_error "Target '$target' is only available on a Linux= host" + return 1 + fi + ;; + ${target_name}-bsd-user) + if test "$bsd" !=3D "yes"; then + print_error "Target '$target' is only available on a BSD h= ost" + return 1 + fi + ;; + esac + return 0 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -1734,23 +1757,27 @@ if test "$solaris" =3D "yes" ; then fi =20 if test -z "${target_list+xxx}" ; then - target_list=3D"$default_target_list" + for target in $default_target_list; do + supported_target $target 2>/dev/null && \ + target_list=3D"$target_list $target" + done + target_list=3D"${target_list# }" else target_list=3D$(echo "$target_list" | sed -e 's/,/ /g') + for target in $target_list; do + # Check that we recognised the target name; this allows a more + # friendly error message than if we let it fall through. + case " $default_target_list " in + *" $target "*) + ;; + *) + error_exit "Unknown target name '$target'" + ;; + esac + supported_target $target || exit 1 + done fi =20 -# Check that we recognised the target name; this allows a more -# friendly error message than if we let it fall through. -for target in $target_list; do - case " $default_target_list " in - *" $target "*) - ;; - *) - error_exit "Unknown target name '$target'" - ;; - esac -done - # see if system emulation was really requested case " $target_list " in *"-softmmu "*) softmmu=3Dyes @@ -6050,16 +6077,10 @@ case "$target" in target_softmmu=3D"yes" ;; ${target_name}-linux-user) - if test "$linux" !=3D "yes" ; then - error_exit "Target '$target' is only available on a Linux host" - fi target_user_only=3D"yes" target_linux_user=3D"yes" ;; ${target_name}-bsd-user) - if test "$bsd" !=3D "yes" ; then - error_exit "Target '$target' is only available on a BSD host" - fi target_user_only=3D"yes" target_bsd_user=3D"yes" ;; --=20 1.8.3.1