From patchwork Sun Nov 14 11:48:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 71099 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 10F5FB7121 for ; Sun, 14 Nov 2010 22:51:44 +1100 (EST) Received: from localhost ([127.0.0.1]:35129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHb7V-0003Ps-53 for incoming@patchwork.ozlabs.org; Sun, 14 Nov 2010 06:51:41 -0500 Received: from [140.186.70.92] (port=43526 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHb5S-0002vJ-06 for qemu-devel@nongnu.org; Sun, 14 Nov 2010 06:49:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHb5Q-0004H8-UY for qemu-devel@nongnu.org; Sun, 14 Nov 2010 06:49:33 -0500 Received: from mail-px0-f173.google.com ([209.85.212.173]:41728) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHb5Q-0004H1-Oq for qemu-devel@nongnu.org; Sun, 14 Nov 2010 06:49:32 -0500 Received: by pxi16 with SMTP id 16so974811pxi.4 for ; Sun, 14 Nov 2010 03:49:31 -0800 (PST) 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=wjqkybbXFQJQrvEww5bhd2IrDzSg6X+I0V8kFfqi9Lw=; b=OWKWiQFVbESpg/JmvgCUXOM+D4aiRTrdxQ+tdfEGbfcxqW5NSI69gzz1akjkFCU1C8 eYlNiTG6dgLmUem8Gvb/Zr02YVP93npgAZ/6ZUItqawTZNYg83F15/Wng1ORr6o3Mpe2 0FQMGuHjeb7TOf+1AmigeGb60zz9mHcsLBS/o= 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=fAhnzL/hbhd1V/C9bt2HZsT2QOK53qru5gszavSuPH2x3s4WuKQtIqam+RHt2BHKVj er/POFGRx6YxigOQRoqugKPU494gIhGuy+To3mnhL1KRPf22+fK5lnBTlQy7muD2+jz2 uEH0tAwN5tnD69+9ccS8PEBqsaqF4+qES8HaY= Received: by 10.142.213.2 with SMTP id l2mr3909823wfg.64.1289735371840; Sun, 14 Nov 2010 03:49:31 -0800 (PST) Received: from localhost.localdomain (s209p8.home.99maxprogres.cz [85.93.118.17]) by mx.google.com with ESMTPS id x35sm7086810wfd.13.2010.11.14.03.49.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 14 Nov 2010 03:49:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sun, 14 Nov 2010 12:48:55 +0100 Message-Id: <1289735342-8660-8-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1289735342-8660-1-git-send-email-pbonzini@redhat.com> References: <1289735342-8660-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 07/14] provide portable HOST_LONG_BITS test 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 Do not hardcode the list of 64-bit CPUs. Use sizeof(void *) to compute it. Renaming it to HOST_LONG_BITS to HOST_POINTER_BITS is left for later. Signed-off-by: Paolo Bonzini --- configure | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 812c41c..1bc9b85 100755 --- a/configure +++ b/configure @@ -1077,13 +1077,15 @@ esac fi -# host long bits test -hostlongbits="32" -case "$cpu" in - x86_64|alpha|ia64|sparc64|ppc64|s390x) - hostlongbits=64 - ;; -esac +# host long bits test, actually a pointer size test +cat > $TMPC << EOF +int sizeof_pointer_is_8[sizeof(void *) == 8 ? 1 : -1]; +EOF +if compile_object; then +hostlongbits=64 +else +hostlongbits=32 +fi ##########################################