From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42984 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P66eB-0004FL-7Q for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:05:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P66e9-00009U-9l for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:05:54 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:55363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P66e9-00009Q-6X for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:05:53 -0400 Received: by qyk1 with SMTP id 1so6826979qyk.4 for ; Wed, 13 Oct 2010 12:05:52 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4CB55D99.7070304@redhat.com> References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> <1286888457-5033-14-git-send-email-pbonzini@redhat.com> <4CB55D99.7070304@redhat.com> From: Blue Swirl Date: Wed, 13 Oct 2010 19:05:32 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH 13/39] properly detect compiler in tests/Makefile Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Wed, Oct 13, 2010 at 7:19 AM, Paolo Bonzini wrote: > On 10/12/2010 09:04 PM, Blue Swirl wrote: >>> >>> diff --git a/tests/Makefile b/tests/Makefile >>> index ff7f787..a789e2d 100644 >>> --- a/tests/Makefile >>> +++ b/tests/Makefile >>> @@ -64,11 +64,21 @@ linux-test: linux-test.c >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< =C2=A0-l= m >>> >>> =C2=A0# speed test >>> +ifeq ($(shell uname -m), x86_64) >>> +CC_I386 =3D $(CC) -m32 >>> +else >>> +ifeq ($(shell uname -m), i386) >>> +CC_I386 =3D $(CC) >>> +else >>> +CC_I386 =3D i386-pc-linux-gnu-$(CC) >>> +endif >>> +endif >> >> I'd move this logic to configure. > > I can do that, but it seemed overengineered for a variable that's only > needed only in one makefile rule, and furthermore a rule that will be > invoked manually by the user. =C2=A0In fact I was tempted to hardcode > "CC_I386=3D$(CC) -m32" which would work on x86_64 and i386 (and leave the= task > of overriding it to the user). That part in configure could be extended to handle other targets as well. If Alpha, ARM, CRIS, or MIPS (cross-)compilers are available, we can easily build tests for those too. In the original Makefile location, this would be a mess.