From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8uAb-0005VN-UH for qemu-devel@nongnu.org; Mon, 21 Nov 2016 14:22:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8uAX-0004ZQ-SD for qemu-devel@nongnu.org; Mon, 21 Nov 2016 14:22:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45126) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c8uAX-0004ZE-M3 for qemu-devel@nongnu.org; Mon, 21 Nov 2016 14:22:21 -0500 Date: Mon, 21 Nov 2016 20:22:16 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20161121192215.GA12949@potion> References: <20161121182250.13186-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161121182250.13186-1-andre.przywara@arm.com> Subject: Re: [Qemu-devel] [kvm-unit-tests PATCH] configure: honour $ARCH and $CROSS_COMPILE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andre Przywara Cc: Andrew Jones , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, qemu-devel@nongnu.org 2016-11-21 18:22+0000, Andre Przywara: > 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. Definitely useful, thanks. > diff --git 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 Host should be set before we override arch, though. I can swap those two lines when applying, but would prefer something like: host=`uname -m | sed -e 's/i.86/i386/;s/arm.*/arm/;s/ppc64.*/ppc64/'` arch=${ARCH:-$host} > -cross_prefix= > +cross_prefix=${CROSS_COMPILE} > endian="" > pretty_print_stacks=yes (And --help is not printing the default value for cross_prefix, which would be nice to change when we can have a non-empty one now.)