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: 9439923 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 B80A460469 for ; Mon, 21 Nov 2016 18:22:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A24EF28755 for ; Mon, 21 Nov 2016 18:22:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 971C92876F; Mon, 21 Nov 2016 18:22:16 +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 vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E66328755 for ; Mon, 21 Nov 2016 18:22:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387AbcKUSWN (ORCPT ); Mon, 21 Nov 2016 13:22:13 -0500 Received: from foss.arm.com ([217.140.101.70]:39686 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbcKUSWM (ORCPT ); Mon, 21 Nov 2016 13:22:12 -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 Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, qemu-devel@nongnu.org Subject: [kvm-unit-tests PATCH] configure: honour $ARCH and $CROSS_COMPILE 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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