diff mbox

configure: Support --target-list=? to list available targets

Message ID 1303391455-5289-1-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show

Commit Message

Peter Maydell April 21, 2011, 1:10 p.m. UTC
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 mbox

Patch

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