Patchwork [2/2] configure: Report unknown target names more helpfully

login
register
mail settings
Submitter Peter Maydell
Date May 20, 2013, 3:16 p.m.
Message ID <1369062976-301-3-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/245055/
State New
Headers show

Comments

Peter Maydell - May 20, 2013, 3:16 p.m.
If the user specifies a target list themselves, check each entry
to make sure it's a target we recognise. This allows us to print
a helpful error message, rather than falling through (where we
would probably eventually end up hitting the uninformative
"ERROR: Unsupported target CPU").

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Patch

diff --git a/configure b/configure
index e0fa143..4b74a94 100755
--- a/configure
+++ b/configure
@@ -1338,6 +1338,19 @@  if test -z "${target_list+xxx}" ; then
 else
     target_list=`echo "$target_list" | sed -e 's/,/ /g'`
 fi
+
+# Check that we recognised the target name; this allows a more
+# friendly error message than if we let it fall through.
+for target in $target_list; do
+    case " $default_target_list " in
+        *" $target "*)
+            ;;
+        *)
+            error_exit "Unknown target name '$target'"
+            ;;
+    esac
+done
+
 # see if system emulation was really requested
 case " $target_list " in
   *"-softmmu "*) softmmu=yes