From 1eb37421cfce29c5187ec12f3c0da5b874116f67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Thu, 31 May 2012 10:54:13 +0200
Subject: [PATCH] Add XEN_CMD to _autoconf.py
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is needed so we can specify the xen command upon configure time

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 Makefile.am  |  1 +
 configure.ac | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 7a2d35952..84605b5ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1138,6 +1138,7 @@ lib/_autoconf.py: Makefile | lib/.dir
 	  echo "ENABLE_CONFD = $(ENABLE_CONFD)"; \
 	  echo "PY_CONFD = $(PY_CONFD)"; \
 	  echo "HS_CONFD = $(HS_CONFD)"; \
+	  echo "XEN_CMD = '$(XEN_CMD)'"; \
 	} > $@
 
 lib/_vcsversion.py: Makefile vcs-version | lib/.dir
diff --git a/configure.ac b/configure.ac
index f93920437..484e2ef8c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,19 @@ AC_ARG_WITH([xen-initrd],
   [xen_initrd="/boot/initrd-3-xenU"])
 AC_SUBST(XEN_INITRD, $xen_initrd)
 
+# --with-xen-cmd=...
+AC_ARG_WITH([xen-cmd],
+  [AS_HELP_STRING([--with-xen-cmd=CMD],
+    [Sets the xen cli interface command (default is xm)]
+  )],
+  [xen_cmd="$withval"],
+  [xen_cmd="xm"])
+AC_SUBST(XEN_CMD, $xen_cmd)
+
+if ! (test "$XEN_CMD" == "xl" || test "$XEN_CMD" == "xm"); then
+  AC_MSG_ERROR([Unsupported xen command specified])
+fi
+
 # --with-kvm-kernel=...
 AC_ARG_WITH([kvm-kernel],
   [AS_HELP_STRING([--with-kvm-kernel=PATH],
-- 
GitLab