]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
ocaml-xenstored: Allow to build ocaml xenstored instead of C version
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 19 May 2009 13:13:20 +0000 (14:13 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 19 May 2009 13:13:20 +0000 (14:13 +0100)
To use, set CONFIG_OCAML_XENSTORED=y at build time.
Then the build system will automatically download the remote repo
to tools/ocaml-xenstored.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
.hgignore
Config.mk
tools/Makefile
tools/xenstore/Makefile

index 244158a5d39709c36fd19b1012fae3d623683955..17b24787dec3525e6bfc7cc68b0247d7cf6864e4 100644 (file)
--- a/.hgignore
+++ b/.hgignore
@@ -90,6 +90,7 @@
 ^stubdom/gcc-.*$
 ^stubdom/include$
 ^stubdom/ioemu$
+^stubdom/xenstore$
 ^stubdom/libxc-.*$
 ^stubdom/lwip-.*$
 ^stubdom/mini-os-.*$
 ^tools/xm-test/tests/.*\.test$
 ^tools/ioemu-remote
 ^tools/ioemu-dir$
+^tools/ocaml-xenstored.*$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
index 214b59296f23b03e993175db68b30964073cfd1a..d756a60f9ce13443210783d1289e445c94f2663b 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -125,6 +125,12 @@ QEMU_REMOTE=http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
 # CONFIG_QEMU ?= ../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
+OCAML_XENSTORED_REPO=http://xenbits.xensource.com/ext/xen-ocaml-tools.hg
+
+# Build OCAML version of xenstored instead of the in-tree C version?
+# This will cause $(OCAML_XENSTORED_REPO) to be cloned.
+CONFIG_OCAML_XENSTORED ?= n
+
 # Optional components
 XENSTAT_XENTOP     ?= y
 VTPM_TOOLS         ?= n
index ed5f7568d2df5578a202772dccc5674c17b8206e..d9208ca1b2a894e5aa166d59a06075089cba700e 100644 (file)
@@ -6,6 +6,7 @@ SUBDIRS-y += check
 SUBDIRS-y += include
 SUBDIRS-y += libxc
 SUBDIRS-y += flask
+SUBDIRS-$(CONFIG_OCAML_XENSTORED) += ocaml-xenstored
 SUBDIRS-y += xenstore
 SUBDIRS-y += misc
 SUBDIRS-y += examples
@@ -49,6 +50,7 @@ install: subdirs-install
        $(INSTALL_DIR) $(DESTDIR)/var/xen/dump
        $(INSTALL_DIR) $(DESTDIR)/var/log/xen
        $(INSTALL_DIR) $(DESTDIR)/var/lib/xen
+       $(INSTALL_DIR) $(DESTDIR)/var/lock/subsys
 
 .PHONY: clean distclean
 clean distclean: subdirs-clean
@@ -103,3 +105,23 @@ subdir-clean-ioemu-dir:
                $(absolutify_xen_root); \
                $(MAKE) -C ioemu-dir clean; \
        fi
+
+ocaml-xenstored:
+       set -ex; \
+       rm -rf ocaml-xenstored.tmp; \
+       hg clone $(OCAML_XENSTORED_REPO) ocaml-xenstored.tmp; \
+       if [ "$(OCAML_XENSTORED_TAG)" ]; then \
+               hg -R ocaml-xenstored.tmp update -r $(OCAML_XENSTORED_TAG) ;\
+               hg -R ocaml-xenstored.tmp branch mybranch ;\
+       fi;                                             \
+       mv ocaml-xenstored.tmp ocaml-xenstored; \
+
+subdir-all-ocaml-xenstored subdir-install-ocaml-xenstored: ocaml-xenstored
+       $(absolutify_xen_root); \
+       $(MAKE) -C ocaml-xenstored $(patsubst subdir-%-ocaml-xenstored,%,$@);
+
+subdir-clean-ocaml-xenstored:
+       set -e; if test -d ocaml-xenstored; then \
+               $(MAKE) -C ocaml-xenstored clean; \
+       fi
+
index 91b854da9078255fd5d5d1693ff517d56fbeb3f6..f64ba9face239c2614adddffd6ee297f5296fc37 100644 (file)
@@ -26,8 +26,13 @@ LIBXENSTORE := libxenstore.a
 xenstore xenstore-control: CFLAGS += -static
 endif
 
+ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump 
+ifneq ($(CONFIG_OCAML_XENSTORED),y)
+ ALL_TARGETS += xenstored
+endif
+
 .PHONY: all
-all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump 
+all: $(ALL_TARGETS)
 
 .PHONY: clients
 clients: xenstore $(CLIENTS) xenstore-control
@@ -90,12 +95,14 @@ tarball: clean
 
 .PHONY: install
 install: all
+ifneq ($(CONFIG_OCAML_XENSTORED),y)
        $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
        $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
+       $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
+endif
        $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
        $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
        $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
-       $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
        $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
        $(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
        set -e ; for c in $(CLIENTS) ; do \