qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] configure: Support --target-list=? to list available targets
@ 2011-04-21 13:10 Peter Maydell
  2011-04-21 17:45 ` Stefan Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2011-04-21 13:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Add support for getting configure to print the list of all targets
that can be built, via the option '--target-list=?'.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Yes, you can get the list of targets by running configure without
any arguments and then scrolling up to find the target list in
the screenful of output, but I think this is a bit more user-friendly.

 configure |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index da2da04..15330ea 100755
--- a/configure
+++ b/configure
@@ -834,7 +834,8 @@ echo "  --help                   print this message"
 echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
 echo "  --interp-prefix=PREFIX   where to find shared libraries, etc."
 echo "                           use %M for cpu name [$interp_prefix]"
-echo "  --target-list=LIST       set target list [$target_list]"
+echo "  --target-list=LIST       set target list (default: build everything)"
+echo "                           use --target-list=? to list available targets"
 echo ""
 echo "Advanced options (experts only):"
 echo "  --source-path=PATH       path of source code [$source_path]"
@@ -1004,11 +1005,11 @@ if test "$solaris" = "yes" ; then
   fi
 fi
 
+default_target_list=""
 
-if test -z "$target_list" ; then
 # these targets are portable
-    if [ "$softmmu" = "yes" ] ; then
-        target_list="\
+if [ "$softmmu" = "yes" ] ; then
+    default_target_list="\
 i386-softmmu \
 x86_64-softmmu \
 arm-softmmu \
@@ -1029,10 +1030,10 @@ sh4eb-softmmu \
 sparc-softmmu \
 sparc64-softmmu \
 "
-    fi
+fi
 # the following are Linux specific
-    if [ "$linux_user" = "yes" ] ; then
-        target_list="${target_list}\
+if [ "$linux_user" = "yes" ] ; then
+    default_target_list="${default_target_list}\
 i386-linux-user \
 x86_64-linux-user \
 alpha-linux-user \
@@ -1054,20 +1055,27 @@ sparc64-linux-user \
 sparc32plus-linux-user \
 unicore32-linux-user \
 "
-    fi
+fi
 # the following are Darwin specific
-    if [ "$darwin_user" = "yes" ] ; then
-        target_list="$target_list i386-darwin-user ppc-darwin-user "
-    fi
+if [ "$darwin_user" = "yes" ] ; then
+    default_target_list="$default_target_list i386-darwin-user ppc-darwin-user "
+fi
 # the following are BSD specific
-    if [ "$bsd_user" = "yes" ] ; then
-        target_list="${target_list}\
+if [ "$bsd_user" = "yes" ] ; then
+    default_target_list="${default_target_list}\
 i386-bsd-user \
 x86_64-bsd-user \
 sparc-bsd-user \
 sparc64-bsd-user \
 "
-    fi
+fi
+
+if test -z "$target_list" ; then
+    target_list="$default_target_list"
+elif [ "$target_list" = "?" ]; then
+    echo "Supported targets: "
+    echo "$default_target_list"
+    exit 0
 else
     target_list=`echo "$target_list" | sed -e 's/,/ /g'`
 fi
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Support --target-list=? to list available targets
  2011-04-21 13:10 [Qemu-devel] [PATCH] configure: Support --target-list=? to list available targets Peter Maydell
@ 2011-04-21 17:45 ` Stefan Weil
  2011-04-22  0:50   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2011-04-21 17:45 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel

Am 21.04.2011 15:10, schrieb Peter Maydell:
> Add support for getting configure to print the list of all targets
> that can be built, via the option '--target-list=?'.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Yes, you can get the list of targets by running configure without
> any arguments and then scrolling up to find the target list in
> the screenful of output, but I think this is a bit more user-friendly.
>
> configure | 36 ++++++++++++++++++++++--------------
> 1 files changed, 22 insertions(+), 14 deletions(-)

The qemu executable supports this use pattern (-cpu ?),
but it's unusual for configure.

Other options (--audio-drv-list=LIST, --audio-card-list=LIST)
show the available values in the help message (configure --help).

What about a similar help text for --target-list? Like this:

   --target-list=LIST       set target list []
                            Available targets: i386-softmmu ...
                            i386-linux-user ...

Users would not have to call configure twice to get the list of
available targets (the first call is configure --help because
they don't know whether it is --target, --targets, --targetlist
or --target-list).

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] configure: Support --target-list=? to list available targets
  2011-04-21 17:45 ` Stefan Weil
@ 2011-04-22  0:50   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2011-04-22  0:50 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel

On 21 April 2011 18:45, Stefan Weil <weil@mail.berlios.de> wrote:
> Am 21.04.2011 15:10, schrieb Peter Maydell:
>> Add support for getting configure to print the list of all targets
>> that can be built, via the option '--target-list=?'.

> The qemu executable supports this use pattern (-cpu ?),
> but it's unusual for configure.
>
> Other options (--audio-drv-list=LIST, --audio-card-list=LIST)
> show the available values in the help message (configure --help).
>
> What about a similar help text for --target-list? Like this:
>
>  --target-list=LIST       set target list []
>                           Available targets: i386-softmmu ...
>                           i386-linux-user ...

The "[]" here is wrong, incidentally, because the bit in [] is
supposed to be the default value, which for the target list is
not "build no targets" but "build all targets". So we could
either say:

  --target-list=LIST       set target list (default: build everything)
                           Available targets: i386-softmmu ...
                           i386-linux-user ...

or

  --target-list=LIST       set target list [i386-softmmu ...
i386-linux-user ...]

I vaguely prefer the first but have no strong feelings.

The other issue is that the target list is vastly longer than
any of the existing lists in the help, so it probably needs
something to automatically format it so it doesn't mess up
the formatting of the --help message.

(We could perhaps support --option=? for all the options that
take a list, in addition to giving the supported values in
--help, but maybe that's overkill.)

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-22  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-21 13:10 [Qemu-devel] [PATCH] configure: Support --target-list=? to list available targets Peter Maydell
2011-04-21 17:45 ` Stefan Weil
2011-04-22  0:50   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).