From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQoR4-0002SW-0n for qemu-devel@nongnu.org; Sat, 24 Jan 2009 14:44:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQoR1-0002SK-Ja for qemu-devel@nongnu.org; Sat, 24 Jan 2009 14:44:52 -0500 Received: from [199.232.76.173] (port=47237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQoR1-0002SH-E2 for qemu-devel@nongnu.org; Sat, 24 Jan 2009 14:44:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:52398) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQoR1-0002ic-2J for qemu-devel@nongnu.org; Sat, 24 Jan 2009 14:44:51 -0500 Received: from Relay2.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id AEBE146CC8 for ; Sat, 24 Jan 2009 20:44:48 +0100 (CET) From: Alexander Graf Date: Sat, 24 Jan 2009 20:44:47 +0100 Message-Id: <1232826287-18542-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH] Enabled building of x86_64 code on Mac OS X Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Mac OS X 10.5 supports 64-bit userspace on an x86_64 kernel and by default uses 32-bit userspace applications, so the detection for the host architecture fails. This patch enabled building of x86_64 code on x86_64 capable CPUS with Mac OS X. Signed-off-by: Alexander Graf --- configure | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/configure b/configure index 3c9d832..c3fbbbe 100755 --- a/configure +++ b/configure @@ -243,11 +243,21 @@ oss_lib="-lossaudio" Darwin) bsd="yes" darwin="yes" +# on Leopard most of the system is 32-bit, so we have to ask the kernel it if we can run 64-bit userspace code +is_x86_64=`sysctl -n hw.optional.x86_64` +if [ "$is_x86_64" = "1" ]; then + cpu=x86_64 +fi +if [ "$cpu" = "x86_64" ] ; then + OS_CFLAGS="-arch x86_64" + LDFLAGS="-arch x86_64" +else + OS_CFLAGS="-mdynamic-no-pic" +fi darwin_user="yes" cocoa="yes" audio_drv_list="coreaudio" audio_possible_drivers="coreaudio sdl fmod" -OS_CFLAGS="-mdynamic-no-pic" OS_LDFLAGS="-framework CoreFoundation -framework IOKit" ;; SunOS) -- 1.6.0.2