From patchwork Mon Nov 21 18:22:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9439927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7ADFD60469 for ; Mon, 21 Nov 2016 18:22:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63E3628755 for ; Mon, 21 Nov 2016 18:22:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 560992876F; Mon, 21 Nov 2016 18:22:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3D1428755 for ; Mon, 21 Nov 2016 18:22:40 +0000 (UTC) Received: from localhost ([::1]:51158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8tEl-0002v6-Ma for patchwork-qemu-devel@patchwork.kernel.org; Mon, 21 Nov 2016 13:22:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8tEQ-0002uj-OI for qemu-devel@nongnu.org; Mon, 21 Nov 2016 13:22:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8tEL-0000St-Sk for qemu-devel@nongnu.org; Mon, 21 Nov 2016 13:22:18 -0500 Received: from foss.arm.com ([217.140.101.70]:47140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8tEL-0000SZ-NB for qemu-devel@nongnu.org; Mon, 21 Nov 2016 13:22:13 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0AE9A16; Mon, 21 Nov 2016 10:22:12 -0800 (PST) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 28E303F220; Mon, 21 Nov 2016 10:22:11 -0800 (PST) From: Andre Przywara To: Andrew Jones Date: Mon, 21 Nov 2016 18:22:50 +0000 Message-Id: <20161121182250.13186-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.140.101.70 Subject: [Qemu-devel] [kvm-unit-tests PATCH] configure: honour $ARCH and $CROSS_COMPILE 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: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Both environment variables seem to be standard in cross-compilation environments, especially with Linux. Let the configure script take those into account when setting the default values for --arch and --cross-prefix. Explicitly specifying the latter on the configure command line still works as expected. Signed-off-by: Andre Przywara --- Hi, this maybe a personal itch to scratch here, since I set these two variables in my environment via a (sourced) script here and never have to care about the particular cross-compiler prefix, for instance. It looks rather generic, though, so I was wondering if this is useful upstream as well. Cheers, Andre. configure | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 995c8fa..9bb38ba 100755 --- a/configure +++ b/configure @@ -8,8 +8,9 @@ objdump=objdump ar=ar addr2line=addr2line arch=`uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/'` +[ -n "$ARCH" ] && arch="$ARCH" host=$arch -cross_prefix= +cross_prefix=${CROSS_COMPILE} endian="" pretty_print_stacks=yes