[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen: enable stubdom on a per arch basis



On Thu, 2013-01-31 at 10:52 +0000, Samuel Thibault wrote:
> Ian Campbell, le Thu 31 Jan 2013 10:46:31 +0000, a Ãcrit :
> > ... and disable on ARM (for now).
> 
> Well, maybe we should rather use an "inclusion" list rather than an
> "exclusion" list, since it essentially depends on which arch mini-os was
> ported to.

Hrm, yes, I was thinking that ARM was the exception but you are right,
it makes more sense to consider x86 the exception (in that it has had
mini-os ported to it).

8<------------------

From 876a991cb2f8efa8076f3089382d0c453c96b68e Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Thu, 31 Jan 2013 10:00:40 +0000
Subject: [PATCH] xen: enable stubdom on a per arch basis

... and disable on ARM (for now).

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Tim (Xen.org) <tim@xxxxxxx>
---
v2: whitelist x86 (which has mini-os ported) instead of blacklisting
    ARM
---
 configure       |  292 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 configure.ac    |   15 +++-
 m4/subsystem.m4 |   65 ++++++++++---
 3 files changed, 333 insertions(+), 39 deletions(-)

diff --git a/configure b/configure
index c2ec87d..69803a7 100755
--- a/configure
+++ b/configure
@@ -568,6 +568,14 @@ tools
 kernels
 xen
 subdirs
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
 target_alias
 host_alias
 build_alias
@@ -1220,6 +1228,10 @@ Fine tuning of the installation directories:
 _ACEOF
 
   cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
 _ACEOF
 fi
 
@@ -1236,7 +1248,7 @@ Optional Features:
   --disable-xen           Disable build and install of xen
   --disable-kernels       Disable build and install of kernels
   --disable-tools         Disable build and install of tools
-  --disable-stubdom       Disable build and install of stubdom
+  --enable-stubdom        Enable build and install of stubdom
   --disable-docs          Disable build and install of docs
 
 Report bugs to <xen-devel@xxxxxxxxxxxxx>.
@@ -1673,20 +1685,6 @@ ac_config_files="$ac_config_files ./config/Toplevel.mk"
 
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -1716,22 +1714,151 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # 
Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" 
"$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" 
"$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case "$host_cpu" in
+    i[3456]86|x86_64)
+        arch_enable_stubdom=y
+        ;;
+    *)
+        arch_enable_stubdom=n
+        ;;
+esac
+
 
 
 
 # Check whether --enable-xen was given.
 if test "${enable_xen+set}" = set; then :
   enableval=$enable_xen;
+
+if test "x$enableval" = "xyes"; then :
+
+
+xen=y
+SUBSYSTEMS="$SUBSYSTEMS xen"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
 xen=n
 
+
+fi
+
+fi
+
+
 else
 
+
 xen=y
 SUBSYSTEMS="$SUBSYSTEMS xen"
-if test -e "xen/configure"; then :
 
-subdirs="$subdirs xen"
 
+fi
+
+
+if test -e "xen/configure"; then :
+
+if test "x$xen" = "xy" || test "x$xen" = "x" ; then
+    subdirs="$subdirs xen"
 
 fi
 
@@ -1743,16 +1870,41 @@ fi
 # Check whether --enable-kernels was given.
 if test "${enable_kernels+set}" = set; then :
   enableval=$enable_kernels;
+
+if test "x$enableval" = "xyes"; then :
+
+
+kernels=y
+SUBSYSTEMS="$SUBSYSTEMS kernels"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
 kernels=n
 
+
+fi
+
+fi
+
+
 else
 
+
 kernels=y
 SUBSYSTEMS="$SUBSYSTEMS kernels"
-if test -e "kernels/configure"; then :
 
-subdirs="$subdirs kernels"
 
+fi
+
+
+if test -e "kernels/configure"; then :
+
+if test "x$kernels" = "xy" || test "x$kernels" = "x" ; then
+    subdirs="$subdirs kernels"
 
 fi
 
@@ -1764,16 +1916,41 @@ fi
 # Check whether --enable-tools was given.
 if test "${enable_tools+set}" = set; then :
   enableval=$enable_tools;
+
+if test "x$enableval" = "xyes"; then :
+
+
+tools=y
+SUBSYSTEMS="$SUBSYSTEMS tools"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
 tools=n
 
+
+fi
+
+fi
+
+
 else
 
+
 tools=y
 SUBSYSTEMS="$SUBSYSTEMS tools"
-if test -e "tools/configure"; then :
 
-subdirs="$subdirs tools"
 
+fi
+
+
+if test -e "tools/configure"; then :
+
+if test "x$tools" = "xy" || test "x$tools" = "x" ; then
+    subdirs="$subdirs tools"
 
 fi
 
@@ -1785,38 +1962,98 @@ fi
 # Check whether --enable-stubdom was given.
 if test "${enable_stubdom+set}" = set; then :
   enableval=$enable_stubdom;
+
+if test "x$enableval" = "xyes"; then :
+
+
+stubdom=y
+SUBSYSTEMS="$SUBSYSTEMS stubdom"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
 stubdom=n
 
+
+fi
+
+fi
+
+
 else
 
+if test "x$arch_enable_stubdom" = "xy"; then :
+
+
 stubdom=y
 SUBSYSTEMS="$SUBSYSTEMS stubdom"
-if test -e "stubdom/configure"; then :
 
-subdirs="$subdirs stubdom"
+
+else
+
+
+stubdom=n
 
 
 fi
 
+if test -e "stubdom/configure"; then :
+
+if test "x$stubdom" = "xy" || test "x$stubdom" = "x" ; then
+    subdirs="$subdirs stubdom"
+
+fi
+
 fi
 
 
 
+fi
+
+
 
 # Check whether --enable-docs was given.
 if test "${enable_docs+set}" = set; then :
   enableval=$enable_docs;
+
+if test "x$enableval" = "xyes"; then :
+
+
+docs=y
+SUBSYSTEMS="$SUBSYSTEMS docs"
+
+
+else
+
+if test "x$enableval" = "xno"; then :
+
+
 docs=n
 
+
+fi
+
+fi
+
+
 else
 
+
 docs=y
 SUBSYSTEMS="$SUBSYSTEMS docs"
-if test -e "docs/configure"; then :
 
-subdirs="$subdirs docs"
+
+fi
 
 
+if test -e "docs/configure"; then :
+
+if test "x$docs" = "xy" || test "x$docs" = "x" ; then
+    subdirs="$subdirs docs"
+
 fi
 
 fi
@@ -1826,6 +2063,11 @@ fi
 
 
 
+echo "Will build the following subsystems:"
+for x in $SUBSYSTEMS; do
+       echo "  $x"
+done
+
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
diff --git a/configure.ac b/configure.ac
index df1d5da..83342f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,14 +8,27 @@ AC_CONFIG_SRCDIR([./xen/common/kernel.c])
 AC_CONFIG_FILES([./config/Toplevel.mk])
 AC_PREFIX_DEFAULT([/usr])
 
+AC_CANONICAL_HOST
+
 m4_include([m4/features.m4])
 m4_include([m4/subsystem.m4])
 
+dnl mini-os is only ported to certain platforms
+case "$host_cpu" in
+    i[[3456]]86|x86_64)
+        arch_enable_stubdom=y
+        ;;
+    *)
+        arch_enable_stubdom=n
+        ;;
+esac
+
 AX_SUBSYSTEM_DEFAULT_ENABLE([xen])
 AX_SUBSYSTEM_DEFAULT_ENABLE([kernels])
 AX_SUBSYSTEM_DEFAULT_ENABLE([tools])
-AX_SUBSYSTEM_DEFAULT_ENABLE([stubdom])
+AX_SUBSYSTEM_CONDITIONAL([stubdom], $arch_enable_stubdom)
 AX_SUBSYSTEM_DEFAULT_ENABLE([docs])
+
 AX_SUBSYSTEM_FINISH
 
 AC_OUTPUT()
diff --git a/m4/subsystem.m4 b/m4/subsystem.m4
index d3eb8c9..9e1e61f 100644
--- a/m4/subsystem.m4
+++ b/m4/subsystem.m4
@@ -1,32 +1,71 @@
+AC_DEFUN([AX_ENABLE_SUBSYSTEM], [
+$1=y
+SUBSYSTEMS="$SUBSYSTEMS $1"
+])
+
+AC_DEFUN([AX_DISABLE_SUBSYSTEM], [
+$1=n
+])
+
 AC_DEFUN([AX_SUBSYSTEM_DEFAULT_ENABLE], [
 AC_ARG_ENABLE([$1],
 AS_HELP_STRING([--disable-$1], [Disable build and install of $1]),[
-$1=n
+AX_SUBSYSTEM_INTERNAL([$1])
 ],[
-$1=y
-SUBSYSTEMS="$SUBSYSTEMS $1"
-AS_IF([test -e "$1/configure"], [
-AC_CONFIG_SUBDIRS([$1])
+AX_ENABLE_SUBSYSTEM([$1])
 ])
-])
-AC_SUBST($1)
+AX_SUBSYSTEM_CONFIGURE([$1])
+AC_SUBST([$1])
 ])
 
 AC_DEFUN([AX_SUBSYSTEM_DEFAULT_DISABLE], [
 AC_ARG_ENABLE([$1],
 AS_HELP_STRING([--enable-$1], [Enable build and install of $1]),[
-$1=y
-SUBSYSTEMS="$SUBSYSTEMS $1"
-AS_IF([test -e "$1/configure"], [
-AC_CONFIG_SUBDIRS([$1])
+AX_SUBSYSTEM_INTERNAL([$1])
+],[
+AX_DISABLE_SUBSYSTEM([$1])
 ])
+AX_SUBSYSTEM_CONFIGURE([$1])
+AC_SUBST([$1])
+])
+
+AC_DEFUN([AX_SUBSYSTEM_CONDITIONAL], [
+AC_ARG_ENABLE([$1],
+AS_HELP_STRING([--enable-$1], [Enable build and install of $1]),[
+AX_SUBSYSTEM_INTERNAL([$1])
 ],[
-$1=n
+AS_IF([test "x$2" = "xy"],[
+AX_ENABLE_SUBSYSTEM([$1])
+],[
+AX_DISABLE_SUBSYSTEM([$1])
 ])
+AX_SUBSYSTEM_CONFIGURE([$1])
 AC_SUBST($1)
 ])
-
+])
 
 AC_DEFUN([AX_SUBSYSTEM_FINISH], [
 AC_SUBST(SUBSYSTEMS)
+echo "Will build the following subsystems:"
+for x in $SUBSYSTEMS; do
+       echo "  $x"
+done
+])
+
+AC_DEFUN([AX_SUBSYSTEM_INTERNAL], [
+AS_IF([test "x$enableval" = "xyes"], [
+AX_ENABLE_SUBSYSTEM([$1])
+],[
+AS_IF([test "x$enableval" = "xno"],[
+AX_DISABLE_SUBSYSTEM([$1])
+])
+])
+])
+
+AC_DEFUN([AX_SUBSYSTEM_CONFIGURE], [
+AS_IF([test -e "$1/configure"], [
+if test "x$$1" = "xy" || test "x$$1" = "x" ; then
+    AC_CONFIG_SUBDIRS([$1])
+fi
+])
 ])
-- 
1.7.2.5




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.