From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5eU5-0007Xm-0J for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5eTy-0004cN-0Y for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:35 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:48077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5eTx-0004Lx-UW for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:01:29 -0400 Received: by mail-qy0-f173.google.com with SMTP id 36so629119qyk.4 for ; Tue, 12 Oct 2010 06:01:29 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 12 Oct 2010 15:00:31 +0200 Message-Id: <1286888457-5033-14-git-send-email-pbonzini@redhat.com> In-Reply-To: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 13/39] properly detect compiler in tests/Makefile List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org `make speed' only makes sense if not cross-compiling, so sha1 can use the CC for the system that is hosting qemu. sha1-i386 is also wrong, since there is usually no variable for the target CC; guess some plausible values. Signed-off-by: Paolo Bonzini --- tests/Makefile | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) 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 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm # speed test +ifeq ($(shell uname -m), x86_64) +CC_I386 = $(CC) -m32 +else +ifeq ($(shell uname -m), i386) +CC_I386 = $(CC) +else +CC_I386 = i386-pc-linux-gnu-$(CC) +endif +endif + sha1-i386: sha1.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< + $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< sha1: sha1.c - $(HOST_CC) $(CFLAGS) $(LDFLAGS) -o $@ $< + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< speed: sha1 sha1-i386 time ./sha1 -- 1.7.2.3