From patchwork Tue Oct 12 13:00:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 67561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 95EF2B6EF0 for ; Wed, 13 Oct 2010 00:20:38 +1100 (EST) Received: from localhost ([127.0.0.1]:35550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5emQ-0000dC-NC for incoming@patchwork.ozlabs.org; Tue, 12 Oct 2010 09:20:34 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=bP9D0f5NKGWq/ElHAf2wu+sLfY+Ar3CGh4CTJkrQw/g=; b=QOgdmr/pagzFFeKHfcIKcwPjTJlPrkB8K79rTntgDrMmIuGboRP/fOvatUndZ6dRMi ijv2KNnu3tZx3TUIwPIJF9jdGGDU4AcN9EZGp/sj0gboGkJFx7NeBI31qRkjRsTr9/5Q W2wUr6JRQ3KcEAaGUJ4BAu9JEOzQ9DaCOw7sU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:subject:date:message-id:x-mailer:in-reply-to :references; b=nccnKSXv5TR8KYqhzXilO87/Bhgy6p7OdQ/SeSO4ptYlaKkP4HSBh++kPIhBR3vpiu RHXyyccVmuZPyqJRjQ/hDuDYZ8KuPkWOr3qNsnWgxdM1aNJUwSxPpVT2cHV8lGBajJMi d/V+0MafUrMlTEYE1GXCDprE/8/WH2T4HEtyw= Received: by 10.224.188.2 with SMTP id cy2mr5669926qab.326.1286888489349; Tue, 12 Oct 2010 06:01:29 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com [209.132.186.34]) by mx.google.com with ESMTPS id s34sm5931078qcp.20.2010.10.12.06.01.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 06:01:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 12 Oct 2010 15:00:31 +0200 Message-Id: <1286888457-5033-14-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> References: <1286888457-5033-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 13/39] properly detect compiler in tests/Makefile X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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