From patchwork Tue Oct 12 13:00:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 67593 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 340BCB70E0 for ; Wed, 13 Oct 2010 01:18:42 +1100 (EST) Received: from localhost ([127.0.0.1]:54773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5fbU-0006lH-Fe for incoming@patchwork.ozlabs.org; Tue, 12 Oct 2010 10:13:20 -0400 Received: from [140.186.70.92] (port=42087 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5eUr-0007uj-Tg for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5eUf-000528-P2 for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:20 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:52643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5eUf-0004Mc-ME for qemu-devel@nongnu.org; Tue, 12 Oct 2010 09:02:13 -0400 Received: by mail-qw0-f45.google.com with SMTP id 5so1841033qwh.4 for ; Tue, 12 Oct 2010 06:02:13 -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=XVd4SFAFQ74S/Huq6RE7zV6YMSLyaAHe0jBbMiVEiF4=; b=TUIqDmxUXB6eg4G2Vg4wcA888Qu0lOK6fVDMXQ9uKt/emer+0Qd5ENR+J5Tf85Tr8p WbPyZuAQDCAlBoSQtYG/a0Kh2WDJS+TYnFkOs/xYP3V9pE9lzOqMqePeZ9bO99F1Yquw VRhmgy3DND84IBhxRj4BIRSjudN/xJ4rDvvE8= 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=tKOTAQYvI5f1iPzj1JC2Y1btVVgDl6eUzw+CrsL+tQGyOcJZmstbvuUjZp/n6HA2MB 7PN0M359xwFPpXTKROkPACSUxrQGKA0OKNWE+mcsCWXJOaOkFyw2D6+kfWjgjFtbsMSO HQvXRuKxluOIoo6RWTwghVucr2xtxyNIf0tCM= Received: by 10.229.248.79 with SMTP id mf15mr2791792qcb.181.1286888533172; Tue, 12 Oct 2010 06:02:13 -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.02.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 Oct 2010 06:02:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 12 Oct 2010 15:00:54 +0200 Message-Id: <1286888457-5033-37-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 36/39] add autoconfy --with-arch= option, compatible with --sparc-cpu 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 Signed-off-by: Paolo Bonzini --- Please test this on SPARC. :) configure | 72 +++++++++++++++++++++++++++++++++---------------------------- 1 files changed, 39 insertions(+), 33 deletions(-) diff --git a/configure b/configure index d6f472b..99de45b 100755 --- a/configure +++ b/configure @@ -82,7 +82,7 @@ path_of() { cpu="" sysroot="/usr/gnemul/qemu-%M" static="no" -sparc_cpu="" +with_arch="" cross_prefix="" cross_compiling="no" default_cross_prefix="" @@ -215,20 +215,7 @@ for opt do ;; --extra-ldflags=*) LDFLAGS="$optarg $LDFLAGS" ;; - --sparc_cpu=*) - sparc_cpu="$optarg" - case $sparc_cpu in - v7|v8|v8plus|v8plusa) - cpu="sparc" - ;; - v9) - cpu="sparc64" - ;; - *) - echo "undefined SPARC architecture. Exiting"; - exit 1 - ;; - esac + --with-arch=*|--sparc_cpu=*) with_arch="$optarg" ;; esac done @@ -661,7 +648,7 @@ for opt do ;; --enable-uname-release=*) uname_release="$optarg" ;; - --sparc_cpu=*) + --with-arch=*|--sparc_cpu=*) ;; --enable-werror) werror="yes" ;; @@ -721,21 +708,40 @@ for opt do done # -# If cpu ~= sparc and sparc_cpu hasn't been defined, plug in the right -# QEMU_CFLAGS/LDFLAGS (assume sparc_v8plus for 32-bit and sparc_v9 for 64-bit) +# Plug in the right QEMU_CFLAGS/LDFLAGS for the architecture # host_guest_base="no" + case "$cpu" in - sparc) case $sparc_cpu in - v7|v8) - QEMU_CFLAGS="-mcpu=${sparc_cpu} -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" - ;; - v8plus|v8plusa) - QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${sparc_cpu}__ $QEMU_CFLAGS" - ;; - *) # sparc_cpu not defined in the command line - QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" - esac + arm*|i386|x86_64|mips*|hppa*|s390|s390x) + test -n "$with_arch" && QEMU_CFLAGS="-march=${with_arch} $QEMU_CFLAGS" + ;; + + sparc|sparc64) + test "$with_arch" = v8plusa && with_arch=v8plus + case "$cpu:$with_arch" in + *:v7|*:v8|*:v8plus) + QEMU_CFLAGS="-mcpu=${with_arch} -D__sparc_${with_arch}__ $QEMU_CFLAGS" + cpu=sparc + ;; + *:v9) + QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_${with_arch}__ $QEMU_CFLAGS" + cpu=sparc64 + ;; + sparc:*) QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v8plus__ $QEMU_CFLAGS" + ;; + sparc64:*) QEMU_CFLAGS="-mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" + ;; + esac + ;; + + *) + test -n "$with_arch" && QEMU_CFLAGS="-mcpu=${with_arch} $QEMU_CFLAGS" + ;; +esac + +case "${cpu}" in + sparc) LDFLAGS="-m32 $LDFLAGS" QEMU_CFLAGS="-m32 -ffixed-g2 -ffixed-g3 $QEMU_CFLAGS" if test "$solaris" = "no" ; then @@ -744,9 +750,8 @@ case "$cpu" in fi ;; sparc64) - QEMU_CFLAGS="-m64 -mcpu=ultrasparc -D__sparc_v9__ $QEMU_CFLAGS" LDFLAGS="-m64 $LDFLAGS" - QEMU_CFLAGS="-ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" + QEMU_CFLAGS="-m64 -ffixed-g5 -ffixed-g6 -ffixed-g7 $QEMU_CFLAGS" if test "$solaris" != "no" ; then QEMU_CFLAGS="-ffixed-g1 $QEMU_CFLAGS" fi @@ -812,6 +817,7 @@ echo "Advanced options (experts only):" echo " --srcdir=PATH path of source code [$srcdir]" echo " --build=BUILD specify triplet for build machine [$build]" echo " --enable-targets=LIST choose compiled targets [$target_list]" +echo " --with-arch=ARCH build qemu for given architecture" echo " --with-sysroot=PREFIX where to find shared libraries, etc." echo " use %M for cpu name [$sysroot]" echo " --host=HOST cross-compile for host triplet HOST [$host]" @@ -879,7 +885,6 @@ echo " --disable-guest-base disable GUEST_BASE support" echo " --enable-user-pie build usermode emulation targets as PIE" echo " --disable-user-pie do not build usermode emulation targets as PIE" echo " --enable-uname-release=R Return R for uname -r in usermode emulation" -echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" echo " --disable-uuid disable uuid support" echo " --enable-uuid enable uuid support" echo " --disable-vde disable support for vde network" @@ -920,6 +925,7 @@ echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" echo " --target-list=LIST set target list [$target_list]" +echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" echo "" echo "Some influential environment variables can be passed on the command line:" echo " CC C compiler command" @@ -2323,8 +2329,8 @@ echo "VNC SASL support $vnc_sasl" echo "VNC JPEG support $vnc_jpeg" echo "VNC PNG support $vnc_png" echo "VNC thread $vnc_thread" -if test -n "$sparc_cpu"; then - echo "Target Sparc Arch $sparc_cpu" +if test -n "$with_arch"; then +echo "Target Arch $with_arch" fi echo "xen support $xen" echo "brlapi support $brlapi"