From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRWut-00009K-1M for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:14:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRWus-000095-Ip for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:14:38 -0500 Received: from [199.232.76.173] (port=51287 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRWus-000092-74 for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:14:38 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51535) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRV2g-0003Tj-TX for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:14:35 -0500 Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRTcj-0007Q4-1r for qemu-devel@nongnu.org; Mon, 26 Jan 2009 10:43:41 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1LRTWu-0003G2-HM for qemu-devel@nongnu.org; Mon, 26 Jan 2009 15:37:40 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1LRTWu-0003Fy-CD for qemu-devel@nongnu.org; Mon, 26 Jan 2009 15:37:40 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 26 Jan 2009 15:37:40 +0000 Subject: [Qemu-devel] [6443] Enabled building of x86_64 code on Mac OS X (Alexander Graf) 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 Revision: 6443 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6443 Author: aliguori Date: 2009-01-26 15:37:40 +0000 (Mon, 26 Jan 2009) Log Message: ----------- Enabled building of x86_64 code on Mac OS X (Alexander Graf) 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/configure Modified: trunk/configure =================================================================== --- trunk/configure 2009-01-26 15:37:35 UTC (rev 6442) +++ trunk/configure 2009-01-26 15:37:40 UTC (rev 6443) @@ -243,11 +243,21 @@ 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)