All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/15] xen: add systemd support
@ 2014-04-30  1:11 Luis R. Rodriguez
  2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
                   ` (16 more replies)
  0 siblings, 17 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This is my 4th series which I addresses all feedback from the
first 3 series on adding systemd support into xen. I've taken
things a bit further, I've been avoiding autoconf but in the end
that proved to provide the best solution. Additionally not
originally understanding systemd's socket stuff prompted me to
look into that and decided its best to just switch to active sockets
for systemd [0] intregration for both censtored and oxenstored. I've
also decided its best to avoid separate service files for the
two daemons given that we can do this cleanly with autoconf.

I've run time tested this against today's tip against the
upstream kernel, on OpenSUSE using both censtored and oxenstored.

To build you can use either of with the default preferring
oxenstored if ocaml tools are present:

./configure --with-xenstored=cxenstored --enable-systemd
./configure --with-xenstored=oxenstored --enable-systemd

Systems should just have to:

systemctl enable xenstored.socket

And then anything that will tickle the sockets:

/var/run/xenstored/socket
/var/run/xenstored/socket_ro

will trigger either censtored or oxenstored to activate. This
example suffices:

nc -U /var/run/xenstored/socket_ro

This example also happens to test the order of supply / demand
of sockets through sytsemd's active socket mechanism and our
integration to do this in order. Sine we cannot currently stop
the xenstore this means we cannot take advantage of dynamically
switching xensrores live, but if that is fixed we should be able
to dynamically swap even the different types of xenstore on a
live system or just upgrade the xenstore without a reboot.

The ordering of active sockets implementation is begging to be
shared with a common small library but given that xc / xl are
not specific to the xenstore it would be pointless to stuff and
duplicate code for both in there. Both the cxenstore and oxenstored
handle their own store access on their own, if there's a desire to
unify that small piece of code we should consider other things to
stuff on it. For now this goes separately.

Systemd autconf support was split out as much as possible from
xen to make it useful for any other project, perhaps this can
go upstream to systemd.

Ocaml lacks support for systemd and as such I needed to extend
oxenstored support through a small stub for access to systemd.
System'd sd_listen_fds() can technically easily be implemented
in ocaml *but* given that FD_CLOEXEC support through the new
Unix.set_cloexec is only available on 4.00.1+dev which isn't
yet widely available I decided agianst this, this lets
systemd take care of FD_CLOEXEC for us. Proper support for
systemd should instead in the end be merged upstream into
ocaml, but who knows when that will happen.

Given the slew of autoconf updates to xen I only provide an
autogen.sh update after the last change to make things easier
to review.

[0] http://0pointer.de/blog/projects/socket-activation2.html
[1] http://caml.inria.fr/mantis/view.php?id=5569

Luis R. Rodriguez (15):
  xenstore: add support for a retry open limit on xenstored
  xencommons: use the retry limit instead of implementing our own
    timeout
  xenstored: enable usage of config.h on both xenstored and oxenstored
  cxenstored: add support for systemd active sockets
  oxenstored: add support for systemd active sockets
  tools/xendomains: make xl the default
  tools/xendomains: do space cleanups
  tools/xendomains: move to libexec and use a smaller init helper
  autoconf: xen: force a refresh with autoconf
  autoconf: update m4/pkg.m4
  autoconf: xen: move standard variables to a generic place
  autoconf: xen: peg the xenstored preference onto the top level config
  systemd: add xen systemd service and module files
  autoconf: xen: add systemd support into the build system
  autoconf: xen: trigger an update with autogen.sh

 .gitignore                                         |    7 +
 Config.mk                                          |   13 -
 Makefile                                           |   11 +-
 autogen.sh                                         |    8 +-
 config/StdGNU.mk                                   |   19 +-
 config/Tools.mk.in                                 |    6 +
 config/Toplevel.mk.in                              |   27 +
 config/xen-environment-header.in                   |   16 +
 config/xen-environment-scripts.in                  |   18 +
 configure                                          | 2396 ++++++++++++++++-
 configure.ac                                       |   10 +-
 docs/man/xenstore.pod.1                            |    7 +-
 m4/expand_config.m4                                |  122 +
 m4/pkg.m4                                          |   88 +-
 m4/pkg.m4.README                                   |   21 +
 m4/systemd.m4                                      |  105 +
 stubdom/Makefile                                   |   17 +-
 stubdom/configure                                  | 2390 +++++++++++++++++
 stubdom/configure.ac                               |    4 +
 tools/config.h.in                                  |    3 +
 tools/configure                                    | 2815 +++++++++++++++++++-
 tools/configure.ac                                 |   29 +-
 tools/hotplug/Linux/Makefile                       |   14 +-
 tools/hotplug/Linux/init.d/xencommons              |   25 +-
 tools/hotplug/Linux/init.d/xendomains              |  567 +---
 tools/hotplug/Linux/systemd/Makefile               |   44 +
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |    9 +
 .../Linux/systemd/var-lib-xenstored.mount.in       |   13 +
 .../systemd/xen-qemu-dom0-disk-backend.service.in  |   22 +
 .../hotplug/Linux/systemd/xen-watchdog.service.in  |   13 +
 .../Linux/systemd/xen.conf.modules-load.d.in       |   16 +
 tools/hotplug/Linux/systemd/xenconsoled.service.in |   20 +
 tools/hotplug/Linux/systemd/xendomains.service.in  |   16 +
 tools/hotplug/Linux/systemd/xenstored.service.in   |   25 +
 tools/hotplug/Linux/systemd/xenstored.socket.in    |    9 +
 tools/hotplug/Linux/xendomains                     |  585 ++++
 tools/hotplug/common/Makefile                      |    7 +-
 tools/libxl/Makefile                               |   11 +-
 tools/ocaml/xenstored/Makefile                     |   15 +-
 tools/ocaml/xenstored/systemd.ml                   |   16 +
 tools/ocaml/xenstored/systemd.mli                  |   21 +
 tools/ocaml/xenstored/systemd_stubs.c              |  166 ++
 tools/ocaml/xenstored/utils.ml                     |   21 +-
 tools/python/Makefile                              |    6 +-
 tools/xenstore/Makefile                            |    7 +
 tools/xenstore/xenstore_client.c                   |   40 +-
 tools/xenstore/xs.c                                |  127 +
 47 files changed, 9267 insertions(+), 680 deletions(-)
 create mode 100644 config/xen-environment-header.in
 create mode 100644 config/xen-environment-scripts.in
 create mode 100644 m4/expand_config.m4
 create mode 100644 m4/pkg.m4.README
 create mode 100644 m4/systemd.m4
 create mode 100644 tools/hotplug/Linux/systemd/Makefile
 create mode 100644 tools/hotplug/Linux/systemd/proc-xen.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-watchdog.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
 create mode 100644 tools/hotplug/Linux/systemd/xenconsoled.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xendomains.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.socket.in
 create mode 100644 tools/hotplug/Linux/xendomains
 create mode 100644 tools/ocaml/xenstored/systemd.ml
 create mode 100644 tools/ocaml/xenstored/systemd.mli
 create mode 100644 tools/ocaml/xenstored/systemd_stubs.c

-- 
1.9.0

^ permalink raw reply	[flat|nested] 84+ messages in thread

* [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-05-07 15:03   ` Ian Campbell
  2014-05-12 13:50   ` Ian Jackson
  2014-04-30  1:11 ` [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout Luis R. Rodriguez
                   ` (15 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This adds support for a customizable retry limit on trying to open
the xenstored unix domain socket, each retry is separated by 1 second.
This should allow us to simplify both our LSB init scripts. For systemd
we'll use socket activation.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 docs/man/xenstore.pod.1          |  7 ++++++-
 tools/xenstore/xenstore_client.c | 40 +++++++++++++++++++++++++++++-----------
 2 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/docs/man/xenstore.pod.1 b/docs/man/xenstore.pod.1
index 7417289..9647143 100644
--- a/docs/man/xenstore.pod.1
+++ b/docs/man/xenstore.pod.1
@@ -4,12 +4,17 @@ xenstore - interact with Xenstore
 
 =head1 SYNOPSIS
 
-B<xenstore> I<CMD> ...
+B<xenstore> I<CMD> I[ --retries <num_open_retries> ] ...
 
 =head1 DESCRIPTION
 
 A set of utilities for interacting with Xenstore.
 
+All xenstore-* commands support the --retries long option which
+can be used to try to opening the unix domain socket a certain
+number of retries before giving up. Each new try occurs every
+second.
+
 =over
 
 =item B<xenstore-chmod>(1)
diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 0ec103f..0ab40f7 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -77,27 +77,28 @@ usage(enum mode mode, int incl_mode, const char *progname)
 	errx(1, "Usage: %s <mode> [-h] [...]", progname);
     case MODE_read:
 	mstr = incl_mode ? "read " : "";
-	errx(1, "Usage: %s %s[-h] [-p] [-s] key [...]", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-p] [-s] key [...]",
+	     progname, mstr);
     case MODE_write:
 	mstr = incl_mode ? "write " : "";
-	errx(1, "Usage: %s %s[-h] [-s] key value [...]", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-s] key value [...]", progname, mstr);
     case MODE_rm:
 	mstr = incl_mode ? "rm " : "";
-	errx(1, "Usage: %s %s[-h] [-s] [-t] key [...]", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-s] [-t] key [...]", progname, mstr);
     case MODE_exists:
 	mstr = incl_mode ? "exists " : "";
     case MODE_list:
 	mstr = mstr ? : incl_mode ? "list " : "";
-	errx(1, "Usage: %s %s[-h] [-p] [-s] key [...]", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-p] [-s] key [...]", progname, mstr);
     case MODE_ls:
 	mstr = mstr ? : incl_mode ? "ls " : "";
-	errx(1, "Usage: %s %s[-h] [-f] [-p] [-s] [path]", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-f] [-p] [-s] [path]", progname, mstr);
     case MODE_chmod:
 	mstr = incl_mode ? "chmod " : "";
-	errx(1, "Usage: %s %s[-h] [-u] [-r] [-s] key <mode [modes...]>", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-u] [-r] [-s] key <mode [modes...]>", progname, mstr);
     case MODE_watch:
 	mstr = incl_mode ? "watch " : "";
-	errx(1, "Usage: %s %s[-h] [-n NR] key", progname, mstr);
+	errx(1, "Usage: %s %s[-h] [ --retries <num_open_retries> ] [-n NR] key", progname, mstr);
     }
 }
 
@@ -493,9 +494,9 @@ static enum mode lookup_mode(const char *m)
 int
 main(int argc, char **argv)
 {
-    struct xs_handle *xsh;
+    struct xs_handle *xsh = NULL;
     xs_transaction_t xth = XBT_NULL;
-    int ret = 0, socket = 0;
+    int ret = 0, socket = 0, retries = 1;
     int prefix = 0;
     int tidy = 0;
     int upto = 0;
@@ -535,6 +536,7 @@ main(int argc, char **argv)
 	    {"upto",    0, 0, 'u'}, /* MODE_chmod */
 	    {"recurse", 0, 0, 'r'}, /* MODE_chmod */
 	    {"number",  1, 0, 'n'}, /* MODE_watch */
+	    {"retries", 1, 0,  0 }, /* index 8 - MODE_* */
 	    {0, 0, 0, 0}
 	};
 
@@ -544,6 +546,15 @@ main(int argc, char **argv)
 	    break;
 
 	switch (c) {
+	case 0:
+	    if (index == 8 && optarg) {
+		retries = atoi(optarg);
+		if (retries < 0) {
+                    retries = 1;
+                    usage(mode, switch_argv, argv[0]);
+		}
+	    }
+	    break;
 	case 'h':
 	    usage(mode, switch_argv, argv[0]);
 	    /* NOTREACHED */
@@ -632,8 +643,15 @@ main(int argc, char **argv)
 	    max_width = ws.ws_col - 2;
     }
 
-    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
-    if (xsh == NULL) err(1, "xs_open");
+    while (retries--) {
+	    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
+	    if (xsh)
+		    break;
+	    if (retries)
+		    sleep(1);
+    }
+    if (!xsh)
+	    err(1, "xs_open");
 
 again:
     if (transaction) {
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
  2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-04-30  9:33   ` Andrew Cooper
  2014-05-07 15:05   ` Ian Campbell
  2014-04-30  1:11 ` [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
                   ` (14 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

xenstore-read now has support to retry opening the xenstored unix domain
socket a certain amount of times, once each second, use that instead of
implementing our own timeout.

For systemd we'll be using socket activation. Details for that will follow.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/hotplug/Linux/init.d/xencommons | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 4ebd636..7195413 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -54,9 +54,6 @@ if test -f /proc/xen/capabilities && \
 fi
 
 do_start () {
-        local time=0
-	local timeout=30
-
 	modprobe xen-evtchn 2>/dev/null
 	modprobe xen-gntdev 2>/dev/null
 	modprobe xen-gntalloc 2>/dev/null
@@ -93,17 +90,11 @@ do_start () {
 		    echo "No xenstored found"
 		    exit 1
 		fi
-
-		# Wait for xenstored to actually come up, timing out after 30 seconds
-                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
-                    echo -n .
-		    time=$(($time+1))
-                    sleep 1
-                done
-		echo
-
-		# Exit if we timed out
-		if ! [ $time -lt $timeout ] ; then
+		# We try opening the xenstored socket every second up to the
+		# limit specified, if it hasn't opened by then assume
+		# failure.
+                ${BINDIR}/xenstore-read --retries 30 -s / >/dev/null 2>&1
+		if [ $? -ne 0 ] ; then
 		    echo Could not start xenstored
 		    exit 1
 		fi
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
  2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
  2014-04-30  1:11 ` [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-05-07 15:06   ` Ian Campbell
  2014-04-30  1:11 ` [PATCH v4 04/15] cxenstored: add support for systemd active sockets Luis R. Rodriguez
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This will be used later for dynamic configuration paths on C code.

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/ocaml/xenstored/Makefile | 2 ++
 tools/xenstore/Makefile        | 1 +
 tools/xenstore/xs.c            | 2 ++
 3 files changed, 5 insertions(+)

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index b18f190..7fa8f53 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -2,6 +2,8 @@ XEN_ROOT = $(CURDIR)/../../..
 OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
+CFLAGS += -I$(XEN_ROOT)/tools/
+
 OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \
 	-I $(OCAML_TOPLEVEL)/libs/mmap \
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 262f401..21a3f11 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -6,6 +6,7 @@ MINOR = 3
 
 CFLAGS += -Werror
 CFLAGS += -I.
+CFLAGS += -I$(XEN_ROOT)/tools/
 CFLAGS += $(CFLAGS_libxenctrl)
 
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 968141d..f1d0f99 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -32,6 +32,8 @@
 #include <signal.h>
 #include <stdint.h>
 #include <errno.h>
+#include <config.h>
+
 #include "xenstore.h"
 #include "list.h"
 #include "utils.h"
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (2 preceding siblings ...)
  2014-04-30  1:11 ` [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-05-07 15:18   ` Ian Campbell
  2014-05-07 15:46   ` Ian Campbell
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
                   ` (12 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel; +Cc: Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This adds systemd socket activation support for the C xenstored.
Active sockets enable xenstored to be loaded only if required by a system
onto which Xen is installed on. Socket activation is handled by
systemd, once a port for a service which claims a socket is used
systemd will start the required services for it, on demand. For more
details on socket activation refer to Lennart's socket-activation
post regarding this [0].

Right now this code adds a no-op for this functionality, leaving the
enablement to be done later once systemd is properly hooked into
the build system. The socket activation is ordered in aligment with
the socket activation order passed on to systemd.

[0] http://0pointer.de/blog/projects/socket-activation2.html

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/xenstore/xs.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 125 insertions(+)

diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index f1d0f99..9bbf736 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -1,6 +1,7 @@
 /* 
     Xen Store Daemon interface providing simple tree-like database.
     Copyright (C) 2005 Rusty Russell IBM Corporation
+    Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
@@ -34,6 +35,10 @@
 #include <errno.h>
 #include <config.h>
 
+#if defined(HAVE_SYSTEMD)
+#include <systemd/sd-daemon.h>
+#endif
+
 #include "xenstore.h"
 #include "list.h"
 #include "utils.h"
@@ -182,11 +187,131 @@ int xs_fileno(struct xs_handle *h)
 	return h->watch_pipe[0];
 }
 
+#if defined(HAVE_SYSTEMD)
+
+/* Conforms to what we should send sd_is_socket_unix() */
+struct xen_systemd_active_socket {
+	int fd;
+	int type;
+	int listening;
+	const char *path;
+	size_t length;
+};
+
+/*
+ * We list stdin, stdout and stderr simply for documentation purposes
+ * and to help our array size fit the number of expected sockets we
+ * as sd_listen_fds() will return 5 for example if you set the socket
+ * service with 2 sockets.
+ */
+static struct xen_systemd_active_socket xenstore_active_sockets[] = {
+	{
+		.fd = SD_LISTEN_FDS_START -3,
+		.type = 0,
+		.listening = 0,
+		.path = "stdin",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START - 2,
+		.type = 0,
+		.listening = 0,
+		.path = "stderr",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START - 1,
+		.type = 0,
+		.listening = 0,
+		.path = "stderr",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START,
+		.type = SOCK_STREAM,
+		.listening = 0,
+		.path = "/var/run/xenstored/socket",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START + 1,
+		.type = SOCK_STREAM,
+		.listening = 0,
+		.path = "/var/run/xenstored/socket_ro",
+		.length = 0,
+	},
+};
+
+static struct xen_systemd_active_socket *get_xen_active_socket(const char *connect_to)
+{
+	unsigned int i;
+
+	for (i=0; i<ARRAY_SIZE(xenstore_active_sockets); i++) {
+		if (!strcmp(connect_to, xenstore_active_sockets[i].path)) {
+			if (!xenstore_active_sockets[i].type)
+				return NULL;
+			return &xenstore_active_sockets[i];
+		}
+	}
+
+	return NULL;
+}
+
+static int xs_get_active_socket(const char *connect_to)
+{
+	int n, r;
+	struct xen_systemd_active_socket *active_socket;
+
+	active_socket = get_xen_active_socket(connect_to);
+	if (!active_socket)
+		return -1;
+
+	n = sd_listen_fds(0);
+	if (n <= 0)
+		return -1;
+	else if (n >= (ARRAY_SIZE(xenstore_active_sockets)))
+		return -1;
+
+	r = sd_is_socket_unix(active_socket->fd,
+			      active_socket->type,
+			      active_socket->listening,
+			      active_socket->path,
+			      active_socket->length);
+	if (r < 0)
+		return r;
+
+	return active_socket->fd;
+}
+
+/*
+ * If xenstored was built to depend on systemd libraries
+ * we assume you want all the bells and whistles with
+ * systemd.
+ */
+static int xs_active_socket_required(void)
+{
+	return 1;
+}
+#else
+static int xs_get_active_socket(const char *connect_to)
+{
+	return -1;
+}
+
+static int xs_active_socket_required(void)
+{
+	return 0;
+}
+#endif
+
 static int get_socket(const char *connect_to)
 {
 	struct sockaddr_un addr;
 	int sock, saved_errno, flags;
 
+	if (xs_active_socket_required())
+		return xs_get_active_socket(connect_to);
+
 	sock = socket(PF_UNIX, SOCK_STREAM, 0);
 	if (sock < 0)
 		return -1;
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (3 preceding siblings ...)
  2014-04-30  1:11 ` [PATCH v4 04/15] cxenstored: add support for systemd active sockets Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-04-30  8:35   ` Dave Scott
                     ` (3 more replies)
  2014-04-30  1:11 ` [PATCH v4 06/15] tools/xendomains: make xl the default Luis R. Rodriguez
                   ` (11 subsequent siblings)
  16 siblings, 4 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel
  Cc: David Scott, Stefano Stabellini, Ian Jackson, Luis R. Rodriguez,
	Vincent Hanquez, Ian Campbell

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This adds systemd socket activation support for the Ocaml xenstored.
Ocaml lacks systemd library support so we provide our own C helpers
as is done with other functionality lacking on Ocaml.

Active sockets enables oxenstored to be loaded only if required by a system
onto which Xen is installed on. Socket activation is handled by
systemd, once a port for a service which claims a socket is used
systemd will start the required services for it, on demand. For more
details on socket activation refer to Lennart's socket-activation
post regarding this [0].

An important different with socket activation is that systemd will set
FD_CLOEXEC for us on the socket before giving it to us, Ocaml gets
support for [1] Unix.set_cloexec but only as of 4.00.1+dev which isn't
yet widely available on distributions.

Right now this code adds a no-op for this functionality, leaving the
enablement to be done later once systemd is properly hooked into
the build system. The socket activation is ordered in aligment with
the socket activation order passed on to systemd.

[0] http://0pointer.de/blog/projects/socket-activation2.html
[1] http://caml.inria.fr/mantis/view.php?id=5569

Cc: David Scott <dave.scott@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/ocaml/xenstored/Makefile        |   8 +-
 tools/ocaml/xenstored/systemd.ml      |  16 ++++
 tools/ocaml/xenstored/systemd.mli     |  21 +++++
 tools/ocaml/xenstored/systemd_stubs.c | 166 ++++++++++++++++++++++++++++++++++
 tools/ocaml/xenstored/utils.ml        |  21 +++--
 5 files changed, 224 insertions(+), 8 deletions(-)
 create mode 100644 tools/ocaml/xenstored/systemd.ml
 create mode 100644 tools/ocaml/xenstored/systemd.mli
 create mode 100644 tools/ocaml/xenstored/systemd_stubs.c

diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 7fa8f53..382a813 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -15,6 +15,11 @@ syslog_OBJS = syslog
 syslog_C_OBJS = syslog_stubs
 OCAML_LIBRARY = syslog
 
+LIBS += systemd.cma systemd.cmxa
+systemd_OBJS = systemd
+systemd_C_OBJS = systemd_stubs
+OCAML_LIBRARY += systemd
+
 OBJS = define \
 	stdext \
 	trie \
@@ -36,11 +41,12 @@ OBJS = define \
 	process \
 	xenstored
 
-INTF = symbol.cmi trie.cmi syslog.cmi
+INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi
 
 XENSTOREDLIBS = \
 	unix.cmxa \
 	-ccopt -L -ccopt . syslog.cmxa \
+	-ccopt -L -ccopt . systemd.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/mmap $(OCAML_TOPLEVEL)/libs/mmap/xenmmap.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
new file mode 100644
index 0000000..cace794
--- /dev/null
+++ b/tools/ocaml/xenstored/systemd.ml
@@ -0,0 +1,16 @@
+(*
+ * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
+external sd_active_socket_required: unit -> int = "ocaml_sd_active_socket_required"
diff --git a/tools/ocaml/xenstored/systemd.mli b/tools/ocaml/xenstored/systemd.mli
new file mode 100644
index 0000000..a65ea5e
--- /dev/null
+++ b/tools/ocaml/xenstored/systemd.mli
@@ -0,0 +1,21 @@
+(*
+ * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *)
+
+(** Calls the C library sd_listen_fds() function for us. Although
+ *  the library doesn't accept argument we send one over to help
+ *  us do sanity checks on the expected sockets *)
+val sd_listen_fds: string -> Unix.file_descr
+
+(** Tells us whether or not systemd support was compiled in *)
+val sd_active_socket_required: unit -> int
diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c
new file mode 100644
index 0000000..ded9542
--- /dev/null
+++ b/tools/ocaml/xenstored/systemd_stubs.c
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <string.h>
+#include <caml/mlvalues.h>
+#include <caml/memory.h>
+#include <caml/alloc.h>
+#include <caml/custom.h>
+#include <caml/signals.h>
+#include <caml/fail.h>
+#include <config.h>
+#if defined(HAVE_SYSTEMD)
+#include <sys/socket.h>
+#include <systemd/sd-daemon.h>
+#endif
+
+#if defined(HAVE_SYSTEMD)
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(ar) (sizeof(ar)/sizeof(ar[0]))
+#endif
+
+/* Conforms to what we should send sd_is_socket_unix() */
+struct xen_systemd_active_socket {
+	int fd;
+	int type;
+	int listening;
+	const char *path;
+	size_t length;
+};
+
+/*
+ * We list stdin, stdout and stderr simply for documentation purposes
+ * and to help our array size fit the number of expected sockets we
+ * as sd_listen_fds() will return 5 for example if you set the socket
+ * service with 2 sockets.
+ */
+static struct xen_systemd_active_socket xenstore_active_sockets[] = {
+	{
+		.fd = SD_LISTEN_FDS_START -3,
+		.type = 0,
+		.listening = 0,
+		.path = "stdin",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START - 2,
+		.type = 0,
+		.listening = 0,
+		.path = "stderr",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START - 1,
+		.type = 0,
+		.listening = 0,
+		.path = "stderr",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START,
+		.type = SOCK_STREAM,
+		.listening = 0,
+		.path = "/var/run/xenstored/socket",
+		.length = 0,
+	},
+	{
+		.fd = SD_LISTEN_FDS_START + 1,
+		.type = SOCK_STREAM,
+		.listening = 0,
+		.path = "/var/run/xenstored/socket_ro",
+		.length = 0,
+	},
+};
+
+static struct xen_systemd_active_socket *get_xen_active_socket(const char *connect_to)
+{
+	unsigned int i;
+
+	for (i=0; i<ARRAY_SIZE(xenstore_active_sockets); i++) {
+		if (!strcmp(connect_to, xenstore_active_sockets[i].path)) {
+			if (!xenstore_active_sockets[i].type)
+				return NULL;
+			return &xenstore_active_sockets[i];
+		}
+	}
+
+	return NULL;
+}
+
+CAMLprim value ocaml_sd_listen_fds(value connect_to)
+{
+	CAMLparam1(connect_to);
+	CAMLlocal1(sock_ret);
+	int n, r;
+	struct xen_systemd_active_socket *active_socket;
+
+	active_socket = get_xen_active_socket((const char *) String_val(connect_to));
+	if (!active_socket)
+		caml_failwith("ocaml_sd_listen_fds() got invalid request");
+
+	n = sd_listen_fds(0);
+	if (n <= 0)
+		caml_failwith("ocaml_sd_listen_fds() failed");
+	else if (n >= (ARRAY_SIZE(xenstore_active_sockets)))
+		caml_failwith("ocaml_sd_listen_fds() got unexpected request");
+
+	r = sd_is_socket_unix(active_socket->fd,
+			      active_socket->type,
+			      active_socket->listening,
+			      active_socket->path,
+			      active_socket->length);
+	if (r < 0)
+		caml_failwith("ocaml_sd_listen_fds() mismatch on socket");
+
+	sock_ret = Val_int(active_socket->fd);
+
+	CAMLreturn(sock_ret);
+}
+
+/*
+ * If xenstored was built to depend on systemd libraries
+ * we assume you want all the bells and whistles with
+ * systemd.
+ */
+CAMLprim value ocaml_sd_active_socket_required(void)
+{
+	CAMLparam0();
+	CAMLlocal1(ret);
+
+	ret = Val_int(1);
+
+	CAMLreturn(ret);
+}
+#else
+CAMLprim value ocaml_sd_listen_fds(value connect_to)
+{
+	CAMLparam1(connect_to);
+	CAMLlocal1(sock_ret);
+
+	sock_ret = Val_int(-1);
+
+	CAMLreturn(sock_ret);
+}
+
+CAMLprim value ocaml_sd_active_socket_required(void)
+{
+	CAMLparam0();
+	CAMLlocal1(ret);
+
+	ret = Val_int(0);
+
+	CAMLreturn(ret);
+}
+#endif
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index 68b70c5..d3d2e31 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -73,14 +73,21 @@ let trim_path path =
 let join_by_null ls = String.concat "\000" ls
 
 (* unix utils *)
+let create_regular_unix_socket name =
+        Unixext.unlink_safe name;
+        Unixext.mkdir_rec (Filename.dirname name) 0o700;
+        let sockaddr = Unix.ADDR_UNIX(name) in
+        let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
+        Unix.bind sock sockaddr;
+        Unix.listen sock 1;
+        sock
+
 let create_unix_socket name =
-	Unixext.unlink_safe name;
-	Unixext.mkdir_rec (Filename.dirname name) 0o700;
-	let sockaddr = Unix.ADDR_UNIX(name) in
-	let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
-	Unix.bind sock sockaddr;
-	Unix.listen sock 1;
-	sock
+        let active_sockets = Systemd.sd_active_socket_required() in
+        if active_sockets = 1 then
+                Systemd.sd_listen_fds name
+        else
+                create_regular_unix_socket name
 
 let read_file_single_integer filename =
 	let fd = Unix.openfile filename [ Unix.O_RDONLY ] 0o640 in
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 06/15] tools/xendomains: make xl the default
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (4 preceding siblings ...)
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
@ 2014-04-30  1:11 ` Luis R. Rodriguez
  2014-04-30  7:02   ` Olaf Hering
  2014-04-30  1:12 ` [PATCH v4 07/15] tools/xendomains: do space cleanups Luis R. Rodriguez
                   ` (10 subsequent siblings)
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:11 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

If that fails backoff to using xm.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/hotplug/Linux/init.d/xendomains | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 59f1e3d..6cb1032 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -29,13 +29,13 @@
 
 . /etc/xen/scripts/hotplugpath.sh
 
-CMD=${SBINDIR}/xm
-HEADCOMP="LinuxGuestRecord"
+CMD=${SBINDIR}/xl
+HEADCOMP="Xen saved domain"
 $CMD list &> /dev/null
 if test $? -ne 0
 then
-	CMD=${SBINDIR}/xl
-	HEADCOMP="Xen saved domain"
+	CMD=${SBINDIR}/xm
+	HEADCOMP="LinuxGuestRecord"
 fi
 
 $CMD list &> /dev/null
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 07/15] tools/xendomains: do space cleanups
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (5 preceding siblings ...)
  2014-04-30  1:11 ` [PATCH v4 06/15] tools/xendomains: make xl the default Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-04-30  1:12 ` [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This has no functional changes. This is just to prepare the file
to be moved, so you won't blind your eyes or get git am to complain.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/hotplug/Linux/init.d/xendomains | 62 +++++++++++++++++------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 6cb1032..587568d 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -23,7 +23,7 @@
 # Default-Start:     2 3 5
 # Default-Stop:      0 1 6
 # Short-Description: Start/stop secondary xen domains
-# Description:       Start / stop domains automatically when domain 0 
+# Description:       Start / stop domains automatically when domain 0
 #                    boots / shuts down.
 ### END INIT INFO
 
@@ -44,7 +44,7 @@ then
 	exit 0;
 fi
 
-# Correct exit code would probably be 5, but it's enough 
+# Correct exit code would probably be 5, but it's enough
 # if xend complains if we're not running as privileged domain
 if ! [ -e /proc/xen/privcmd ]; then
 	exit 0
@@ -74,7 +74,7 @@ test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
 if test -e /etc/rc.status; then
     # SUSE rc script library
     . /etc/rc.status
-else    
+else
     _cmd=$1
     declare -a _SMSG
     if test "${_cmd}" = "status"; then
@@ -97,7 +97,7 @@ else
 	    fi
 	}
     elif test -e /lib/lsb/init-functions; then
-	# LSB    
+	# LSB
     	. /lib/lsb/init-functions
         if alias log_success_msg >/dev/null 2>/dev/null; then
 	  echo_rc()
@@ -114,7 +114,7 @@ else
 	    fi
 	  }
         fi
-    else    
+    else
 	# emulate it
 	echo_rc()
 	{
@@ -124,17 +124,17 @@ else
     rc_reset() { _RC_RV=0; }
     rc_failed()
     {
-	if test -z "$1"; then 
+	if test -z "$1"; then
 	    _RC_RV=1;
-	elif test "$1" != "0"; then 
-	    _RC_RV=$1; 
-    	fi
+	elif test "$1" != "0"; then
+	    _RC_RV=$1;
+	fi
 	return ${_RC_RV}
     }
     rc_check()
     {
 	return rc_failed $?
-    }	
+    }
     rc_status()
     {
 	rc_failed $?
@@ -146,7 +146,7 @@ else
 	return ${_RC_RV}
     }
     rc_exit() { exit ${_RC_RV}; }
-    rc_active() 
+    rc_active()
     {
 	if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
 	if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
@@ -193,13 +193,13 @@ rdnames()
 {
     NAMES=
     if ! contains_something "$XENDOMAINS_AUTO"
-    then 
+    then
 	return
     fi
     for dom in $XENDOMAINS_AUTO/*; do
 	rdname $dom
-	if test -z $NAMES; then 
-	    NAMES=$NM; 
+	if test -z $NAMES; then
+	    NAMES=$NM;
 	else
 	    NAMES="$NAMES|$NM"
 	fi
@@ -232,7 +232,7 @@ is_running()
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
-	case $name in 
+	case $name in
 	    ($NM)
 		RC=0
 		;;
@@ -241,11 +241,11 @@ is_running()
     return $RC
 }
 
-start() 
+start()
 {
-    if [ -f $LOCKFILE ]; then 
+    if [ -f $LOCKFILE ]; then
 	echo -e "xendomains already running (lockfile exists)"
-	return; 
+	return;
     fi
 
     saved_domains=" "
@@ -285,10 +285,10 @@ start()
 	# XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
 
 	# Create all domains with config files in XENDOMAINS_AUTO.
-	# TODO: We should record which domain name belongs 
+	# TODO: We should record which domain name belongs
 	# so we have the option to selectively shut down / migrate later
 	# If a domain statefile from $XENDOMAINS_SAVE matches a domain name
-	# in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't 
+	# in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't
 	# restore correctly it requires administrative attention.
 	for dom in $XENDOMAINS_AUTO/*; do
 	    echo -n " ${dom##*/}"
@@ -349,14 +349,14 @@ watchdog_xencmd()
     read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
     # kill $CMD $1
     kill $PSPID >/dev/null 2>&1
-    
+
     echo -e .
 }
 
 stop()
 {
     exec 3>&2 2> /dev/null
-    
+
     # Collect list of domains to shut down
     if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
 	rdnames
@@ -380,7 +380,7 @@ stop()
 	    esac
 	    "
 	fi
-	# XENDOMAINS_SYSRQ chould be something like just "s" 
+	# XENDOMAINS_SYSRQ chould be something like just "s"
 	# or "s e i u" or even "s e s i u o"
 	# for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so
 	if test -n "$XENDOMAINS_SYSRQ"; then
@@ -413,7 +413,7 @@ stop()
 		kill $WDOG_PID >/dev/null 2>&1
 	    else
 		kill $WDOG_PID >/dev/null 2>&1
-		
+
 		echo -e .
 		usleep 1000
 		continue
@@ -472,7 +472,7 @@ stop()
 
     # Unconditionally delete lock file
     rm -f $LOCKFILE
-    
+
     exec 2>&3
 }
 
@@ -482,7 +482,7 @@ check_domain_up()
     while read LN; do
 	parseln "$LN" || continue
 	if test $id = 0; then continue; fi
-	case $name in 
+	case $name in
 	    ($1)
 		return 0
 		;;
@@ -501,9 +501,9 @@ check_all_auto_domains_up()
     for nm in $XENDOMAINS_AUTO/*; do
 	rdname $nm
 	found=0
-	if check_domain_up "$NM"; then 
+	if check_domain_up "$NM"; then
 	    echo -n " $name"
-	else 
+	else
 	    missing="$missing $NM"
 	fi
     done
@@ -516,7 +516,7 @@ check_all_auto_domains_up()
 
 check_all_saved_domains_up()
 {
-    if ! contains_something "$XENDOMAINS_SAVE" 
+    if ! contains_something "$XENDOMAINS_SAVE"
     then
       return 0
     fi
@@ -563,8 +563,8 @@ case "$1" in
 	;;
 
     status)
-	echo -n "Checking for xendomains:" 
-	if test ! -f $LOCKFILE; then 
+	echo -n "Checking for xendomains:"
+	if test ! -f $LOCKFILE; then
 	    rc_failed 3
 	else
 	    check_all_auto_domains_up
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (6 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 07/15] tools/xendomains: do space cleanups Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:24   ` Ian Campbell
  2014-04-30  1:12 ` [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

The xendomains script can be reused with systemd systems as it
does not control services or sockets per se, but does a one shot
scrape of domUs it needs start bring up, stop, reload so we're
going to reuse it. This moves the core of the script to libexec
and leaves only a helper on init.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 tools/hotplug/Linux/Makefile          |   6 +
 tools/hotplug/Linux/init.d/xendomains | 567 +-------------------------------
 tools/hotplug/Linux/xendomains        | 585 ++++++++++++++++++++++++++++++++++
 3 files changed, 607 insertions(+), 551 deletions(-)
 create mode 100644 tools/hotplug/Linux/xendomains

diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 4874ec5..7e6646e 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 # Init scripts.
 XENDOMAINS_INITD = init.d/xendomains
+XENDOMAINS_LIBEXEC = xendomains
 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
 
 XENCOMMONS_INITD = init.d/xencommons
@@ -45,6 +46,11 @@ install: all install-initd install-scripts install-udev
 install-initd:
 	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
 	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
+	[ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
+ifeq ($(CONFIG_XEND),y)
+	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
+endif
+	$(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC)
 	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
 	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 587568d..d0122fc 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -1,18 +1,13 @@
 #!/bin/bash
 #
 # /etc/init.d/xendomains
-# Start / stop domains automatically when domain 0 boots / shuts down.
+# Wrapper to start / stop domains automatically when domain 0 boots / shuts down
 #
 # chkconfig: 345 99 00
-# description: Start / stop Xen domains.
+# description: Helper to start / stop Xen domains.
 #
-# This script offers fairly basic functionality.  It should work on Redhat
-# but also on LSB-compliant SuSE releases and on Debian with the LSB package
-# installed.  (LSB is the Linux Standard Base)
-#
-# Based on the example in the "Designing High Quality Integrated Linux
-# Applications HOWTO" by Avi Alkalay
-# <http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/>
+# This script is a wrapper init helper for the real workload horse script.
+# It should work on LSB-compliant systems.
 #
 ### BEGIN INIT INFO
 # Provides:          xendomains
@@ -22,564 +17,34 @@
 # Should-Stop:       xend
 # Default-Start:     2 3 5
 # Default-Stop:      0 1 6
-# Short-Description: Start/stop secondary xen domains
-# Description:       Start / stop domains automatically when domain 0
-#                    boots / shuts down.
+# Short-Description: Wrapper to start/stop secondary xen domains
+# Description:       Wrapper for starting / stopping domains automatically
+#                    when domain 0 boots / shuts down on systems using init.
+#                    The $SBINDIR/xendomains helper is shared between init and
+#                    systemd systems.
 ### END INIT INFO
 
 . /etc/xen/scripts/hotplugpath.sh
 
-CMD=${SBINDIR}/xl
-HEADCOMP="Xen saved domain"
-$CMD list &> /dev/null
-if test $? -ne 0
-then
-	CMD=${SBINDIR}/xm
-	HEADCOMP="LinuxGuestRecord"
-fi
-
-$CMD list &> /dev/null
-if test $? -ne 0
-then
-	exit 0;
-fi
-
-# Correct exit code would probably be 5, but it's enough
-# if xend complains if we're not running as privileged domain
-if ! [ -e /proc/xen/privcmd ]; then
-	exit 0
-fi
-
-# See docs/misc/distro_mapping.txt
-if [ -d /var/lock/subsys ]; then
-	LOCKFILE=/var/lock/subsys/xendomains
-else
-	LOCKFILE=/var/lock/xendomains
-fi
-
-if [ -d /etc/sysconfig ]; then
-	XENDOM_CONFIG=/etc/sysconfig/xendomains
-else
-	XENDOM_CONFIG=/etc/default/xendomains
-fi
-
-test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
-	if [ "$1" = "stop" ]; then exit 0;
-	else exit 6; fi; }
-
-. $XENDOM_CONFIG
-
-# Use the SUSE rc_ init script functions;
-# emulate them on LSB, RH and other systems
-if test -e /etc/rc.status; then
-    # SUSE rc script library
-    . /etc/rc.status
-else
-    _cmd=$1
-    declare -a _SMSG
-    if test "${_cmd}" = "status"; then
-	_SMSG=(running dead dead unused unknown)
-	_RC_UNUSED=3
-    else
-	_SMSG=(done failed failed missed failed skipped unused failed failed)
-	_RC_UNUSED=6
-    fi
-    if test -e /etc/init.d/functions; then
-	# REDHAT
-	. /etc/init.d/functions
-	echo_rc()
-	{
-	    #echo -n "  [${_SMSG[${_RC_RV}]}] "
-	    if test ${_RC_RV} = 0; then
-		success "  [${_SMSG[${_RC_RV}]}] "
-	    else
-		failure "  [${_SMSG[${_RC_RV}]}] "
-	    fi
-	}
-    elif test -e /lib/lsb/init-functions; then
-	# LSB
-    	. /lib/lsb/init-functions
-        if alias log_success_msg >/dev/null 2>/dev/null; then
-	  echo_rc()
-	  {
-	       echo "  [${_SMSG[${_RC_RV}]}] "
-	  }
-        else
-	  echo_rc()
-	  {
-	    if test ${_RC_RV} = 0; then
-		log_success_msg "  [${_SMSG[${_RC_RV}]}] "
-	    else
-		log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
-	    fi
-	  }
-        fi
-    else
-	# emulate it
-	echo_rc()
-	{
-	    echo "  [${_SMSG[${_RC_RV}]}] "
-	}
-    fi
-    rc_reset() { _RC_RV=0; }
-    rc_failed()
-    {
-	if test -z "$1"; then
-	    _RC_RV=1;
-	elif test "$1" != "0"; then
-	    _RC_RV=$1;
-	fi
-	return ${_RC_RV}
-    }
-    rc_check()
-    {
-	return rc_failed $?
-    }
-    rc_status()
-    {
-	rc_failed $?
-	if test "$1" = "-r"; then _RC_RV=0; shift; fi
-	if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
-	if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
-	if test "$1" = "-v"; then echo_rc; shift; fi
-	if test "$1" = "-r"; then _RC_RV=0; shift; fi
-	return ${_RC_RV}
-    }
-    rc_exit() { exit ${_RC_RV}; }
-    rc_active()
-    {
-	if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
-	if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
-	return 1
-    }
-fi
-
-if ! which usleep >&/dev/null
-then
-  usleep()
-  {
-    if [ -n "$1" ]
-    then
-      sleep $(( $1 / 1000000 ))
-    fi
-  }
-fi
-
-# Reset status of this service
-rc_reset
-
-##
-# Returns 0 (success) if the given parameter names a directory, and that
-# directory is not empty.
-#
-contains_something()
-{
-  if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ]
-  then
-    return 0
-  else
-    return 1
-  fi
-}
-
-# read name from xen config file
-rdname()
-{
-    NM=$($CMD create --quiet --dryrun --defconfig "$1" |
-         sed -n 's/^.*(name \(.*\))$/\1/p;s/^.*"name": "\(.*\)",$/\1/p')
-}
-
-rdnames()
-{
-    NAMES=
-    if ! contains_something "$XENDOMAINS_AUTO"
-    then
-	return
-    fi
-    for dom in $XENDOMAINS_AUTO/*; do
-	rdname $dom
-	if test -z $NAMES; then
-	    NAMES=$NM;
-	else
-	    NAMES="$NAMES|$NM"
-	fi
-    done
-}
-
-LIST_GREP='(domain\|(domid\|(name\|^    {$\|"name":\|"domid":'
-parseln()
-{
-    if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then
-        name=;id=
-    elif [[ "$1" =~ '(name' ]]; then
-        name=$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/')
-    elif [[ "$1" =~ '(domid' ]]; then
-        id=$(echo $1 | sed -e 's/^.*(domid \(.*\))$/\1/')
-    elif [[ "$1" =~ '"name":' ]]; then
-        name=$(echo $1 | sed -e 's/^.*"name": "\(.*\)",$/\1/')
-    elif [[ "$1" =~ '"domid":' ]]; then
-        id=$(echo $1 | sed -e 's/^.*"domid": \(.*\),$/\1/')
-    fi
-
-    [ -n "$name" -a -n "$id" ] && return 0 || return 1
-}
-
-is_running()
-{
-    rdname $1
-    RC=1
-    name=;id=
-    while read LN; do
-	parseln "$LN" || continue
-	if test $id = 0; then continue; fi
-	case $name in
-	    ($NM)
-		RC=0
-		;;
-	esac
-    done < <($CMD list -l | grep "$LIST_GREP")
-    return $RC
-}
-
-start()
-{
-    if [ -f $LOCKFILE ]; then
-	echo -e "xendomains already running (lockfile exists)"
-	return;
-    fi
-
-    saved_domains=" "
-    if [ "$XENDOMAINS_RESTORE" = "true" ] &&
-       contains_something "$XENDOMAINS_SAVE"
-    then
-	mkdir -p $(dirname "$LOCKFILE")
-	touch $LOCKFILE
-	echo -n "Restoring Xen domains:"
-	saved_domains=`ls $XENDOMAINS_SAVE`
-        for dom in $XENDOMAINS_SAVE/*; do
-            if [ -f $dom ] ; then
-                HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`
-                if [ "$HEADER" = "$HEADCOMP" ]; then
-                    echo -n " ${dom##*/}"
-                    XMR=`$CMD restore $dom 2>&1 1>/dev/null`
-                    #$CMD restore $dom
-                    if [ $? -ne 0 ]; then
-                        echo -e "\nAn error occurred while restoring domain ${dom##*/}:\n$XMR"
-                        rc_failed $?
-                        echo -e '!'
-                    else
-                        # mv $dom ${dom%/*}/.${dom##*/}
-                        rm $dom
-                    fi
-                fi
-            fi
-        done
-	echo -e
-    fi
-
-    if contains_something "$XENDOMAINS_AUTO"
-    then
-	touch $LOCKFILE
-	echo -n "Starting auto Xen domains:"
-	# We expect config scripts for auto starting domains to be in
-	# XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
-
-	# Create all domains with config files in XENDOMAINS_AUTO.
-	# TODO: We should record which domain name belongs
-	# so we have the option to selectively shut down / migrate later
-	# If a domain statefile from $XENDOMAINS_SAVE matches a domain name
-	# in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't
-	# restore correctly it requires administrative attention.
-	for dom in $XENDOMAINS_AUTO/*; do
-	    echo -n " ${dom##*/}"
-	    shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p')
-	    echo $saved_domains | grep -w $shortdom > /dev/null
-	    if [ $? -eq 0 ] || is_running $dom; then
-		echo -n "(skip)"
-	    else
-		XMC=`$CMD create --quiet --defconfig $dom`
-		if [ $? -ne 0 ]; then
-		    echo -e "\nAn error occurred while creating domain ${dom##*/}: $XMC\n"
-		    rc_failed $?
-		    echo -e '!'
-		else
-		    usleep $XENDOMAINS_CREATE_USLEEP
-		fi
-	    fi
-	done
-    fi
-}
-
-all_zombies()
-{
-    name=;id=
-    while read LN; do
-	parseln "$LN" || continue
-	if test $id = 0; then continue; fi
-	if test "$state" != "-b---d" -a "$state" != "-----d"; then
-	    return 1;
-	fi
-    done < <($CMD list -l | grep "$LIST_GREP")
-    return 0
-}
-
-# Wait for max $XENDOMAINS_STOP_MAXWAIT for $CMD $1 to finish;
-# if it has not exited by that time kill it, so the init script will
-# succeed within a finite amount of time; if $2 is nonnull, it will
-# kill the command as well as soon as no domain (except for zombies)
-# are left (used for shutdown --all). Third parameter, if any, suppresses
-# output of dots per working state (formatting issues)
-watchdog_xencmd()
-{
-    if test -z "$XENDOMAINS_STOP_MAXWAIT" -o "$XENDOMAINS_STOP_MAXWAIT" = "0"; then
-	exit
-    fi
-
-    usleep 20000
-    for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do
-	# exit if $CMD save/migrate/shutdown is finished
-	PSAX=`ps axlw | grep "$CMD $1" | grep -v grep`
-	if test -z "$PSAX"; then exit; fi
-	if ! test -n "$3"; then echo -n '.'; fi
-	sleep 1
-	# go to kill immediately if there's only zombies left
-	if all_zombies && test -n "$2"; then break; fi
-    done
-    sleep 1
-    read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
-    # kill $CMD $1
-    kill $PSPID >/dev/null 2>&1
-
-    echo -e .
-}
-
-stop()
-{
-    exec 3>&2 2> /dev/null
-
-    # Collect list of domains to shut down
-    if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
-	rdnames
-    fi
-    echo -n "Shutting down Xen domains:"
-    name=;id=
-    while read LN; do
-	parseln "$LN" || continue
-	if test $id = 0; then continue; fi
-	echo -n " $name"
-	if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
-	    eval "
-	    case \"\$name\" in
-		($NAMES)
-		    # nothing
-		    ;;
-		(*)
-		    echo -e '(skip)'
-		    continue
-		    ;;
-	    esac
-	    "
-	fi
-	# XENDOMAINS_SYSRQ chould be something like just "s"
-	# or "s e i u" or even "s e s i u o"
-	# for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so
-	if test -n "$XENDOMAINS_SYSRQ"; then
-	    for sysrq in $XENDOMAINS_SYSRQ; do
-		echo -n "(SR-$sysrq)"
-		XMR=`$CMD sysrq $id $sysrq 2>&1 1>/dev/null`
-		if test $? -ne 0; then
-		    echo -e "\nAn error occurred while doing sysrq on domain:\n$XMR\n"
-		    rc_failed $?
-		    echo -n '!'
-		fi
-		# usleep just ignores empty arg
-		usleep $XENDOMAINS_USLEEP
-	    done
-	fi
-	if test "$state" = "-b---d" -o "$state" = "-----d"; then
-	    echo -n "(zomb)"
-	    continue
-	fi
-	if test -n "$XENDOMAINS_MIGRATE"; then
-	    echo -n "(migr)"
-	    watchdog_xencmd migrate &
-	    WDOG_PID=$!
-	    XMR=`$CMD migrate $id $XENDOMAINS_MIGRATE 2>&1 1>/dev/null`
-	    if test $? -ne 0; then
-		echo -e "\nAn error occurred while migrating domain:\n$XMR\n"
-		rc_failed $?
-		echo -e '!'
-
-		kill $WDOG_PID >/dev/null 2>&1
-	    else
-		kill $WDOG_PID >/dev/null 2>&1
-
-		echo -e .
-		usleep 1000
-		continue
-	    fi
-	fi
-	if test -n "$XENDOMAINS_SAVE"; then
-	    echo -n "(save)"
-	    watchdog_xencmd save &
-	    WDOG_PID=$!
-	    mkdir -p "$XENDOMAINS_SAVE"
-	    XMR=`$CMD save $id $XENDOMAINS_SAVE/$name 2>&1 1>/dev/null`
-	    if test $? -ne 0; then
-		echo -e "\nAn error occurred while saving domain:\n$XMR\n"
-		rc_failed $?
-		echo -e '!'
-		kill $WDOG_PID >/dev/null 2>&1
-	    else
-		kill $WDOG_PID >/dev/null 2>&1
-		echo -e .
-		usleep 1000
-		continue
-	    fi
-	fi
-	if test -n "$XENDOMAINS_SHUTDOWN"; then
-	    # XENDOMAINS_SHUTDOWN should be "--wait"
-	    echo -n "(shut)"
-	    watchdog_xencmd shutdown &
-	    WDOG_PID=$!
-	    XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN $id 2>&1 1>/dev/null`
-	    if test $? -ne 0; then
-		echo -e "\nAn error occurred while shutting down domain:\n$XMR\n"
-		rc_failed $?
-		echo -e '!'
-	    fi
-	    kill $WDOG_PID >/dev/null 2>&1
-	fi
-    done < <($CMD list -l | grep "$LIST_GREP")
-
-    # NB. this shuts down ALL Xen domains (politely), not just the ones in
-    # AUTODIR/*
-    # This is because it's easier to do ;-) but arguably if this script is run
-    # on system shutdown then it's also the right thing to do.
-    if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then
-	# XENDOMAINS_SHUTDOWN_ALL should be "--all --wait"
-	echo -n " SHUTDOWN_ALL "
-	watchdog_xencmd shutdown 1 false &
-	WDOG_PID=$!
-	XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN_ALL 2>&1 1>/dev/null`
-	if test $? -ne 0; then
-	    echo -e "\nAn error occurred while shutting down all domains: $XMR\n"
-	    rc_failed $?
-	    echo -e '!'
-	fi
-	kill $WDOG_PID >/dev/null 2>&1
-    fi
-
-    # Unconditionally delete lock file
-    rm -f $LOCKFILE
-
-    exec 2>&3
-}
-
-check_domain_up()
-{
-    name=;id=
-    while read LN; do
-	parseln "$LN" || continue
-	if test $id = 0; then continue; fi
-	case $name in
-	    ($1)
-		return 0
-		;;
-	esac
-    done < <($CMD list -l | grep "$LIST_GREP")
-    return 1
-}
-
-check_all_auto_domains_up()
-{
-    if ! contains_something "$XENDOMAINS_AUTO"
-    then
-      return 0
-    fi
-    missing=
-    for nm in $XENDOMAINS_AUTO/*; do
-	rdname $nm
-	found=0
-	if check_domain_up "$NM"; then
-	    echo -n " $name"
-	else
-	    missing="$missing $NM"
-	fi
-    done
-    if test -n "$missing"; then
-	echo -n " MISS AUTO:$missing"
-	return 1
-    fi
-    return 0
-}
-
-check_all_saved_domains_up()
-{
-    if ! contains_something "$XENDOMAINS_SAVE"
-    then
-      return 0
-    fi
-    missing=`/bin/ls $XENDOMAINS_SAVE`
-    echo -n " MISS SAVED: " $missing
-    return 1
-}
-
-# This does NOT necessarily restart all running domains: instead it
-# stops all running domains and then boots all the domains specified in
-# AUTODIR.  If other domains have been started manually then they will
-# not get restarted.
-# Commented out to avoid confusion!
-
-restart()
-{
-    stop
-    start
-}
-
-reload()
-{
-    restart
-}
-
-
 case "$1" in
     start)
-	start
-	rc_status
-	if test -f $LOCKFILE; then rc_status -v; fi
+	$SBINDIR/xendomains start
 	;;
-
     stop)
-	stop
-	rc_status -v
+	$SBINDIR/xendomains stop
 	;;
-
     restart)
-	restart
+	$SBINDIR/xendomains restart
 	;;
     reload)
-	reload
+	$SBINDIR/xendomains reload
 	;;
-
     status)
-	echo -n "Checking for xendomains:"
-	if test ! -f $LOCKFILE; then
-	    rc_failed 3
-	else
-	    check_all_auto_domains_up
-	    rc_status
-	    check_all_saved_domains_up
-	    rc_status
-	fi
-	rc_status -v
+	$SBINDIR/xendomains status
 	;;
-
     *)
 	echo "Usage: $0 {start|stop|restart|reload|status}"
-	rc_failed 3
-	rc_status -v
+	exit 3
 	;;
 esac
-
-rc_exit
+exit $?
diff --git a/tools/hotplug/Linux/xendomains b/tools/hotplug/Linux/xendomains
new file mode 100644
index 0000000..587568d
--- /dev/null
+++ b/tools/hotplug/Linux/xendomains
@@ -0,0 +1,585 @@
+#!/bin/bash
+#
+# /etc/init.d/xendomains
+# Start / stop domains automatically when domain 0 boots / shuts down.
+#
+# chkconfig: 345 99 00
+# description: Start / stop Xen domains.
+#
+# This script offers fairly basic functionality.  It should work on Redhat
+# but also on LSB-compliant SuSE releases and on Debian with the LSB package
+# installed.  (LSB is the Linux Standard Base)
+#
+# Based on the example in the "Designing High Quality Integrated Linux
+# Applications HOWTO" by Avi Alkalay
+# <http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/>
+#
+### BEGIN INIT INFO
+# Provides:          xendomains
+# Required-Start:    $syslog $remote_fs xenstored xenconsoled
+# Should-Start:      xend
+# Required-Stop:     $syslog $remote_fs xenstored xenconsoled
+# Should-Stop:       xend
+# Default-Start:     2 3 5
+# Default-Stop:      0 1 6
+# Short-Description: Start/stop secondary xen domains
+# Description:       Start / stop domains automatically when domain 0
+#                    boots / shuts down.
+### END INIT INFO
+
+. /etc/xen/scripts/hotplugpath.sh
+
+CMD=${SBINDIR}/xl
+HEADCOMP="Xen saved domain"
+$CMD list &> /dev/null
+if test $? -ne 0
+then
+	CMD=${SBINDIR}/xm
+	HEADCOMP="LinuxGuestRecord"
+fi
+
+$CMD list &> /dev/null
+if test $? -ne 0
+then
+	exit 0;
+fi
+
+# Correct exit code would probably be 5, but it's enough
+# if xend complains if we're not running as privileged domain
+if ! [ -e /proc/xen/privcmd ]; then
+	exit 0
+fi
+
+# See docs/misc/distro_mapping.txt
+if [ -d /var/lock/subsys ]; then
+	LOCKFILE=/var/lock/subsys/xendomains
+else
+	LOCKFILE=/var/lock/xendomains
+fi
+
+if [ -d /etc/sysconfig ]; then
+	XENDOM_CONFIG=/etc/sysconfig/xendomains
+else
+	XENDOM_CONFIG=/etc/default/xendomains
+fi
+
+test -r $XENDOM_CONFIG || { echo "$XENDOM_CONFIG not existing";
+	if [ "$1" = "stop" ]; then exit 0;
+	else exit 6; fi; }
+
+. $XENDOM_CONFIG
+
+# Use the SUSE rc_ init script functions;
+# emulate them on LSB, RH and other systems
+if test -e /etc/rc.status; then
+    # SUSE rc script library
+    . /etc/rc.status
+else
+    _cmd=$1
+    declare -a _SMSG
+    if test "${_cmd}" = "status"; then
+	_SMSG=(running dead dead unused unknown)
+	_RC_UNUSED=3
+    else
+	_SMSG=(done failed failed missed failed skipped unused failed failed)
+	_RC_UNUSED=6
+    fi
+    if test -e /etc/init.d/functions; then
+	# REDHAT
+	. /etc/init.d/functions
+	echo_rc()
+	{
+	    #echo -n "  [${_SMSG[${_RC_RV}]}] "
+	    if test ${_RC_RV} = 0; then
+		success "  [${_SMSG[${_RC_RV}]}] "
+	    else
+		failure "  [${_SMSG[${_RC_RV}]}] "
+	    fi
+	}
+    elif test -e /lib/lsb/init-functions; then
+	# LSB
+    	. /lib/lsb/init-functions
+        if alias log_success_msg >/dev/null 2>/dev/null; then
+	  echo_rc()
+	  {
+	       echo "  [${_SMSG[${_RC_RV}]}] "
+	  }
+        else
+	  echo_rc()
+	  {
+	    if test ${_RC_RV} = 0; then
+		log_success_msg "  [${_SMSG[${_RC_RV}]}] "
+	    else
+		log_failure_msg "  [${_SMSG[${_RC_RV}]}] "
+	    fi
+	  }
+        fi
+    else
+	# emulate it
+	echo_rc()
+	{
+	    echo "  [${_SMSG[${_RC_RV}]}] "
+	}
+    fi
+    rc_reset() { _RC_RV=0; }
+    rc_failed()
+    {
+	if test -z "$1"; then
+	    _RC_RV=1;
+	elif test "$1" != "0"; then
+	    _RC_RV=$1;
+	fi
+	return ${_RC_RV}
+    }
+    rc_check()
+    {
+	return rc_failed $?
+    }
+    rc_status()
+    {
+	rc_failed $?
+	if test "$1" = "-r"; then _RC_RV=0; shift; fi
+	if test "$1" = "-s"; then rc_failed 5; echo_rc; rc_failed 3; shift; fi
+	if test "$1" = "-u"; then rc_failed ${_RC_UNUSED}; echo_rc; rc_failed 3; shift; fi
+	if test "$1" = "-v"; then echo_rc; shift; fi
+	if test "$1" = "-r"; then _RC_RV=0; shift; fi
+	return ${_RC_RV}
+    }
+    rc_exit() { exit ${_RC_RV}; }
+    rc_active()
+    {
+	if test -z "$RUNLEVEL"; then read RUNLEVEL REST < <(/sbin/runlevel); fi
+	if test -e /etc/init.d/S[0-9][0-9]${1}; then return 0; fi
+	return 1
+    }
+fi
+
+if ! which usleep >&/dev/null
+then
+  usleep()
+  {
+    if [ -n "$1" ]
+    then
+      sleep $(( $1 / 1000000 ))
+    fi
+  }
+fi
+
+# Reset status of this service
+rc_reset
+
+##
+# Returns 0 (success) if the given parameter names a directory, and that
+# directory is not empty.
+#
+contains_something()
+{
+  if [ -d "$1" ] && [ `/bin/ls $1 | wc -l` -gt 0 ]
+  then
+    return 0
+  else
+    return 1
+  fi
+}
+
+# read name from xen config file
+rdname()
+{
+    NM=$($CMD create --quiet --dryrun --defconfig "$1" |
+         sed -n 's/^.*(name \(.*\))$/\1/p;s/^.*"name": "\(.*\)",$/\1/p')
+}
+
+rdnames()
+{
+    NAMES=
+    if ! contains_something "$XENDOMAINS_AUTO"
+    then
+	return
+    fi
+    for dom in $XENDOMAINS_AUTO/*; do
+	rdname $dom
+	if test -z $NAMES; then
+	    NAMES=$NM;
+	else
+	    NAMES="$NAMES|$NM"
+	fi
+    done
+}
+
+LIST_GREP='(domain\|(domid\|(name\|^    {$\|"name":\|"domid":'
+parseln()
+{
+    if [[ "$1" =~ '(domain' ]] || [[ "$1" = "{" ]]; then
+        name=;id=
+    elif [[ "$1" =~ '(name' ]]; then
+        name=$(echo $1 | sed -e 's/^.*(name \(.*\))$/\1/')
+    elif [[ "$1" =~ '(domid' ]]; then
+        id=$(echo $1 | sed -e 's/^.*(domid \(.*\))$/\1/')
+    elif [[ "$1" =~ '"name":' ]]; then
+        name=$(echo $1 | sed -e 's/^.*"name": "\(.*\)",$/\1/')
+    elif [[ "$1" =~ '"domid":' ]]; then
+        id=$(echo $1 | sed -e 's/^.*"domid": \(.*\),$/\1/')
+    fi
+
+    [ -n "$name" -a -n "$id" ] && return 0 || return 1
+}
+
+is_running()
+{
+    rdname $1
+    RC=1
+    name=;id=
+    while read LN; do
+	parseln "$LN" || continue
+	if test $id = 0; then continue; fi
+	case $name in
+	    ($NM)
+		RC=0
+		;;
+	esac
+    done < <($CMD list -l | grep "$LIST_GREP")
+    return $RC
+}
+
+start()
+{
+    if [ -f $LOCKFILE ]; then
+	echo -e "xendomains already running (lockfile exists)"
+	return;
+    fi
+
+    saved_domains=" "
+    if [ "$XENDOMAINS_RESTORE" = "true" ] &&
+       contains_something "$XENDOMAINS_SAVE"
+    then
+	mkdir -p $(dirname "$LOCKFILE")
+	touch $LOCKFILE
+	echo -n "Restoring Xen domains:"
+	saved_domains=`ls $XENDOMAINS_SAVE`
+        for dom in $XENDOMAINS_SAVE/*; do
+            if [ -f $dom ] ; then
+                HEADER=`head -c 16 $dom | head -n 1 2> /dev/null`
+                if [ "$HEADER" = "$HEADCOMP" ]; then
+                    echo -n " ${dom##*/}"
+                    XMR=`$CMD restore $dom 2>&1 1>/dev/null`
+                    #$CMD restore $dom
+                    if [ $? -ne 0 ]; then
+                        echo -e "\nAn error occurred while restoring domain ${dom##*/}:\n$XMR"
+                        rc_failed $?
+                        echo -e '!'
+                    else
+                        # mv $dom ${dom%/*}/.${dom##*/}
+                        rm $dom
+                    fi
+                fi
+            fi
+        done
+	echo -e
+    fi
+
+    if contains_something "$XENDOMAINS_AUTO"
+    then
+	touch $LOCKFILE
+	echo -n "Starting auto Xen domains:"
+	# We expect config scripts for auto starting domains to be in
+	# XENDOMAINS_AUTO - they could just be symlinks to files elsewhere
+
+	# Create all domains with config files in XENDOMAINS_AUTO.
+	# TODO: We should record which domain name belongs
+	# so we have the option to selectively shut down / migrate later
+	# If a domain statefile from $XENDOMAINS_SAVE matches a domain name
+	# in $XENDOMAINS_AUTO, do not try to start that domain; if it didn't
+	# restore correctly it requires administrative attention.
+	for dom in $XENDOMAINS_AUTO/*; do
+	    echo -n " ${dom##*/}"
+	    shortdom=$(echo $dom | sed -n 's/^.*\/\(.*\)$/\1/p')
+	    echo $saved_domains | grep -w $shortdom > /dev/null
+	    if [ $? -eq 0 ] || is_running $dom; then
+		echo -n "(skip)"
+	    else
+		XMC=`$CMD create --quiet --defconfig $dom`
+		if [ $? -ne 0 ]; then
+		    echo -e "\nAn error occurred while creating domain ${dom##*/}: $XMC\n"
+		    rc_failed $?
+		    echo -e '!'
+		else
+		    usleep $XENDOMAINS_CREATE_USLEEP
+		fi
+	    fi
+	done
+    fi
+}
+
+all_zombies()
+{
+    name=;id=
+    while read LN; do
+	parseln "$LN" || continue
+	if test $id = 0; then continue; fi
+	if test "$state" != "-b---d" -a "$state" != "-----d"; then
+	    return 1;
+	fi
+    done < <($CMD list -l | grep "$LIST_GREP")
+    return 0
+}
+
+# Wait for max $XENDOMAINS_STOP_MAXWAIT for $CMD $1 to finish;
+# if it has not exited by that time kill it, so the init script will
+# succeed within a finite amount of time; if $2 is nonnull, it will
+# kill the command as well as soon as no domain (except for zombies)
+# are left (used for shutdown --all). Third parameter, if any, suppresses
+# output of dots per working state (formatting issues)
+watchdog_xencmd()
+{
+    if test -z "$XENDOMAINS_STOP_MAXWAIT" -o "$XENDOMAINS_STOP_MAXWAIT" = "0"; then
+	exit
+    fi
+
+    usleep 20000
+    for no in `seq 0 $XENDOMAINS_STOP_MAXWAIT`; do
+	# exit if $CMD save/migrate/shutdown is finished
+	PSAX=`ps axlw | grep "$CMD $1" | grep -v grep`
+	if test -z "$PSAX"; then exit; fi
+	if ! test -n "$3"; then echo -n '.'; fi
+	sleep 1
+	# go to kill immediately if there's only zombies left
+	if all_zombies && test -n "$2"; then break; fi
+    done
+    sleep 1
+    read PSF PSUID PSPID PSPPID < <(echo "$PSAX")
+    # kill $CMD $1
+    kill $PSPID >/dev/null 2>&1
+
+    echo -e .
+}
+
+stop()
+{
+    exec 3>&2 2> /dev/null
+
+    # Collect list of domains to shut down
+    if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
+	rdnames
+    fi
+    echo -n "Shutting down Xen domains:"
+    name=;id=
+    while read LN; do
+	parseln "$LN" || continue
+	if test $id = 0; then continue; fi
+	echo -n " $name"
+	if test "$XENDOMAINS_AUTO_ONLY" = "true"; then
+	    eval "
+	    case \"\$name\" in
+		($NAMES)
+		    # nothing
+		    ;;
+		(*)
+		    echo -e '(skip)'
+		    continue
+		    ;;
+	    esac
+	    "
+	fi
+	# XENDOMAINS_SYSRQ chould be something like just "s"
+	# or "s e i u" or even "s e s i u o"
+	# for the latter, you should set XENDOMAINS_USLEEP to 1200000 or so
+	if test -n "$XENDOMAINS_SYSRQ"; then
+	    for sysrq in $XENDOMAINS_SYSRQ; do
+		echo -n "(SR-$sysrq)"
+		XMR=`$CMD sysrq $id $sysrq 2>&1 1>/dev/null`
+		if test $? -ne 0; then
+		    echo -e "\nAn error occurred while doing sysrq on domain:\n$XMR\n"
+		    rc_failed $?
+		    echo -n '!'
+		fi
+		# usleep just ignores empty arg
+		usleep $XENDOMAINS_USLEEP
+	    done
+	fi
+	if test "$state" = "-b---d" -o "$state" = "-----d"; then
+	    echo -n "(zomb)"
+	    continue
+	fi
+	if test -n "$XENDOMAINS_MIGRATE"; then
+	    echo -n "(migr)"
+	    watchdog_xencmd migrate &
+	    WDOG_PID=$!
+	    XMR=`$CMD migrate $id $XENDOMAINS_MIGRATE 2>&1 1>/dev/null`
+	    if test $? -ne 0; then
+		echo -e "\nAn error occurred while migrating domain:\n$XMR\n"
+		rc_failed $?
+		echo -e '!'
+
+		kill $WDOG_PID >/dev/null 2>&1
+	    else
+		kill $WDOG_PID >/dev/null 2>&1
+
+		echo -e .
+		usleep 1000
+		continue
+	    fi
+	fi
+	if test -n "$XENDOMAINS_SAVE"; then
+	    echo -n "(save)"
+	    watchdog_xencmd save &
+	    WDOG_PID=$!
+	    mkdir -p "$XENDOMAINS_SAVE"
+	    XMR=`$CMD save $id $XENDOMAINS_SAVE/$name 2>&1 1>/dev/null`
+	    if test $? -ne 0; then
+		echo -e "\nAn error occurred while saving domain:\n$XMR\n"
+		rc_failed $?
+		echo -e '!'
+		kill $WDOG_PID >/dev/null 2>&1
+	    else
+		kill $WDOG_PID >/dev/null 2>&1
+		echo -e .
+		usleep 1000
+		continue
+	    fi
+	fi
+	if test -n "$XENDOMAINS_SHUTDOWN"; then
+	    # XENDOMAINS_SHUTDOWN should be "--wait"
+	    echo -n "(shut)"
+	    watchdog_xencmd shutdown &
+	    WDOG_PID=$!
+	    XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN $id 2>&1 1>/dev/null`
+	    if test $? -ne 0; then
+		echo -e "\nAn error occurred while shutting down domain:\n$XMR\n"
+		rc_failed $?
+		echo -e '!'
+	    fi
+	    kill $WDOG_PID >/dev/null 2>&1
+	fi
+    done < <($CMD list -l | grep "$LIST_GREP")
+
+    # NB. this shuts down ALL Xen domains (politely), not just the ones in
+    # AUTODIR/*
+    # This is because it's easier to do ;-) but arguably if this script is run
+    # on system shutdown then it's also the right thing to do.
+    if ! all_zombies && test -n "$XENDOMAINS_SHUTDOWN_ALL"; then
+	# XENDOMAINS_SHUTDOWN_ALL should be "--all --wait"
+	echo -n " SHUTDOWN_ALL "
+	watchdog_xencmd shutdown 1 false &
+	WDOG_PID=$!
+	XMR=`$CMD shutdown $XENDOMAINS_SHUTDOWN_ALL 2>&1 1>/dev/null`
+	if test $? -ne 0; then
+	    echo -e "\nAn error occurred while shutting down all domains: $XMR\n"
+	    rc_failed $?
+	    echo -e '!'
+	fi
+	kill $WDOG_PID >/dev/null 2>&1
+    fi
+
+    # Unconditionally delete lock file
+    rm -f $LOCKFILE
+
+    exec 2>&3
+}
+
+check_domain_up()
+{
+    name=;id=
+    while read LN; do
+	parseln "$LN" || continue
+	if test $id = 0; then continue; fi
+	case $name in
+	    ($1)
+		return 0
+		;;
+	esac
+    done < <($CMD list -l | grep "$LIST_GREP")
+    return 1
+}
+
+check_all_auto_domains_up()
+{
+    if ! contains_something "$XENDOMAINS_AUTO"
+    then
+      return 0
+    fi
+    missing=
+    for nm in $XENDOMAINS_AUTO/*; do
+	rdname $nm
+	found=0
+	if check_domain_up "$NM"; then
+	    echo -n " $name"
+	else
+	    missing="$missing $NM"
+	fi
+    done
+    if test -n "$missing"; then
+	echo -n " MISS AUTO:$missing"
+	return 1
+    fi
+    return 0
+}
+
+check_all_saved_domains_up()
+{
+    if ! contains_something "$XENDOMAINS_SAVE"
+    then
+      return 0
+    fi
+    missing=`/bin/ls $XENDOMAINS_SAVE`
+    echo -n " MISS SAVED: " $missing
+    return 1
+}
+
+# This does NOT necessarily restart all running domains: instead it
+# stops all running domains and then boots all the domains specified in
+# AUTODIR.  If other domains have been started manually then they will
+# not get restarted.
+# Commented out to avoid confusion!
+
+restart()
+{
+    stop
+    start
+}
+
+reload()
+{
+    restart
+}
+
+
+case "$1" in
+    start)
+	start
+	rc_status
+	if test -f $LOCKFILE; then rc_status -v; fi
+	;;
+
+    stop)
+	stop
+	rc_status -v
+	;;
+
+    restart)
+	restart
+	;;
+    reload)
+	reload
+	;;
+
+    status)
+	echo -n "Checking for xendomains:"
+	if test ! -f $LOCKFILE; then
+	    rc_failed 3
+	else
+	    check_all_auto_domains_up
+	    rc_status
+	    check_all_saved_domains_up
+	    rc_status
+	fi
+	rc_status -v
+	;;
+
+    *)
+	echo "Usage: $0 {start|stop|restart|reload|status}"
+	rc_failed 3
+	rc_status -v
+	;;
+esac
+
+rc_exit
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (7 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:25   ` Ian Campbell
  2014-05-07 16:12   ` Roger Pau Monné
  2014-04-30  1:12 ` [PATCH v4 10/15] autoconf: update m4/pkg.m4 Luis R. Rodriguez
                   ` (7 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich

From: "Luis R. Rodriguez" <mcgrof@suse.com>

With some new functionality introduced we can't keep around the old cache.

Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 autogen.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index b5c9688..2be8360 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,12 +1,12 @@
 #!/bin/sh -e
-autoconf
+autoconf -f
 ( cd tools
-  autoconf
+  autoconf -f
   autoheader
 )
 ( cd stubdom
-  autoconf
+  autoconf -f
 )
 ( cd docs
-  autoconf
+  autoconf -f
 )
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 10/15] autoconf: update m4/pkg.m4
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (8 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:28   ` Ian Campbell
  2014-05-07 16:17   ` Roger Pau Monné
  2014-04-30  1:12 ` [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
                   ` (6 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich

From: "Luis R. Rodriguez" <mcgrof@suse.com>

The provenance of the m4 pkg.m4 macro library was not documented
and it was not clear how and if we can update this without breaking
things. Document where this comes from, update us to the latest
release from git and put a warning about avoiding private evolutions
so that instead things go upstream.

The pkg-config m4 macro library comes from the upstream pkg-config
git repository [0]. If you update the m4 library update this file
with provenance and last commit ID information. For documentation
on how to use this read the pkg-config(1) man page.

Tree: git://anongit.freedesktop.org/pkg-config

The last synch was from commit:

commit 4f0084d9d3b8726a797a373c7ec5e406000995d0
Author: Dan Nicholson <dbn.lists@gmail.com>
Date:   Mon Feb 3 15:59:18 2014 -0800

    glib: Fix Makefiles to suppress warnings from automake

    With the newly added glib.mk, some of the noinst_* variables need to use
    += in the evaluation to avoid multiple definition warnings from
    automake.

Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 m4/pkg.m4        | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++----
 m4/pkg.m4.README | 21 ++++++++++++++
 2 files changed, 103 insertions(+), 6 deletions(-)
 create mode 100644 m4/pkg.m4.README

diff --git a/m4/pkg.m4 b/m4/pkg.m4
index 9bb3e06..62995f0 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -26,7 +26,8 @@
 # ----------------------------------
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
@@ -72,7 +73,8 @@ m4_define([_PKG_CONFIG],
     pkg_cv_[]$1="$$1"
  elif test -n "$PKG_CONFIG"; then
     PKG_CHECK_EXISTS([$3],
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes ],
 		     [pkg_failed=yes])
  else
     pkg_failed=untried
@@ -120,9 +122,9 @@ if test $pkg_failed = yes; then
    	AC_MSG_RESULT([no])
         _PKG_SHORT_ERRORS_SUPPORTED
         if test $_pkg_short_errors_supported = yes; then
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
         else 
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
@@ -135,7 +137,7 @@ $$1_PKG_ERRORS
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
 installed software in a non-standard prefix.
 
-_PKG_TEXT])dnl
+_PKG_TEXT])[]dnl
         ])
 elif test $pkg_failed = untried; then
      	AC_MSG_RESULT([no])
@@ -146,7 +148,7 @@ path to pkg-config.
 
 _PKG_TEXT
 
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
         ])
 else
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
@@ -155,3 +157,77 @@ else
 	$3
 fi[]dnl
 ])# PKG_CHECK_MODULES
+
+
+# PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------
+# Checks for existence of MODULES and gathers its build flags with
+# static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+# and VARIABLE-PREFIX_LIBS from --libs.
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES_STATIC might not happen, you should be sure to include
+# an explicit call to PKG_PROG_PKG_CONFIG in your configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+    [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_INSTALLDIR
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+    [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+]) dnl PKG_NOARCH_INSTALLDIR
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])# PKG_CHECK_VAR
diff --git a/m4/pkg.m4.README b/m4/pkg.m4.README
new file mode 100644
index 0000000..9705040
--- /dev/null
+++ b/m4/pkg.m4.README
@@ -0,0 +1,21 @@
+The pkg-config m4 macro library comes from the upstream pkg-config
+git repository [0]. If you update the m4 library update this file
+with provenance and last commit ID information. For documentation
+on how to use this read the pkg-config(1) man page.
+
+Do not modify this file yourself, if you want to evolve it send
+patches upstream and then synch back here.
+
+Tree: git://anongit.freedesktop.org/pkg-config
+
+The last synch was from commit:
+
+commit 4f0084d9d3b8726a797a373c7ec5e406000995d0
+Author: Dan Nicholson <dbn.lists@gmail.com>
+Date:   Mon Feb 3 15:59:18 2014 -0800
+
+    glib: Fix Makefiles to suppress warnings from automake
+    
+    With the newly added glib.mk, some of the noinst_* variables need to use
+    += in the evaluation to avoid multiple definition warnings from
+    automake.
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (9 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 10/15] autoconf: update m4/pkg.m4 Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-04-30  6:52   ` Jan Beulich
       [not found]   ` <5360B9CB020000780000D9BB@suse.com>
  2014-04-30  1:12 ` [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config Luis R. Rodriguez
                   ` (5 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich, Samuel Thibault

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This moves all generic variables to the top level makefile,
tons of files use these so just make them general enough. This
also paves the way to let us easily dynamically configure these
with autoconf, for now we leave the same presets as was present
before.

This work was prompted by looking for an autoconf way to do
replacements for the hotplug global file, while at it I realized
that a few other files use the same variables and have in places
around the tree the same constructs for generating their own
files. This replaces all that with a two central files, one for
shell scripts and another for C header files. We should later
optimize this further by only having one target file and
generating the two needed from that.

Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 .gitignore                        |  2 ++
 Config.mk                         | 13 ---------
 config/StdGNU.mk                  | 19 ++----------
 config/Toplevel.mk.in             | 24 +++++++++++++++
 config/xen-environment-header.in  | 13 +++++++++
 config/xen-environment-scripts.in | 15 ++++++++++
 configure.ac                      |  9 +++++-
 m4/expand_config.m4               | 61 +++++++++++++++++++++++++++++++++++++++
 stubdom/Makefile                  | 17 ++++++-----
 stubdom/configure.ac              |  3 ++
 tools/configure.ac                |  3 ++
 tools/hotplug/common/Makefile     |  6 ++--
 tools/libxl/Makefile              | 11 ++-----
 tools/python/Makefile             |  6 ++--
 14 files changed, 149 insertions(+), 53 deletions(-)
 create mode 100644 config/xen-environment-header.in
 create mode 100644 config/xen-environment-scripts.in
 create mode 100644 m4/expand_config.m4

diff --git a/.gitignore b/.gitignore
index 562c262..fd1b627 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,8 @@ config.log
 config.status
 config.cache
 config/Toplevel.mk
+config/xen-environment-scripts
+config/xen-environment-header
 
 build-*
 dist/*
diff --git a/Config.mk b/Config.mk
index 6a93533..84f79a0 100644
--- a/Config.mk
+++ b/Config.mk
@@ -166,19 +166,6 @@ define move-if-changed
 	if ! cmp -s $(1) $(2); then mv -f $(1) $(2); else rm -f $(1); fi
 endef
 
-buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
-define buildmakevars2file-closure
-    .PHONY: genpath
-    genpath:
-	rm -f $(1).tmp;                                                     \
-	$(foreach var,                                                      \
-	          SBINDIR BINDIR LIBEXEC LIBDIR SHAREDIR PRIVATE_BINDIR     \
-	          XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
-	          XEN_RUN_DIR XEN_PAGING_DIR,                               \
-	          echo "$(var)=\"$($(var))\"" >>$(1).tmp;)        \
-	$(call move-if-changed,$(1).tmp,$(1))
-endef
-
 ifeq ($(debug_symbols),y)
 CFLAGS += -g
 endif
diff --git a/config/StdGNU.mk b/config/StdGNU.mk
index 25fc594..00b47de 100644
--- a/config/StdGNU.mk
+++ b/config/StdGNU.mk
@@ -1,3 +1,5 @@
+include $(XEN_ROOT)/config/Toplevel.mk
+
 AS         = $(CROSS_COMPILE)as
 LD         = $(CROSS_COMPILE)ld
 ifeq ($(clang),y)
@@ -27,30 +29,13 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
 INSTALL_DATA = $(INSTALL) -m0644 -p
 INSTALL_PROG = $(INSTALL) -m0755 -p
 
-PREFIX ?= /usr
-BINDIR = $(PREFIX)/bin
 INCLUDEDIR = $(PREFIX)/include
-LIBEXEC = $(PREFIX)/lib/xen/bin
-SHAREDIR = $(PREFIX)/share
 MANDIR = $(SHAREDIR)/man
 MAN1DIR = $(MANDIR)/man1
 MAN8DIR = $(MANDIR)/man8
-SBINDIR = $(PREFIX)/sbin
-XENFIRMWAREDIR = $(PREFIX)/lib/xen/boot
-
-PRIVATE_PREFIX = $(LIBDIR)/xen
-PRIVATE_BINDIR = $(PRIVATE_PREFIX)/bin
-
-CONFIG_DIR = /etc
-XEN_LOCK_DIR = /var/lock
-XEN_RUN_DIR = /var/run/xen
-XEN_PAGING_DIR = /var/lib/xen/xenpaging
 
 SYSCONFIG_DIR = $(CONFIG_DIR)/$(CONFIG_LEAF_DIR)
 
-XEN_CONFIG_DIR = $(CONFIG_DIR)/xen
-XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
-
 SOCKET_LIBS =
 UTIL_LIBS = -lutil
 DLOPEN_LIBS = -ldl
diff --git a/config/Toplevel.mk.in b/config/Toplevel.mk.in
index 4db7eaf..fc2754c 100644
--- a/config/Toplevel.mk.in
+++ b/config/Toplevel.mk.in
@@ -1 +1,25 @@
 SUBSYSTEMS               := @SUBSYSTEMS@
+
+SBINDIR                  := @SBINDIR@
+BINDIR                   := @BINDIR@
+LIBEXEC                  := @LIBEXEC@
+
+SHAREDIR                 := @SHAREDIR@
+LIBDIR                   := @LIBDIR@
+
+XEN_RUN_DIR              := @XEN_RUN_DIR@
+XEN_LOG_DIR              := @XEN_LOG_DIR@
+XEN_LIB_STORED           := @XEN_LIB_STORED@
+
+CONFIG_DIR               := @CONFIG_DIR@
+XEN_LOCK_DIR             := @XEN_LOCK_DIR@
+XEN_PAGING_DIR           := @XEN_PAGING_DIR@
+
+PRIVATE_PREFIX           := @PRIVATE_PREFIX@
+PRIVATE_PREFIX           := @PKG_XEN_PREFIX@
+PRIVATE_BINDIR           := @PRIVATE_BINDIR@
+
+XENFIRMWAREDIR           := @XENFIRMWAREDIR@
+
+XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
+XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
diff --git a/config/xen-environment-header.in b/config/xen-environment-header.in
new file mode 100644
index 0000000..7dd7a53
--- /dev/null
+++ b/config/xen-environment-header.in
@@ -0,0 +1,13 @@
+#define SBINDIR "@SBINDIR@"
+#define BINDIR "@BINDIR@"
+#define LIBEXEC "@LIBEXEC@"
+#define LIBDIR "@LIBDIR@"
+#define SHAREDIR "@SHAREDIR@"
+
+#define PRIVATE_BINDIR "@PRIVATE_BINDIR@"
+#define XENFIRMWAREDIR "@XENFIRMWAREDIR@"
+#define XEN_CONFIG_DIR "@XEN_CONFIG_DIR@"
+#define XEN_SCRIPT_DIR "@XEN_SCRIPT_DIR@"
+#define XEN_LOCK_DIR "@XEN_LOCK_DIR@"
+#define XEN_RUN_DIR "@XEN_RUN_DIR@"
+#define XEN_PAGING_DIR "@XEN_PAGING_DIR@"
diff --git a/config/xen-environment-scripts.in b/config/xen-environment-scripts.in
new file mode 100644
index 0000000..9623231
--- /dev/null
+++ b/config/xen-environment-scripts.in
@@ -0,0 +1,15 @@
+SBINDIR="@SBINDIR@"
+BINDIR="@BINDIR@"
+LIBEXEC="@LIBEXEC@"
+LIBDIR="@LIBDIR@"
+SHAREDIR="@SHAREDIR@"
+
+PRIVATE_BINDIR="@PRIVATE_BINDIR@"
+XENFIRMWAREDIR="@XENFIRMWAREDIR@"
+XEN_CONFIG_DIR="@XEN_CONFIG_DIR@"
+XEN_SCRIPT_DIR="@XEN_SCRIPT_DIR@"
+XEN_LOCK_DIR="@XEN_LOCK_DIR@"
+XEN_LOG_DIR="@XEN_LOG_DIR@"
+XEN_LIB_STORED="@XEN_LIB_STORED@"
+XEN_RUN_DIR="@XEN_RUN_DIR@"
+XEN_PAGING_DIR="@XEN_PAGING_DIR@"
diff --git a/configure.ac b/configure.ac
index 6c14524..3f26a39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,12 +5,19 @@ AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor], m4_esyscmd([./version.sh ./xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([./xen/common/kernel.c])
-AC_CONFIG_FILES([./config/Toplevel.mk])
+AC_CONFIG_FILES([
+	config/Toplevel.mk
+	config/xen-environment-scripts
+	config/xen-environment-header
+])
 
 AC_CANONICAL_HOST
 
 m4_include([m4/features.m4])
 m4_include([m4/subsystem.m4])
+m4_include([m4/expand_config.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 dnl mini-os is only ported to certain platforms
 case "$host_cpu" in
diff --git a/m4/expand_config.m4 b/m4/expand_config.m4
new file mode 100644
index 0000000..717fcd1
--- /dev/null
+++ b/m4/expand_config.m4
@@ -0,0 +1,61 @@
+AC_DEFUN([AX_XEN_EXPAND_CONFIG], [
+dnl expand these early so we can use this for substitutions
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
+
+BINDIR=$prefix/bin
+AC_SUBST(BINDIR)
+
+SBINDIR=$prefix/sbin
+AC_SUBST(SBINDIR)
+
+dnl XXX: this should be changed to use the passed $libexec
+dnl but can be done as a second step
+LIBEXEC=$prefix/lib/xen/bin
+AC_SUBST(LIBEXEC)
+
+LIBDIR=`eval echo $libdir`
+AC_SUBST(LIBDIR)
+
+XEN_RUN_DIR=/var/run/xen
+AC_SUBST(XEN_RUN_DIR)
+
+XEN_LOG_DIR=/var/log/xen
+AC_SUBST(XEN_LOG_DIR)
+
+XEN_LIB_STORED=/var/lib/xenstored
+AC_SUBST(XEN_LIB_STORED)
+
+SHAREDIR=$prefix/share
+AC_SUBST(SHAREDIR)
+
+PRIVATE_PREFIX=$LIBDIR/xen
+AC_SUBST(PRIVATE_PREFIX)
+
+PKG_XEN_PREFIX=$LIBDIR/xen
+AC_SUBST(PKG_XEN_PREFIX)
+
+PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+AC_SUBST(PRIVATE_BINDIR)
+
+XENFIRMWAREDIR=$prefix/lib/xen/boot
+AC_SUBST(XENFIRMWAREDIR)
+
+CONFIG_DIR=/etc
+AC_SUBST(CONFIG_DIR)
+
+XEN_CONFIG_DIR=$CONFIG_DIR/xen
+AC_SUBST(XEN_CONFIG_DIR)
+
+XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
+AC_SUBST(XEN_SCRIPT_DIR)
+
+XEN_LOCK_DIR=/var/lock
+AC_SUBST(XEN_LOCK_DIR)
+
+XEN_RUN_DIR=/var/run/xen
+AC_SUBST(XEN_RUN_DIR)
+
+XEN_PAGING_DIR=/var/lib/xen/xenpaging
+AC_SUBST(XEN_PAGING_DIR)
+])
diff --git a/stubdom/Makefile b/stubdom/Makefile
index b1822b7..bf2ee1d 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -48,18 +48,19 @@ TARGET_LDFLAGS += -nostdlib -L$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib
 
 TARGETS=$(STUBDOM_TARGETS)
 
+STUBDOMPATH="stubdompath.sh"
+
+$(STUBDOMPATH): $(XEN_ROOT)/config/xen-environment-scripts
+	@cp $(XEN_ROOT)/config/xen-environment-scripts $@
+
 .PHONY: all
 all: build
 ifeq ($(STUBDOM_SUPPORTED),1)
-build: genpath $(STUBDOM_BUILD)
+build: $(STUBDOMPATH) $(STUBDOM_BUILD)
 else
-build: genpath
+build: $(STUBDOMPATH)
 endif
 
-STUBDOMPATH="stubdompath.sh"
-genpath-target = $(call buildmakevars2file,$(STUBDOMPATH))
-$(eval $(genpath-target))
-
 ##############
 # Cross-newlib
 ##############
@@ -446,9 +447,9 @@ xenstore-stubdom: mini-os-$(XEN_TARGET_ARCH)-xenstore libxc xenstore
 #########
 
 ifeq ($(STUBDOM_SUPPORTED),1)
-install: genpath install-readme $(STUBDOM_INSTALL)
+install: $(STUBDOMPATH) install-readme $(STUBDOM_INSTALL)
 else
-install: genpath
+install: $(STUBDOMPATH)
 endif
 
 install-readme:
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index 6468203..d6b0fbf 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -16,6 +16,9 @@ m4_include([../m4/features.m4])
 m4_include([../m4/path_or_fail.m4])
 m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
+m4_include([../m4/expand_config.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable stub domains
 AX_STUBDOM_CONDITIONAL([ioemu-stubdom], [ioemu])
diff --git a/tools/configure.ac b/tools/configure.ac
index 00fb47b..c7674a0 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -47,6 +47,9 @@ m4_include([../m4/ptyfuncs.m4])
 m4_include([../m4/extfs.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/ax_compare_version.m4])
+m4_include([../m4/expand_config.m4])
+
+AX_XEN_EXPAND_CONFIG()
 
 # Enable/disable options
 AX_ARG_DEFAULT_DISABLE([githttp], [Download GIT repositories via HTTP])
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 18d87aa..4a63f40 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -9,14 +9,14 @@ HOTPLUGPATH="hotplugpath.sh"
 XEN_SCRIPTS =
 XEN_SCRIPT_DATA = $(HOTPLUGPATH)
 
-genpath-target = $(call buildmakevars2file,$(HOTPLUGPATH))
-$(eval $(genpath-target))
+$(HOTPLUGPATH): $(XEN_ROOT)/config/xen-environment-scripts
+	@cp $(XEN_ROOT)/config/xen-environment-scripts $@
 
 .PHONY: all
 all: build
 
 .PHONY: build
-build: genpath
+build: $(HOTPLUGPATH)
 
 .PHONY: install
 install: all install-scripts
diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 755b666..1b8852c 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -97,6 +97,9 @@ TEST_PROGS += $(foreach t, $(LIBXL_TESTS),test_$t)
 
 $(LIBXL_OBJS) $(LIBXL_TEST_OBJS): CFLAGS += $(CFLAGS_LIBXL) -include $(XEN_ROOT)/tools/config.h
 
+_paths.h: $(XEN_ROOT)/config/xen-environment-header
+	@cp $(XEN_ROOT)/config/xen-environment-header $@
+
 AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h _paths.h \
 	libxlu_disk_l.h _libxl_save_msgs_callout.h _libxl_save_msgs_helper.h
 AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c
@@ -141,9 +144,6 @@ $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS) $(SAVE_HELPER_OBJS) \
 	@rm -f $*.[ch]
 	$(FLEX) --header-file=$*.h --outfile=$*.c $<
 
-genpath-target = $(call buildmakevars2file,_paths.h.tmp)
-$(eval $(genpath-target))
-
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
 	touch $@
@@ -154,11 +154,6 @@ _%.api-for-check: %.h $(AUTOINCS)
 		>$@.new
 	mv -f $@.new $@
 
-_paths.h: genpath
-	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp
-	rm -f $@.tmp
-	$(call move-if-changed,$@.2.tmp,$@)
-
 _libxl_list.h: $(XEN_INCLUDE)/xen-external/bsd-sys-queue-h-seddery $(XEN_INCLUDE)/xen-external/bsd-sys-queue.h
 	$(PERL) $^ --prefix=libxl >$@.new
 	$(call move-if-changed,$@.new,$@)
diff --git a/tools/python/Makefile b/tools/python/Makefile
index 74ed027..99479d6 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -6,11 +6,11 @@ all: build
 
 XENPATH = "xen/util/path.py"
 
-genpath-target = $(call buildmakevars2file,$(XENPATH))
-$(eval $(genpath-target))
+$(XENPATH): $(XEN_ROOT)/config/xen-environment-scripts
+	@cp $(XEN_ROOT)/config/xen-environment-scripts $@
 
 .PHONY: build
-build: genpath genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
+build: $(XENPATH) genwrap.py $(XEN_ROOT)/tools/libxl/libxl_types.idl \
 		$(XEN_ROOT)/tools/libxl/idl.py
 	PYTHONPATH=$(XEN_ROOT)/tools/libxl $(PYTHON) genwrap.py \
 		$(XEN_ROOT)/tools/libxl/libxl_types.idl \
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (10 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:32   ` Ian Campbell
  2014-04-30  1:12 ` [PATCH v4 13/15] systemd: add xen systemd service and module files Luis R. Rodriguez
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This lets us easily look what xenstored we have on the build system
and use it with autoconf for file generation. Although you can now
specify your preference to disable ocaml tools the we can only make
a general build flag available if coming from the parent configure.ac

You can only use:

./configure --with-xenstored=cxenstored
./configure --with-xenstored=oxenstored

And by default oxenstored will be used, but only if you have ocaml
dependencies. Enabling cxenstored will then disable ocamltools. This lets
us simplify the legacy init script a bit but it should help us simplify
our systemd service files even more.

Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 config/Toplevel.mk.in                 |  3 ++
 config/xen-environment-header.in      |  3 ++
 config/xen-environment-scripts.in     |  3 ++
 configure.ac                          |  1 +
 m4/expand_config.m4                   | 61 +++++++++++++++++++++++++++++++++++
 stubdom/configure.ac                  |  1 +
 tools/configure.ac                    | 11 +++++++
 tools/hotplug/Linux/init.d/xencommons |  6 ----
 8 files changed, 83 insertions(+), 6 deletions(-)

diff --git a/config/Toplevel.mk.in b/config/Toplevel.mk.in
index fc2754c..bea9d96 100644
--- a/config/Toplevel.mk.in
+++ b/config/Toplevel.mk.in
@@ -23,3 +23,6 @@ XENFIRMWAREDIR           := @XENFIRMWAREDIR@
 
 XEN_CONFIG_DIR           := @XEN_CONFIG_DIR@
 XEN_SCRIPT_DIR           := @XEN_SCRIPT_DIR@
+
+XENSTORED                := @XENSTORED@
+XENSTORE                 := @XENSTORE@
diff --git a/config/xen-environment-header.in b/config/xen-environment-header.in
index 7dd7a53..3ee8e32 100644
--- a/config/xen-environment-header.in
+++ b/config/xen-environment-header.in
@@ -11,3 +11,6 @@
 #define XEN_LOCK_DIR "@XEN_LOCK_DIR@"
 #define XEN_RUN_DIR "@XEN_RUN_DIR@"
 #define XEN_PAGING_DIR "@XEN_PAGING_DIR@"
+
+#define XENSTORED @XENSTORED@
+#define XENSTORE @XENSTORE@
diff --git a/config/xen-environment-scripts.in b/config/xen-environment-scripts.in
index 9623231..a17e0e9 100644
--- a/config/xen-environment-scripts.in
+++ b/config/xen-environment-scripts.in
@@ -13,3 +13,6 @@ XEN_LOG_DIR="@XEN_LOG_DIR@"
 XEN_LIB_STORED="@XEN_LIB_STORED@"
 XEN_RUN_DIR="@XEN_RUN_DIR@"
 XEN_PAGING_DIR="@XEN_PAGING_DIR@"
+
+XENSTORED="@XENSTORED@"
+XENSTORE="@XENSTORE@"
diff --git a/configure.ac b/configure.ac
index 3f26a39..f5faa4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,6 +16,7 @@ AC_CANONICAL_HOST
 m4_include([m4/features.m4])
 m4_include([m4/subsystem.m4])
 m4_include([m4/expand_config.m4])
+m4_include([m4/ocaml.m4])
 
 AX_XEN_EXPAND_CONFIG()
 
diff --git a/m4/expand_config.m4 b/m4/expand_config.m4
index 717fcd1..40d9707 100644
--- a/m4/expand_config.m4
+++ b/m4/expand_config.m4
@@ -58,4 +58,65 @@ AC_SUBST(XEN_RUN_DIR)
 
 XEN_PAGING_DIR=/var/lib/xen/xenpaging
 AC_SUBST(XEN_PAGING_DIR)
+
+AC_DEFUN([AX_XEN_OCAML_XENSTORE_CHECK], [
+	AC_PROG_OCAML
+	AC_PROG_FINDLIB
+	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+		AC_MSG_ERROR([Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib])
+	])
+])
+
+AC_DEFUN([AX_XEN_OCAML_XENSTORE_DEFAULTS], [
+	xenstore="oxenstored"
+	xenstored=$SBINDIR/oxenstored
+	AC_PROG_OCAML
+	AC_PROG_FINDLIB
+	AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
+		xenstore="cxenstored"
+		xenstored=$SBINDIR/xenstored
+	])
+])
+
+AS_IF([test "x$XENSTORE" = "x"], [
+AC_ARG_WITH([xenstored],
+	AS_HELP_STRING([--with-xenstored@<:@=cxenstored|cxenstored@:>@],
+		[This lets you choose which xenstore daemon you want, you have
+		two options: the original xenstored written in C (cxenstored)
+		or the newer and robust one written in Ocaml (oxenstored).
+		The oxenstored daemon is the default but will but can only
+		be used if you have ocaml library / build dependencies solved,
+		if you have not specified a preference and do not have ocaml
+		dependencies resolved we'll enable the C xenstored for you. If
+		you ask for oxenstored we'll complain until you resolve those
+		dependencies]),
+	[
+		AS_IF([test "x$withval" = "xcxenstored"], [
+			xenstore="cxenstored"
+			xenstored=$SBINDIR/xenstored
+		])
+		AS_IF([test "x$withval" = "xoxenstored"], [
+			xenstore="oxenstored"
+			xenstored=$SBINDIR/oxenstored
+			AX_XEN_OCAML_XENSTORE_CHECK()
+		])
+		AS_IF([test "x$withval" != "xoxenstored" && test "x$withval" != "xcxenstored"], [
+			AC_MSG_ERROR([Unsupported xenstored specified, supported types: oxenstored cxenstored])
+		])
+	],
+	[
+		AX_XEN_OCAML_XENSTORE_DEFAULTS()
+	])
+])
+
+XENSTORE=$xenstore
+AC_SUBST(XENSTORE)
+
+AS_IF([test "x$XENSTORED" = "x"], [
+	XENSTORED=$xenstored
+])
+AC_SUBST(XENSTORED)
+
+AS_IF([test "x$XENSTORE" != "xcxenstored" && test "x$XENSTORE" != "xoxenstored"],
+	[AC_MSG_ERROR([Invalid xenstore: $XENSTORE])])
 ])
diff --git a/stubdom/configure.ac b/stubdom/configure.ac
index d6b0fbf..3c30004 100644
--- a/stubdom/configure.ac
+++ b/stubdom/configure.ac
@@ -17,6 +17,7 @@ m4_include([../m4/path_or_fail.m4])
 m4_include([../m4/depends.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/expand_config.m4])
+m4_include([../m4/ocaml.m4])
 
 AX_XEN_EXPAND_CONFIG()
 
diff --git a/tools/configure.ac b/tools/configure.ac
index c7674a0..ac984a3 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -152,6 +152,17 @@ AC_PROG_INSTALL
 AC_PATH_PROG([BISON], [bison])
 AC_PATH_PROG([FLEX], [flex])
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
+AS_IF([test "x$xapi" = "xy"], [
+    AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
+    AX_PATH_PROG_OR_FAIL([XML], [xml2-config])
+])
+
+case $XENSTORE in
+	"cxenstored") ocamltools=n;;
+	"oxenstored") ocamltools=y;;
+	*) AC_MSG_ERROR([xenstore: $xenstore]);;
+esac
+
 AS_IF([test "x$ocamltools" = "xy"], [
     AC_PROG_OCAML
     AC_PROG_FINDLIB
diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
index 7195413..cbe2903 100644
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -80,12 +80,6 @@ do_start () {
 		if [ -n "$XENSTORED" ] ; then
 		    echo -n Starting $XENSTORED...
 		    $XENSTORED --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x ${SBINDIR}/oxenstored ] ; then
-		    echo -n Starting oxenstored...
-		    ${SBINDIR}/oxenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
-		elif [ -x ${SBINDIR}/xenstored ] ; then
-		    echo -n Starting C xenstored...
-		    ${SBINDIR}/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS
 		else
 		    echo "No xenstored found"
 		    exit 1
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (11 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:46   ` Ian Campbell
  2014-05-12 14:11   ` Ian Jackson
  2014-04-30  1:12 ` [PATCH v4 14/15] autoconf: xen: add systemd support into the build system Luis R. Rodriguez
                   ` (3 subsequent siblings)
  16 siblings, 2 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This adds the systemd xen service / module files. All of this
is disabled for now, and won't install / build until we hook
up proper support for systemd into the build system.

These are originally based on the Fedora systemd files.

Changes made from Fedora's systemd files:

  * use autoconf to replace @variable@ paths for us which piggy
    backs on top of the latest autoconf changes to xen
  * removes oxenstored service file in favor of a build systemd dynamic
    change, that is upon build time you pick what xentore you want, we
    don't want multiple service files floating around, although its
    possible to support with this target files this seems rather
    pointless right now specially since we cannot stop [co]xenstored.
    We instead strive for simplicity with one direct target build.
  * enables systemd socket activation for C xenstored and Ocaml
    oxenstored
  * simplifies startup to not require polling on the sockets
    as initial socket management is handled by systemd, we just
    take on the socket later once anything pokes at it, a simple nc -U
    on the socket files can activate the service for example. Anything
    queued up will be sent to us once we start. Socket activation should
    in theory also let us dynamically switch between xenstores but more
    importantly we could upgrade xenstored while keeping all active
    socket communication queued up, but in order to take advantage of
    this we eventually would need to remove the requirement of not being
    able to bring down the xenstored.
  * allow for xenstored configuration through *either* of these
    configuration files:
	- /etc/sysconfig/xenstored
	- /etc/default/xenstored
    The /etc/default/xenstored will let debian based systems do
    the same, while SUSE/OpenSUSE/Fedora/RedHat can keep on chugging
    with sysconfig
  * ensures we create the run directory as most systems will likely
    be using a tmpfs for run dirs for the pid files
  * Some systems define the selinux context in the systemd Option for the
    /var/lib/xenstored tmpfs:
	Options=mode=755,context="system_u:object_r:xenstored_var_lib_t:s0"
    For the upstream version we remove that and let systems specify the
    context on their system /etc/default/xenstored or /etc/sysconfig/xenstored
    $XENSTORED_MOUNT_CTX variable
  * defines a modules-load.d for us
  * takes advantage of the shared xendomains helper for the xendomains
    service
  * Add the new dom0 that gets kicked off for disk backend access into
    its own systemd service associated to xen

We end up with these systemd files:

General requirements:

  * proc-xen.mount
  * var-lib-xenstored.mount

xenstored:

  * xenstored.service
  * xenstored.socket
  * xenconsoled.service
  * xen-qemu-dom0-disk-backend.service.in

Optional:

  * xendomains.service
  * xen-watchdog.service

As for integration with xen, we house keep all the systemd files
under a new directory tools/hotplug/Linux/systemd/ and will be targetted
by default when building on Linux systems with systemd enabled.

The systemd files will be sanitized for meta @VARIABLES@ upon
configuration and installed upon the install target. Systems that
do not use systemd will not have these files installed and will
end up using the old LSB init scripts.

If you don't specify a prefix you will end up with the services
files under /usr/local/lib/systemd/system/ by default, and systemd
modules-load.d conf files under /usr/local/lib/modules-load.d/ which
systemd does look for (although it seems this is not documented).

Distributions are expected to provide their /usr/ prefix to end up in
the more generic location upon distribution install at
/usr/lib/systemd/system/ and /usr/lib/modules-load.d/ respectively.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 .gitignore                                         |  5 +++
 Makefile                                           | 11 +++++-
 tools/configure.ac                                 | 12 +++++-
 tools/hotplug/Linux/Makefile                       |  8 ++--
 tools/hotplug/Linux/systemd/Makefile               | 44 ++++++++++++++++++++++
 tools/hotplug/Linux/systemd/proc-xen.mount.in      |  9 +++++
 .../Linux/systemd/var-lib-xenstored.mount.in       | 13 +++++++
 .../systemd/xen-qemu-dom0-disk-backend.service.in  | 22 +++++++++++
 .../hotplug/Linux/systemd/xen-watchdog.service.in  | 13 +++++++
 .../Linux/systemd/xen.conf.modules-load.d.in       | 16 ++++++++
 tools/hotplug/Linux/systemd/xenconsoled.service.in | 20 ++++++++++
 tools/hotplug/Linux/systemd/xendomains.service.in  | 16 ++++++++
 tools/hotplug/Linux/systemd/xenstored.service.in   | 25 ++++++++++++
 tools/hotplug/Linux/systemd/xenstored.socket.in    |  9 +++++
 14 files changed, 218 insertions(+), 5 deletions(-)
 create mode 100644 tools/hotplug/Linux/systemd/Makefile
 create mode 100644 tools/hotplug/Linux/systemd/proc-xen.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen-watchdog.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
 create mode 100644 tools/hotplug/Linux/systemd/xenconsoled.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xendomains.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.service.in
 create mode 100644 tools/hotplug/Linux/systemd/xenstored.socket.in

diff --git a/.gitignore b/.gitignore
index fd1b627..5ece576 100644
--- a/.gitignore
+++ b/.gitignore
@@ -390,3 +390,8 @@ tools/xenstore/xenstore-watch
 docs/txt/misc/*.txt
 docs/txt/man/*.txt
 docs/figs/*.png
+
+tools/hotplug/Linux/systemd/*.conf
+tools/hotplug/Linux/systemd/*.mount
+tools/hotplug/Linux/systemd/*.socket
+tools/hotplug/Linux/systemd/*.service
diff --git a/Makefile b/Makefile
index 41dabbf..5330985 100644
--- a/Makefile
+++ b/Makefile
@@ -216,8 +216,17 @@ uninstall:
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
 	rm -f  $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
 	rm -f  $(D)$(SYSCONFIG_DIR)/xendomains
+	rm -f  $(D)$(SBINDIR)/xendomains
 	rm -f  $(D)$(SYSCONFIG_DIR)/xencommons
-	rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xenconsoled.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xendomains.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xenstored.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/oxenstored.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/xen-watchdog.service
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/proc-xen.mount
+	rm -f  $(D)$(XEN_SYSTEMD_DIR)/var-lib-xenstored.mount
+	rm -f  $(D)$(XEN_SYSTEMD_MODULES_LOAD)/xen.conf
+	rm -rf $(D)${XEN_RUN_DIR}* $(D)/var/lib/xen*
 	make -C tools uninstall
 	rm -rf $(D)/boot/tboot*
 
diff --git a/tools/configure.ac b/tools/configure.ac
index ac984a3..8a8831f 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -5,7 +5,17 @@ AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
     [xen-devel@lists.xen.org], [xen], [http://www.xen.org/])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
-AC_CONFIG_FILES([../config/Tools.mk])
+AC_CONFIG_FILES([
+../config/Tools.mk
+hotplug/Linux/systemd/proc-xen.mount
+hotplug/Linux/systemd/var-lib-xenstored.mount
+hotplug/Linux/systemd/xenstored.socket
+hotplug/Linux/systemd/xenstored.service
+hotplug/Linux/systemd/xenconsoled.service
+hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service
+hotplug/Linux/systemd/xendomains.service
+hotplug/Linux/systemd/xen-watchdog.service
+])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR([../])
 
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 7e6646e..540e908 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -25,6 +25,8 @@ XEN_SCRIPTS += vscsi
 XEN_SCRIPTS += block-iscsi
 XEN_SCRIPTS += $(XEN_SCRIPTS-y)
 
+SUBDIRS-$(CONFIG_SYSTEMD) += systemd
+
 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
 XEN_SCRIPT_DATA += block-common.sh
@@ -33,13 +35,13 @@ UDEV_RULES_DIR = $(CONFIG_DIR)/udev
 UDEV_RULES = xen-backend.rules $(UDEV_RULES-y)
 
 .PHONY: all
-all:
+all: subdirs-all
 
 .PHONY: build
 build:
 
 .PHONY: install
-install: all install-initd install-scripts install-udev
+install: all install-initd install-scripts install-udev subdirs-install
 
 # See docs/misc/distro_mapping.txt for INITD_DIR location
 .PHONY: install-initd
@@ -80,4 +82,4 @@ install-udev:
 	done
 
 .PHONY: clean
-clean:
+clean: subdirs-clean
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
new file mode 100644
index 0000000..f23a727
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -0,0 +1,44 @@
+XEN_ROOT = $(CURDIR)/../../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+XEN_SYSTEMD_MODULES = xen.conf
+
+XEN_SYSTEMD_MOUNT =  proc-xen.mount
+XEN_SYSTEMD_MOUNT += var-lib-xenstored.mount
+
+XEN_SYSTEMD_SOCKET += xenstored.socket
+
+XEN_SYSTEMD_SERVICE  = xenstored.service
+XEN_SYSTEMD_SERVICE += xenconsoled.service
+XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
+XEN_SYSTEMD_SERVICE += xendomains.service
+XEN_SYSTEMD_SERVICE += xen-watchdog.service
+
+ALL_XEN_SYSTEMD =	$(XEN_SYSTEMD_MODULES)  \
+			$(XEN_SYSTEMD_MOUNT)	\
+			$(XEN_SYSTEMD_SOCKET)	\
+			$(XEN_SYSTEMD_SERVICE)
+
+.PHONY: all
+all:	$(ALL_XEN_SYSTEMD)
+
+.PHONY: clean
+clean:
+	rm -f *.socket *.service *.mount *.conf
+
+.PHONY: install
+install: $(ALL_XEN_SYSTEMD)
+	[ -d $(DESTDIR)$(XEN_SYSTEMD_DIR) ] || \
+		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	[ -d $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD) ] || \
+		$(INSTALL_DIR) $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
+	$(INSTALL_DATA) *.socket $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.service $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.mount $(DESTDIR)$(XEN_SYSTEMD_DIR)
+	$(INSTALL_DATA) *.conf $(DESTDIR)$(XEN_SYSTEMD_MODULES_LOAD)
+
+%.conf: %.conf.modules-load.d.in
+	cp $< $@
+
+.PHONY: clean
+clean:
diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
new file mode 100644
index 0000000..6eb61b2
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Mount /proc/xen files
+ConditionPathIsDirectory=/proc/xen
+RefuseManualStop=true
+
+[Mount]
+What=xenfs
+Where=/proc/xen
+Type=xenfs
diff --git a/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
new file mode 100644
index 0000000..a393b06
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/var-lib-xenstored.mount.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=mount xenstore file system
+ConditionPathIsDirectory=/proc/xen
+RefuseManualStop=true
+
+[Mount]
+Environment=XENSTORED_MOUNT_CTX=
+EnvironmentFile=-/etc/sysconfig/xenstored
+EnvironmentFile=-/etc/default/xenstored
+What=xenstore
+Where=@XEN_LIB_STORED@
+Type=tmpfs
+Options=mode=755,context="$XENSTORED_MOUNT_CTX"
diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
new file mode 100644
index 0000000..1855719
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
@@ -0,0 +1,22 @@
+[Unit]
+Description=qemu for xen dom0 disk backend
+Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
+After=xenstored.service xenconsoled.service
+Before=xendomains.service libvirtd.service libvirt-guests.service
+RefuseManualStop=true
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/default/xenstored
+EnvironmentFile=-/etc/sysconfig/xenstored
+PIDFile=@XEN_RUN_DIR@/qemu-dom0.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=/bin/mkdir -p /var/run/xen
+ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \
+	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
+	-monitor /dev/null -serial /dev/null -parallel /dev/null \
+	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xen-watchdog.service.in b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
new file mode 100644
index 0000000..c202fe9
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen-watchdog.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xen-watchdog - run xen watchdog daemon
+Requires=proc-xen.mount
+After=proc-xen.mount xendomains.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/xenwatchdogd 30 15
+KillSignal=USR1
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
new file mode 100644
index 0000000..3fbd59b
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
@@ -0,0 +1,16 @@
+xen-evtchn
+xen-gntdev
+xen-gntalloc
+xen-blkback
+xen-netback
+xen-pciback
+evtchn
+gntdev
+netbk
+blkbk
+xen-scsibk
+usbbk
+pciback
+xen-acpi-processor
+blktap2
+blktap
diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
new file mode 100644
index 0000000..50fe583
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenconsoled.service.in
@@ -0,0 +1,20 @@
+[Unit]
+Description=Xenconsoled - handles logging from guest consoles and hypervisor
+Requires=xenstored.socket
+After=xenstored.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=simple
+Environment=XENCONSOLED_ARGS=
+Environment=XENCONSOLED_LOG=none
+Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
+EnvironmentFile=-/etc/default/xenconsoled
+EnvironmentFile=-/etc/sysconfig/xenconsoled
+PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xendomains.service.in b/tools/hotplug/Linux/systemd/xendomains.service.in
new file mode 100644
index 0000000..ee44484
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xendomains.service.in
@@ -0,0 +1,16 @@
+[Unit]
+Description=Xendomains - start and stop guests on boot and shutdown
+Requires=xenstored.socket
+After=xenstored.service xenconsoled.service
+ConditionPathIsDirectory=/proc/xen
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStart=-@LIBEXEC@/xendomains start
+ExecStop=@LIBEXEC@/xendomains stop
+ExecReload=@LIBEXEC@/xendomains restart
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
new file mode 100644
index 0000000..f64dfa1
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenstored.service.in
@@ -0,0 +1,25 @@
+[Unit]
+Description=Xenstored - daemon managing xenstore file system
+Requires=xenstored.socket proc-xen.mount var-lib-xenstored.mount
+After=proc-xen.mount var-lib-xenstored.mount
+Before=libvirtd.service libvirt-guests.service
+RefuseManualStop=true
+ConditionPathIsDirectory=/proc/xen
+ConditionFileIsExecutable=@XENSTORED@
+
+[Service]
+Type=forking
+Environment=XENSTORED_ARGS=
+Environment=XENSTORED_ROOTDIR=@XEN_LIB_STORED@
+EnvironmentFile=-/etc/default/xenstored
+EnvironmentFile=-/etc/sysconfig/xenstored
+PIDFile=@XEN_RUN_DIR@/xenstored.pid
+ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
+ExecStartPre=-/bin/rm -f @XEN_LIB_STORED@/tdb*
+ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@
+ExecStart=@XENSTORED@ --pid-file @XEN_RUN_DIR@/xenstored.pid $XENSTORED_ARGS
+ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/name" "Domain-0"
+ExecStartPost=-@BINDIR@/xenstore-write "/local/domain/0/domid" 0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
new file mode 100644
index 0000000..3270f4d
--- /dev/null
+++ b/tools/hotplug/Linux/systemd/xenstored.socket.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Xen xenstored / oxenstored Activation Socket
+
+[Socket]
+ListenStream=/var/run/xenstored/socket
+ListenStream=/var/run/xenstored/socket_ro
+
+[Install]
+WantedBy=sockets.target
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 14/15] autoconf: xen: add systemd support into the build system
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (12 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 13/15] systemd: add xen systemd service and module files Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 16:40   ` Roger Pau Monné
  2014-04-30  1:12 ` [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh Luis R. Rodriguez
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

This adds autoconf systemd support into the build system.
Autoconf support for system has been split up as much as
possible into its own set of helpers in hopes that this
might be useful for other daemons and I was unable to
find anything generic. You can use either one of two
helpers depending on whether or not you want to make
systemd required or optional:

  * AX_ENABLE_SYSTEMD() - requires systemd
  * AX_ALLOW_SYSTEMD()  - lets you enable systemd with configure

This then lets you use the variables in your build system:

  * SYSTEMD_CFLAGS
  * SYSTEMD_LIBS
  * SYSTEMD_DIR
  * SYSTEMD_MODULES_LOAD

Systemd support is left disabled by default given xen can
be built for non-systemd systems and enabling systemd support
will require support of having libsystemd-daemon present
in order to use active sockets. We use AX_ALLOW_SYSTEMD() then,
you can enable systemd support into the build system by using
the --enable-systemd configure flag, you will have been expected
to have installed your distribution's version of the package
systemd-devel.

This integration currently does not make use of

pkg-config --variable=systemdsystemunitdir systemd

for setting of the SYSTEMD_DIR where the unit files are
stored given upstream systemd pc files it do not respect the
${prefix} overriding and fixing that upstream on system is
a bit complicated, to account for that we provide a path
helper --with-systemd which can be used to override the path
to the service files. Upstream systemd also lacks a pc file
placement for a modules load path, we can add that upstream
but for now we enable overriding through the flag configure
flag --with-systemd-modules-load. By default you're preferred
${prefix} will be respected, this means /usr/local/ will be used
for both as prefix if none is provided thereby leaving your
own distribution's files in place if present.

Enabling systemd will trigger a config.h define for HAVE_SYSTEMD
which is used by C xensotred and Ocaml oxenstored for active
socket communication.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 config/Tools.mk.in             |   6 +++
 m4/systemd.m4                  | 105 +++++++++++++++++++++++++++++++++++++++++
 tools/configure.ac             |   3 ++
 tools/hotplug/common/Makefile  |   1 +
 tools/ocaml/xenstored/Makefile |   5 ++
 tools/xenstore/Makefile        |   6 +++
 6 files changed, 126 insertions(+)
 create mode 100644 m4/systemd.m4

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 0bdf37a..c47e6af 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -55,6 +55,12 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
 CONFIG_QEMU_XEN     := @qemu_xen@
 CONFIG_BLKTAP1      := @blktap1@
 
+CONFIG_SYSTEMD      := @systemd@
+SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
+SYSTEMD_LIBS        := @SYSTEMD_LIBS@
+XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
+XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
+
 #System options
 ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
diff --git a/m4/systemd.m4 b/m4/systemd.m4
new file mode 100644
index 0000000..d5734d4
--- /dev/null
+++ b/m4/systemd.m4
@@ -0,0 +1,105 @@
+# systemd.m4 - Macros to check for and enable systemd          -*- Autoconf -*-
+#
+# Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+dnl Some optional path options
+AC_DEFUN([AX_SYSTEMD_OPTIONS], [
+	AC_ARG_WITH(systemd, [  --with-systemd          set directory for systemd service files],
+		SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
+	AC_SUBST(SYSTEMD_DIR)
+
+	AC_ARG_WITH(systemd, [  --with-systemd-modules-load          set directory for systemd modules load files],
+		SYSTEMD_MODULES_LOAD="$withval", SYSTEMD_MODULES_LOAD="")
+	AC_SUBST(SYSTEMD_MODULES_LOAD)
+])
+
+dnl Enables systemd by default and requires a --disable-systemd option flag
+dnl to configure if you want to disable.
+AC_DEFUN([AX_ENABLE_SYSTEMD_OPTS], [
+	AX_ARG_DEFAULT_ENABLE([systemd], [Disable systemd support])
+	AX_SYSTEMD_OPTIONS()
+])
+
+dnl Systemd will be disabled by default and requires you to run configure with
+dnl --enable-systemd to look for and enable systemd.
+AC_DEFUN([AX_ALLOW_SYSTEMD_OPTS], [
+	AX_ARG_DEFAULT_DISABLE([systemd], [Enable systemd support])
+	AX_SYSTEMD_OPTIONS()
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
+	AC_CHECK_HEADER([systemd/sd-daemon.h], [
+	    AC_CHECK_LIB([systemd-daemon], [sd_listen_fds], [libsystemddaemon="y"])
+	])
+	AS_IF([test "x$libsystemddaemon" = x], [
+	    AC_MSG_ERROR([Unable to find a suitable libsystemd-daemon library])
+	])
+
+	PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon])
+	dnl pkg-config older than 0.24 does not set these for
+	dnl PKG_CHECK_MODULES() worth also noting is that as of version 208
+	dnl of systemd pkg-config --cflags currently yields no extra flags yet.
+	AC_SUBST([SYSTEMD_CFLAGS])
+	AC_SUBST([SYSTEMD_LIBS])
+
+	AS_IF([test "x$SYSTEMD_DIR" = x], [
+	    dnl In order to use the line below we need to fix upstream systemd
+	    dnl to properly ${prefix} for child variables in
+	    dnl src/core/systemd.pc.in but this is a bit complex at the
+	    dnl moment as they depend on another rootprefix, which can vary
+	    dnl from prefix in practice. We provide our own definition as we
+	    dnl *know* where systemd will dump this to, but this does limit
+	    dnl us to stick to a non custom systemdsystemunitdir, dnl to work
+	    dnl around this we provide the additional configure option
+	    dnl --with-systemd where you can specify the directory for the unit
+	    dnl files. It would also be best to just extend the upstream
+	    dnl pkg-config  pkg.m4 with an AC_DEFUN() to do this neatly.
+	    dnl SYSTEMD_DIR="`$PKG_CONFIG --define-variable=prefix=$PREFIX --variable=systemdsystemunitdir systemd`"
+	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+	], [])
+
+	AS_IF([test "x$SYSTEMD_DIR" = x], [
+	    AC_MSG_ERROR([SYSTEMD_DIR is unset])
+	], [])
+
+	dnl There is no variable for this yet for some reason
+	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
+	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+	], [])
+
+	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
+	    AC_MSG_ERROR([SYSTEMD_MODULES_LOAD is unset])
+	], [])
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD], [
+	AS_IF([test "x$systemd" = "xy" ], [
+	    AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and enabled])
+	    systemd=y
+	    AX_CHECK_SYSTEMD_LIBS()
+	],[systemd=n])
+])
+
+AC_DEFUN([AX_ENABLE_SYSTEMD], [
+	AX_ENABLE_SYSTEMD_OPTS()
+	AX_CHECK_SYSTEMD()
+])
+
+AC_DEFUN([AX_ALLOW_SYSTEMD], [
+	AX_ALLOW_SYSTEMD_OPTS()
+	AX_CHECK_SYSTEMD()
+])
diff --git a/tools/configure.ac b/tools/configure.ac
index 8a8831f..24d1109 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -58,6 +58,7 @@ m4_include([../m4/extfs.m4])
 m4_include([../m4/fetcher.m4])
 m4_include([../m4/ax_compare_version.m4])
 m4_include([../m4/expand_config.m4])
+m4_include([../m4/systemd.m4])
 
 AX_XEN_EXPAND_CONFIG()
 
@@ -261,5 +262,7 @@ esac
 # Checks for header files.
 AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
 
+dnl Once and if systemd is prevalent we can just use AX_ENABLE_SYSTEMD()
+AX_ALLOW_SYSTEMD()
 AC_OUTPUT()
 
diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
index 4a63f40..45fd840 100644
--- a/tools/hotplug/common/Makefile
+++ b/tools/hotplug/common/Makefile
@@ -1,5 +1,6 @@
 XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
+include $(XEN_ROOT)/config/Tools.mk
 
 HOTPLUGPATH="hotplugpath.sh"
 
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index 382a813..068e04a 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -3,6 +3,11 @@ OCAML_TOPLEVEL = $(CURDIR)/..
 include $(OCAML_TOPLEVEL)/common.make
 
 CFLAGS += -I$(XEN_ROOT)/tools/
+CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
+LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
+
+CFLAGS  += $(CFLAGS-y)
+LDFLAGS += $(LDFLAGS-y)
 
 OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index 21a3f11..6adac7f 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -9,6 +9,12 @@ CFLAGS += -I.
 CFLAGS += -I$(XEN_ROOT)/tools/
 CFLAGS += $(CFLAGS_libxenctrl)
 
+CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
+LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
+
+CFLAGS  += $(CFLAGS-y)
+LDFLAGS += $(LDFLAGS-y)
+
 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
 CLIENTS += xenstore-write xenstore-ls xenstore-watch
 
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (13 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 14/15] autoconf: xen: add systemd support into the build system Luis R. Rodriguez
@ 2014-04-30  1:12 ` Luis R. Rodriguez
  2014-05-07 15:47   ` Ian Campbell
  2014-04-30  1:15 ` [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
  2014-05-08 11:28 ` Anthony PERARD
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:12 UTC (permalink / raw)
  To: xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

From: "Luis R. Rodriguez" <mcgrof@suse.com>

Now that all the series of autoconf updates have gone in trigger
an updates so that downstream users don't have to run autogen.sh.

Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Rękorajski <baggins@pld-linux.org>
Cc: M A Young <m.a.young@durham.ac.uk>
Cc: Jacek Konieczny <jajcus@jajcus.net>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
---
 configure         | 2396 ++++++++++++++++++++++++++++++++++++++++++++-
 stubdom/configure | 2390 +++++++++++++++++++++++++++++++++++++++++++++
 tools/config.h.in |    3 +
 tools/configure   | 2815 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 4 files changed, 7583 insertions(+), 21 deletions(-)

diff --git a/configure b/configure
index d5c8500..c0f3ef2 100755
--- a/configure
+++ b/configure
@@ -594,6 +594,39 @@ stubdom
 tools
 xen
 subdirs
+XENSTORED
+XENSTORE
+OCAMLFIND
+OCAMLBUILD
+OCAMLDOC
+OCAMLMKLIB
+OCAMLMKTOP
+OCAMLDEP
+OCAML
+OCAMLOPTDOTOPT
+OCAMLCDOTOPT
+OCAMLBEST
+OCAMLOPT
+OCAMLLIB
+OCAMLVERSION
+OCAMLC
+XEN_PAGING_DIR
+XEN_LOCK_DIR
+XEN_SCRIPT_DIR
+XEN_CONFIG_DIR
+CONFIG_DIR
+XENFIRMWAREDIR
+PRIVATE_BINDIR
+PKG_XEN_PREFIX
+PRIVATE_PREFIX
+SHAREDIR
+XEN_LIB_STORED
+XEN_LOG_DIR
+XEN_RUN_DIR
+LIBDIR
+LIBEXEC
+SBINDIR
+BINDIR
 host_os
 host_vendor
 host_cpu
@@ -643,6 +676,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_xenstored
 enable_xen
 enable_tools
 enable_stubdom
@@ -1272,6 +1306,21 @@ Optional Features:
   --enable-stubdom        Enable build and install of stubdom
   --disable-docs          Disable build and install of docs
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-xenstored[=cxenstored|cxenstored]
+                          This lets you choose which xenstore daemon you want,
+                          you have two options: the original xenstored written
+                          in C (cxenstored) or the newer and robust one
+                          written in Ocaml (oxenstored). The oxenstored daemon
+                          is the default but will but can only be used if you
+                          have ocaml library / build dependencies solved, if
+                          you have not specified a preference and do not have
+                          ocaml dependencies resolved we'll enable the C
+                          xenstored for you. If you ask for oxenstored we'll
+                          complain until you resolve those dependencies
+
 Report bugs to <xen-devel@lists.xen.org>.
 Xen Hypervisor home page: <http://www.xen.org/>.
 _ACEOF
@@ -1702,7 +1751,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ./config/Toplevel.mk"
+ac_config_files="$ac_config_files config/Toplevel.mk config/xen-environment-scripts config/xen-environment-header"
 
 
 ac_aux_dir=
@@ -1829,6 +1878,2347 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
+
+BINDIR=$prefix/bin
+
+
+SBINDIR=$prefix/sbin
+
+
+LIBEXEC=$prefix/lib/xen/bin
+
+
+LIBDIR=`eval echo $libdir`
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_LOG_DIR=/var/log/xen
+
+
+XEN_LIB_STORED=/var/lib/xenstored
+
+
+SHAREDIR=$prefix/share
+
+
+PRIVATE_PREFIX=$LIBDIR/xen
+
+
+PKG_XEN_PREFIX=$LIBDIR/xen
+
+
+PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+
+
+XENFIRMWAREDIR=$prefix/lib/xen/boot
+
+
+CONFIG_DIR=/etc
+
+
+XEN_CONFIG_DIR=$CONFIG_DIR/xen
+
+
+XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
+
+
+XEN_LOCK_DIR=/var/lock
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_PAGING_DIR=/var/lib/xen/xenpaging
+
+
+
+
+
+
+if test "x$XENSTORE" = "x"; then :
+
+
+# Check whether --with-xenstored was given.
+if test "${with_xenstored+set}" = set; then :
+  withval=$with_xenstored;
+		if test "x$withval" = "xcxenstored"; then :
+
+			xenstore="cxenstored"
+			xenstored=$SBINDIR/xenstored
+
+fi
+		if test "x$withval" = "xoxenstored"; then :
+
+			xenstore="oxenstored"
+			xenstored=$SBINDIR/oxenstored
+
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
+
+fi
+
+
+fi
+		if test "x$withval" != "xoxenstored" && test "x$withval" != "xcxenstored"; then :
+
+			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored cxenstored" "$LINENO" 5
+
+fi
+
+else
+
+
+	xenstore="oxenstored"
+	xenstored=$SBINDIR/oxenstored
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		xenstore="cxenstored"
+		xenstored=$SBINDIR/xenstored
+
+fi
+
+
+fi
+
+
+fi
+
+XENSTORE=$xenstore
+
+
+if test "x$XENSTORED" = "x"; then :
+
+	XENSTORED=$xenstored
+
+fi
+
+
+if test "x$XENSTORE" != "xcxenstored" && test "x$XENSTORE" != "xoxenstored"; then :
+  as_fn_error $? "Invalid xenstore: $XENSTORE" "$LINENO" 5
+fi
+
+
 case "$host_cpu" in
     i[3456]86|x86_64)
         arch_enable_stubdom=y
@@ -2749,7 +5139,9 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
-    "./config/Toplevel.mk") CONFIG_FILES="$CONFIG_FILES ./config/Toplevel.mk" ;;
+    "config/Toplevel.mk") CONFIG_FILES="$CONFIG_FILES config/Toplevel.mk" ;;
+    "config/xen-environment-scripts") CONFIG_FILES="$CONFIG_FILES config/xen-environment-scripts" ;;
+    "config/xen-environment-header") CONFIG_FILES="$CONFIG_FILES config/xen-environment-header" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
diff --git a/stubdom/configure b/stubdom/configure
index 9981f5a..0548069 100755
--- a/stubdom/configure
+++ b/stubdom/configure
@@ -632,6 +632,39 @@ xenstore
 grub
 caml
 c
+XENSTORED
+XENSTORE
+OCAMLFIND
+OCAMLBUILD
+OCAMLDOC
+OCAMLMKLIB
+OCAMLMKTOP
+OCAMLDEP
+OCAML
+OCAMLOPTDOTOPT
+OCAMLCDOTOPT
+OCAMLBEST
+OCAMLOPT
+OCAMLLIB
+OCAMLVERSION
+OCAMLC
+XEN_PAGING_DIR
+XEN_LOCK_DIR
+XEN_SCRIPT_DIR
+XEN_CONFIG_DIR
+CONFIG_DIR
+XENFIRMWAREDIR
+PRIVATE_BINDIR
+PKG_XEN_PREFIX
+PRIVATE_PREFIX
+SHAREDIR
+XEN_LIB_STORED
+XEN_LOG_DIR
+XEN_RUN_DIR
+LIBDIR
+LIBEXEC
+SBINDIR
+BINDIR
 host_os
 host_vendor
 host_cpu
@@ -681,6 +714,7 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_xenstored
 enable_ioemu_stubdom
 enable_c_stubdom
 enable_caml_stubdom
@@ -1338,6 +1372,21 @@ Optional Features:
   --disable-extfiles      Use xen extfiles repository for libraries (default
                           is ENABLED)
 
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-xenstored[=cxenstored|cxenstored]
+                          This lets you choose which xenstore daemon you want,
+                          you have two options: the original xenstored written
+                          in C (cxenstored) or the newer and robust one
+                          written in Ocaml (oxenstored). The oxenstored daemon
+                          is the default but will but can only be used if you
+                          have ocaml library / build dependencies solved, if
+                          you have not specified a preference and do not have
+                          ocaml dependencies resolved we'll enable the C
+                          xenstored for you. If you ask for oxenstored we'll
+                          complain until you resolve those dependencies
+
 Some influential environment variables:
   CMAKE       Path to the cmake program
   CC          C compiler command
@@ -1971,6 +2020,2347 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
+
+BINDIR=$prefix/bin
+
+
+SBINDIR=$prefix/sbin
+
+
+LIBEXEC=$prefix/lib/xen/bin
+
+
+LIBDIR=`eval echo $libdir`
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_LOG_DIR=/var/log/xen
+
+
+XEN_LIB_STORED=/var/lib/xenstored
+
+
+SHAREDIR=$prefix/share
+
+
+PRIVATE_PREFIX=$LIBDIR/xen
+
+
+PKG_XEN_PREFIX=$LIBDIR/xen
+
+
+PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+
+
+XENFIRMWAREDIR=$prefix/lib/xen/boot
+
+
+CONFIG_DIR=/etc
+
+
+XEN_CONFIG_DIR=$CONFIG_DIR/xen
+
+
+XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
+
+
+XEN_LOCK_DIR=/var/lock
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_PAGING_DIR=/var/lib/xen/xenpaging
+
+
+
+
+
+
+if test "x$XENSTORE" = "x"; then :
+
+
+# Check whether --with-xenstored was given.
+if test "${with_xenstored+set}" = set; then :
+  withval=$with_xenstored;
+		if test "x$withval" = "xcxenstored"; then :
+
+			xenstore="cxenstored"
+			xenstored=$SBINDIR/xenstored
+
+fi
+		if test "x$withval" = "xoxenstored"; then :
+
+			xenstore="oxenstored"
+			xenstored=$SBINDIR/oxenstored
+
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
+
+fi
+
+
+fi
+		if test "x$withval" != "xoxenstored" && test "x$withval" != "xcxenstored"; then :
+
+			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored cxenstored" "$LINENO" 5
+
+fi
+
+else
+
+
+	xenstore="oxenstored"
+	xenstored=$SBINDIR/oxenstored
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		xenstore="cxenstored"
+		xenstored=$SBINDIR/xenstored
+
+fi
+
+
+fi
+
+
+fi
+
+XENSTORE=$xenstore
+
+
+if test "x$XENSTORED" = "x"; then :
+
+	XENSTORED=$xenstored
+
+fi
+
+
+if test "x$XENSTORE" != "xcxenstored" && test "x$XENSTORE" != "xoxenstored"; then :
+  as_fn_error $? "Invalid xenstore: $XENSTORE" "$LINENO" 5
+fi
+
+
 # Enable/disable stub domains
 
 # Check whether --enable-ioemu-stubdom was given.
diff --git a/tools/config.h.in b/tools/config.h.in
index 015f2a1..c005c36 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -36,6 +36,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H
 
+/* Systemd available and enabled */
+#undef HAVE_SYSTEMD
+
 /* Define to 1 if you have the <sys/eventfd.h> header file. */
 #undef HAVE_SYS_EVENTFD_H
 
diff --git a/tools/configure b/tools/configure
index e1eeff4..8090c79 100755
--- a/tools/configure
+++ b/tools/configure
@@ -624,6 +624,11 @@ ac_includes_default="\
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_MODULES_LOAD
+SYSTEMD_DIR
+systemd
 libiconv
 PTYFUNCS_LIBS
 PTHREAD_LIBS
@@ -649,20 +654,6 @@ pyconfig
 PYTHONPATH
 CHECKPOLICY
 AWK
-OCAMLFIND
-OCAMLBUILD
-OCAMLDOC
-OCAMLMKLIB
-OCAMLMKTOP
-OCAMLDEP
-OCAML
-OCAMLOPTDOTOPT
-OCAMLCDOTOPT
-OCAMLBEST
-OCAMLOPT
-OCAMLLIB
-OCAMLVERSION
-OCAMLC
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
@@ -696,6 +687,39 @@ xsmpolicy
 ocamltools
 monitors
 githttp
+XENSTORED
+XENSTORE
+OCAMLFIND
+OCAMLBUILD
+OCAMLDOC
+OCAMLMKLIB
+OCAMLMKTOP
+OCAMLDEP
+OCAML
+OCAMLOPTDOTOPT
+OCAMLCDOTOPT
+OCAMLBEST
+OCAMLOPT
+OCAMLLIB
+OCAMLVERSION
+OCAMLC
+XEN_PAGING_DIR
+XEN_LOCK_DIR
+XEN_SCRIPT_DIR
+XEN_CONFIG_DIR
+CONFIG_DIR
+XENFIRMWAREDIR
+PRIVATE_BINDIR
+PKG_XEN_PREFIX
+PRIVATE_PREFIX
+SHAREDIR
+XEN_LIB_STORED
+XEN_LOG_DIR
+XEN_RUN_DIR
+LIBDIR
+LIBEXEC
+SBINDIR
+BINDIR
 FILE_OFFSET_BITS
 OBJEXT
 EXEEXT
@@ -754,6 +778,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_largefile
+with_xenstored
 enable_githttp
 enable_monitors
 enable_ocamltools
@@ -767,6 +792,8 @@ enable_qemu_traditional
 with_system_qemu
 with_system_seabios
 with_system_ovmf
+enable_systemd
+with_systemd
 '
       ac_precious_vars='build_alias
 host_alias
@@ -797,7 +824,9 @@ PKG_CONFIG
 PKG_CONFIG_PATH
 PKG_CONFIG_LIBDIR
 glib_CFLAGS
-glib_LIBS'
+glib_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1426,10 +1455,22 @@ Optional Features:
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
                           for x86, otherwise off)
+  --enable-systemd        Enable systemd support (default is DISABLED)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-xenstored[=cxenstored|cxenstored]
+                          This lets you choose which xenstore daemon you want,
+                          you have two options: the original xenstored written
+                          in C (cxenstored) or the newer and robust one
+                          written in Ocaml (oxenstored). The oxenstored daemon
+                          is the default but will but can only be used if you
+                          have ocaml library / build dependencies solved, if
+                          you have not specified a preference and do not have
+                          ocaml dependencies resolved we'll enable the C
+                          xenstored for you. If you ask for oxenstored we'll
+                          complain until you resolve those dependencies
   --with-system-qemu[=PATH]
                           Use system supplied qemu PATH or qemu (taken from
                           $PATH) as qemu-xen device model instead of building
@@ -1440,6 +1481,8 @@ Optional Packages:
   --with-system-ovmf[=PATH]
                           Use system supplied OVMF PATH instead of building
                           and installing our own version
+  --with-systemd          set directory for systemd service files
+  --with-systemd-modules-load          set directory for systemd modules load files
 
 Some influential environment variables:
   CC          C compiler command
@@ -1475,6 +1518,10 @@ Some influential environment variables:
               path overriding pkg-config's built-in search path
   glib_CFLAGS C compiler flags for glib, overriding pkg-config
   glib_LIBS   linker flags for glib, overriding pkg-config
+  SYSTEMD_CFLAGS
+              C compiler flags for SYSTEMD, overriding pkg-config
+  SYSTEMD_LIBS
+              linker flags for SYSTEMD, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -2194,7 +2241,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-ac_config_files="$ac_config_files ../config/Tools.mk"
+ac_config_files="$ac_config_files ../config/Tools.mk hotplug/Linux/systemd/proc-xen.mount hotplug/Linux/systemd/var-lib-xenstored.mount hotplug/Linux/systemd/xenstored.socket hotplug/Linux/systemd/xenstored.service hotplug/Linux/systemd/xenconsoled.service hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service hotplug/Linux/systemd/xendomains.service hotplug/Linux/systemd/xen-watchdog.service"
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -3422,6 +3469,44 @@ esac
 # PKG_CHECK_MODULES
 
 
+# PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+# [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------
+# Checks for existence of MODULES and gathers its build flags with
+# static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+# and VARIABLE-PREFIX_LIBS from --libs.
+#
+# Note that if there is a possibility the first call to
+# PKG_CHECK_MODULES_STATIC might not happen, you should be sure to include
+# an explicit call to PKG_PROG_PKG_CONFIG in your configure.ac.
+
+
+
+# PKG_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable pkgconfigdir as the location where a module
+# should install pkg-config .pc files. By default the directory is
+# $libdir/pkgconfig, but the default can be changed by passing
+# DIRECTORY. The user can override through the --with-pkgconfigdir
+# parameter.
+
+
+# PKG_NOARCH_INSTALLDIR(DIRECTORY)
+# -------------------------
+# Substitutes the variable noarch_pkgconfigdir as the location where a
+# module should install arch-independent pkg-config .pc files. By
+# default the directory is $datadir/pkgconfig, but the default can be
+# changed by passing DIRECTORY. The user can override through the
+# --with-noarch-pkgconfigdir parameter.
+
+
+# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------
+# Retrieves the value of the pkg-config variable for the given module.
+# PKG_CHECK_VAR
+
+
 
 # We define, separately, PTHREAD_CFLAGS, _LDFLAGS and _LIBS
 # even though currently we don't set them very separately.
@@ -3528,8 +3613,2356 @@ esac
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 11
+#serial 11
+
+
+
+
+# systemd.m4 - Macros to check for and enable systemd          -*- Autoconf -*-
+#
+# Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test "x$prefix" = "xNONE" && prefix=$ac_default_prefix
+test "x$exec_prefix" = "xNONE" && exec_prefix=$ac_default_prefix
+
+BINDIR=$prefix/bin
+
+
+SBINDIR=$prefix/sbin
+
+
+LIBEXEC=$prefix/lib/xen/bin
+
+
+LIBDIR=`eval echo $libdir`
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_LOG_DIR=/var/log/xen
+
+
+XEN_LIB_STORED=/var/lib/xenstored
+
+
+SHAREDIR=$prefix/share
+
+
+PRIVATE_PREFIX=$LIBDIR/xen
+
+
+PKG_XEN_PREFIX=$LIBDIR/xen
+
+
+PRIVATE_BINDIR=$PRIVATE_PREFIX/bin
+
+
+XENFIRMWAREDIR=$prefix/lib/xen/boot
+
+
+CONFIG_DIR=/etc
+
+
+XEN_CONFIG_DIR=$CONFIG_DIR/xen
+
+
+XEN_SCRIPT_DIR=$XEN_CONFIG_DIR/scripts
+
+
+XEN_LOCK_DIR=/var/lock
+
+
+XEN_RUN_DIR=/var/run/xen
+
+
+XEN_PAGING_DIR=/var/lib/xen/xenpaging
+
+
+
+
+
+
+if test "x$XENSTORE" = "x"; then :
+
+
+# Check whether --with-xenstored was given.
+if test "${with_xenstored+set}" = set; then :
+  withval=$with_xenstored;
+		if test "x$withval" = "xcxenstored"; then :
+
+			xenstore="cxenstored"
+			xenstored=$SBINDIR/xenstored
+
+fi
+		if test "x$withval" = "xoxenstored"; then :
+
+			xenstore="oxenstored"
+			xenstored=$SBINDIR/oxenstored
+
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		as_fn_error $? "Missing ocaml dependencies for oxenstored, try installing ocaml ocaml-compiler-libs ocaml-runtime ocaml-findlib" "$LINENO" 5
+
+fi
+
+
+fi
+		if test "x$withval" != "xoxenstored" && test "x$withval" != "xcxenstored"; then :
+
+			as_fn_error $? "Unsupported xenstored specified, supported types: oxenstored cxenstored" "$LINENO" 5
+
+fi
+
+else
+
+
+	xenstore="oxenstored"
+	xenstored=$SBINDIR/oxenstored
+	  # checking for ocamlc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLC"; then
+  ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLC=$ac_cv_prog_OCAMLC
+if test -n "$OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5
+$as_echo "$OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLC"; then
+  ac_ct_OCAMLC=$OCAMLC
+  # Extract the first word of "ocamlc", so it can be a program name with args.
+set dummy ocamlc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLC"; then
+  ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLC="ocamlc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC
+if test -n "$ac_ct_OCAMLC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5
+$as_echo "$ac_ct_OCAMLC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLC" = x; then
+    OCAMLC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLC=$ac_ct_OCAMLC
+  fi
+else
+  OCAMLC="$ac_cv_prog_OCAMLC"
+fi
+
+
+  if test "$OCAMLC" != "no"; then
+     OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'`
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5
+$as_echo "OCaml version is $OCAMLVERSION" >&6; }
+     # If OCAMLLIB is set, use it
+     if test "$OCAMLLIB" = ""; then
+        OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4`
+     else
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5
+$as_echo "OCAMLLIB previously set; preserving it." >&6; }
+     fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5
+$as_echo "OCaml library path is $OCAMLLIB" >&6; }
+
+
+
+
+     # checking for ocamlopt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPT"; then
+  ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPT=$ac_cv_prog_OCAMLOPT
+if test -n "$OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5
+$as_echo "$OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPT"; then
+  ac_ct_OCAMLOPT=$OCAMLOPT
+  # Extract the first word of "ocamlopt", so it can be a program name with args.
+set dummy ocamlopt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT
+if test -n "$ac_ct_OCAMLOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5
+$as_echo "$ac_ct_OCAMLOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPT" = x; then
+    OCAMLOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPT=$ac_ct_OCAMLOPT
+  fi
+else
+  OCAMLOPT="$ac_cv_prog_OCAMLOPT"
+fi
+
+     OCAMLBEST=byte
+     if test "$OCAMLOPT" = "no"; then
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5
+$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;}
+     else
+	TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlopt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlopt discarded." >&6; }
+	    OCAMLOPT=no
+	else
+	    OCAMLBEST=opt
+	fi
+     fi
+
+
+
+     # checking for ocamlc.opt
+     if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLCDOTOPT"; then
+  ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT
+if test -n "$OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5
+$as_echo "$OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then
+  ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT
+  # Extract the first word of "ocamlc.opt", so it can be a program name with args.
+set dummy ocamlc.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT
+if test -n "$ac_ct_OCAMLCDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLCDOTOPT" = x; then
+    OCAMLCDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT
+  fi
+else
+  OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT"
+fi
+
+     if test "$OCAMLCDOTOPT" != "no"; then
+	TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc; ocamlc.opt discarded." >&5
+$as_echo "versions differs from ocamlc; ocamlc.opt discarded." >&6; }
+	else
+	    OCAMLC=$OCAMLCDOTOPT
+	fi
+     fi
+
+     # checking for ocamlopt.opt
+     if test "$OCAMLOPT" != "no" ; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLOPTDOTOPT"; then
+  ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT
+if test -n "$OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5
+$as_echo "$OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then
+  ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT
+  # Extract the first word of "ocamlopt.opt", so it can be a program name with args.
+set dummy ocamlopt.opt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT
+if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5
+$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then
+    OCAMLOPTDOTOPT="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT
+  fi
+else
+  OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT"
+fi
+
+	if test "$OCAMLOPTDOTOPT" != "no"; then
+	   TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' `
+	   if test "$TMPVERSION" != "$OCAMLVERSION" ; then
+	      { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc; ocamlopt.opt discarded." >&5
+$as_echo "version differs from ocamlc; ocamlopt.opt discarded." >&6; }
+	   else
+	      OCAMLOPT=$OCAMLOPTDOTOPT
+	   fi
+        fi
+     fi
+
+
+  fi
+
+
+
+  # checking for ocaml toplevel
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAML"; then
+  ac_cv_prog_OCAML="$OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAML="${ac_tool_prefix}ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAML=$ac_cv_prog_OCAML
+if test -n "$OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5
+$as_echo "$OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAML"; then
+  ac_ct_OCAML=$OCAML
+  # Extract the first word of "ocaml", so it can be a program name with args.
+set dummy ocaml; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAML"; then
+  ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAML="ocaml"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML
+if test -n "$ac_ct_OCAML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5
+$as_echo "$ac_ct_OCAML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAML" = x; then
+    OCAML="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAML=$ac_ct_OCAML
+  fi
+else
+  OCAML="$ac_cv_prog_OCAML"
+fi
+
+
+  # checking for ocamldep
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDEP"; then
+  ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDEP=$ac_cv_prog_OCAMLDEP
+if test -n "$OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5
+$as_echo "$OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDEP"; then
+  ac_ct_OCAMLDEP=$OCAMLDEP
+  # Extract the first word of "ocamldep", so it can be a program name with args.
+set dummy ocamldep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDEP"; then
+  ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDEP="ocamldep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP
+if test -n "$ac_ct_OCAMLDEP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5
+$as_echo "$ac_ct_OCAMLDEP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDEP" = x; then
+    OCAMLDEP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDEP=$ac_ct_OCAMLDEP
+  fi
+else
+  OCAMLDEP="$ac_cv_prog_OCAMLDEP"
+fi
+
+
+  # checking for ocamlmktop
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKTOP"; then
+  ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP
+if test -n "$OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5
+$as_echo "$OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKTOP"; then
+  ac_ct_OCAMLMKTOP=$OCAMLMKTOP
+  # Extract the first word of "ocamlmktop", so it can be a program name with args.
+set dummy ocamlmktop; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKTOP"; then
+  ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP
+if test -n "$ac_ct_OCAMLMKTOP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5
+$as_echo "$ac_ct_OCAMLMKTOP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKTOP" = x; then
+    OCAMLMKTOP="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKTOP=$ac_ct_OCAMLMKTOP
+  fi
+else
+  OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP"
+fi
+
+
+  # checking for ocamlmklib
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLMKLIB"; then
+  ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB
+if test -n "$OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5
+$as_echo "$OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLMKLIB"; then
+  ac_ct_OCAMLMKLIB=$OCAMLMKLIB
+  # Extract the first word of "ocamlmklib", so it can be a program name with args.
+set dummy ocamlmklib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLMKLIB"; then
+  ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB
+if test -n "$ac_ct_OCAMLMKLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5
+$as_echo "$ac_ct_OCAMLMKLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLMKLIB" = x; then
+    OCAMLMKLIB="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLMKLIB=$ac_ct_OCAMLMKLIB
+  fi
+else
+  OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB"
+fi
+
+
+  # checking for ocamldoc
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLDOC"; then
+  ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLDOC=$ac_cv_prog_OCAMLDOC
+if test -n "$OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5
+$as_echo "$OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLDOC"; then
+  ac_ct_OCAMLDOC=$OCAMLDOC
+  # Extract the first word of "ocamldoc", so it can be a program name with args.
+set dummy ocamldoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLDOC"; then
+  ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC
+if test -n "$ac_ct_OCAMLDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5
+$as_echo "$ac_ct_OCAMLDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLDOC" = x; then
+    OCAMLDOC="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLDOC=$ac_ct_OCAMLDOC
+  fi
+else
+  OCAMLDOC="$ac_cv_prog_OCAMLDOC"
+fi
+
+
+  # checking for ocamlbuild
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLBUILD"; then
+  ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLBUILD=$ac_cv_prog_OCAMLBUILD
+if test -n "$OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5
+$as_echo "$OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLBUILD"; then
+  ac_ct_OCAMLBUILD=$OCAMLBUILD
+  # Extract the first word of "ocamlbuild", so it can be a program name with args.
+set dummy ocamlbuild; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLBUILD"; then
+  ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD
+if test -n "$ac_ct_OCAMLBUILD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5
+$as_echo "$ac_ct_OCAMLBUILD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLBUILD" = x; then
+    OCAMLBUILD="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLBUILD=$ac_ct_OCAMLBUILD
+  fi
+else
+  OCAMLBUILD="$ac_cv_prog_OCAMLBUILD"
+fi
+
+
+
+  # checking for ocamlfind
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ocamlfind", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OCAMLFIND"; then
+  ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OCAMLFIND="${ac_tool_prefix}ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OCAMLFIND=$ac_cv_prog_OCAMLFIND
+if test -n "$OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5
+$as_echo "$OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OCAMLFIND"; then
+  ac_ct_OCAMLFIND=$OCAMLFIND
+  # Extract the first word of "ocamlfind", so it can be a program name with args.
+set dummy ocamlfind; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OCAMLFIND+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OCAMLFIND"; then
+  ac_cv_prog_ac_ct_OCAMLFIND="$ac_ct_OCAMLFIND" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OCAMLFIND="ocamlfind"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OCAMLFIND=$ac_cv_prog_ac_ct_OCAMLFIND
+if test -n "$ac_ct_OCAMLFIND"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLFIND" >&5
+$as_echo "$ac_ct_OCAMLFIND" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OCAMLFIND" = x; then
+    OCAMLFIND="no"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OCAMLFIND=$ac_ct_OCAMLFIND
+  fi
+else
+  OCAMLFIND="$ac_cv_prog_OCAMLFIND"
+fi
+
+
+
+	if test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"; then :
+
+		xenstore="cxenstored"
+		xenstored=$SBINDIR/xenstored
+
+fi
+
+
+fi
+
+
+fi
 
+XENSTORE=$xenstore
+
+
+if test "x$XENSTORED" = "x"; then :
+
+	XENSTORED=$xenstored
+
+fi
+
+
+if test "x$XENSTORE" != "xcxenstored" && test "x$XENSTORE" != "xoxenstored"; then :
+  as_fn_error $? "Invalid xenstore: $XENSTORE" "$LINENO" 5
+fi
 
 
 # Enable/disable options
@@ -4650,6 +7083,107 @@ if test x"${PERL}" = x"no"
 then
     as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
 fi
+if test "x$xapi" = "xy"; then :
+
+    # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_CURL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $CURL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CURL="$CURL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_CURL="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_CURL" && ac_cv_path_CURL="no"
+  ;;
+esac
+fi
+CURL=$ac_cv_path_CURL
+if test -n "$CURL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURL" >&5
+$as_echo "$CURL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${CURL}" = x"no"
+then
+    as_fn_error $? "Unable to find curl-config, please install curl-config" "$LINENO" 5
+fi
+    # Extract the first word of "xml2-config", so it can be a program name with args.
+set dummy xml2-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_XML+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $XML in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XML="$XML" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_XML="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_XML" && ac_cv_path_XML="no"
+  ;;
+esac
+fi
+XML=$ac_cv_path_XML
+if test -n "$XML"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML" >&5
+$as_echo "$XML" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test x"${XML}" = x"no"
+then
+    as_fn_error $? "Unable to find xml2-config, please install xml2-config" "$LINENO" 5
+fi
+
+fi
+
+case $XENSTORE in
+	"cxenstored") ocamltools=n;;
+	"oxenstored") ocamltools=y;;
+	*) as_fn_error $? "xenstore: $xenstore" "$LINENO" 5;;
+esac
+
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -7025,6 +9559,7 @@ fi
 
 
 
+
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
@@ -7153,6 +9688,7 @@ if test -n "$glib_CFLAGS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_glib_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.12" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -7169,6 +9705,7 @@ if test -n "$glib_LIBS"; then
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
   pkg_cv_glib_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.12" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
 fi
@@ -7188,9 +9725,9 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-	        glib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0 >= 2.12" 2>&1`
+	        glib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.12" 2>&1`
         else
-	        glib_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0 >= 2.12" 2>&1`
+	        glib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.12" 2>&1`
         fi
 	# Put the nasty error message in config.log where it belongs
 	echo "$glib_PKG_ERRORS" >&5
@@ -8053,6 +10590,238 @@ fi
 done
 
 
+
+
+
+# Check whether --enable-systemd was given.
+if test "${enable_systemd+set}" = set; then :
+  enableval=$enable_systemd;
+fi
+
+
+if test "x$enable_systemd" = "xno"; then :
+
+    ax_cv_systemd="n"
+
+elif test "x$enable_systemd" = "xyes"; then :
+
+    ax_cv_systemd="y"
+
+elif test -z $ax_cv_systemd; then :
+
+    ax_cv_systemd="n"
+
+fi
+systemd=$ax_cv_systemd
+
+
+
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+  withval=$with_systemd; SYSTEMD_DIR="$withval"
+else
+  SYSTEMD_DIR=""
+fi
+
+
+
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+  withval=$with_systemd; SYSTEMD_MODULES_LOAD="$withval"
+else
+  SYSTEMD_MODULES_LOAD=""
+fi
+
+
+
+
+
+	if test "x$systemd" = "xy" ; then :
+
+
+$as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
+
+	    systemd=y
+
+	ac_fn_c_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
+if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
+
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_listen_fds in -lsystemd-daemon" >&5
+$as_echo_n "checking for sd_listen_fds in -lsystemd-daemon... " >&6; }
+if ${ac_cv_lib_systemd_daemon_sd_listen_fds+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsystemd-daemon  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sd_listen_fds ();
+int
+main ()
+{
+return sd_listen_fds ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_systemd_daemon_sd_listen_fds=yes
+else
+  ac_cv_lib_systemd_daemon_sd_listen_fds=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_systemd_daemon_sd_listen_fds" >&5
+$as_echo "$ac_cv_lib_systemd_daemon_sd_listen_fds" >&6; }
+if test "x$ac_cv_lib_systemd_daemon_sd_listen_fds" = xyes; then :
+  libsystemddaemon="y"
+fi
+
+
+fi
+
+
+	if test "x$libsystemddaemon" = x; then :
+
+	    as_fn_error $? "Unable to find a suitable libsystemd-daemon library" "$LINENO" 5
+
+fi
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd-daemon" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsystemd-daemon\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd-daemon") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd-daemon" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsystemd-daemon" 2>&1`
+        else
+	        SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsystemd-daemon" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$SYSTEMD_PKG_ERRORS" >&5
+
+	as_fn_error $? "Package requirements (libsystemd-daemon) were not met:
+
+$SYSTEMD_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+	SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+	SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+	if test "x$SYSTEMD_DIR" = x; then :
+
+	    	    	    	    	    	    	    	    	    	    	    	    	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+
+fi
+
+	if test "x$SYSTEMD_DIR" = x; then :
+
+	    as_fn_error $? "SYSTEMD_DIR is unset" "$LINENO" 5
+
+fi
+
+		if test "x$SYSTEMD_MODULES_LOAD" = x; then :
+
+	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+
+fi
+
+	if test "x$SYSTEMD_MODULES_LOAD" = x; then :
+
+	    as_fn_error $? "SYSTEMD_MODULES_LOAD is unset" "$LINENO" 5
+
+fi
+
+
+else
+  systemd=n
+fi
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -8746,6 +11515,14 @@ for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
+    "hotplug/Linux/systemd/proc-xen.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/proc-xen.mount" ;;
+    "hotplug/Linux/systemd/var-lib-xenstored.mount") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/var-lib-xenstored.mount" ;;
+    "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
+    "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
+    "hotplug/Linux/systemd/xenconsoled.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenconsoled.service" ;;
+    "hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service" ;;
+    "hotplug/Linux/systemd/xendomains.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xendomains.service" ;;
+    "hotplug/Linux/systemd/xen-watchdog.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xen-watchdog.service" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
-- 
1.9.0


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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 00/15] xen: add systemd support
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (14 preceding siblings ...)
  2014-04-30  1:12 ` [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh Luis R. Rodriguez
@ 2014-04-30  1:15 ` Luis R. Rodriguez
  2014-05-07 15:18   ` Ian Campbell
  2014-05-08 11:28 ` Anthony PERARD
  16 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30  1:15 UTC (permalink / raw)
  To: xen-devel; +Cc: Luis R. Rodriguez

On Tue, Apr 29, 2014 at 6:11 PM, Luis R. Rodriguez
<mcgrof@do-not-panic.com> wrote:
> nc -U /var/run/xenstored/socket_ro

Note that xl doesn't look for the socket first, when systemd is
enabled this optimization can now be enabled and therefore would be
triggered upon demand. I'm not going to work on that though.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place
  2014-04-30  1:12 ` [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
@ 2014-04-30  6:52   ` Jan Beulich
       [not found]   ` <5360B9CB020000780000D9BB@suse.com>
  1 sibling, 0 replies; 84+ messages in thread
From: Jan Beulich @ 2014-04-30  6:52 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis Rodriguez,
	Ian Jackson, xen-devel, Samuel Thibault

>>> On 30.04.14 at 03:12, <mcgrof@do-not-panic.com> wrote:
> This moves all generic variables to the top level makefile,
> tons of files use these so just make them general enough. This
> also paves the way to let us easily dynamically configure these
> with autoconf, for now we leave the same presets as was present
> before.

Am I right understanding that this then will require ./configure to
be run even for hypervisor-only building? If so, I objected to that
idea already when the configuration process got introduced, and
I continue to do so now.

Jan

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 06/15] tools/xendomains: make xl the default
  2014-04-30  1:11 ` [PATCH v4 06/15] tools/xendomains: make xl the default Luis R. Rodriguez
@ 2014-04-30  7:02   ` Olaf Hering
  2014-04-30 17:43     ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Olaf Hering @ 2014-04-30  7:02 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young,
	xen-devel

On Tue, Apr 29, Luis R. Rodriguez wrote:

> If that fails backoff to using xm.

xm is gone, so that part can be removed in this or a followup patch.


Olaf

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
@ 2014-04-30  8:35   ` Dave Scott
  2014-04-30 17:30     ` Luis R. Rodriguez
  2014-04-30  9:27   ` Anil Madhavapeddy
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 84+ messages in thread
From: Dave Scott @ 2014-04-30  8:35 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Dave Scott, Ian Campbell, Luis R. Rodriguez, Vincent Hanquez,
	Stefano Stabellini, Ian Jackson, xen-devel

Hi Luis,

Thanks for the patch!


On 30 Apr 2014, at 02:11, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:

...
> An important different with socket activation is that systemd will set
> FD_CLOEXEC for us on the socket before giving it to us, Ocaml gets
> support for [1] Unix.set_cloexec but only as of 4.00.1+dev which isn't
> yet widely available on distributions.

I’m not familiar with systemd but I’m curious: if systems is setting the flag on the socket before giving it to us, why would we still need the Unix.set_cloexec function in OCaml?

...
> diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
> new file mode 100644
> index 0000000..cace794
> --- /dev/null
> +++ b/tools/ocaml/xenstored/systemd.ml
> @@ -0,0 +1,16 @@
> +(*
> + * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU Lesser General Public License as published
> + * by the Free Software Foundation; version 2.1 only. with the special
> + * exception on linking described in file LICENSE.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU Lesser General Public License for more details.
> + *)
> +
> +external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
> +external sd_active_socket_required: unit -> int = “ocaml_sd_active_socket_required"

Minor comment: It would be clearer if sd_active_socket_required was unit -> bool. In the C code you should use Val_true and Val_false from <caml/mlvalues.h>.

Everything else looks good to me!

Thanks,
Dave

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
  2014-04-30  8:35   ` Dave Scott
@ 2014-04-30  9:27   ` Anil Madhavapeddy
  2014-04-30 17:35     ` Luis R. Rodriguez
  2014-05-07 15:20   ` Ian Campbell
  2014-05-12 13:57   ` Ian Jackson
  3 siblings, 1 reply; 84+ messages in thread
From: Anil Madhavapeddy @ 2014-04-30  9:27 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: David Scott, Stefano Stabellini, Ian Jackson, Luis R. Rodriguez,
	Vincent Hanquez, xen-devel, Ian Campbell

On 30 Apr 2014, at 02:11, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:

> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This adds systemd socket activation support for the Ocaml xenstored.
> Ocaml lacks systemd library support so we provide our own C helpers
> as is done with other functionality lacking on Ocaml.
> 
<snip>

The definition of sd_active_socket_required (unit ->int) below doesn't
match the C stub:

> +
> +external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
> +external sd_active_socket_required: unit -> int = "ocaml_sd_active_socket_required"

> +
> +CAMLprim value ocaml_sd_active_socket_required(void)
> +{
> +	CAMLparam0();
> +	CAMLlocal1(ret);
> +
> +	ret = Val_int(0);
> +
> +	CAMLreturn(ret);
> +}
> +#endif

That should be:

CAMLprim value ocaml_sd_active_socket_required(value u)
{
  CAMLparam1(u);
  CAMLlocal1(ret);
  ret = Val_int(0);
  CAMLreturn(ret);
}

(Since the function isn't doing any heap allocation, it's actually
just safe to compress it to "return (Val_int(0))", but it's probably
better to keep it like this to avoid any surprises).

As Dave notes, returning Val_true and setting the OCaml signature to
bool would be a clearer interface.

-anil

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout
  2014-04-30  1:11 ` [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout Luis R. Rodriguez
@ 2014-04-30  9:33   ` Andrew Cooper
  2014-04-30 16:36     ` Luis R. Rodriguez
  2014-05-07 15:05   ` Ian Campbell
  1 sibling, 1 reply; 84+ messages in thread
From: Andrew Cooper @ 2014-04-30  9:33 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young,
	xen-devel

On 30/04/14 02:11, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>
> xenstore-read now has support to retry opening the xenstored unix domain
> socket a certain amount of times, once each second, use that instead of
> implementing our own timeout.
>
> For systemd we'll be using socket activation. Details for that will follow.
>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Rękorajski <baggins@pld-linux.org>
> Cc: M A Young <m.a.young@durham.ac.uk>
> Cc: Jacek Konieczny <jajcus@jajcus.net>
> Cc: xen-devel@lists.xenproject.org
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  tools/hotplug/Linux/init.d/xencommons | 19 +++++--------------
>  1 file changed, 5 insertions(+), 14 deletions(-)
>
> diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
> index 4ebd636..7195413 100644
> --- a/tools/hotplug/Linux/init.d/xencommons
> +++ b/tools/hotplug/Linux/init.d/xencommons
> @@ -54,9 +54,6 @@ if test -f /proc/xen/capabilities && \
>  fi
>  
>  do_start () {
> -        local time=0
> -	local timeout=30
> -
>  	modprobe xen-evtchn 2>/dev/null
>  	modprobe xen-gntdev 2>/dev/null
>  	modprobe xen-gntalloc 2>/dev/null
> @@ -93,17 +90,11 @@ do_start () {
>  		    echo "No xenstored found"
>  		    exit 1
>  		fi
> -
> -		# Wait for xenstored to actually come up, timing out after 30 seconds
> -                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
> -                    echo -n .
> -		    time=$(($time+1))
> -                    sleep 1
> -                done
> -		echo
> -
> -		# Exit if we timed out
> -		if ! [ $time -lt $timeout ] ; then
> +		# We try opening the xenstored socket every second up to the
> +		# limit specified, if it hasn't opened by then assume
> +		# failure.
> +                ${BINDIR}/xenstore-read --retries 30 -s / >/dev/null 2>&1
> +		if [ $? -ne 0 ] ; then

Tabs vs spaces here.

~Andrew

>  		    echo Could not start xenstored
>  		    exit 1
>  		fi


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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout
  2014-04-30  9:33   ` Andrew Cooper
@ 2014-04-30 16:36     ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30 16:36 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel,
	Luis R. Rodriguez

On Wed, Apr 30, 2014 at 10:33:30AM +0100, Andrew Cooper wrote:
> On 30/04/14 02:11, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> >
> > xenstore-read now has support to retry opening the xenstored unix domain
> > socket a certain amount of times, once each second, use that instead of
> > implementing our own timeout.
> >
> > For systemd we'll be using socket activation. Details for that will follow.
> >
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Jan Rękorajski <baggins@pld-linux.org>
> > Cc: M A Young <m.a.young@durham.ac.uk>
> > Cc: Jacek Konieczny <jajcus@jajcus.net>
> > Cc: xen-devel@lists.xenproject.org
> > Acked-by: Ian Campbell <ian.campbell@citrix.com>
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> >  tools/hotplug/Linux/init.d/xencommons | 19 +++++--------------
> >  1 file changed, 5 insertions(+), 14 deletions(-)
> >
> > diff --git a/tools/hotplug/Linux/init.d/xencommons b/tools/hotplug/Linux/init.d/xencommons
> > index 4ebd636..7195413 100644
> > --- a/tools/hotplug/Linux/init.d/xencommons
> > +++ b/tools/hotplug/Linux/init.d/xencommons
> > @@ -54,9 +54,6 @@ if test -f /proc/xen/capabilities && \
> >  fi
> >  
> >  do_start () {
> > -        local time=0
> > -	local timeout=30
> > -
> >  	modprobe xen-evtchn 2>/dev/null
> >  	modprobe xen-gntdev 2>/dev/null
> >  	modprobe xen-gntalloc 2>/dev/null
> > @@ -93,17 +90,11 @@ do_start () {
> >  		    echo "No xenstored found"
> >  		    exit 1
> >  		fi
> > -
> > -		# Wait for xenstored to actually come up, timing out after 30 seconds
> > -                while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
> > -                    echo -n .
> > -		    time=$(($time+1))
> > -                    sleep 1
> > -                done
> > -		echo
> > -
> > -		# Exit if we timed out
> > -		if ! [ $time -lt $timeout ] ; then
> > +		# We try opening the xenstored socket every second up to the
> > +		# limit specified, if it hasn't opened by then assume
> > +		# failure.
> > +                ${BINDIR}/xenstore-read --retries 30 -s / >/dev/null 2>&1
> > +		if [ $? -ne 0 ] ; then
> 
> Tabs vs spaces here.

Thanks, I've fixed this now, and will send as part of a v5.

  Luis

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  8:35   ` Dave Scott
@ 2014-04-30 17:30     ` Luis R. Rodriguez
  2014-05-01 10:21       ` Dave Scott
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30 17:30 UTC (permalink / raw)
  To: Dave Scott
  Cc: Ian Campbell, Luis R. Rodriguez, Vincent Hanquez,
	Stefano Stabellini, Ian Jackson, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 5107 bytes --]

On Wed, Apr 30, 2014 at 08:35:50AM +0000, Dave Scott wrote:
> On 30 Apr 2014, at 02:11, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> > An important different with socket activation is that systemd will set
> > FD_CLOEXEC for us on the socket before giving it to us, Ocaml gets
> > support for [1] Unix.set_cloexec but only as of 4.00.1+dev which isn't
> > yet widely available on distributions.
> 
> I’m not familiar with systemd but I’m curious: if systems is setting the flag
> on the socket before giving it to us, why would we still need the
> Unix.set_cloexec function in OCaml?

systemd is setting the flag for us, my point was that Unix.set_cloexec is not being
set yet for non-systemd cases. This can go in as a separate patch, I for some
reason couldn't find this on documentation so I just checked out ocaml code to
find the right call, would this be OK as a separate patch:

diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index d3d2e31..b206898 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -78,13 +78,13 @@ let create_regular_unix_socket name =
         Unixext.mkdir_rec (Filename.dirname name) 0o700;
         let sockaddr = Unix.ADDR_UNIX(name) in
         let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
+        Unix.set_close_on_exec sock;
         Unix.bind sock sockaddr;
         Unix.listen sock 1;
         sock
 
> ...
> > diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
> > new file mode 100644
> > index 0000000..cace794
> > --- /dev/null
> > +++ b/tools/ocaml/xenstored/systemd.ml
> > @@ -0,0 +1,16 @@
> > +(*
> > + * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU Lesser General Public License as published
> > + * by the Free Software Foundation; version 2.1 only. with the special
> > + * exception on linking described in file LICENSE.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU Lesser General Public License for more details.
> > + *)
> > +
> > +external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
> > +external sd_active_socket_required: unit -> int = “ocaml_sd_active_socket_required"
> 
> Minor comment: It would be clearer if sd_active_socket_required was unit ->
> bool. In the C code you should use Val_true and Val_false from
> <caml/mlvalues.h>.

Thanks! Like this? If so then I rolled this in, and can send as part of my v5.

diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
index cace794..baa1c00 100644
--- a/tools/ocaml/xenstored/systemd.ml
+++ b/tools/ocaml/xenstored/systemd.ml
@@ -13,4 +13,4 @@
  *)
 
 external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
-external sd_active_socket_required: unit -> int = "ocaml_sd_active_socket_required"
+external sd_active_socket_required: unit -> bool = "ocaml_sd_active_socket_required"
diff --git a/tools/ocaml/xenstored/systemd.mli b/tools/ocaml/xenstored/systemd.mli
index a65ea5e..6f2db9c 100644
--- a/tools/ocaml/xenstored/systemd.mli
+++ b/tools/ocaml/xenstored/systemd.mli
@@ -18,4 +18,4 @@
 val sd_listen_fds: string -> Unix.file_descr
 
 (** Tells us whether or not systemd support was compiled in *)
-val sd_active_socket_required: unit -> int
+val sd_active_socket_required: unit -> bool
diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c
index ded9542..942ae19 100644
--- a/tools/ocaml/xenstored/systemd_stubs.c
+++ b/tools/ocaml/xenstored/systemd_stubs.c
@@ -13,6 +13,7 @@
  */
 
 #include <string.h>
+#include <stdbool.h>
 #include <caml/mlvalues.h>
 #include <caml/memory.h>
 #include <caml/alloc.h>
@@ -139,7 +140,7 @@ CAMLprim value ocaml_sd_active_socket_required(void)
 	CAMLparam0();
 	CAMLlocal1(ret);
 
-	ret = Val_int(1);
+	ret = Val_true;
 
 	CAMLreturn(ret);
 }
@@ -159,7 +160,7 @@ CAMLprim value ocaml_sd_active_socket_required(void)
 	CAMLparam0();
 	CAMLlocal1(ret);
 
-	ret = Val_int(0);
+	ret = Val_false;
 
 	CAMLreturn(ret);
 }
diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
index d3d2e31..50f05c1 100644
--- a/tools/ocaml/xenstored/utils.ml
+++ b/tools/ocaml/xenstored/utils.ml
@@ -83,8 +83,7 @@ let create_regular_unix_socket name =
         sock
 
 let create_unix_socket name =
-        let active_sockets = Systemd.sd_active_socket_required() in
-        if active_sockets = 1 then
+        if Systemd.sd_active_socket_required() then
                 Systemd.sd_listen_fds name
         else
                 create_regular_unix_socket name
> 
> Everything else looks good to me!

Thanks, can I sprinkle an Acked-by: Dave Scott <Dave.Scott@citrix.com> ?

  Luis

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  9:27   ` Anil Madhavapeddy
@ 2014-04-30 17:35     ` Luis R. Rodriguez
  2014-05-01  9:16       ` Anil Madhavapeddy
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30 17:35 UTC (permalink / raw)
  To: Anil Madhavapeddy
  Cc: David Scott, Stefano Stabellini, Ian Jackson, Luis R. Rodriguez,
	Vincent Hanquez, xen-devel, Ian Campbell


[-- Attachment #1.1: Type: text/plain, Size: 1571 bytes --]

On Wed, Apr 30, 2014 at 10:27:43AM +0100, Anil Madhavapeddy wrote:
> On 30 Apr 2014, at 02:11, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
> 
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > This adds systemd socket activation support for the Ocaml xenstored.
> > Ocaml lacks systemd library support so we provide our own C helpers
> > as is done with other functionality lacking on Ocaml.
> > 
> <snip>
> 
> The definition of sd_active_socket_required (unit ->int) below doesn't
> match the C stub:
> 
> > +
> > +external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
> > +external sd_active_socket_required: unit -> int = "ocaml_sd_active_socket_required"
> 
> > +
> > +CAMLprim value ocaml_sd_active_socket_required(void)
> > +{
> > +	CAMLparam0();
> > +	CAMLlocal1(ret);
> > +
> > +	ret = Val_int(0);
> > +
> > +	CAMLreturn(ret);
> > +}
> > +#endif
> 
> That should be:
> 
> CAMLprim value ocaml_sd_active_socket_required(value u)
> {
>   CAMLparam1(u);
>   CAMLlocal1(ret);
>   ret = Val_int(0);
>   CAMLreturn(ret);
> }

Do we have to require an argument though?

> (Since the function isn't doing any heap allocation, it's actually
> just safe to compress it to "return (Val_int(0))", but it's probably
> better to keep it like this to avoid any surprises).
> 
> As Dave notes, returning Val_true and setting the OCaml signature to
> bool would be a clearer interface.

OK thanks for the review! Let me know what you think of the other changes
I sent in reply to Dave.

  Luis

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 06/15] tools/xendomains: make xl the default
  2014-04-30  7:02   ` Olaf Hering
@ 2014-04-30 17:43     ` Luis R. Rodriguez
  2014-05-07 15:21       ` Ian Campbell
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30 17:43 UTC (permalink / raw)
  To: Olaf Hering
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel,
	Luis R. Rodriguez


[-- Attachment #1.1: Type: text/plain, Size: 1367 bytes --]

On Wed, Apr 30, 2014 at 09:02:09AM +0200, Olaf Hering wrote:
> On Tue, Apr 29, Luis R. Rodriguez wrote:
> 
> > If that fails backoff to using xm.
> 
> xm is gone, so that part can be removed in this or a followup patch.

OK thanks for the review, how about this as a patch after this one:

commit 1d70fb3a7c49a9d4728ac159e09b7bcbad9f1960
Author: Luis R. Rodriguez <mcgrof@suse.com>
Date:   Wed Apr 30 10:42:05 2014 -0700

    tools/xendomains: remove xm usage as its gone
    
    As per Olaf xm is gone, so don't even bother looking for it.
    
    Cc: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Cc: Jan Rękorajski <baggins@pld-linux.org>
    Cc: M A Young <m.a.young@durham.ac.uk>
    Cc: Jacek Konieczny <jajcus@jajcus.net>
    Cc: xen-devel@lists.xenproject.org
    Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>

diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
index 6cb1032..f68fd2b 100644
--- a/tools/hotplug/Linux/init.d/xendomains
+++ b/tools/hotplug/Linux/init.d/xendomains
@@ -34,8 +34,7 @@ HEADCOMP="Xen saved domain"
 $CMD list &> /dev/null
 if test $? -ne 0
 then
-	CMD=${SBINDIR}/xm
-	HEADCOMP="LinuxGuestRecord"
+	exit $?
 fi
 
 $CMD list &> /dev/null

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply related	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place
       [not found]   ` <5360B9CB020000780000D9BB@suse.com>
@ 2014-04-30 17:53     ` Luis R. Rodriguez
  2014-05-02  8:12       ` Jan Beulich
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-04-30 17:53 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Keir Fraser, Ian Campbell, Luis R. Rodriguez, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault


[-- Attachment #1.1: Type: text/plain, Size: 1179 bytes --]

On Wed, Apr 30, 2014 at 12:52:27AM -0600, Jan Beulich wrote:
> >>> On 30.04.14 at 03:12, <mcgrof@do-not-panic.com> wrote:
> > This moves all generic variables to the top level makefile,
> > tons of files use these so just make them general enough. This
> > also paves the way to let us easily dynamically configure these
> > with autoconf, for now we leave the same presets as was present
> > before.
> 
> Am I right understanding that this then will require ./configure to
> be run even for hypervisor-only building?

Its unclear what you mean by that, can you describe what is required
to accomplish this on a fresh git tree. Can you describe what expectations
you have on build time to see if this patch breaks that and if so see
what can be done to avoid this? All the changes I did here really was
to toss around variables to be set through autoconf and if building
the hypervisor requries them then yes, but fixing that should be as
easy as adding schecks to add sensible defaults if configure has not
been run.

> If so, I objected to that
> idea already when the configuration process got introduced, and
> I continue to do so now.

OK

  Luis

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30 17:35     ` Luis R. Rodriguez
@ 2014-05-01  9:16       ` Anil Madhavapeddy
  0 siblings, 0 replies; 84+ messages in thread
From: Anil Madhavapeddy @ 2014-05-01  9:16 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Luis R. Rodriguez, Stefano Stabellini, Ian Jackson,
	xen-devel, David Scott

On 30 Apr 2014, at 18:35, Luis R. Rodriguez <mcgrof@suse.com> wrote:
> 
> Do we have to require an argument though?

External bindings needs to be functions, yes.  The `unit` argument ensures
that you can call the binding multiple times.  It's a little wasteful to
have a C binding just to return a constant compile-time value, and this
could be improved by using optcomp (the OCaml equivalent of cpp) to put
this logic into the OCaml code rather than C.  A separate patchset, though.

> 
>> (Since the function isn't doing any heap allocation, it's actually
>> just safe to compress it to "return (Val_int(0))", but it's probably
>> better to keep it like this to avoid any surprises).
>> 
>> As Dave notes, returning Val_true and setting the OCaml signature to
>> bool would be a clearer interface.
> 
> OK thanks for the review! Let me know what you think of the other changes
> I sent in reply to Dave.

Look good to me with the argument addition and switch to bool;

Acked-by: Anil Madhavapeddy <anil@recoil.org>

-anil

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30 17:30     ` Luis R. Rodriguez
@ 2014-05-01 10:21       ` Dave Scott
  0 siblings, 0 replies; 84+ messages in thread
From: Dave Scott @ 2014-05-01 10:21 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Luis R. Rodriguez, Vincent Hanquez,
	Stefano Stabellini, xen-devel, Ian Jackson


On 30 Apr 2014, at 18:30, Luis R. Rodriguez <mcgrof@suse.com> wrote:

> On Wed, Apr 30, 2014 at 08:35:50AM +0000, Dave Scott wrote:
>> On 30 Apr 2014, at 02:11, Luis R. Rodriguez <mcgrof@do-not-panic.com> wrote:
>>> An important different with socket activation is that systemd will set
>>> FD_CLOEXEC for us on the socket before giving it to us, Ocaml gets
>>> support for [1] Unix.set_cloexec but only as of 4.00.1+dev which isn't
>>> yet widely available on distributions.
>> 
>> I’m not familiar with systemd but I’m curious: if systems is setting the flag
>> on the socket before giving it to us, why would we still need the
>> Unix.set_cloexec function in OCaml?
> 
> systemd is setting the flag for us, my point was that Unix.set_cloexec is not being
> set yet for non-systemd cases. This can go in as a separate patch, I for some
> reason couldn't find this on documentation so I just checked out ocaml code to
> find the right call, would this be OK as a separate patch:
> 
> diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
> index d3d2e31..b206898 100644
> --- a/tools/ocaml/xenstored/utils.ml
> +++ b/tools/ocaml/xenstored/utils.ml
> @@ -78,13 +78,13 @@ let create_regular_unix_socket name =
>         Unixext.mkdir_rec (Filename.dirname name) 0o700;
>         let sockaddr = Unix.ADDR_UNIX(name) in
>         let sock = Unix.socket Unix.PF_UNIX Unix.SOCK_STREAM 0 in
> +        Unix.set_close_on_exec sock;
>         Unix.bind sock sockaddr;
>         Unix.listen sock 1;
>         sock

Sure, a separate patch is fine. I don’t think oxenstored ever execs, but there’s no harm in being careful just in case that changes in future.

> 
>> ...
>>> diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
>>> new file mode 100644
>>> index 0000000..cace794
>>> --- /dev/null
>>> +++ b/tools/ocaml/xenstored/systemd.ml
>>> @@ -0,0 +1,16 @@
>>> +(*
>>> + * Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
>>> + *
>>> + * This program is free software; you can redistribute it and/or modify
>>> + * it under the terms of the GNU Lesser General Public License as published
>>> + * by the Free Software Foundation; version 2.1 only. with the special
>>> + * exception on linking described in file LICENSE.
>>> + *
>>> + * This program is distributed in the hope that it will be useful,
>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> + * GNU Lesser General Public License for more details.
>>> + *)
>>> +
>>> +external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
>>> +external sd_active_socket_required: unit -> int = “ocaml_sd_active_socket_required"
>> 
>> Minor comment: It would be clearer if sd_active_socket_required was unit ->
>> bool. In the C code you should use Val_true and Val_false from
>> <caml/mlvalues.h>.
> 
> Thanks! Like this? If so then I rolled this in, and can send as part of my v5.
> 
> diff --git a/tools/ocaml/xenstored/systemd.ml b/tools/ocaml/xenstored/systemd.ml
> index cace794..baa1c00 100644
> --- a/tools/ocaml/xenstored/systemd.ml
> +++ b/tools/ocaml/xenstored/systemd.ml
> @@ -13,4 +13,4 @@
>  *)
> 
> external sd_listen_fds: string -> Unix.file_descr = "ocaml_sd_listen_fds"
> -external sd_active_socket_required: unit -> int = "ocaml_sd_active_socket_required"
> +external sd_active_socket_required: unit -> bool = "ocaml_sd_active_socket_required"
> diff --git a/tools/ocaml/xenstored/systemd.mli b/tools/ocaml/xenstored/systemd.mli
> index a65ea5e..6f2db9c 100644
> --- a/tools/ocaml/xenstored/systemd.mli
> +++ b/tools/ocaml/xenstored/systemd.mli
> @@ -18,4 +18,4 @@
> val sd_listen_fds: string -> Unix.file_descr
> 
> (** Tells us whether or not systemd support was compiled in *)
> -val sd_active_socket_required: unit -> int
> +val sd_active_socket_required: unit -> bool
> diff --git a/tools/ocaml/xenstored/systemd_stubs.c b/tools/ocaml/xenstored/systemd_stubs.c
> index ded9542..942ae19 100644
> --- a/tools/ocaml/xenstored/systemd_stubs.c
> +++ b/tools/ocaml/xenstored/systemd_stubs.c
> @@ -13,6 +13,7 @@
>  */
> 
> #include <string.h>
> +#include <stdbool.h>
> #include <caml/mlvalues.h>
> #include <caml/memory.h>
> #include <caml/alloc.h>
> @@ -139,7 +140,7 @@ CAMLprim value ocaml_sd_active_socket_required(void)
> 	CAMLparam0();
> 	CAMLlocal1(ret);
> 
> -	ret = Val_int(1);
> +	ret = Val_true;
> 
> 	CAMLreturn(ret);
> }
> @@ -159,7 +160,7 @@ CAMLprim value ocaml_sd_active_socket_required(void)
> 	CAMLparam0();
> 	CAMLlocal1(ret);
> 
> -	ret = Val_int(0);
> +	ret = Val_false;
> 
> 	CAMLreturn(ret);
> }
> diff --git a/tools/ocaml/xenstored/utils.ml b/tools/ocaml/xenstored/utils.ml
> index d3d2e31..50f05c1 100644
> --- a/tools/ocaml/xenstored/utils.ml
> +++ b/tools/ocaml/xenstored/utils.ml
> @@ -83,8 +83,7 @@ let create_regular_unix_socket name =
>         sock
> 
> let create_unix_socket name =
> -        let active_sockets = Systemd.sd_active_socket_required() in
> -        if active_sockets = 1 then
> +        if Systemd.sd_active_socket_required() then
>                 Systemd.sd_listen_fds name
>         else
>                 create_regular_unix_socket name
>> 
>> Everything else looks good to me!
> 
> Thanks, can I sprinkle an Acked-by: Dave Scott <Dave.Scott@citrix.com> ?

If you also add the parameter that Anil pointed out, then

Acked-by: Dave Scott <Dave.Scott@citrix.com>


Thanks,
Dave

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place
  2014-04-30 17:53     ` Luis R. Rodriguez
@ 2014-05-02  8:12       ` Jan Beulich
  2014-05-13 23:03         ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Jan Beulich @ 2014-05-02  8:12 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Ian Campbell, Luis R. Rodriguez, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault

>>> On 30.04.14 at 19:53, <mcgrof@suse.com> wrote:
> On Wed, Apr 30, 2014 at 12:52:27AM -0600, Jan Beulich wrote:
>> >>> On 30.04.14 at 03:12, <mcgrof@do-not-panic.com> wrote:
>> > This moves all generic variables to the top level makefile,
>> > tons of files use these so just make them general enough. This
>> > also paves the way to let us easily dynamically configure these
>> > with autoconf, for now we leave the same presets as was present
>> > before.
>> 
>> Am I right understanding that this then will require ./configure to
>> be run even for hypervisor-only building?
> 
> Its unclear what you mean by that, can you describe what is required
> to accomplish this on a fresh git tree. Can you describe what expectations
> you have on build time to see if this patch breaks that and if so see
> what can be done to avoid this? All the changes I did here really was
> to toss around variables to be set through autoconf and if building
> the hypervisor requries them then yes, but fixing that should be as
> easy as adding schecks to add sensible defaults if configure has not
> been run.

The main problem I see is with config/StdGNU.mk now including
config/Toplevel.mk, with the latter only being generated by the
configure process. What I expect to continue to work is "make xen"
(and - hopefully unaffected, albeit I didn't check -
"make -C extras/mini-os") without anything else done on a fresh
tree.

Jan

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
@ 2014-05-07 15:03   ` Ian Campbell
  2014-05-12 13:50   ` Ian Jackson
  1 sibling, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:03 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This adds support for a customizable retry limit on trying to open
> the xenstored unix domain socket, each retry is separated by 1 second.
> This should allow us to simplify both our LSB init scripts. For systemd
> we'll use socket activation.
> 
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Rękorajski <baggins@pld-linux.org>
> Cc: M A Young <m.a.young@durham.ac.uk>
> Cc: Jacek Konieczny <jajcus@jajcus.net>
> Cc: xen-devel@lists.xenproject.org
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  docs/man/xenstore.pod.1          |  7 ++++++-
>  tools/xenstore/xenstore_client.c | 40 +++++++++++++++++++++++++++++-----------
>  2 files changed, 35 insertions(+), 12 deletions(-)
> 
> diff --git a/docs/man/xenstore.pod.1 b/docs/man/xenstore.pod.1
> index 7417289..9647143 100644
> --- a/docs/man/xenstore.pod.1
> +++ b/docs/man/xenstore.pod.1
> @@ -4,12 +4,17 @@ xenstore - interact with Xenstore
>  
>  =head1 SYNOPSIS
>  
> -B<xenstore> I<CMD> ...
> +B<xenstore> I<CMD> I[ --retries <num_open_retries> ] ...

I think "--retries <N>" is sufficient and less likely to push things up
to >80 columns. (Same in the errx output which is in main())
>  
>  =head1 DESCRIPTION

>  A set of utilities for interacting with Xenstore.

I think a bit more formatting can be applied here.

+ =head2 COMMON OPTIONS 
+ =over
+ =item B<--retries <N>>

> +All xenstore-* commands support the --retries long option which
> +can be used to try to opening the unix domain socket a certain
> +number of retries before giving up. Each new try occurs every
> +second.

"Retry opening the Unix domain socket once a second for I<N> attempts."

+ =back

+ =head2 COMMANDS
+ =over

(some playing with it in real life might be required).

> [...]
> @@ -493,9 +494,9 @@ static enum mode lookup_mode(const char *m)
>  int
>  main(int argc, char **argv)
>  {
> -    struct xs_handle *xsh;
> +    struct xs_handle *xsh = NULL;
>      xs_transaction_t xth = XBT_NULL;
> -    int ret = 0, socket = 0;
> +    int ret = 0, socket = 0, retries = 1;
>      int prefix = 0;
>      int tidy = 0;
>      int upto = 0;
> @@ -535,6 +536,7 @@ main(int argc, char **argv)
>  	    {"upto",    0, 0, 'u'}, /* MODE_chmod */
>  	    {"recurse", 0, 0, 'r'}, /* MODE_chmod */
>  	    {"number",  1, 0, 'n'}, /* MODE_watch */
> +	    {"retries", 1, 0,  0 }, /* index 8 - MODE_* */


The usual way to deal with the lack of a short character is to use a
small non-zero integer unique to each long opt here and to switch on it.

So:

#define OPT_RETRIES 1 
...
{"retries", 1, 0, OPT_RETRIES },
...
>  	switch (c) {
case OPT_RETIRES:
	retires = atoi(...)
	etc.

> @@ -632,8 +643,15 @@ main(int argc, char **argv)
>  	    max_width = ws.ws_col - 2;
>      }
>  
> -    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
> -    if (xsh == NULL) err(1, "xs_open");
> +    while (retries--) {
> +	    xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
> +	    if (xsh)
> +		    break;
> +	    if (retries)
> +		    sleep(1);

I think a do {} while() would remove the need for the if(retries) (IOW
sleep unconditionally, I don't think we need to worry unduly about an
extra 1s sleep after the last attempt)

> +    }
> +    if (!xsh)
> +	    err(1, "xs_open");
>  
>  again:
>      if (transaction) {



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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout
  2014-04-30  1:11 ` [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout Luis R. Rodriguez
  2014-04-30  9:33   ` Andrew Cooper
@ 2014-05-07 15:05   ` Ian Campbell
  1 sibling, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:05 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> xenstore-read now has support to retry opening the xenstored unix domain
> socket a certain amount of times, once each second, use that instead of
> implementing our own timeout.
> 
> For systemd we'll be using socket activation. Details for that will follow.

No need to mention this last bit here.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored
  2014-04-30  1:11 ` [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
@ 2014-05-07 15:06   ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:06 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel, Luis R. Rodriguez

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This will be used later for dynamic configuration paths on C code.
> 
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 04/15] cxenstored: add support for systemd active sockets Luis R. Rodriguez
@ 2014-05-07 15:18   ` Ian Campbell
  2014-05-07 15:46   ` Ian Campbell
  1 sibling, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:18 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel, Luis R. Rodriguez

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This adds systemd socket activation support for the C xenstored.
> Active sockets enable xenstored to be loaded only if required by a system
> onto which Xen is installed on. Socket activation is handled by
> systemd, once a port for a service which claims a socket is used
> systemd will start the required services for it, on demand. For more
> details on socket activation refer to Lennart's socket-activation
> post regarding this [0].
> 
> Right now this code adds a no-op for this functionality, leaving the
> enablement to be done later once systemd is properly hooked into
> the build system. The socket activation is ordered in aligment with
> the socket activation order passed on to systemd.
> 
> [0] http://0pointer.de/blog/projects/socket-activation2.html
> 
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  tools/xenstore/xs.c | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 125 insertions(+)
> 
> diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
> index f1d0f99..9bbf736 100644
> --- a/tools/xenstore/xs.c
> +++ b/tools/xenstore/xs.c
> @@ -1,6 +1,7 @@
>  /* 
>      Xen Store Daemon interface providing simple tree-like database.
>      Copyright (C) 2005 Rusty Russell IBM Corporation
> +    Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
>  
>      This library is free software; you can redistribute it and/or
>      modify it under the terms of the GNU Lesser General Public
> @@ -34,6 +35,10 @@
>  #include <errno.h>
>  #include <config.h>
>  
> +#if defined(HAVE_SYSTEMD)
> +#include <systemd/sd-daemon.h>
> +#endif
> +
>  #include "xenstore.h"
>  #include "list.h"
>  #include "utils.h"
> @@ -182,11 +187,131 @@ int xs_fileno(struct xs_handle *h)
>  	return h->watch_pipe[0];
>  }
>  
> +#if defined(HAVE_SYSTEMD)
> +
> +/* Conforms to what we should send sd_is_socket_unix() */
> +struct xen_systemd_active_socket {
> +	int fd;
> +	int type;
> +	int listening;
> +	const char *path;
> +	size_t length;
> +};
> +
> +/*
> + * We list stdin, stdout and stderr simply for documentation purposes
> + * and to help our array size fit the number of expected sockets we
> + * as sd_listen_fds() will return 5 for example if you set the socket
> + * service with 2 sockets.

This sounds gross, why is this needed?

SD_LISTEN_FDS_START seems to be the correct offset to apply.

Having ditched those 3 then the majority of the fields here become
unnecessary and it seems like it would be far simpler to just implement
the mapping from connect_to to the index directly by comparison with
xs_daemon_socket_ro() et al.

Or even better refactor get_handle to split out the stuff which is
common to both sockets and devices and use that to implement
open_daemon_socket(int ro), which then just does the right thing when
systemd is on, using ro to determine which socket offset to use.

Since there is more than one I think it is necessary to document the
requirements for the number of sockets which are expected to be passed
in.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 00/15] xen: add systemd support
  2014-04-30  1:15 ` [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
@ 2014-05-07 15:18   ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:18 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel

On Tue, 2014-04-29 at 18:15 -0700, Luis R. Rodriguez wrote:
> On Tue, Apr 29, 2014 at 6:11 PM, Luis R. Rodriguez
> <mcgrof@do-not-panic.com> wrote:
> > nc -U /var/run/xenstored/socket_ro
> 
> Note that xl doesn't look for the socket first,

ISTR there was a reason for that, but I don't recall what it was...

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
  2014-04-30  8:35   ` Dave Scott
  2014-04-30  9:27   ` Anil Madhavapeddy
@ 2014-05-07 15:20   ` Ian Campbell
  2014-05-12 19:09     ` Luis R. Rodriguez
  2014-05-12 13:57   ` Ian Jackson
  3 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:20 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: David Scott, Stefano Stabellini, Ian Jackson, Luis R. Rodriguez,
	Vincent Hanquez, xen-devel

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:

> +/*
> + * We list stdin, stdout and stderr simply for documentation purposes
> + * and to help our array size fit the number of expected sockets we
> + * as sd_listen_fds() will return 5 for example if you set the socket
> + * service with 2 sockets.
> + */

I think my comments/simplifications made on the C version probably apply
here.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 06/15] tools/xendomains: make xl the default
  2014-04-30 17:43     ` Luis R. Rodriguez
@ 2014-05-07 15:21       ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:21 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Olaf Hering, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel,
	Luis R. Rodriguez

On Wed, 2014-04-30 at 19:43 +0200, Luis R. Rodriguez wrote:
> On Wed, Apr 30, 2014 at 09:02:09AM +0200, Olaf Hering wrote:
> > On Tue, Apr 29, Luis R. Rodriguez wrote:
> > 
> > > If that fails backoff to using xm.
> > 
> > xm is gone, so that part can be removed in this or a followup patch.
> 
> OK thanks for the review, how about this as a patch after this one:

Please fold it in to one patch to just forget about xm in one go.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper
  2014-04-30  1:12 ` [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
@ 2014-05-07 15:24   ` Ian Campbell
  2014-05-13 22:21     ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:24 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> The xendomains script can be reused with systemd systems as it
> does not control services or sockets per se, but does a one shot
> scrape of domUs it needs start bring up, stop, reload so we're
> going to reuse it. This moves the core of the script to libexec
> and leaves only a helper on init.
> 
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Rękorajski <baggins@pld-linux.org>
> Cc: M A Young <m.a.young@durham.ac.uk>
> Cc: Jacek Konieczny <jajcus@jajcus.net>
> Cc: xen-devel@lists.xenproject.org
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  tools/hotplug/Linux/Makefile          |   6 +
>  tools/hotplug/Linux/init.d/xendomains | 567 +-------------------------------
>  tools/hotplug/Linux/xendomains        | 585 ++++++++++++++++++++++++++++++++++

Did you use the -M option here?

> @@ -45,6 +46,11 @@ install: all install-initd install-scripts install-udev
>  install-initd:
>  	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
>  	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
> +	[ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
> +ifeq ($(CONFIG_XEND),y)
> +	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)

With xend's removal this can now go.

> +endif
> +	$(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC)
>  	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
>  	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
>  	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
> diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
> index 587568d..d0122fc 100644
> --- a/tools/hotplug/Linux/init.d/xendomains
> +++ b/tools/hotplug/Linux/init.d/xendomains

I think I need to apply the series and examine with git to figure out
what changed here, which I'll do another time.

Ian.



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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-04-30  1:12 ` [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
@ 2014-05-07 15:25   ` Ian Campbell
  2014-05-07 16:12   ` Roger Pau Monné
  1 sibling, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:25 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Tim Deegan, Luis R. Rodriguez, Ian Jackson,
	Jan Beulich, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> With some new functionality introduced we can't keep around the old cache.

This seems likely to be correct, but I don't understand this commit
message. What new functionality? Xen's or autoconf's?

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 10/15] autoconf: update m4/pkg.m4
  2014-04-30  1:12 ` [PATCH v4 10/15] autoconf: update m4/pkg.m4 Luis R. Rodriguez
@ 2014-05-07 15:28   ` Ian Campbell
  2014-05-13 22:32     ` Luis R. Rodriguez
  2014-05-07 16:17   ` Roger Pau Monné
  1 sibling, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:28 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Tim Deegan, Luis R. Rodriguez, Ian Jackson,
	Jan Beulich, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> The provenance of the m4 pkg.m4 macro library was not documented
> and it was not clear how and if we can update this without breaking
> things. Document where this comes from, update us to the latest
> release from git and put a warning about avoiding private evolutions
> so that instead things go upstream.
> 
> The pkg-config m4 macro library comes from the upstream pkg-config
> git repository [0]. If you update the m4 library update this file
> with provenance and last commit ID information. For documentation
> on how to use this read the pkg-config(1) man page.
> 
> Tree: git://anongit.freedesktop.org/pkg-config
> 
> The last synch was from commit:
> 
> commit 4f0084d9d3b8726a797a373c7ec5e406000995d0
> Author: Dan Nicholson <dbn.lists@gmail.com>
> Date:   Mon Feb 3 15:59:18 2014 -0800
> 
>     glib: Fix Makefiles to suppress warnings from automake
> 
>     With the newly added glib.mk, some of the noinst_* variables need to use
>     += in the evaluation to avoid multiple definition warnings from
>     automake.
> 
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> ---

Please note here (after the --- marker) if the committer should rerun
autogen.sh.

> diff --git a/m4/pkg.m4.README b/m4/pkg.m4.README

Since it seems like the advice here could apply to multiple modules I
wonder if we should start off with m4/README.source or some such and a
list of the relevant upstreams (a list of 1 entry now, I don't expect
you to reverse engineer the others)?

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config
  2014-04-30  1:12 ` [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config Luis R. Rodriguez
@ 2014-05-07 15:32   ` Ian Campbell
  2014-05-13 23:05     ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:32 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Tim Deegan, Luis R. Rodriguez, Ian Jackson,
	Jan Beulich, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> Enabling cxenstored will then disable ocamltools.

I think there is ocaml code other than oxenstored which people might
want to use. I don't see any harm in building all the ocaml stuff
(including oxenstored) even if the default requested here is cxenstored.
Having both allows the user to switch later if they want, by
editing /etc/sysconfig etc.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 04/15] cxenstored: add support for systemd active sockets Luis R. Rodriguez
  2014-05-07 15:18   ` Ian Campbell
@ 2014-05-07 15:46   ` Ian Campbell
  2014-05-13 22:17     ` Luis R. Rodriguez
  1 sibling, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:46 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel, Luis R. Rodriguez

On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> +#if defined(HAVE_SYSTEMD)
> +#include <systemd/sd-daemon.h>
> +#endif

Please document this new optional dependency in the top level makefile.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-04-30  1:12 ` [PATCH v4 13/15] systemd: add xen systemd service and module files Luis R. Rodriguez
@ 2014-05-07 15:46   ` Ian Campbell
  2014-05-12 18:22     ` Luis R. Rodriguez
  2014-05-13 23:28     ` Luis R. Rodriguez
  2014-05-12 14:11   ` Ian Jackson
  1 sibling, 2 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:46 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
>   * simplifies startup to not require polling on the sockets
>     as initial socket management is handled by systemd, we just
>     take on the socket later once anything pokes at it, a simple nc -U
>     on the socket files can activate the service for example.

What about xenstore users which don't use the sockets but instead use
the kernel ring interface? Does this mean that if only those users are
present nothing starts xenstored?

>   * allow for xenstored configuration through *either* of these
>     configuration files:
> 	- /etc/sysconfig/xenstored
> 	- /etc/default/xenstored
>     The /etc/default/xenstored will let debian based systems do
>     the same, while SUSE/OpenSUSE/Fedora/RedHat can keep on chugging
>     with sysconfig

Is the usual systemd way?

>   * defines a modules-load.d for us

Does this duplicate the existing list in the LSB initscript, meaning we
have to keep two places up to date? Can we avoid that somehow?

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh
  2014-04-30  1:12 ` [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh Luis R. Rodriguez
@ 2014-05-07 15:47   ` Ian Campbell
  2014-05-07 18:34     ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 15:47 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel

On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> Now that all the series of autoconf updates have gone in trigger
> an updates so that downstream users don't have to run autogen.sh.

Please do this bit by bit as you update the sources and include a note
for the committer to rerun autogen.sh. (up to you if you want to also
include the regeneration in the patch, but it is usually less bulky to
not do so)

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-04-30  1:12 ` [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
  2014-05-07 15:25   ` Ian Campbell
@ 2014-05-07 16:12   ` Roger Pau Monné
  2014-05-07 16:21     ` Ian Campbell
  1 sibling, 1 reply; 84+ messages in thread
From: Roger Pau Monné @ 2014-05-07 16:12 UTC (permalink / raw)
  To: Luis R. Rodriguez, xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich

On 30/04/14 03:12, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> With some new functionality introduced we can't keep around the old cache.
> 
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  autogen.sh | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/autogen.sh b/autogen.sh
> index b5c9688..2be8360 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,12 +1,12 @@
>  #!/bin/sh -e
> -autoconf
> +autoconf -f
>  ( cd tools
> -  autoconf
> +  autoconf -f
>    autoheader
>  )
>  ( cd stubdom
> -  autoconf
> +  autoconf -f
>  )
>  ( cd docs
> -  autoconf
> +  autoconf -f
>  )

Not that is that important, but why do you need to force the regen of
all files? I expect autoconf should be able to detect which files need
rebuilding.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 10/15] autoconf: update m4/pkg.m4
  2014-04-30  1:12 ` [PATCH v4 10/15] autoconf: update m4/pkg.m4 Luis R. Rodriguez
  2014-05-07 15:28   ` Ian Campbell
@ 2014-05-07 16:17   ` Roger Pau Monné
  1 sibling, 0 replies; 84+ messages in thread
From: Roger Pau Monné @ 2014-05-07 16:17 UTC (permalink / raw)
  To: Luis R. Rodriguez, xen-devel
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich

On 30/04/14 03:12, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> The provenance of the m4 pkg.m4 macro library was not documented
> and it was not clear how and if we can update this without breaking
> things. Document where this comes from, update us to the latest
> release from git and put a warning about avoiding private evolutions
> so that instead things go upstream.
> 
> The pkg-config m4 macro library comes from the upstream pkg-config
> git repository [0]. If you update the m4 library update this file
> with provenance and last commit ID information. For documentation
> on how to use this read the pkg-config(1) man page.
> 
> Tree: git://anongit.freedesktop.org/pkg-config
> 
> The last synch was from commit:
> 
> commit 4f0084d9d3b8726a797a373c7ec5e406000995d0
> Author: Dan Nicholson <dbn.lists@gmail.com>
> Date:   Mon Feb 3 15:59:18 2014 -0800
> 
>     glib: Fix Makefiles to suppress warnings from automake
> 
>     With the newly added glib.mk, some of the noinst_* variables need to use
>     += in the evaluation to avoid multiple definition warnings from
>     automake.
> 
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Tim Deegan <tim@xen.org>
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-05-07 16:12   ` Roger Pau Monné
@ 2014-05-07 16:21     ` Ian Campbell
  2014-05-07 16:44       ` Roger Pau Monné
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-07 16:21 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Keir Fraser, Luis R. Rodriguez, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich, xen-devel

On Wed, 2014-05-07 at 18:12 +0200, Roger Pau Monné wrote:
> On 30/04/14 03:12, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > With some new functionality introduced we can't keep around the old cache.
> > 
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Cc: Keir Fraser <keir@xen.org>
> > Cc: Tim Deegan <tim@xen.org>
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> >  autogen.sh | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/autogen.sh b/autogen.sh
> > index b5c9688..2be8360 100755
> > --- a/autogen.sh
> > +++ b/autogen.sh
> > @@ -1,12 +1,12 @@
> >  #!/bin/sh -e
> > -autoconf
> > +autoconf -f
> >  ( cd tools
> > -  autoconf
> > +  autoconf -f
> >    autoheader
> >  )
> >  ( cd stubdom
> > -  autoconf
> > +  autoconf -f
> >  )
> >  ( cd docs
> > -  autoconf
> > +  autoconf -f
> >  )
> 
> Not that is that important, but why do you need to force the regen of
> all files? I expect autoconf should be able to detect which files need
> rebuilding.

I've observed it not doing so, when I thought it should, I never figured
out why and/or if I was mistaken though


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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 14/15] autoconf: xen: add systemd support into the build system
  2014-04-30  1:12 ` [PATCH v4 14/15] autoconf: xen: add systemd support into the build system Luis R. Rodriguez
@ 2014-05-07 16:40   ` Roger Pau Monné
  2014-05-15  1:58     ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Roger Pau Monné @ 2014-05-07 16:40 UTC (permalink / raw)
  To: Luis R. Rodriguez, xen-devel
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Ian Jackson, Jacek Konieczny, M A Young

On 30/04/14 03:12, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This adds autoconf systemd support into the build system.
> Autoconf support for system has been split up as much as
> possible into its own set of helpers in hopes that this
> might be useful for other daemons and I was unable to
> find anything generic. You can use either one of two
> helpers depending on whether or not you want to make
> systemd required or optional:
> 
>   * AX_ENABLE_SYSTEMD() - requires systemd
>   * AX_ALLOW_SYSTEMD()  - lets you enable systemd with configure
> 
> This then lets you use the variables in your build system:
> 
>   * SYSTEMD_CFLAGS
>   * SYSTEMD_LIBS
>   * SYSTEMD_DIR
>   * SYSTEMD_MODULES_LOAD
> 
> Systemd support is left disabled by default given xen can
> be built for non-systemd systems and enabling systemd support
> will require support of having libsystemd-daemon present
> in order to use active sockets. We use AX_ALLOW_SYSTEMD() then,
> you can enable systemd support into the build system by using
> the --enable-systemd configure flag, you will have been expected
> to have installed your distribution's version of the package
> systemd-devel.
> 
> This integration currently does not make use of
> 
> pkg-config --variable=systemdsystemunitdir systemd
> 
> for setting of the SYSTEMD_DIR where the unit files are
> stored given upstream systemd pc files it do not respect the
> ${prefix} overriding and fixing that upstream on system is
> a bit complicated, to account for that we provide a path
> helper --with-systemd which can be used to override the path
> to the service files. Upstream systemd also lacks a pc file
> placement for a modules load path, we can add that upstream
> but for now we enable overriding through the flag configure
> flag --with-systemd-modules-load. By default you're preferred
> ${prefix} will be respected, this means /usr/local/ will be used
> for both as prefix if none is provided thereby leaving your
> own distribution's files in place if present.
> 
> Enabling systemd will trigger a config.h define for HAVE_SYSTEMD
> which is used by C xensotred and Ocaml oxenstored for active
> socket communication.
> 
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Cc: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Rękorajski <baggins@pld-linux.org>
> Cc: M A Young <m.a.young@durham.ac.uk>
> Cc: Jacek Konieczny <jajcus@jajcus.net>
> Cc: xen-devel@lists.xenproject.org
> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> ---
>  config/Tools.mk.in             |   6 +++
>  m4/systemd.m4                  | 105 +++++++++++++++++++++++++++++++++++++++++
>  tools/configure.ac             |   3 ++
>  tools/hotplug/common/Makefile  |   1 +
>  tools/ocaml/xenstored/Makefile |   5 ++
>  tools/xenstore/Makefile        |   6 +++
>  6 files changed, 126 insertions(+)
>  create mode 100644 m4/systemd.m4
> 
> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> index 0bdf37a..c47e6af 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -55,6 +55,12 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
>  CONFIG_QEMU_XEN     := @qemu_xen@
>  CONFIG_BLKTAP1      := @blktap1@
>  
> +CONFIG_SYSTEMD      := @systemd@
> +SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
> +SYSTEMD_LIBS        := @SYSTEMD_LIBS@
> +XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
> +XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
> +
>  #System options
>  ZLIB                := @zlib@
>  CONFIG_LIBICONV     := @libiconv@
> diff --git a/m4/systemd.m4 b/m4/systemd.m4
> new file mode 100644
> index 0000000..d5734d4
> --- /dev/null
> +++ b/m4/systemd.m4
> @@ -0,0 +1,105 @@
> +# systemd.m4 - Macros to check for and enable systemd          -*- Autoconf -*-
> +#
> +# Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful, but
> +# WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +# General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software Foundation, Inc.,
> +# 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
> +
> +dnl Some optional path options
> +AC_DEFUN([AX_SYSTEMD_OPTIONS], [
> +	AC_ARG_WITH(systemd, [  --with-systemd          set directory for systemd service files],
> +		SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
> +	AC_SUBST(SYSTEMD_DIR)
> +
> +	AC_ARG_WITH(systemd, [  --with-systemd-modules-load          set directory for systemd modules load files],
> +		SYSTEMD_MODULES_LOAD="$withval", SYSTEMD_MODULES_LOAD="")
> +	AC_SUBST(SYSTEMD_MODULES_LOAD)
> +])
> +
> +dnl Enables systemd by default and requires a --disable-systemd option flag
> +dnl to configure if you want to disable.
> +AC_DEFUN([AX_ENABLE_SYSTEMD_OPTS], [
> +	AX_ARG_DEFAULT_ENABLE([systemd], [Disable systemd support])
> +	AX_SYSTEMD_OPTIONS()
> +])
> +
> +dnl Systemd will be disabled by default and requires you to run configure with
> +dnl --enable-systemd to look for and enable systemd.
> +AC_DEFUN([AX_ALLOW_SYSTEMD_OPTS], [
> +	AX_ARG_DEFAULT_DISABLE([systemd], [Enable systemd support])
> +	AX_SYSTEMD_OPTIONS()
> +])
> +
> +AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
> +	AC_CHECK_HEADER([systemd/sd-daemon.h], [
> +	    AC_CHECK_LIB([systemd-daemon], [sd_listen_fds], [libsystemddaemon="y"])
> +	])
> +	AS_IF([test "x$libsystemddaemon" = x], [
> +	    AC_MSG_ERROR([Unable to find a suitable libsystemd-daemon library])
> +	])
> +
> +	PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon])
> +	dnl pkg-config older than 0.24 does not set these for
> +	dnl PKG_CHECK_MODULES() worth also noting is that as of version 208
> +	dnl of systemd pkg-config --cflags currently yields no extra flags yet.
> +	AC_SUBST([SYSTEMD_CFLAGS])
> +	AC_SUBST([SYSTEMD_LIBS])
> +
> +	AS_IF([test "x$SYSTEMD_DIR" = x], [
> +	    dnl In order to use the line below we need to fix upstream systemd
> +	    dnl to properly ${prefix} for child variables in
> +	    dnl src/core/systemd.pc.in but this is a bit complex at the
> +	    dnl moment as they depend on another rootprefix, which can vary
> +	    dnl from prefix in practice. We provide our own definition as we
> +	    dnl *know* where systemd will dump this to, but this does limit
> +	    dnl us to stick to a non custom systemdsystemunitdir, dnl to work
> +	    dnl around this we provide the additional configure option
> +	    dnl --with-systemd where you can specify the directory for the unit
> +	    dnl files. It would also be best to just extend the upstream
> +	    dnl pkg-config  pkg.m4 with an AC_DEFUN() to do this neatly.
> +	    dnl SYSTEMD_DIR="`$PKG_CONFIG --define-variable=prefix=$PREFIX --variable=systemdsystemunitdir systemd`"
> +	    SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
> +	], [])
> +
> +	AS_IF([test "x$SYSTEMD_DIR" = x], [
> +	    AC_MSG_ERROR([SYSTEMD_DIR is unset])
> +	], [])
> +
> +	dnl There is no variable for this yet for some reason
> +	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
> +	    SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
> +	], [])
> +
> +	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
> +	    AC_MSG_ERROR([SYSTEMD_MODULES_LOAD is unset])
> +	], [])
> +])
> +
> +AC_DEFUN([AX_CHECK_SYSTEMD], [
> +	AS_IF([test "x$systemd" = "xy" ], [
> +	    AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and enabled])
> +	    systemd=y
> +	    AX_CHECK_SYSTEMD_LIBS()
> +	],[systemd=n])
> +])
> +
> +AC_DEFUN([AX_ENABLE_SYSTEMD], [
> +	AX_ENABLE_SYSTEMD_OPTS()
> +	AX_CHECK_SYSTEMD()
> +])
> +
> +AC_DEFUN([AX_ALLOW_SYSTEMD], [
> +	AX_ALLOW_SYSTEMD_OPTS()
> +	AX_CHECK_SYSTEMD()
> +])
> diff --git a/tools/configure.ac b/tools/configure.ac
> index 8a8831f..24d1109 100644
> --- a/tools/configure.ac
> +++ b/tools/configure.ac
> @@ -58,6 +58,7 @@ m4_include([../m4/extfs.m4])
>  m4_include([../m4/fetcher.m4])
>  m4_include([../m4/ax_compare_version.m4])
>  m4_include([../m4/expand_config.m4])
> +m4_include([../m4/systemd.m4])
>  
>  AX_XEN_EXPAND_CONFIG()
>  
> @@ -261,5 +262,7 @@ esac
>  # Checks for header files.
>  AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
>  
> +dnl Once and if systemd is prevalent we can just use AX_ENABLE_SYSTEMD()
> +AX_ALLOW_SYSTEMD()

Shouldn't systemd init scripts be installed by default if systemd is
detect on the host?

Or are there cases of distros that install systemd but don't use it?

If I'm understanding this right, the user has to always pass
--enable-systemd in order to get systemd init scripts installed.

>  AC_OUTPUT()
>  
> diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
> index 4a63f40..45fd840 100644
> --- a/tools/hotplug/common/Makefile
> +++ b/tools/hotplug/common/Makefile
> @@ -1,5 +1,6 @@
>  XEN_ROOT = $(CURDIR)/../../..
>  include $(XEN_ROOT)/tools/Rules.mk
> +include $(XEN_ROOT)/config/Tools.mk

tools/Rules.mk already includes config/Tools.mk

>  
>  HOTPLUGPATH="hotplugpath.sh"
>  
> diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
> index 382a813..068e04a 100644
> --- a/tools/ocaml/xenstored/Makefile
> +++ b/tools/ocaml/xenstored/Makefile
> @@ -3,6 +3,11 @@ OCAML_TOPLEVEL = $(CURDIR)/..
>  include $(OCAML_TOPLEVEL)/common.make
>  
>  CFLAGS += -I$(XEN_ROOT)/tools/
> +CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
> +LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
> +
> +CFLAGS  += $(CFLAGS-y)
> +LDFLAGS += $(LDFLAGS-y)
>  
>  OCAMLINCLUDE += \
>  	-I $(OCAML_TOPLEVEL)/libs/xb \
> diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
> index 21a3f11..6adac7f 100644
> --- a/tools/xenstore/Makefile
> +++ b/tools/xenstore/Makefile
> @@ -9,6 +9,12 @@ CFLAGS += -I.
>  CFLAGS += -I$(XEN_ROOT)/tools/
>  CFLAGS += $(CFLAGS_libxenctrl)
>  
> +CFLAGS-$(CONFIG_SYSTEMD)  += $(SYSTEMD_CFLAGS)
> +LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_LIBS)
> +
> +CFLAGS  += $(CFLAGS-y)
> +LDFLAGS += $(LDFLAGS-y)
> +
>  CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
>  CLIENTS += xenstore-write xenstore-ls xenstore-watch
>  
> 


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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-05-07 16:21     ` Ian Campbell
@ 2014-05-07 16:44       ` Roger Pau Monné
  2014-05-07 18:28         ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Roger Pau Monné @ 2014-05-07 16:44 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, Luis R. Rodriguez, Tim Deegan, Luis R. Rodriguez,
	Ian Jackson, Jan Beulich, xen-devel

On 07/05/14 18:21, Ian Campbell wrote:
> On Wed, 2014-05-07 at 18:12 +0200, Roger Pau Monné wrote:
>> On 30/04/14 03:12, Luis R. Rodriguez wrote:
>>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>>
>>> With some new functionality introduced we can't keep around the old cache.
>>>
>>> Cc: Ian Campbell <ian.campbell@citrix.com>
>>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
>>> Cc: Jan Beulich <jbeulich@suse.com>
>>> Cc: Keir Fraser <keir@xen.org>
>>> Cc: Tim Deegan <tim@xen.org>
>>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
>>> ---
>>>  autogen.sh | 8 ++++----
>>>  1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/autogen.sh b/autogen.sh
>>> index b5c9688..2be8360 100755
>>> --- a/autogen.sh
>>> +++ b/autogen.sh
>>> @@ -1,12 +1,12 @@
>>>  #!/bin/sh -e
>>> -autoconf
>>> +autoconf -f
>>>  ( cd tools
>>> -  autoconf
>>> +  autoconf -f
>>>    autoheader
>>>  )
>>>  ( cd stubdom
>>> -  autoconf
>>> +  autoconf -f
>>>  )
>>>  ( cd docs
>>> -  autoconf
>>> +  autoconf -f
>>>  )
>>
>> Not that is that important, but why do you need to force the regen of
>> all files? I expect autoconf should be able to detect which files need
>> rebuilding.
> 
> I've observed it not doing so, when I thought it should, I never figured
> out why and/or if I was mistaken though

I have not seen this myself, but if it's the case (and provided that the
commit message is reworded to reflect this):

Acked-by: Roger Pau Monné <roger.pau@citrix.com>


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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-05-07 16:44       ` Roger Pau Monné
@ 2014-05-07 18:28         ` Luis R. Rodriguez
  2014-05-12 14:00           ` Ian Jackson
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-07 18:28 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Keir Fraser, Ian Campbell, Luis R. Rodriguez, Tim Deegan,
	Ian Jackson, Jan Beulich, xen-devel

On Wed, May 07, 2014 at 06:44:25PM +0200, Roger Pau Monné wrote:
> On 07/05/14 18:21, Ian Campbell wrote:
> > On Wed, 2014-05-07 at 18:12 +0200, Roger Pau Monné wrote:
> >> On 30/04/14 03:12, Luis R. Rodriguez wrote:
> >>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> >>>
> >>> With some new functionality introduced we can't keep around the old cache.
> >>>
> >>> Cc: Ian Campbell <ian.campbell@citrix.com>
> >>> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> >>> Cc: Jan Beulich <jbeulich@suse.com>
> >>> Cc: Keir Fraser <keir@xen.org>
> >>> Cc: Tim Deegan <tim@xen.org>
> >>> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> >>> ---
> >>>  autogen.sh | 8 ++++----
> >>>  1 file changed, 4 insertions(+), 4 deletions(-)
> >>>
> >>> diff --git a/autogen.sh b/autogen.sh
> >>> index b5c9688..2be8360 100755
> >>> --- a/autogen.sh
> >>> +++ b/autogen.sh
> >>> @@ -1,12 +1,12 @@
> >>>  #!/bin/sh -e
> >>> -autoconf
> >>> +autoconf -f
> >>>  ( cd tools
> >>> -  autoconf
> >>> +  autoconf -f
> >>>    autoheader
> >>>  )
> >>>  ( cd stubdom
> >>> -  autoconf
> >>> +  autoconf -f
> >>>  )
> >>>  ( cd docs
> >>> -  autoconf
> >>> +  autoconf -f
> >>>  )
> >>
> >> Not that is that important, but why do you need to force the regen of
> >> all files? I expect autoconf should be able to detect which files need
> >> rebuilding.
> > 
> > I've observed it not doing so, when I thought it should, I never figured
> > out why and/or if I was mistaken though
> 
> I have not seen this myself, but if it's the case (and provided that the
> commit message is reworded to reflect this):
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

I spotted what I think is a bug on autoconf where I observed inconsistent
behaviour when you touch a file, sometimes it yielded the results you wanted,
sometimes it did not, in the end I got close to linking the issue to the cache
somehow, but before I dove myself deeper into autoconf I found a force prevents
this issue which let me conserve some of the remaining sanity I have left. I'll
follow up with upstream autoconf on this eventually but figured providing
all the glory details on this on the commit log was not worth it. I'll respin
and add all the glory details.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh
  2014-05-07 15:47   ` Ian Campbell
@ 2014-05-07 18:34     ` Luis R. Rodriguez
  2014-05-08  8:42       ` Ian Campbell
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-07 18:34 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Wed, May 07, 2014 at 04:47:53PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > Now that all the series of autoconf updates have gone in trigger
> > an updates so that downstream users don't have to run autogen.sh.
> 
> Please do this bit by bit as you update the sources and include a note
> for the committer to rerun autogen.sh. (up to you if you want to also
> include the regeneration in the patch, but it is usually less bulky to
> not do so)

To be clear you don't need the generation yourself, but instead will
do it yourself? If so then yeah that'd be great, this output is a
waste of bytes IMHO and just clutters the mailing list.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh
  2014-05-07 18:34     ` Luis R. Rodriguez
@ 2014-05-08  8:42       ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-08  8:42 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Wed, 2014-05-07 at 20:34 +0200, Luis R. Rodriguez wrote:
> On Wed, May 07, 2014 at 04:47:53PM +0100, Ian Campbell wrote:
> > On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> > > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > > 
> > > Now that all the series of autoconf updates have gone in trigger
> > > an updates so that downstream users don't have to run autogen.sh.
> > 
> > Please do this bit by bit as you update the sources and include a note
> > for the committer to rerun autogen.sh. (up to you if you want to also
> > include the regeneration in the patch, but it is usually less bulky to
> > not do so)
> 
> To be clear you don't need the generation yourself, but instead will
> do it yourself?

Yes I can regenerate while committing. Please note in each patch where
this needs to be done, after the commit message and --- marker, e.g. as
Roger did in
http://article.gmane.org/gmane.comp.emulators.xen.devel/195900

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 00/15] xen: add systemd support
  2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
                   ` (15 preceding siblings ...)
  2014-04-30  1:15 ` [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
@ 2014-05-08 11:28 ` Anthony PERARD
  2014-05-15  2:12   ` Luis R. Rodriguez
  2014-05-15  6:14   ` Luis R. Rodriguez
  16 siblings, 2 replies; 84+ messages in thread
From: Anthony PERARD @ 2014-05-08 11:28 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel, Luis R. Rodriguez

On Tue, Apr 29, 2014 at 06:11:53PM -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@suse.com>
> 
> This is my 4th series which I addresses all feedback from the
> first 3 series on adding systemd support into xen. I've taken
> things a bit further, I've been avoiding autoconf but in the end
> that proved to provide the best solution. Additionally not
> originally understanding systemd's socket stuff prompted me to
> look into that and decided its best to just switch to active sockets
> for systemd [0] intregration for both censtored and oxenstored. I've
> also decided its best to avoid separate service files for the
> two daemons given that we can do this cleanly with autoconf.
> 
> I've run time tested this against today's tip against the
> upstream kernel, on OpenSUSE using both censtored and oxenstored.
> 
> To build you can use either of with the default preferring
> oxenstored if ocaml tools are present:
> 
> ./configure --with-xenstored=cxenstored --enable-systemd
> ./configure --with-xenstored=oxenstored --enable-systemd
> 
> Systems should just have to:
> 
> systemctl enable xenstored.socket
> 
> And then anything that will tickle the sockets:
> 
> /var/run/xenstored/socket
> /var/run/xenstored/socket_ro
> 
> will trigger either censtored or oxenstored to activate. This
> example suffices:
> 
> nc -U /var/run/xenstored/socket_ro
> 
> This example also happens to test the order of supply / demand
> of sockets through sytsemd's active socket mechanism and our
> integration to do this in order. Sine we cannot currently stop
> the xenstore this means we cannot take advantage of dynamically
> switching xensrores live, but if that is fixed we should be able
> to dynamically swap even the different types of xenstore on a
> live system or just upgrade the xenstore without a reboot.
> 
> The ordering of active sockets implementation is begging to be
> shared with a common small library but given that xc / xl are
> not specific to the xenstore it would be pointless to stuff and
> duplicate code for both in there. Both the cxenstore and oxenstored
> handle their own store access on their own, if there's a desire to
> unify that small piece of code we should consider other things to
> stuff on it. For now this goes separately.
> 
> Systemd autconf support was split out as much as possible from
> xen to make it useful for any other project, perhaps this can
> go upstream to systemd.
> 
> Ocaml lacks support for systemd and as such I needed to extend
> oxenstored support through a small stub for access to systemd.
> System'd sd_listen_fds() can technically easily be implemented
> in ocaml *but* given that FD_CLOEXEC support through the new
> Unix.set_cloexec is only available on 4.00.1+dev which isn't
> yet widely available I decided agianst this, this lets
> systemd take care of FD_CLOEXEC for us. Proper support for
> systemd should instead in the end be merged upstream into
> ocaml, but who knows when that will happen.
> 
> Given the slew of autoconf updates to xen I only provide an
> autogen.sh update after the last change to make things easier
> to review.
> 
> [0] http://0pointer.de/blog/projects/socket-activation2.html
> [1] http://caml.inria.fr/mantis/view.php?id=5569

Hi,

I gave a try to this patch series, the "./configure; make install" and
the systemd services.


A) First, what when wrong during make install:

When I do `./configure --prefix=/usr`, `make install` will put libs into
/usr/local/lib ... (full list at the bottom of the mail, to help debug).
Also, it would be nice if the --sbindir configure option was working.


B) Next, xenstored.socket:

I install xen, activate the socket, reboot the machine, and:
$ xl info
xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
libxl: error: libxl.c:99:libxl_ctx_alloc: cannot open libxc handle: No such file or directory
cannot init xl context

So I tried `nc -U /var/run/xenstored/socket_ro`, but it appear that
/var/lib/xenstored those not mount because of an empty context= option.
Once the context= options have been removed, xenstored is finaly started.

Then, `xl create hvm_guest`. This does not return ...
I think qemu is not happy about xenstore, this is what I get from a `xl
-vvv create hvm_guest`:
libxl: debug: libxl_event.c:570:libxl__ev_xswatch_register: watch w=0x127b9a8 wpath=/local/domain/0/device-model/3/state token=3/0: register slotnum=3
libxl: debug: libxl_create.c:1370:do_domain_create: ao 0x127ce90: inprogress: poller=0x127c5e0, flags=i
libxl: debug: libxl_event.c:514:watchfd_callback: watch w=0x127b9a8 wpath=/local/domain/0/device-model/3/state token=3/0: event epath=/local/domain/0/device-model/3/state
(qemu is running)
Actually, dmesg said that both xl and qemu-system-i386 proccess are
blocked. I suppose qemu is not able to access xenstore.


That is from me for now.

Regards,




usr/local/lib
usr/local/lib/fs
usr/local/lib/fs/ext2fs-lib
usr/local/lib/fs/ext2fs-lib/fsimage.so
usr/local/lib/fs/fat
usr/local/lib/fs/fat/fsimage.so
usr/local/lib/fs/iso9660
usr/local/lib/fs/iso9660/fsimage.so
usr/local/lib/fs/reiserfs
usr/local/lib/fs/reiserfs/fsimage.so
usr/local/lib/fs/ufs
usr/local/lib/fs/ufs/fsimage.so
usr/local/lib/fs/xfs
usr/local/lib/fs/xfs/fsimage.so
usr/local/lib/fs/zfs
usr/local/lib/fs/zfs/fsimage.so
usr/local/lib/libblktapctl.so -> libblktapctl.so.1.0
usr/local/lib/libblktapctl.so.1.0 -> libblktapctl.so.1.0.0
usr/local/lib/libblktapctl.so.1.0.0
usr/local/lib/libfsimage.so -> libfsimage.so.1.0
usr/local/lib/libfsimage.so.1.0 -> libfsimage.so.1.0.0
usr/local/lib/libfsimage.so.1.0.0
usr/local/lib/libvhd.so -> libvhd.so.1.0
usr/local/lib/libvhd.so.1.0 -> libvhd.so.1.0.0
usr/local/lib/libvhd.so.1.0.0
usr/local/lib/libxenctrl.so -> libxenctrl.so.4.4
usr/local/lib/libxenctrl.so.4.4 -> libxenctrl.so.4.4.0
usr/local/lib/libxenctrl.so.4.4.0
usr/local/lib/libxenguest.so -> libxenguest.so.4.4
usr/local/lib/libxenguest.so.4.4 -> libxenguest.so.4.4.0
usr/local/lib/libxenguest.so.4.4.0
usr/local/lib/libxenlight.so -> libxenlight.so.4.4
usr/local/lib/libxenlight.so.4.4 -> libxenlight.so.4.4.0
usr/local/lib/libxenlight.so.4.4.0
usr/local/lib/libxenstat.so -> libxenstat.so.0
usr/local/lib/libxenstat.so.0 -> libxenstat.so.0.0
usr/local/lib/libxenstat.so.0.0
usr/local/lib/libxenstore.so -> libxenstore.so.3.0
usr/local/lib/libxenstore.so.3.0 -> libxenstore.so.3.0.3
usr/local/lib/libxenstore.so.3.0.3
usr/local/lib/libxenvchan.so -> libxenvchan.so.1.0
usr/local/lib/libxenvchan.so.1.0 -> libxenvchan.so.1.0.0
usr/local/lib/libxenvchan.so.1.0.0
usr/local/lib/libxlutil.so -> libxlutil.so.4.3
usr/local/lib/libxlutil.so.4.3 -> libxlutil.so.4.3.0
usr/local/lib/libxlutil.so.4.3.0
usr/local/lib/xen
usr/local/lib/xen/bin
usr/local/lib/xen/bin/libxl-save-helper
usr/local/lib/xen/bin/lsevtchn
usr/local/lib/xen/bin/pygrub
usr/local/lib/xen/bin/readnotes
usr/local/lib/xen/bin/xenconsole
usr/local/lib/xen/bin/xenctx
usr/local/lib/xen/bin/xenpvnetboot

-- 
Anthony PERARD

^ permalink raw reply	[flat|nested] 84+ messages in thread

* [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
  2014-05-07 15:03   ` Ian Campbell
@ 2014-05-12 13:50   ` Ian Jackson
  2014-05-12 14:18     ` Ian Campbell
  1 sibling, 1 reply; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 13:50 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Jacek Konieczny, M A Young, xen-devel

Luis R. Rodriguez writes ("[PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
> This adds support for a customizable retry limit on trying to open
> the xenstored unix domain socket, each retry is separated by 1 second.
> This should allow us to simplify both our LSB init scripts. For systemd
> we'll use socket activation.

I'm afraid I fundamentally disagree with this timeout/polling based
approach.  Why is it necessary ?

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
                     ` (2 preceding siblings ...)
  2014-05-07 15:20   ` Ian Campbell
@ 2014-05-12 13:57   ` Ian Jackson
  2014-05-12 18:11     ` Luis R. Rodriguez
  3 siblings, 1 reply; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 13:57 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: David Scott, Stefano Stabellini, Luis R. Rodriguez,
	Vincent Hanquez, xen-devel, Ian Campbell

Luis R. Rodriguez writes ("[PATCH v4 05/15] oxenstored: add support for systemd active sockets"):
...
> +/* Conforms to what we should send sd_is_socket_unix() */
> +struct xen_systemd_active_socket {
> +	int fd;
> +	int type;
> +	int listening;
> +	const char *path;
> +	size_t length;
> +};

This is quite a lot of extraneous stuff, AFAICT.  For example, we
always set listening to 0.

Why is this array not const ?

> +/*
> + * We list stdin, stdout and stderr simply for documentation purposes
> + * and to help our array size fit the number of expected sockets we
> + * as sd_listen_fds() will return 5 for example if you set the socket
> + * service with 2 sockets.
> + */

This doesn't seem very convincing to me.

> +CAMLprim value ocaml_sd_listen_fds(value connect_to)
> +{
> +	CAMLparam1(connect_to);
> +	CAMLlocal1(sock_ret);
> +	int n, r;
> +	struct xen_systemd_active_socket *active_socket;
> +
> +	active_socket = get_xen_active_socket((const char *) String_val(connect_to));
> +	if (!active_socket)
> +		caml_failwith("ocaml_sd_listen_fds() got invalid request");

The sole purpose of this is to convert the string to an entry in the
the table ?  I.e., essentially, just the table index ?

> +/*
> + * If xenstored was built to depend on systemd libraries
> + * we assume you want all the bells and whistles with
> + * systemd.
> + */

This is not correct.  A distro might want to use the same binary for
both systemd and non-systemd installations.  You need to use a runtime
test.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-05-07 18:28         ` Luis R. Rodriguez
@ 2014-05-12 14:00           ` Ian Jackson
  2014-05-12 18:14             ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 14:00 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Keir Fraser, Ian Campbell, Luis R. Rodriguez, Tim Deegan,
	Jan Beulich, xen-devel, Roger Pau Monné

Luis R. Rodriguez writes ("Re: [Xen-devel] [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf"):
> I spotted what I think is a bug on autoconf where I observed
> inconsistent behaviour when you touch a file, sometimes it yielded
> the results you wanted, sometimes it did not, in the end I got close
> to linking the issue to the cache somehow, but before I dove myself
> deeper into autoconf I found a force prevents this issue which let
> me conserve some of the remaining sanity I have left. I'll follow up
> with upstream autoconf on this eventually but figured providing all
> the glory details on this on the commit log was not worth it. I'll
> respin and add all the glory details.

What are the downsides to the -f option ?  Do they apply in our
situation ?  This needs to be discussed.

(I haven't gone and read the autoconf manual; IMO this question ought
to be answered, at least with a prima facie explanation, in the
commit message.)

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-04-30  1:12 ` [PATCH v4 13/15] systemd: add xen systemd service and module files Luis R. Rodriguez
  2014-05-07 15:46   ` Ian Campbell
@ 2014-05-12 14:11   ` Ian Jackson
  2014-05-12 14:32     ` Jacek Konieczny
  2014-05-12 18:46     ` Luis R. Rodriguez
  1 sibling, 2 replies; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 14:11 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, Jacek Konieczny, M A Young, xen-devel

Thanks for pursuing this.  I have some comments:

Luis R. Rodriguez writes ("[PATCH v4 13/15] systemd: add xen systemd service and module files"):
...
> diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
> new file mode 100644
> index 0000000..6eb61b2
> --- /dev/null
> +++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
> @@ -0,0 +1,9 @@
> +[Unit]
> +Description=Mount /proc/xen files
> +ConditionPathIsDirectory=/proc/xen
> +RefuseManualStop=true
> +
> +[Mount]
> +What=xenfs
> +Where=/proc/xen
> +Type=xenfs

Blimey.  All of this to replace one line in a shell script.

Can you explain why this needs to be broken out into a separate
systemd service ?  Could it be bundled into some script which is
already being run ?

If it can be bundled into a script somewhere, that would be better
because it avoids duplicating the information.

> diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> new file mode 100644
> index 0000000..1855719
> --- /dev/null
> +++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
> @@ -0,0 +1,22 @@
> +[Unit]
> +Description=qemu for xen dom0 disk backend
> +Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
> +After=xenstored.service xenconsoled.service
> +Before=xendomains.service libvirtd.service libvirt-guests.service
> +RefuseManualStop=true
> +ConditionPathIsDirectory=/proc/xen
...
> +ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \
> +	-xen-attach -name dom0 -nographic -M xenpv -daemonize \
> +	-monitor /dev/null -serial /dev/null -parallel /dev/null \
> +	-pidfile @XEN_RUN_DIR@/qemu-dom0.pid

IMO duplicating this command line isn't acceptable.  It is likely to
have to change in the future and there needs to be one copy of it in
the source tree.

> diff --git a/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
> new file mode 100644
> index 0000000..3fbd59b
> --- /dev/null
> +++ b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
> @@ -0,0 +1,16 @@
> +xen-evtchn
> +xen-gntdev
> +xen-gntalloc
> +xen-blkback
> +xen-netback
> +xen-pciback
> +evtchn
> +gntdev
> +netbk
> +blkbk
> +xen-scsibk
> +usbbk
> +pciback
> +xen-acpi-processor
> +blktap2
> +blktap

This duplicates the list of modules from one of the init scripts.
Again, I think we need a common list.

(In theory we shouldn't need manual module loading, but it seems that
failure to load module bugs continue to exist in Linux.)

> diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
> +[Service]
> +Type=simple
> +Environment=XENCONSOLED_ARGS=
> +Environment=XENCONSOLED_LOG=none
> +Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
> +EnvironmentFile=-/etc/default/xenconsoled
> +EnvironmentFile=-/etc/sysconfig/xenconsoled
> +PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
> +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
> +ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@> +ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS

This should use a non-forking startup protocol, rather than pid files.

> diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
> new file mode 100644
> index 0000000..f64dfa1
> --- /dev/null
> +++ b/tools/hotplug/Linux/systemd/xenstored.service.in
> @@ -0,0 +1,25 @@
> +[Unit]
> +Description=Xenstored - daemon managing xenstore file system

xenstore isn't a file system.  The /var/run area it uses is just
something it needs for its private data.

> diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
> +[Socket]
> +ListenStream=/var/run/xenstored/socket
> +ListenStream=/var/run/xenstored/socket_ro

AIUI the systemd socket activation protocol requires the systemd
config and the daemon code/configuration to correspond.

There should be a comment explaining where the corresponding
configuration in xenstored is (ie referring to the code in both
daemons listing the sockets).

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-05-12 13:50   ` Ian Jackson
@ 2014-05-12 14:18     ` Ian Campbell
  2014-05-12 14:40       ` Jacek Konieczny
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-12 14:18 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Mon, 2014-05-12 at 14:50 +0100, Ian Jackson wrote:
> Luis R. Rodriguez writes ("[PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
> > This adds support for a customizable retry limit on trying to open
> > the xenstored unix domain socket, each retry is separated by 1 second.
> > This should allow us to simplify both our LSB init scripts. For systemd
> > we'll use socket activation.
> 
> I'm afraid I fundamentally disagree with this timeout/polling based
> approach.

It already exists, all the first two patches in this series are doing is
moving it from /etc/init.d/xencommons into the client utility.

>   Why is it necessary ?

If xenstored has failed to start for some reason then the xenstore-write
in the initscript would potentially block forever without a timeout.

As for the retry -- I suppose xenstored forks before it is really ready?

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-12 14:11   ` Ian Jackson
@ 2014-05-12 14:32     ` Jacek Konieczny
  2014-05-12 15:36       ` Ian Jackson
  2014-05-12 18:46     ` Luis R. Rodriguez
  1 sibling, 1 reply; 84+ messages in thread
From: Jacek Konieczny @ 2014-05-12 14:32 UTC (permalink / raw)
  To: Ian Jackson, Luis R. Rodriguez
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, M A Young, xen-devel

On 05/12/14 16:11, Ian Jackson wrote:
> Thanks for pursuing this.  I have some comments:
> 
> Luis R. Rodriguez writes ("[PATCH v4 13/15] systemd: add xen systemd service and module files"):
> ...
>> diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
>> new file mode 100644
>> index 0000000..6eb61b2
>> --- /dev/null
>> +++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
>> @@ -0,0 +1,9 @@
>> +[Unit]
>> +Description=Mount /proc/xen files
>> +ConditionPathIsDirectory=/proc/xen
>> +RefuseManualStop=true
>> +
>> +[Mount]
>> +What=xenfs
>> +Where=/proc/xen
>> +Type=xenfs
> 
> Blimey.  All of this to replace one line in a shell script.
> 
> Can you explain why this needs to be broken out into a separate
> systemd service ?

Because that is how mount points are configured in systemd.

One could drop /etc/fstab all together and use a shell script to mount
every file system. Would that be better?

In fact mounting /proc/xen from within a script instead of using fstab
entry is hack required because /etc/fstab cannot be reliably updated on
Xen install or activation.

The systemd mount units seem verbose, but they contain not much more
than an /etc/fstab line and allow more flexibility (conditions and
ordering).

> Could it be bundled into some script which is already being run ?

No. Scripts are bad way for configuring mounts. Doing it in the script
is the necessary evil in systems without drop-in configuration like
systemd provides.

>> diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
>> +[Service]
>> +Type=simple
>> +Environment=XENCONSOLED_ARGS=
>> +Environment=XENCONSOLED_LOG=none
>> +Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
>> +EnvironmentFile=-/etc/default/xenconsoled
>> +EnvironmentFile=-/etc/sysconfig/xenconsoled
>> +PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
>> +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
>> +ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@> +ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
> 
> This should use a non-forking startup protocol, rather than pid files.

I would say more: it seems weird to use both 'Type=simple' and
'PIDFile=' – PIDFile seems unnecessary here. sd_notify support
(Type=notify) would be the best option here, but it must be implemented
in the daemon.

> xenstore isn't a file system.  The /var/run area it uses is just
> something it needs for its private data.
> 
>> diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
>> +[Socket]
>> +ListenStream=/var/run/xenstored/socket
>> +ListenStream=/var/run/xenstored/socket_ro
> 
> AIUI the systemd socket activation protocol requires the systemd
> config and the daemon code/configuration to correspond.

The daemon may have no own configuration when the systemd-provided
sockets are used – the daemon does not need to know the paths, just that
the first socked is read-write, and the other is read-only.

> There should be a comment explaining where the corresponding
> configuration in xenstored is (ie referring to the code in both
> daemons listing the sockets).

Comment about the expected sockets would not hurt, I guess.

Jacek

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-05-12 14:18     ` Ian Campbell
@ 2014-05-12 14:40       ` Jacek Konieczny
  2014-05-12 15:37         ` Ian Jackson
  0 siblings, 1 reply; 84+ messages in thread
From: Jacek Konieczny @ 2014-05-12 14:40 UTC (permalink / raw)
  To: Ian Campbell, Ian Jackson
  Cc: Stefano Stabellini, Luis R. Rodriguez, Jan Rękorajski,
	M A Young, xen-devel, Luis R. Rodriguez

On 05/12/14 16:18, Ian Campbell wrote:
> On Mon, 2014-05-12 at 14:50 +0100, Ian Jackson wrote:
>> Luis R. Rodriguez writes ("[PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
>>> This adds support for a customizable retry limit on trying to open
>>> the xenstored unix domain socket, each retry is separated by 1 second.
>>> This should allow us to simplify both our LSB init scripts. For systemd
>>> we'll use socket activation.
>>
>> I'm afraid I fundamentally disagree with this timeout/polling based
>> approach.
>
> As for the retry -- I suppose xenstored forks before it is really ready?

I guess this should be fixed in xenstored instead of hacking
work-arounds in the client. When daemon start succeeds then the socket
should be available and working. If it failed, no retry will help. If
the daemon is still starting although the start command exited – than
this sounds like a bug.

Jacek

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-12 14:32     ` Jacek Konieczny
@ 2014-05-12 15:36       ` Ian Jackson
  2014-05-12 18:55         ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 15:36 UTC (permalink / raw)
  To: Jacek Konieczny
  Cc: Jan Rękorajski, Ian Campbell, Stefano Stabellini,
	Luis R. Rodriguez, Luis R. Rodriguez, Ian Jackson, M A Young,
	xen-devel

Jacek Konieczny writes ("Re: [PATCH v4 13/15] systemd: add xen systemd service and module files"):
> On 05/12/14 16:11, Ian Jackson wrote:
> > Blimey.  All of this to replace one line in a shell script.
> > 
> > Can you explain why this needs to be broken out into a separate
> > systemd service ?
> 
> Because that is how mount points are configured in systemd.
> 
> One could drop /etc/fstab all together and use a shell script to mount
> every file system. Would that be better?
> 
> In fact mounting /proc/xen from within a script instead of using fstab
> entry is hack required because /etc/fstab cannot be reliably updated on
> Xen install or activation.

Arguably, yes.

> The systemd mount units seem verbose, but they contain not much more
> than an /etc/fstab line and allow more flexibility (conditions and
> ordering).

My question was whether the same ordering and conditionality could be
left in an existing script without causing bugs.  That would be
preferable IMO.

> > Could it be bundled into some script which is already being run ?
> 
> No. Scripts are bad way for configuring mounts. Doing it in the script
> is the necessary evil in systems without drop-in configuration like
> systemd provides.

I'm afraid that this isn't a reason, it's just an assertion.

> > This should use a non-forking startup protocol, rather than pid files.
> 
> I would say more: it seems weird to use both 'Type=simple' and
> 'PIDFile=' – PIDFile seems unnecessary here. sd_notify support
> (Type=notify) would be the best option here, but it must be implemented
> in the daemon.

I would not object to sd_notify support.

> > xenstore isn't a file system.  The /var/run area it uses is just
> > something it needs for its private data.
> > 
> >> diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
> >> +[Socket]
> >> +ListenStream=/var/run/xenstored/socket
> >> +ListenStream=/var/run/xenstored/socket_ro
> > 
> > AIUI the systemd socket activation protocol requires the systemd
> > config and the daemon code/configuration to correspond.
> 
> The daemon may have no own configuration when the systemd-provided
> sockets are used – the daemon does not need to know the paths, just that
> the first socked is read-write, and the other is read-only.

Indeed.  But that information is spread in multiple places and I think
it should be written down clearly.

And where that's helpful these multiple places should refer to each
other.  Finding the systemd config given the code will be
straightforward.  The other way around is less clear - particularly
given that there are two xenstored implementations and a change to
this startup arrangement might involve changing both.

> > There should be a comment explaining where the corresponding
> > configuration in xenstored is (ie referring to the code in both
> > daemons listing the sockets).
> 
> Comment about the expected sockets would not hurt, I guess.

Right, and a reference to the places in the code where it's
implemented.

Thanks,
Ian.

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-05-12 14:40       ` Jacek Konieczny
@ 2014-05-12 15:37         ` Ian Jackson
  2014-05-12 18:59           ` Luis R. Rodriguez
  2014-05-13 21:33           ` Luis R. Rodriguez
  0 siblings, 2 replies; 84+ messages in thread
From: Ian Jackson @ 2014-05-12 15:37 UTC (permalink / raw)
  To: Jacek Konieczny
  Cc: Ian Campbell, Stefano Stabellini, Luis R. Rodriguez,
	Jan Rękorajski, M A Young, xen-devel, Luis R. Rodriguez

Jacek Konieczny writes ("Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
> On 05/12/14 16:18, Ian Campbell wrote:
> > On Mon, 2014-05-12 at 14:50 +0100, Ian Jackson wrote:
> >> I'm afraid I fundamentally disagree with this timeout/polling based
> >> approach.
> >
> > As for the retry -- I suppose xenstored forks before it is really ready?
> 
> I guess this should be fixed in xenstored instead of hacking
> work-arounds in the client. When daemon start succeeds then the socket
> should be available and working. If it failed, no retry will help. If
> the daemon is still starting although the start command exited – than
> this sounds like a bug.

Right.

I think moving this retry from a shell script into the client code is
going in the wrong direction.

Thanks,
Ian.

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-05-12 13:57   ` Ian Jackson
@ 2014-05-12 18:11     ` Luis R. Rodriguez
  2014-05-13  8:53       ` Ian Campbell
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:11 UTC (permalink / raw)
  To: Ian Jackson
  Cc: xen-devel, Ian Campbell, Vincent Hanquez, David Scott,
	Stefano Stabellini

On Mon, May 12, 2014 at 6:57 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Luis R. Rodriguez writes ("[PATCH v4 05/15] oxenstored: add support for systemd active sockets"):
> ...
>> +/* Conforms to what we should send sd_is_socket_unix() */
>> +struct xen_systemd_active_socket {
>> +     int fd;
>> +     int type;
>> +     int listening;
>> +     const char *path;
>> +     size_t length;
>> +};
>
> This is quite a lot of extraneous stuff, AFAICT.  For example, we
> always set listening to 0.
>
> Why is this array not const ?

Its set to 0 as this is and only should be used for the different
xenstores for initialization, I have a some fixes and optimizations
for this where I ended up sharing most of this code into a library
that can be used by cenxstored and oxenstored, will send it out soon.

I'll make the entire thing const.

>> +/*
>> + * We list stdin, stdout and stderr simply for documentation purposes
>> + * and to help our array size fit the number of expected sockets we
>> + * as sd_listen_fds() will return 5 for example if you set the socket
>> + * service with 2 sockets.
>> + */
>
> This doesn't seem very convincing to me.

Not sure what you mean, this is describing the logic used by systemd +
the order in which systemd gets our declared sockets to help keep
order once we ask for them.

>> +CAMLprim value ocaml_sd_listen_fds(value connect_to)
>> +{
>> +     CAMLparam1(connect_to);
>> +     CAMLlocal1(sock_ret);
>> +     int n, r;
>> +     struct xen_systemd_active_socket *active_socket;
>> +
>> +     active_socket = get_xen_active_socket((const char *) String_val(connect_to));
>> +     if (!active_socket)
>> +             caml_failwith("ocaml_sd_listen_fds() got invalid request");
>
> The sole purpose of this is to convert the string to an entry in the
> the table ?  I.e., essentially, just the table index ?

A few things actually:

  1. Used to that the path is expected by the program / systemd
  2. Lets then tell systemd we are ready for that socket
  3. Verification of the integrity of the socket as we expected it to be set up
  4. Verification that we only get from systemd the number of sockets expected

>> +/*
>> + * If xenstored was built to depend on systemd libraries
>> + * we assume you want all the bells and whistles with
>> + * systemd.
>> + */
>
> This is not correct.  A distro might want to use the same binary for
> both systemd and non-systemd installations.  You need to use a runtime
> test.

Will give dynamic checking a try in my new series.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf
  2014-05-12 14:00           ` Ian Jackson
@ 2014-05-12 18:14             ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:14 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Keir Fraser, Ian Campbell, Tim Deegan, Jan Beulich, xen-devel,
	Roger Pau Monné

On Mon, May 12, 2014 at 7:00 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Luis R. Rodriguez writes ("Re: [Xen-devel] [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf"):
>> I spotted what I think is a bug on autoconf where I observed
>> inconsistent behaviour when you touch a file, sometimes it yielded
>> the results you wanted, sometimes it did not, in the end I got close
>> to linking the issue to the cache somehow, but before I dove myself
>> deeper into autoconf I found a force prevents this issue which let
>> me conserve some of the remaining sanity I have left. I'll follow up
>> with upstream autoconf on this eventually but figured providing all
>> the glory details on this on the commit log was not worth it. I'll
>> respin and add all the glory details.
>
> What are the downsides to the -f option ?  Do they apply in our
> situation ?  This needs to be discussed.
>
> (I haven't gone and read the autoconf manual; IMO this question ought
> to be answered, at least with a prima facie explanation, in the
> commit message.)

Other projects do it all the time, the impact is just that it will
take longer, I don't think that is an issue since this is an overhead
only incurred on developers and the maintainers. I'll try to verify
the bug I had mentioned and document it on the commit log but think
its pointless to wait on autoconf to get that fixed / verified before
we move on with -f considering other projects tend to use this.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-07 15:46   ` Ian Campbell
@ 2014-05-12 18:22     ` Luis R. Rodriguez
  2014-05-13 23:28     ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:22 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel

On Wed, May 7, 2014 at 8:46 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
>>   * simplifies startup to not require polling on the sockets
>>     as initial socket management is handled by systemd, we just
>>     take on the socket later once anything pokes at it, a simple nc -U
>>     on the socket files can activate the service for example.
>
> What about xenstore users which don't use the sockets but instead use
> the kernel ring interface? Does this mean that if only those users are
> present nothing starts xenstored?

It depends on how you use the service files, what you say is true only
if the xenstored.socket is enabled:

systemctl enable xenstored.socket

If however an administrator or a Linux distribution does this:

systemctl enable xenstored.service

then the xenstored will always be guaranteed to be started regardless.
If someone wants to test active socket working they should just enable
the socket and then tickle it with nc -U to see it working, that's
all.

>>   * allow for xenstored configuration through *either* of these
>>     configuration files:
>>       - /etc/sysconfig/xenstored
>>       - /etc/default/xenstored
>>     The /etc/default/xenstored will let debian based systems do
>>     the same, while SUSE/OpenSUSE/Fedora/RedHat can keep on chugging
>>     with sysconfig
>
> Is the usual systemd way?

Yes and no. Yes in the sense that its what daemons have been using for
ages, as such existing deamons need to keep working with what they've
been used to, in order to avoid huge changes. In the long run though
at least Lennert has expressed disdain towards these two practices of
using /etc/sysconfig and /etc/default -- and calls for developers to
abandon them. You can read the full rant here:

http://0pointer.de/blog/projects/on-etc-sysinit.html

The replacement should then be to start moving towards abandoning
these, however this is a radical change and I would encourage this to
be done as a phased step rather than a requirement.

>>   * defines a modules-load.d for us
>
> Does this duplicate the existing list in the LSB initscript, meaning we
> have to keep two places up to date? Can we avoid that somehow?

Its a good idea to keep only one, will work on that as part of my next series.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-12 14:11   ` Ian Jackson
  2014-05-12 14:32     ` Jacek Konieczny
@ 2014-05-12 18:46     ` Luis R. Rodriguez
  2014-05-13  8:57       ` Ian Campbell
  1 sibling, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:46 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel

On Mon, May 12, 2014 at 7:11 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Thanks for pursuing this.  I have some comments:
>
> Luis R. Rodriguez writes ("[PATCH v4 13/15] systemd: add xen systemd service and module files"):
> ...
>> diff --git a/tools/hotplug/Linux/systemd/proc-xen.mount.in b/tools/hotplug/Linux/systemd/proc-xen.mount.in
>> new file mode 100644
>> index 0000000..6eb61b2
>> --- /dev/null
>> +++ b/tools/hotplug/Linux/systemd/proc-xen.mount.in
>> @@ -0,0 +1,9 @@
>> +[Unit]
>> +Description=Mount /proc/xen files
>> +ConditionPathIsDirectory=/proc/xen
>> +RefuseManualStop=true
>> +
>> +[Mount]
>> +What=xenfs
>> +Where=/proc/xen
>> +Type=xenfs
>
> Blimey.  All of this to replace one line in a shell script.
>
> Can you explain why this needs to be broken out into a separate
> systemd service ?  Could it be bundled into some script which is
> already being run ?

I don't see why, systemd wants to know exactly what it needs to be set
up and this is component based, mounts are one type of component,
stuffing it into a shell scripts hides an important system component.

> If it can be bundled into a script somewhere, that would be better
> because it avoids duplicating the information.

One of the objectives of systemd is to help enable a different way to
think about initializing a system and scripts don't really contribute
any component information to the system that let systemd use to help
ensure things are done efficiently. Using scripts was what got us into
the position we are in today with the legacy init, doing away with
that requires components to be split up and for logic of requirements
to be dealt with through systemd, in this case service files.

>> diff --git a/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
>> new file mode 100644
>> index 0000000..1855719
>> --- /dev/null
>> +++ b/tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in
>> @@ -0,0 +1,22 @@
>> +[Unit]
>> +Description=qemu for xen dom0 disk backend
>> +Requires=proc-xen.mount var-lib-xenstored.mount xenstored.socket
>> +After=xenstored.service xenconsoled.service
>> +Before=xendomains.service libvirtd.service libvirt-guests.service
>> +RefuseManualStop=true
>> +ConditionPathIsDirectory=/proc/xen
> ...
>> +ExecStart=@LIBEXEC@/qemu-system-i386 -xen-domid 0 \
>> +     -xen-attach -name dom0 -nographic -M xenpv -daemonize \
>> +     -monitor /dev/null -serial /dev/null -parallel /dev/null \
>> +     -pidfile @XEN_RUN_DIR@/qemu-dom0.pid
>
> IMO duplicating this command line isn't acceptable.  It is likely to
> have to change in the future and there needs to be one copy of it in
> the source tree.

Xen is already a complicated boat that tries to accommodate many
Operating Systems, supporting two different init systems for one
Operating System likely incurs a duplicate or sharing effort penalty
cost. I do agree trying to share is better for this case and will try
it out somehow in my next series.

>> diff --git a/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
>> new file mode 100644
>> index 0000000..3fbd59b
>> --- /dev/null
>> +++ b/tools/hotplug/Linux/systemd/xen.conf.modules-load.d.in
>> @@ -0,0 +1,16 @@
>> +xen-evtchn
>> +xen-gntdev
>> +xen-gntalloc
>> +xen-blkback
>> +xen-netback
>> +xen-pciback
>> +evtchn
>> +gntdev
>> +netbk
>> +blkbk
>> +xen-scsibk
>> +usbbk
>> +pciback
>> +xen-acpi-processor
>> +blktap2
>> +blktap
>
> This duplicates the list of modules from one of the init scripts.
> Again, I think we need a common list.

Sure.

> (In theory we shouldn't need manual module loading, but it seems that
> failure to load module bugs continue to exist in Linux.)

Once I'm done with systemd I'm going to jump on the kernel and would
like to know exactly which modules there is an issue for on this. Do
you have pointers?

>> diff --git a/tools/hotplug/Linux/systemd/xenconsoled.service.in b/tools/hotplug/Linux/systemd/xenconsoled.service.in
>> +[Service]
>> +Type=simple
>> +Environment=XENCONSOLED_ARGS=
>> +Environment=XENCONSOLED_LOG=none
>> +Environment=XENCONSOLED_LOG_DIR=@XEN_LOG_DIR@/console
>> +EnvironmentFile=-/etc/default/xenconsoled
>> +EnvironmentFile=-/etc/sysconfig/xenconsoled
>> +PIDFile=@XEN_RUN_DIR@/xenconsoled.pid
>> +ExecStartPre=/bin/grep -q control_d /proc/xen/capabilities
>> +ExecStartPre=/bin/mkdir -p @XEN_RUN_DIR@> +ExecStart=@SBINDIR@/xenconsoled --pid-file @XEN_RUN_DIR@/xenconsoled.pid --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS
>
> This should use a non-forking startup protocol, rather than pid files.

Not sure what you mean. Systemd already knows of the PID file, this is
just to help forward port the old behavior and expectations. Are you
providing some hints as to what you wish for systemd to do ? If so
consider any users of the PID file.

>> diff --git a/tools/hotplug/Linux/systemd/xenstored.service.in b/tools/hotplug/Linux/systemd/xenstored.service.in
>> new file mode 100644
>> index 0000000..f64dfa1
>> --- /dev/null
>> +++ b/tools/hotplug/Linux/systemd/xenstored.service.in
>> @@ -0,0 +1,25 @@
>> +[Unit]
>> +Description=Xenstored - daemon managing xenstore file system
>
> xenstore isn't a file system.  The /var/run area it uses is just
> something it needs for its private data.

Feel free to provide a better alternative description that suits
anyone's likings.

>> diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
>> +[Socket]
>> +ListenStream=/var/run/xenstored/socket
>> +ListenStream=/var/run/xenstored/socket_ro
>
> AIUI the systemd socket activation protocol requires the systemd
> config and the daemon code/configuration to correspond.
>
> There should be a comment explaining where the corresponding
> configuration in xenstored is (ie referring to the code in both
> daemons listing the sockets).

Sure that makes sense and this is pretty important information. I
consider this an area that could likely be enhanced upstream on
systemd in the future to help making this crystal clear as part of the
design of the system, but that's homework for later.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-12 15:36       ` Ian Jackson
@ 2014-05-12 18:55         ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:55 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel

On Mon, May 12, 2014 at 8:36 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Jacek Konieczny writes ("Re: [PATCH v4 13/15] systemd: add xen systemd service and module files"):
>> On 05/12/14 16:11, Ian Jackson wrote:
>> > Blimey.  All of this to replace one line in a shell script.
>> >
>> > Can you explain why this needs to be broken out into a separate
>> > systemd service ?
>>
>> Because that is how mount points are configured in systemd.
>>
>> One could drop /etc/fstab all together and use a shell script to mount
>> every file system. Would that be better?
>>
>> In fact mounting /proc/xen from within a script instead of using fstab
>> entry is hack required because /etc/fstab cannot be reliably updated on
>> Xen install or activation.
>
> Arguably, yes.
>
>> The systemd mount units seem verbose, but they contain not much more
>> than an /etc/fstab line and allow more flexibility (conditions and
>> ordering).
>
> My question was whether the same ordering and conditionality could be
> left in an existing script without causing bugs.  That would be
> preferable IMO.

Systemd provides a guarantee of dependencies being met if defined on
the unit files, which is what has been done. I'd put a bit more trust
over the unit service dependency mapping over LSB scripts.

>> > Could it be bundled into some script which is already being run ?
>>
>> No. Scripts are bad way for configuring mounts. Doing it in the script
>> is the necessary evil in systems without drop-in configuration like
>> systemd provides.
>
> I'm afraid that this isn't a reason, it's just an assertion.

Don't think about weighing service files vs scripts -- think about the
design goals that systemd is trying achieve, only then will replacing
scripts make some sort of sense.

>> > This should use a non-forking startup protocol, rather than pid files.
>>
>> I would say more: it seems weird to use both 'Type=simple' and
>> 'PIDFile=' – PIDFile seems unnecessary here. sd_notify support
>> (Type=notify) would be the best option here, but it must be implemented
>> in the daemon.
>
> I would not object to sd_notify support.

sd_notify() support is indeed reasonable but at this point I'd prefer
if we provide support for it separately as an atomic evolution, I
don't see it as a requirement.

>> > xenstore isn't a file system.  The /var/run area it uses is just
>> > something it needs for its private data.
>> >
>> >> diff --git a/tools/hotplug/Linux/systemd/xenstored.socket.in b/tools/hotplug/Linux/systemd/xenstored.socket.in
>> >> +[Socket]
>> >> +ListenStream=/var/run/xenstored/socket
>> >> +ListenStream=/var/run/xenstored/socket_ro
>> >
>> > AIUI the systemd socket activation protocol requires the systemd
>> > config and the daemon code/configuration to correspond.
>>
>> The daemon may have no own configuration when the systemd-provided
>> sockets are used – the daemon does not need to know the paths, just that
>> the first socked is read-write, and the other is read-only.
>
> Indeed.  But that information is spread in multiple places and I think
> it should be written down clearly.
>
> And where that's helpful these multiple places should refer to each
> other.  Finding the systemd config given the code will be
> straightforward.  The other way around is less clear - particularly
> given that there are two xenstored implementations and a change to
> this startup arrangement might involve changing both.

The complexity on xen is due to its wide support for different
systems, as xen grows to support two init systems for one OS this will
obviously grow, and making it a requirement to share can and should be
part of the design goals. This however should be clearly accepted then
as an overhead in terms of design, so give me a bit more time and I'll
bake something up as part of the next series.

>> > There should be a comment explaining where the corresponding
>> > configuration in xenstored is (ie referring to the code in both
>> > daemons listing the sockets).
>>
>> Comment about the expected sockets would not hurt, I guess.
>
> Right, and a reference to the places in the code where it's
> implemented.

Sure, this is crucial.

  Luis

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-05-12 15:37         ` Ian Jackson
@ 2014-05-12 18:59           ` Luis R. Rodriguez
  2014-05-13 21:33           ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 18:59 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel

On Mon, May 12, 2014 at 8:37 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> Jacek Konieczny writes ("Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
>> On 05/12/14 16:18, Ian Campbell wrote:
>> > On Mon, 2014-05-12 at 14:50 +0100, Ian Jackson wrote:
>> >> I'm afraid I fundamentally disagree with this timeout/polling based
>> >> approach.
>> >
>> > As for the retry -- I suppose xenstored forks before it is really ready?
>>
>> I guess this should be fixed in xenstored instead of hacking
>> work-arounds in the client. When daemon start succeeds then the socket
>> should be available and working. If it failed, no retry will help. If
>> the daemon is still starting although the start command exited – than
>> this sounds like a bug.
>
> Right.
>
> I think moving this retry from a shell script into the client code is
> going in the wrong direction.

At this point the retry option can not only be used for opening the
socket but for anything so its a bit different now. In terms of design
of issues specifically to opening the socket -- I believe using
systemd is actually a good step forward to move away from all this
legacy bullshit.

Either way, I'm happy to drop this patch from my series, originally I
just wanted to avoid nasty shell code and wanted to try to share code.
You guys let me know if I should drop it, for now I'll keep it in the
series.

 Luis

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-05-07 15:20   ` Ian Campbell
@ 2014-05-12 19:09     ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-12 19:09 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Vincent Hanquez, xen-devel, Ian Jackson, David Scott, Stefano Stabellini

On Wed, May 7, 2014 at 8:20 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
>
>> +/*
>> + * We list stdin, stdout and stderr simply for documentation purposes
>> + * and to help our array size fit the number of expected sockets we
>> + * as sd_listen_fds() will return 5 for example if you set the socket
>> + * service with 2 sockets.
>> + */
>
> I think my comments/simplifications made on the C version probably apply
> here.

Sure, will roll into my series.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 05/15] oxenstored: add support for systemd active sockets
  2014-05-12 18:11     ` Luis R. Rodriguez
@ 2014-05-13  8:53       ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-13  8:53 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Vincent Hanquez, xen-devel, Ian Jackson, David Scott, Stefano Stabellini

On Mon, 2014-05-12 at 11:11 -0700, Luis R. Rodriguez wrote:
> >> +CAMLprim value ocaml_sd_listen_fds(value connect_to)
> >> +{
> >> +     CAMLparam1(connect_to);
> >> +     CAMLlocal1(sock_ret);
> >> +     int n, r;
> >> +     struct xen_systemd_active_socket *active_socket;
> >> +
> >> +     active_socket = get_xen_active_socket((const char *) String_val(connect_to));
> >> +     if (!active_socket)
> >> +             caml_failwith("ocaml_sd_listen_fds() got invalid request");
> >
> > The sole purpose of this is to convert the string to an entry in the
> > the table ?  I.e., essentially, just the table index ?
> 
> A few things actually:
> 
>   1. Used to that the path is expected by the program / systemd
>   2. Lets then tell systemd we are ready for that socket
>   3. Verification of the integrity of the socket as we expected it to be set up
>   4. Verification that we only get from systemd the number of sockets expected

I think this should be refactored to be something like:

        /* NB these should also be documented somewhere... */
        #define SOCKET_ACTIVATION_RW_INDEX 3
        #define SOCKET_ACTIVATION_RO_INDEX 4
        
        static int get_handle(int ro)
        {
        	if (systemd_active())
        		return get_systemd_handle(ro ?
        			SOCKET_ACTIVATION_RO_INDEX : 
        			SOCKET_ACTIVATION_RW_INDEX);
        	else
        		return get_unix_socket_handle(ro ?
        			xs_daemon_socket_ro() :
        			xs_daemon_socket());
        }
        
That's a rough outline and subject to coding style and my not having
looked at the actual naming conventions in that file etc. I suspect the
existing get_handle() needs to be refactored into something which
get_systemd_handle(), get_unix_socket_handle() and the xs_domain_dev()
path can all use.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-12 18:46     ` Luis R. Rodriguez
@ 2014-05-13  8:57       ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-13  8:57 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel

On Mon, 2014-05-12 at 11:46 -0700, Luis R. Rodriguez wrote:
> On Mon, May 12, 2014 at 7:11 AM, Ian Jackson <Ian.Jackson@eu.citrix.com> wrote:
> > (In theory we shouldn't need manual module loading, but it seems that
> > failure to load module bugs continue to exist in Linux.)
> 
> Once I'm done with systemd I'm going to jump on the kernel and would
> like to know exactly which modules there is an issue for on this. Do
> you have pointers?

The list you have in this patch is a pretty good start.

But one thing to remember is that this needs to handle not just the
current kernel (which may have many of these bugs fixed) but also older
distro kernels which may still have them. Figuring out which is which
would be some serious archeology, and even then it's not clear what
could be done with the knowledge, perhaps annotate this list with the
oldest kernel/distro which doesn't autoload and prune as we move the
support window forward.

Also some of these drivers might suffer the same sort of issue as
loop.ko, which is that there is no obvious trigger for when to load them
i.e. there's no bus, and the old "open /dev/loop and have the driver
loaded approach no longer works since udev was introduced.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored
  2014-05-12 15:37         ` Ian Jackson
  2014-05-12 18:59           ` Luis R. Rodriguez
@ 2014-05-13 21:33           ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 21:33 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Mon, May 12, 2014 at 04:37:54PM +0100, Ian Jackson wrote:
> Jacek Konieczny writes ("Re: [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored"):
> > On 05/12/14 16:18, Ian Campbell wrote:
> > > On Mon, 2014-05-12 at 14:50 +0100, Ian Jackson wrote:
> > >> I'm afraid I fundamentally disagree with this timeout/polling based
> > >> approach.
> > >
> > > As for the retry -- I suppose xenstored forks before it is really ready?
> > 
> > I guess this should be fixed in xenstored instead of hacking
> > work-arounds in the client. When daemon start succeeds then the socket
> > should be available and working. If it failed, no retry will help. If
> > the daemon is still starting although the start command exited – than
> > this sounds like a bug.
> 
> Right.
> 
> I think moving this retry from a shell script into the client code is
> going in the wrong direction.

To be clear I will ignore this series of patches that deal with retries on
LSB init.

  Luis

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-05-07 15:46   ` Ian Campbell
@ 2014-05-13 22:17     ` Luis R. Rodriguez
  2014-05-14  8:44       ` Ian Campbell
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 22:17 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, Luis R. Rodriguez

On Wed, May 07, 2014 at 04:46:49PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> > +#if defined(HAVE_SYSTEMD)
> > +#include <systemd/sd-daemon.h>
> > +#endif
> 
> Please document this new optional dependency in the top level makefile.

OK I think this is best done on the wiki once merged but will add stuff
to the top level Makefile.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper
  2014-05-07 15:24   ` Ian Campbell
@ 2014-05-13 22:21     ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 22:21 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Wed, May 07, 2014 at 04:24:20PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > The xendomains script can be reused with systemd systems as it
> > does not control services or sockets per se, but does a one shot
> > scrape of domUs it needs start bring up, stop, reload so we're
> > going to reuse it. This moves the core of the script to libexec
> > and leaves only a helper on init.
> > 
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Jan Rękorajski <baggins@pld-linux.org>
> > Cc: M A Young <m.a.young@durham.ac.uk>
> > Cc: Jacek Konieczny <jajcus@jajcus.net>
> > Cc: xen-devel@lists.xenproject.org
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> > ---
> >  tools/hotplug/Linux/Makefile          |   6 +
> >  tools/hotplug/Linux/init.d/xendomains | 567 +-------------------------------
> >  tools/hotplug/Linux/xendomains        | 585 ++++++++++++++++++++++++++++++++++
> 
> Did you use the -M option here?

I always do, hence my original concern -- but we determined last that even
though the output did not show the move the commit does, so I think we're
good. Will be good to follow up on the possible discprepancy with upstreamg
git though.

> > @@ -45,6 +46,11 @@ install: all install-initd install-scripts install-udev
> >  install-initd:
> >  	[ -d $(DESTDIR)$(INITD_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(INITD_DIR)
> >  	[ -d $(DESTDIR)$(SYSCONFIG_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(SYSCONFIG_DIR)
> > +	[ -d $(DESTDIR)$(LIBEXEC) ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC)
> > +ifeq ($(CONFIG_XEND),y)
> > +	$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(INITD_DIR)
> 
> With xend's removal this can now go.

Done.

> 
> > +endif
> > +	$(INSTALL_PROG) $(XENDOMAINS_LIBEXEC) $(DESTDIR)$(LIBEXEC)
> >  	$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(INITD_DIR)
> >  	$(INSTALL_DATA) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(SYSCONFIG_DIR)/xendomains
> >  	$(INSTALL_PROG) $(XENCOMMONS_INITD) $(DESTDIR)$(INITD_DIR)
> > diff --git a/tools/hotplug/Linux/init.d/xendomains b/tools/hotplug/Linux/init.d/xendomains
> > index 587568d..d0122fc 100644
> > --- a/tools/hotplug/Linux/init.d/xendomains
> > +++ b/tools/hotplug/Linux/init.d/xendomains
> 
> I think I need to apply the series and examine with git to figure out
> what changed here, which I'll do another time.

Better try my next series.

  Luis

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

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 10/15] autoconf: update m4/pkg.m4
  2014-05-07 15:28   ` Ian Campbell
@ 2014-05-13 22:32     ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 22:32 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, Luis R. Rodriguez, Ian Jackson, Tim Deegan,
	Jan Beulich, xen-devel

On Wed, May 07, 2014 at 04:28:38PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > 
> > The provenance of the m4 pkg.m4 macro library was not documented
> > and it was not clear how and if we can update this without breaking
> > things. Document where this comes from, update us to the latest
> > release from git and put a warning about avoiding private evolutions
> > so that instead things go upstream.
> > 
> > The pkg-config m4 macro library comes from the upstream pkg-config
> > git repository [0]. If you update the m4 library update this file
> > with provenance and last commit ID information. For documentation
> > on how to use this read the pkg-config(1) man page.
> > 
> > Tree: git://anongit.freedesktop.org/pkg-config
> > 
> > The last synch was from commit:
> > 
> > commit 4f0084d9d3b8726a797a373c7ec5e406000995d0
> > Author: Dan Nicholson <dbn.lists@gmail.com>
> > Date:   Mon Feb 3 15:59:18 2014 -0800
> > 
> >     glib: Fix Makefiles to suppress warnings from automake
> > 
> >     With the newly added glib.mk, some of the noinst_* variables need to use
> >     += in the evaluation to avoid multiple definition warnings from
> >     automake.
> > 
> > Cc: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> > Cc: Jan Beulich <jbeulich@suse.com>
> > Cc: Keir Fraser <keir@xen.org>
> > Cc: Tim Deegan <tim@xen.org>
> > Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
> 
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
> 
> > ---
> 
> Please note here (after the --- marker) if the committer should rerun
> autogen.sh.
> 
> > diff --git a/m4/pkg.m4.README b/m4/pkg.m4.README
> 
> Since it seems like the advice here could apply to multiple modules I
> wonder if we should start off with m4/README.source or some such and a
> list of the relevant upstreams (a list of 1 entry now, I don't expect
> you to reverse engineer the others)?

Sure makes senses.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place
  2014-05-02  8:12       ` Jan Beulich
@ 2014-05-13 23:03         ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 23:03 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Keir Fraser, Ian Campbell, Luis R. Rodriguez, Tim Deegan,
	Ian Jackson, xen-devel, Samuel Thibault

On Fri, May 02, 2014 at 09:12:46AM +0100, Jan Beulich wrote:
> >>> On 30.04.14 at 19:53, <mcgrof@suse.com> wrote:
> > On Wed, Apr 30, 2014 at 12:52:27AM -0600, Jan Beulich wrote:
> >> >>> On 30.04.14 at 03:12, <mcgrof@do-not-panic.com> wrote:
> >> > This moves all generic variables to the top level makefile,
> >> > tons of files use these so just make them general enough. This
> >> > also paves the way to let us easily dynamically configure these
> >> > with autoconf, for now we leave the same presets as was present
> >> > before.
> >> 
> >> Am I right understanding that this then will require ./configure to
> >> be run even for hypervisor-only building?
> > 
> > Its unclear what you mean by that, can you describe what is required
> > to accomplish this on a fresh git tree. Can you describe what expectations
> > you have on build time to see if this patch breaks that and if so see
> > what can be done to avoid this? All the changes I did here really was
> > to toss around variables to be set through autoconf and if building
> > the hypervisor requries them then yes, but fixing that should be as
> > easy as adding schecks to add sensible defaults if configure has not
> > been run.
> 
> The main problem I see is with config/StdGNU.mk now including
> config/Toplevel.mk, with the latter only being generated by the
> configure process. What I expect to continue to work is "make xen"
> (and - hopefully unaffected, albeit I didn't check -
> "make -C extras/mini-os") without anything else done on a fresh
> tree.

OK thanks, I've addressed this by not requiring that file but also
providing defaults that the system can override once configure is
used. Will roll it into my series.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config
  2014-05-07 15:32   ` Ian Campbell
@ 2014-05-13 23:05     ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 23:05 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Keir Fraser, Luis R. Rodriguez, Ian Jackson, Tim Deegan,
	Jan Beulich, xen-devel

On Wed, May 07, 2014 at 04:32:39PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> > Enabling cxenstored will then disable ocamltools.
> 
> I think there is ocaml code other than oxenstored which people might
> want to use. I don't see any harm in building all the ocaml stuff
> (including oxenstored) even if the default requested here is cxenstored.
> Having both allows the user to switch later if they want, by
> editing /etc/sysconfig etc.

OK I'll skip that disablement logic.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 13/15] systemd: add xen systemd service and module files
  2014-05-07 15:46   ` Ian Campbell
  2014-05-12 18:22     ` Luis R. Rodriguez
@ 2014-05-13 23:28     ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-13 23:28 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Stefano Stabellini, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Luis R. Rodriguez

On Wed, May 07, 2014 at 04:46:54PM +0100, Ian Campbell wrote:
> On Tue, 2014-04-29 at 18:12 -0700, Luis R. Rodriguez wrote:
> >   * simplifies startup to not require polling on the sockets
> >     as initial socket management is handled by systemd, we just
> >     take on the socket later once anything pokes at it, a simple nc -U
> >     on the socket files can activate the service for example.
> 
> What about xenstore users which don't use the sockets but instead use
> the kernel ring interface? Does this mean that if only those users are
> present nothing starts xenstored?

That should still work.

 Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-05-13 22:17     ` Luis R. Rodriguez
@ 2014-05-14  8:44       ` Ian Campbell
  2014-05-15  1:50         ` Luis R. Rodriguez
  0 siblings, 1 reply; 84+ messages in thread
From: Ian Campbell @ 2014-05-14  8:44 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: xen-devel, Luis R. Rodriguez

On Wed, 2014-05-14 at 00:17 +0200, Luis R. Rodriguez wrote:
> On Wed, May 07, 2014 at 04:46:49PM +0100, Ian Campbell wrote:
> > On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> > > +#if defined(HAVE_SYSTEMD)
> > > +#include <systemd/sd-daemon.h>
> > > +#endif
> > 
> > Please document this new optional dependency in the top level makefile.
> 
> OK I think this is best done on the wiki once merged but will add stuff
> to the top level Makefile.

Sorry, I meant README not Makefile.

Ian.

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 04/15] cxenstored: add support for systemd active sockets
  2014-05-14  8:44       ` Ian Campbell
@ 2014-05-15  1:50         ` Luis R. Rodriguez
  0 siblings, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-15  1:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, Luis R. Rodriguez

On Wed, May 14, 2014 at 09:44:48AM +0100, Ian Campbell wrote:
> On Wed, 2014-05-14 at 00:17 +0200, Luis R. Rodriguez wrote:
> > On Wed, May 07, 2014 at 04:46:49PM +0100, Ian Campbell wrote:
> > > On Tue, 2014-04-29 at 18:11 -0700, Luis R. Rodriguez wrote:
> > > > +#if defined(HAVE_SYSTEMD)
> > > > +#include <systemd/sd-daemon.h>
> > > > +#endif
> > > 
> > > Please document this new optional dependency in the top level makefile.
> > 
> > OK I think this is best done on the wiki once merged but will add stuff
> > to the top level Makefile.
> 
> Sorry, I meant README not Makefile.

Got it, my entire series now expands on that and elaborate more on the wiki.
If my patches get merged I'll go to town on the wiki with more details.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 14/15] autoconf: xen: add systemd support into the build system
  2014-05-07 16:40   ` Roger Pau Monné
@ 2014-05-15  1:58     ` Luis R. Rodriguez
  2014-05-15  9:02       ` Ian Campbell
  0 siblings, 1 reply; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-15  1:58 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: Ian Campbell, Stefano Stabellini, Jan Rękorajski,
	Ian Jackson, Jacek Konieczny, M A Young, xen-devel,
	Luis R. Rodriguez

On Wed, May 07, 2014 at 06:40:01PM +0200, Roger Pau Monné wrote:
> On 30/04/14 03:12, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > +dnl Once and if systemd is prevalent we can just use AX_ENABLE_SYSTEMD()
> > +AX_ALLOW_SYSTEMD()
> 
> Shouldn't systemd init scripts be installed by default if systemd is
> detect on the host?

That is up to whoever is building the stuff, if systemd is enabled then
both old init scripts and systemd scripts will be installed.

> Or are there cases of distros that install systemd but don't use it?

There are cases where a system can have libraries for systemd but not
have systemd.

> If I'm understanding this right, the user has to always pass
> --enable-systemd in order to get systemd init scripts installed.

For now I think this is a good option as we get systemd widely tested,
eventually I agree that this should be switched to AX_ENABLE_SYSTEMD()
which will then enable systemd if systemd libraries are detected. I'd
prefer we do this once we get all all this widely tested.

> >  AC_OUTPUT()
> >  
> > diff --git a/tools/hotplug/common/Makefile b/tools/hotplug/common/Makefile
> > index 4a63f40..45fd840 100644
> > --- a/tools/hotplug/common/Makefile
> > +++ b/tools/hotplug/common/Makefile
> > @@ -1,5 +1,6 @@
> >  XEN_ROOT = $(CURDIR)/../../..
> >  include $(XEN_ROOT)/tools/Rules.mk
> > +include $(XEN_ROOT)/config/Tools.mk
> 
> tools/Rules.mk already includes config/Tools.mk

Good catch, changed.

 Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 00/15] xen: add systemd support
  2014-05-08 11:28 ` Anthony PERARD
@ 2014-05-15  2:12   ` Luis R. Rodriguez
  2014-05-15  6:14   ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-15  2:12 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Luis R. Rodriguez

On Thu, May 08, 2014 at 12:28:50PM +0100, Anthony PERARD wrote:
> Hi,
> 
> I gave a try to this patch series, the "./configure; make install" and
> the systemd services.
> 
> 
> A) First, what when wrong during make install:
> 
> When I do `./configure --prefix=/usr`, `make install` will put libs into
> /usr/local/lib ... (full list at the bottom of the mail, to help debug).

That is not an issue with --prefix not being respected but rather that
libs will be installed under the libdir variable which is what Xen likes
to use, so you will have to use --libdir=/usr/lib64/ to override that.

If we want to change this to use prefix we can do it but I went with what
was used by the default configuration.

> Also, it would be nice if the --sbindir configure option was working.

--sbindir was not used before so my changes don't add support for it,
so adding support for that is easy but its a separate change, but easy
and I'd rather we do this separately. Right now we respect the old
behaviour and use SBINDIR=$prefix/sbin

> B) Next, xenstored.socket:
> 
> I install xen, activate the socket, reboot the machine, and:
> $ xl info
> xc: error: Could not obtain handle on privileged command interface (2 = No such file or directory): Internal error
> libxl: error: libxl.c:99:libxl_ctx_alloc: cannot open libxc handle: No such file or directory
> cannot init xl context

You need to make sure ldconfig us run on the system after installation.
I noted this in the mailing list and I was told that we never do this
on the build system, so the onus is on the person installing to use this.
This also bit me on the ass a few times, and hence why I wanted to also
run it within the build system.

> So I tried `nc -U /var/run/xenstored/socket_ro`,

I made some changes which will require now this to be run as root as I had
left the socket open widely, my next series addresses that.

> but it appear that
> /var/lib/xenstored those not mount because of an empty context= option.
> Once the context= options have been removed, xenstored is finaly started.

Well that is odd, an empty context works here, what system are you using?
Mind if we roll in the changes as we have them now and address this separately?
Can't think of a way to deal with this cleanly right now.

> Then, `xl create hvm_guest`. This does not return ...
> I think qemu is not happy about xenstore, this is what I get from a `xl
> -vvv create hvm_guest`:
> libxl: debug: libxl_event.c:570:libxl__ev_xswatch_register: watch w=0x127b9a8 wpath=/local/domain/0/device-model/3/state token=3/0: register slotnum=3
> libxl: debug: libxl_create.c:1370:do_domain_create: ao 0x127ce90: inprogress: poller=0x127c5e0, flags=i
> libxl: debug: libxl_event.c:514:watchfd_callback: watch w=0x127b9a8 wpath=/local/domain/0/device-model/3/state token=3/0: event epath=/local/domain/0/device-model/3/state
> (qemu is running)
> Actually, dmesg said that both xl and qemu-system-i386 proccess are
> blocked. I suppose qemu is not able to access xenstore.

I traced this down to that bug fix on mmap() failing, and the unchecked failure
on madvise with the fork option. Apart from this I also found that the xl library
should not use systemd but rather just open the socket regularly, I've fixed this
on my series and will push out the new changes soon.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 00/15] xen: add systemd support
  2014-05-08 11:28 ` Anthony PERARD
  2014-05-15  2:12   ` Luis R. Rodriguez
@ 2014-05-15  6:14   ` Luis R. Rodriguez
  1 sibling, 0 replies; 84+ messages in thread
From: Luis R. Rodriguez @ 2014-05-15  6:14 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: xen-devel, Luis R. Rodriguez

On Thu, May 08, 2014 at 12:28:50PM +0100, Anthony PERARD wrote:
> it appear that
> /var/lib/xenstored those not mount because of an empty context= option.
> Once the context= options have been removed, xenstored is finaly started.

Actually I can reproduce on debian, the fix is to use context=none by default.
I'll roll this into my series by default, folks who need this can specify the
context on sysconfig.

  Luis

^ permalink raw reply	[flat|nested] 84+ messages in thread

* Re: [PATCH v4 14/15] autoconf: xen: add systemd support into the build system
  2014-05-15  1:58     ` Luis R. Rodriguez
@ 2014-05-15  9:02       ` Ian Campbell
  0 siblings, 0 replies; 84+ messages in thread
From: Ian Campbell @ 2014-05-15  9:02 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Luis R. Rodriguez, Jan Rękorajski, Ian Jackson,
	Jacek Konieczny, M A Young, xen-devel, Stefano Stabellini,
	Roger Pau Monné

On Thu, 2014-05-15 at 03:58 +0200, Luis R. Rodriguez wrote:
> On Wed, May 07, 2014 at 06:40:01PM +0200, Roger Pau Monné wrote:
> > On 30/04/14 03:12, Luis R. Rodriguez wrote:
> > > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > > +dnl Once and if systemd is prevalent we can just use AX_ENABLE_SYSTEMD()
> > > +AX_ALLOW_SYSTEMD()
> > 
> > Shouldn't systemd init scripts be installed by default if systemd is
> > detect on the host?
> 
> That is up to whoever is building the stuff, if systemd is enabled then
> both old init scripts and systemd scripts will be installed.
> 
> > Or are there cases of distros that install systemd but don't use it?
> 
> There are cases where a system can have libraries for systemd but not
> have systemd.

At least in Debian there is support for installing systemd without
having it supply /sbin/init, so that you can test by using
init=/sbin/systemd without replacing your existing init.

And for distros generally it is certainly the case that you might want
the distro binary package to support systemd without necessarily
insisting on systemd at runtime.

> > If I'm understanding this right, the user has to always pass
> > --enable-systemd in order to get systemd init scripts installed.
> 
> For now I think this is a good option as we get systemd widely tested,
> eventually I agree that this should be switched to AX_ENABLE_SYSTEMD()
> which will then enable systemd if systemd libraries are detected. I'd
> prefer we do this once we get all all this widely tested.

Since things must still work without systemd at runtime even if systemd
was enable at build time I don't think there is any downside to enabling
this by default if the libraries are present at configure time.

Ian.


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

^ permalink raw reply	[flat|nested] 84+ messages in thread

end of thread, other threads:[~2014-05-15  9:02 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30  1:11 [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
2014-04-30  1:11 ` [PATCH v4 01/15] xenstore: add support for a retry open limit on xenstored Luis R. Rodriguez
2014-05-07 15:03   ` Ian Campbell
2014-05-12 13:50   ` Ian Jackson
2014-05-12 14:18     ` Ian Campbell
2014-05-12 14:40       ` Jacek Konieczny
2014-05-12 15:37         ` Ian Jackson
2014-05-12 18:59           ` Luis R. Rodriguez
2014-05-13 21:33           ` Luis R. Rodriguez
2014-04-30  1:11 ` [PATCH v4 02/15] xencommons: use the retry limit instead of implementing our own timeout Luis R. Rodriguez
2014-04-30  9:33   ` Andrew Cooper
2014-04-30 16:36     ` Luis R. Rodriguez
2014-05-07 15:05   ` Ian Campbell
2014-04-30  1:11 ` [PATCH v4 03/15] xenstored: enable usage of config.h on both xenstored and oxenstored Luis R. Rodriguez
2014-05-07 15:06   ` Ian Campbell
2014-04-30  1:11 ` [PATCH v4 04/15] cxenstored: add support for systemd active sockets Luis R. Rodriguez
2014-05-07 15:18   ` Ian Campbell
2014-05-07 15:46   ` Ian Campbell
2014-05-13 22:17     ` Luis R. Rodriguez
2014-05-14  8:44       ` Ian Campbell
2014-05-15  1:50         ` Luis R. Rodriguez
2014-04-30  1:11 ` [PATCH v4 05/15] oxenstored: " Luis R. Rodriguez
2014-04-30  8:35   ` Dave Scott
2014-04-30 17:30     ` Luis R. Rodriguez
2014-05-01 10:21       ` Dave Scott
2014-04-30  9:27   ` Anil Madhavapeddy
2014-04-30 17:35     ` Luis R. Rodriguez
2014-05-01  9:16       ` Anil Madhavapeddy
2014-05-07 15:20   ` Ian Campbell
2014-05-12 19:09     ` Luis R. Rodriguez
2014-05-12 13:57   ` Ian Jackson
2014-05-12 18:11     ` Luis R. Rodriguez
2014-05-13  8:53       ` Ian Campbell
2014-04-30  1:11 ` [PATCH v4 06/15] tools/xendomains: make xl the default Luis R. Rodriguez
2014-04-30  7:02   ` Olaf Hering
2014-04-30 17:43     ` Luis R. Rodriguez
2014-05-07 15:21       ` Ian Campbell
2014-04-30  1:12 ` [PATCH v4 07/15] tools/xendomains: do space cleanups Luis R. Rodriguez
2014-04-30  1:12 ` [PATCH v4 08/15] tools/xendomains: move to libexec and use a smaller init helper Luis R. Rodriguez
2014-05-07 15:24   ` Ian Campbell
2014-05-13 22:21     ` Luis R. Rodriguez
2014-04-30  1:12 ` [PATCH v4 09/15] autoconf: xen: force a refresh with autoconf Luis R. Rodriguez
2014-05-07 15:25   ` Ian Campbell
2014-05-07 16:12   ` Roger Pau Monné
2014-05-07 16:21     ` Ian Campbell
2014-05-07 16:44       ` Roger Pau Monné
2014-05-07 18:28         ` Luis R. Rodriguez
2014-05-12 14:00           ` Ian Jackson
2014-05-12 18:14             ` Luis R. Rodriguez
2014-04-30  1:12 ` [PATCH v4 10/15] autoconf: update m4/pkg.m4 Luis R. Rodriguez
2014-05-07 15:28   ` Ian Campbell
2014-05-13 22:32     ` Luis R. Rodriguez
2014-05-07 16:17   ` Roger Pau Monné
2014-04-30  1:12 ` [PATCH v4 11/15] autoconf: xen: move standard variables to a generic place Luis R. Rodriguez
2014-04-30  6:52   ` Jan Beulich
     [not found]   ` <5360B9CB020000780000D9BB@suse.com>
2014-04-30 17:53     ` Luis R. Rodriguez
2014-05-02  8:12       ` Jan Beulich
2014-05-13 23:03         ` Luis R. Rodriguez
2014-04-30  1:12 ` [PATCH v4 12/15] autoconf: xen: peg the xenstored preference onto the top level config Luis R. Rodriguez
2014-05-07 15:32   ` Ian Campbell
2014-05-13 23:05     ` Luis R. Rodriguez
2014-04-30  1:12 ` [PATCH v4 13/15] systemd: add xen systemd service and module files Luis R. Rodriguez
2014-05-07 15:46   ` Ian Campbell
2014-05-12 18:22     ` Luis R. Rodriguez
2014-05-13 23:28     ` Luis R. Rodriguez
2014-05-12 14:11   ` Ian Jackson
2014-05-12 14:32     ` Jacek Konieczny
2014-05-12 15:36       ` Ian Jackson
2014-05-12 18:55         ` Luis R. Rodriguez
2014-05-12 18:46     ` Luis R. Rodriguez
2014-05-13  8:57       ` Ian Campbell
2014-04-30  1:12 ` [PATCH v4 14/15] autoconf: xen: add systemd support into the build system Luis R. Rodriguez
2014-05-07 16:40   ` Roger Pau Monné
2014-05-15  1:58     ` Luis R. Rodriguez
2014-05-15  9:02       ` Ian Campbell
2014-04-30  1:12 ` [PATCH v4 15/15] autoconf: xen: trigger an update with autogen.sh Luis R. Rodriguez
2014-05-07 15:47   ` Ian Campbell
2014-05-07 18:34     ` Luis R. Rodriguez
2014-05-08  8:42       ` Ian Campbell
2014-04-30  1:15 ` [PATCH v4 00/15] xen: add systemd support Luis R. Rodriguez
2014-05-07 15:18   ` Ian Campbell
2014-05-08 11:28 ` Anthony PERARD
2014-05-15  2:12   ` Luis R. Rodriguez
2014-05-15  6:14   ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.