Patchwork [2/4] linux-user: specify the cpu model during configure

login
register
mail settings
Submitter Laurent Vivier
Date July 28, 2011, 1:37 p.m.
Message ID <1311860276-24690-3-git-send-email-Laurent@Vivier.EU>
Download mbox | patch
Permalink /patch/107254/
State New
Headers show

Comments

Laurent Vivier - July 28, 2011, 1:37 p.m.
This patch allows to set the default cpu model for a given architecture,
for instance:

 configure --target-list=m68k-linux-user --m68k-default-cpu=m68040

Signed-off-by: Laurent Vivier <Laurent@Vivier.EU>
---
 configure |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/configure b/configure
index c74a5f9..d54f0ed 100755
--- a/configure
+++ b/configure
@@ -527,6 +527,10 @@  for opt do
   ;;
   --target-list=*) target_list="$optarg"
   ;;
+  --*-default-cpu=*)
+    tmp=`expr "x$opt" : 'x--\(.*\)-default-cpu=.*'`
+    eval ${tmp}_default_cpu="$optarg"
+  ;;
   --enable-trace-backend=*) trace_backend="$optarg"
   ;;
   --with-trace-file=*) trace_file="$optarg"
@@ -916,6 +920,7 @@  echo "                           use %M for cpu name [$interp_prefix]"
 echo "  --target-list=LIST       set target list (default: build everything)"
 echo "Available targets: $default_target_list" | \
     fold -s -w 53 | sed -e 's/^/                           /'
+echo "  --ARCH-default-cpu=CPU   set the default cpu for a given architecture"
 echo ""
 echo "Advanced options (experts only):"
 echo "  --source-path=PATH       path of source code [$source_path]"
@@ -3291,6 +3296,10 @@  case "$target_arch2" in
     exit 1
   ;;
 esac
+tmp_target_default_cpu=`eval echo \\$${target_arch2}_default_cpu`
+if [ "x$tmp_target_default_cpu" != "x" ] ; then
+  target_default_cpu="$tmp_target_default_cpu"
+fi
 echo "TARGET_SHORT_ALIGNMENT=$target_short_alignment" >> $config_target_mak
 echo "TARGET_INT_ALIGNMENT=$target_int_alignment" >> $config_target_mak
 echo "TARGET_LONG_ALIGNMENT=$target_long_alignment" >> $config_target_mak