diff mbox

[v2] configure: List available targets in --help output

Message ID 1304430613-25312-1-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 60e0df25e415b00cf35c4d214eaba9dc19aaa9e6
Headers show

Commit Message

Peter Maydell May 3, 2011, 1:50 p.m. UTC
Include the list of available targets in the --help output
for the --target-list= option.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
v2: As suggested by Stefan Weil, put the target list in --help
rather than using '--target-list=?'. This patch includes using
fold(1) in configure -- this should be OK because fold is a
standard POSIX utility (and part of GNU coreutils and busybox).
The resulting output looks like this:

Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                   print this message
  --prefix=PREFIX          install in PREFIX [/usr/local]
  --interp-prefix=PREFIX   where to find shared libraries, etc.
                           use %M for cpu name [/usr/gnemul/qemu-%M]
  --target-list=LIST       set target list (default: build everything)
                           Available targets: i386-softmmu x86_64-softmmu 
                           arm-softmmu cris-softmmu lm32-softmmu m68k-softmmu 
                           microblaze-softmmu microblazeel-softmmu mips-softmmu 
                           mipsel-softmmu mips64-softmmu mips64el-softmmu 
                           ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu 
                           sh4eb-softmmu sparc-softmmu sparc64-softmmu 
                           i386-linux-user x86_64-linux-user alpha-linux-user 
                           arm-linux-user armeb-linux-user cris-linux-user 
                           m68k-linux-user microblaze-linux-user 
                           microblazeel-linux-user mips-linux-user 
                           mipsel-linux-user ppc-linux-user ppc64-linux-user 
                           ppc64abi32-linux-user sh4-linux-user 
                           sh4eb-linux-user sparc-linux-user sparc64-linux-user 
                           sparc32plus-linux-user unicore32-linux-user 

Advanced options (experts only):
[etc]


 configure |  134 ++++++++++++++++++++++++++++++++-----------------------------
 1 files changed, 70 insertions(+), 64 deletions(-)

Comments

Stefan Weil May 3, 2011, 8:47 p.m. UTC | #1
Am 03.05.2011 15:50, schrieb Peter Maydell:
> Include the list of available targets in the --help output
> for the --target-list= option.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> v2: As suggested by Stefan Weil, put the target list in --help
> rather than using '--target-list=?'. This patch includes using
> fold(1) in configure -- this should be OK because fold is a
> standard POSIX utility (and part of GNU coreutils and busybox).
> The resulting output looks like this:
>
> Usage: configure [options]
> Options: [defaults in brackets after descriptions]
>
> Standard options:
> --help print this message
> --prefix=PREFIX install in PREFIX [/usr/local]
> --interp-prefix=PREFIX where to find shared libraries, etc.
> use %M for cpu name [/usr/gnemul/qemu-%M]
> --target-list=LIST set target list (default: build everything)
> Available targets: i386-softmmu x86_64-softmmu
> arm-softmmu cris-softmmu lm32-softmmu m68k-softmmu
> microblaze-softmmu microblazeel-softmmu mips-softmmu
> mipsel-softmmu mips64-softmmu mips64el-softmmu
> ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu
> sh4eb-softmmu sparc-softmmu sparc64-softmmu
> i386-linux-user x86_64-linux-user alpha-linux-user
> arm-linux-user armeb-linux-user cris-linux-user
> m68k-linux-user microblaze-linux-user
> microblazeel-linux-user mips-linux-user
> mipsel-linux-user ppc-linux-user ppc64-linux-user
> ppc64abi32-linux-user sh4-linux-user
> sh4eb-linux-user sparc-linux-user sparc64-linux-user
> sparc32plus-linux-user unicore32-linux-user
>
> Advanced options (experts only):
> [etc]
>
>
> configure | 134 
> ++++++++++++++++++++++++++++++++-----------------------------
> 1 files changed, 70 insertions(+), 64 deletions(-)
>


Thanks, your patch looks good.

I tested it also with MinGW32 (cross and native) - fold works there, too.

Acked-by: Stefan Weil <weil@mail.berlios.de>
Aurelien Jarno May 14, 2011, 11:02 p.m. UTC | #2
On Tue, May 03, 2011 at 02:50:13PM +0100, Peter Maydell wrote:
> Include the list of available targets in the --help output
> for the --target-list= option.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Thanks, applied.

> ---
> v2: As suggested by Stefan Weil, put the target list in --help
> rather than using '--target-list=?'. This patch includes using
> fold(1) in configure -- this should be OK because fold is a
> standard POSIX utility (and part of GNU coreutils and busybox).
> The resulting output looks like this:
> 
> Usage: configure [options]
> Options: [defaults in brackets after descriptions]
> 
> Standard options:
>   --help                   print this message
>   --prefix=PREFIX          install in PREFIX [/usr/local]
>   --interp-prefix=PREFIX   where to find shared libraries, etc.
>                            use %M for cpu name [/usr/gnemul/qemu-%M]
>   --target-list=LIST       set target list (default: build everything)
>                            Available targets: i386-softmmu x86_64-softmmu 
>                            arm-softmmu cris-softmmu lm32-softmmu m68k-softmmu 
>                            microblaze-softmmu microblazeel-softmmu mips-softmmu 
>                            mipsel-softmmu mips64-softmmu mips64el-softmmu 
>                            ppc-softmmu ppcemb-softmmu ppc64-softmmu sh4-softmmu 
>                            sh4eb-softmmu sparc-softmmu sparc64-softmmu 
>                            i386-linux-user x86_64-linux-user alpha-linux-user 
>                            arm-linux-user armeb-linux-user cris-linux-user 
>                            m68k-linux-user microblaze-linux-user 
>                            microblazeel-linux-user mips-linux-user 
>                            mipsel-linux-user ppc-linux-user ppc64-linux-user 
>                            ppc64abi32-linux-user sh4-linux-user 
>                            sh4eb-linux-user sparc-linux-user sparc64-linux-user 
>                            sparc32plus-linux-user unicore32-linux-user 
> 
> Advanced options (experts only):
> [etc]
> 
> 
>  configure |  134 ++++++++++++++++++++++++++++++++-----------------------------
>  1 files changed, 70 insertions(+), 64 deletions(-)
> 
> diff --git a/configure b/configure
> index 6f75e2e..f46f5d4 100755
> --- a/configure
> +++ b/configure
> @@ -822,6 +822,72 @@ esac
>  
>  [ -z "$guest_base" ] && guest_base="$host_guest_base"
>  
> +
> +default_target_list=""
> +
> +# these targets are portable
> +if [ "$softmmu" = "yes" ] ; then
> +    default_target_list="\
> +i386-softmmu \
> +x86_64-softmmu \
> +arm-softmmu \
> +cris-softmmu \
> +lm32-softmmu \
> +m68k-softmmu \
> +microblaze-softmmu \
> +microblazeel-softmmu \
> +mips-softmmu \
> +mipsel-softmmu \
> +mips64-softmmu \
> +mips64el-softmmu \
> +ppc-softmmu \
> +ppcemb-softmmu \
> +ppc64-softmmu \
> +sh4-softmmu \
> +sh4eb-softmmu \
> +sparc-softmmu \
> +sparc64-softmmu \
> +"
> +fi
> +# the following are Linux specific
> +if [ "$linux_user" = "yes" ] ; then
> +    default_target_list="${default_target_list}\
> +i386-linux-user \
> +x86_64-linux-user \
> +alpha-linux-user \
> +arm-linux-user \
> +armeb-linux-user \
> +cris-linux-user \
> +m68k-linux-user \
> +microblaze-linux-user \
> +microblazeel-linux-user \
> +mips-linux-user \
> +mipsel-linux-user \
> +ppc-linux-user \
> +ppc64-linux-user \
> +ppc64abi32-linux-user \
> +sh4-linux-user \
> +sh4eb-linux-user \
> +sparc-linux-user \
> +sparc64-linux-user \
> +sparc32plus-linux-user \
> +unicore32-linux-user \
> +"
> +fi
> +# the following are Darwin specific
> +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
> +    default_target_list="${default_target_list}\
> +i386-bsd-user \
> +x86_64-bsd-user \
> +sparc-bsd-user \
> +sparc64-bsd-user \
> +"
> +fi
> +
>  if test x"$show_help" = x"yes" ; then
>  cat << EOF
>  
> @@ -834,7 +900,9 @@ 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 "Available targets: $default_target_list" | \
> +    fold -s -w 53 | sed -e 's/^/                           /'
>  echo ""
>  echo "Advanced options (experts only):"
>  echo "  --source-path=PATH       path of source code [$source_path]"
> @@ -1004,70 +1072,8 @@ if test "$solaris" = "yes" ; then
>    fi
>  fi
>  
> -
>  if test -z "$target_list" ; then
> -# these targets are portable
> -    if [ "$softmmu" = "yes" ] ; then
> -        target_list="\
> -i386-softmmu \
> -x86_64-softmmu \
> -arm-softmmu \
> -cris-softmmu \
> -lm32-softmmu \
> -m68k-softmmu \
> -microblaze-softmmu \
> -microblazeel-softmmu \
> -mips-softmmu \
> -mipsel-softmmu \
> -mips64-softmmu \
> -mips64el-softmmu \
> -ppc-softmmu \
> -ppcemb-softmmu \
> -ppc64-softmmu \
> -sh4-softmmu \
> -sh4eb-softmmu \
> -sparc-softmmu \
> -sparc64-softmmu \
> -"
> -    fi
> -# the following are Linux specific
> -    if [ "$linux_user" = "yes" ] ; then
> -        target_list="${target_list}\
> -i386-linux-user \
> -x86_64-linux-user \
> -alpha-linux-user \
> -arm-linux-user \
> -armeb-linux-user \
> -cris-linux-user \
> -m68k-linux-user \
> -microblaze-linux-user \
> -microblazeel-linux-user \
> -mips-linux-user \
> -mipsel-linux-user \
> -ppc-linux-user \
> -ppc64-linux-user \
> -ppc64abi32-linux-user \
> -sh4-linux-user \
> -sh4eb-linux-user \
> -sparc-linux-user \
> -sparc64-linux-user \
> -sparc32plus-linux-user \
> -unicore32-linux-user \
> -"
> -    fi
> -# the following are Darwin specific
> -    if [ "$darwin_user" = "yes" ] ; then
> -        target_list="$target_list i386-darwin-user ppc-darwin-user "
> -    fi
> -# the following are BSD specific
> -    if [ "$bsd_user" = "yes" ] ; then
> -        target_list="${target_list}\
> -i386-bsd-user \
> -x86_64-bsd-user \
> -sparc-bsd-user \
> -sparc64-bsd-user \
> -"
> -    fi
> +    target_list="$default_target_list"
>  else
>      target_list=`echo "$target_list" | sed -e 's/,/ /g'`
>  fi
> -- 
> 1.7.1
> 
> 
>
diff mbox

Patch

diff --git a/configure b/configure
index 6f75e2e..f46f5d4 100755
--- a/configure
+++ b/configure
@@ -822,6 +822,72 @@  esac
 
 [ -z "$guest_base" ] && guest_base="$host_guest_base"
 
+
+default_target_list=""
+
+# these targets are portable
+if [ "$softmmu" = "yes" ] ; then
+    default_target_list="\
+i386-softmmu \
+x86_64-softmmu \
+arm-softmmu \
+cris-softmmu \
+lm32-softmmu \
+m68k-softmmu \
+microblaze-softmmu \
+microblazeel-softmmu \
+mips-softmmu \
+mipsel-softmmu \
+mips64-softmmu \
+mips64el-softmmu \
+ppc-softmmu \
+ppcemb-softmmu \
+ppc64-softmmu \
+sh4-softmmu \
+sh4eb-softmmu \
+sparc-softmmu \
+sparc64-softmmu \
+"
+fi
+# the following are Linux specific
+if [ "$linux_user" = "yes" ] ; then
+    default_target_list="${default_target_list}\
+i386-linux-user \
+x86_64-linux-user \
+alpha-linux-user \
+arm-linux-user \
+armeb-linux-user \
+cris-linux-user \
+m68k-linux-user \
+microblaze-linux-user \
+microblazeel-linux-user \
+mips-linux-user \
+mipsel-linux-user \
+ppc-linux-user \
+ppc64-linux-user \
+ppc64abi32-linux-user \
+sh4-linux-user \
+sh4eb-linux-user \
+sparc-linux-user \
+sparc64-linux-user \
+sparc32plus-linux-user \
+unicore32-linux-user \
+"
+fi
+# the following are Darwin specific
+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
+    default_target_list="${default_target_list}\
+i386-bsd-user \
+x86_64-bsd-user \
+sparc-bsd-user \
+sparc64-bsd-user \
+"
+fi
+
 if test x"$show_help" = x"yes" ; then
 cat << EOF
 
@@ -834,7 +900,9 @@  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 "Available targets: $default_target_list" | \
+    fold -s -w 53 | sed -e 's/^/                           /'
 echo ""
 echo "Advanced options (experts only):"
 echo "  --source-path=PATH       path of source code [$source_path]"
@@ -1004,70 +1072,8 @@  if test "$solaris" = "yes" ; then
   fi
 fi
 
-
 if test -z "$target_list" ; then
-# these targets are portable
-    if [ "$softmmu" = "yes" ] ; then
-        target_list="\
-i386-softmmu \
-x86_64-softmmu \
-arm-softmmu \
-cris-softmmu \
-lm32-softmmu \
-m68k-softmmu \
-microblaze-softmmu \
-microblazeel-softmmu \
-mips-softmmu \
-mipsel-softmmu \
-mips64-softmmu \
-mips64el-softmmu \
-ppc-softmmu \
-ppcemb-softmmu \
-ppc64-softmmu \
-sh4-softmmu \
-sh4eb-softmmu \
-sparc-softmmu \
-sparc64-softmmu \
-"
-    fi
-# the following are Linux specific
-    if [ "$linux_user" = "yes" ] ; then
-        target_list="${target_list}\
-i386-linux-user \
-x86_64-linux-user \
-alpha-linux-user \
-arm-linux-user \
-armeb-linux-user \
-cris-linux-user \
-m68k-linux-user \
-microblaze-linux-user \
-microblazeel-linux-user \
-mips-linux-user \
-mipsel-linux-user \
-ppc-linux-user \
-ppc64-linux-user \
-ppc64abi32-linux-user \
-sh4-linux-user \
-sh4eb-linux-user \
-sparc-linux-user \
-sparc64-linux-user \
-sparc32plus-linux-user \
-unicore32-linux-user \
-"
-    fi
-# the following are Darwin specific
-    if [ "$darwin_user" = "yes" ] ; then
-        target_list="$target_list i386-darwin-user ppc-darwin-user "
-    fi
-# the following are BSD specific
-    if [ "$bsd_user" = "yes" ] ; then
-        target_list="${target_list}\
-i386-bsd-user \
-x86_64-bsd-user \
-sparc-bsd-user \
-sparc64-bsd-user \
-"
-    fi
+    target_list="$default_target_list"
 else
     target_list=`echo "$target_list" | sed -e 's/,/ /g'`
 fi