All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH RFC] configure: shorthand for only enabling native softmmu target
Date: Wed, 14 Mar 2018 12:09:06 +0000	[thread overview]
Message-ID: <20180314120906.30872-1-berrange@redhat.com> (raw)

With the huge number of QEMU targets, a default configuration will take
a very long time to rebuild. When developing most code changes, it is
sufficient to test compilation with a single target - rebuilding all
targets just extends compile times while not detecting any new problems.

Developers will often thus specify a single target for configure,
commonly matching the host architecture. eg

  ./configure --target-list=x86_64-softmmu

This works fine, but is a bit of a verbose thing to type out everytime
configure is invoked. There are already short-hand args to disable all
user targets, all softmmu targets, or all tcg targets. This adds one
further shorthand to disable all non-native architecture targets.

  ./configure --native

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---

Suggestions welcomed for better names than --native, but bear in mind
the goal is to minimise amount of typing so nothing too verbose, hence
why I didn't do something like --disable-non-native ...

 configure | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/configure b/configure
index af72fc852e..807af93116 100755
--- a/configure
+++ b/configure
@@ -233,6 +233,22 @@ supported_whpx_target() {
     return 1
 }
 
+supported_native_target() {
+    glob "$1" "*-softmmu" || return 1
+    case "${1%-softmmu}:$cpu" in
+        arm:arm | aarch64:aarch64 | \
+        i386:i386 | i386:x32 | \
+        x86_64:x86_64 | \
+        mips:mips | mipsel:mips | \
+        ppc:ppc | ppcemb:ppc | \
+        ppc64:ppc64 | \
+        s390x:s390x)
+            return 0
+        ;;
+    esac
+    return 1
+}
+
 supported_target() {
     case "$1" in
         *-softmmu)
@@ -254,6 +270,10 @@ supported_target() {
             return 1
             ;;
     esac
+    if test "$native" = "yes"
+    then
+	supported_native_target "$1" || return 1
+    fi
     test "$tcg" = "yes" && return 0
     supported_kvm_target "$1" && return 0
     supported_xen_target "$1" && return 0
@@ -390,6 +410,7 @@ cocoa="no"
 softmmu="yes"
 linux_user="no"
 bsd_user="no"
+native="no"
 blobs="yes"
 pkgversion=""
 pie=""
@@ -1112,6 +1133,8 @@ for opt do
       cocoa="yes" ;
       audio_drv_list="coreaudio $(echo $audio_drv_list | sed s,coreaudio,,g)"
   ;;
+  --native) native="yes"
+  ;;
   --disable-system) softmmu="no"
   ;;
   --enable-system) softmmu="yes"
@@ -1540,6 +1563,7 @@ Advanced options (experts only):
                            xen pv domain builder
   --enable-debug-stack-usage
                            track the maximum stack usage of stacks created by qemu_alloc_stack
+  --native                 only enable the softmmu target matching host architecture
 
 Optional features, enabled with --enable-FEATURE and
 disabled with --disable-FEATURE, default is enabled if available:
-- 
2.14.3

             reply	other threads:[~2018-03-14 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-14 12:09 Daniel P. Berrangé [this message]
2018-03-14 18:04 ` [Qemu-devel] [PATCH RFC] configure: shorthand for only enabling native softmmu target Alex Bennée
2018-03-14 18:20 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180314120906.30872-1-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.