xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: update ocamlfind handling
@ 2013-01-31 14:04 Olaf Hering
  2013-01-31 14:28 ` [PATCH v2] " Olaf Hering
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2013-01-31 14:04 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1359641034 -3600
# Node ID b5de88e7e5c8a30be26f0d2207132b14b970ffcb
# Parent  6727070b4129cf852199b66b6a81042ee6966a98
tools: update ocamlfind handling

configure checks just for ocamlc, but the tools in tools/ocaml depend
also on ocamlfind. On my workstation I have just ocamlc installed, but
no ocamlfind. As a result make will fail.

Update configure.ac to check also for OCAMLFIND, update various
Makefiles and replace hardcoded ocamlfind string with $(OCAMLFIND)

Please rerun autogen after applying this (untested) patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 6727070b4129 -r b5de88e7e5c8 tools/configure.ac
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -85,7 +85,8 @@ AS_IF([test "x$xapi" = "xy"], [
 ])
 AS_IF([test "x$ocamltools" = "xy"], [
     AC_PROG_OCAML
-    AS_IF([test "x$OCAMLC" = "xno"], [
+    AC_PROG_FINDLIB
+    AS_IF([test "x$OCAMLC" = "xno" && test "$OCAMLFIND" = "xno"], [
         AS_IF([test "x$enable_ocamltools" = "xyes"], [
             AC_MSG_ERROR([Ocaml tools enabled, but unable to find Ocaml])])
         ocamltools="n"
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/common.make
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -7,6 +7,7 @@ OCAMLMKLIB ?= ocamlmklib
 OCAMLDEP ?= ocamldep
 OCAMLLEX ?= ocamllex
 OCAMLYACC ?= ocamlyacc
+OCAMLFIND ?= ocamlfind
 
 CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
@@ -16,6 +17,6 @@ OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -
 
 VERSION := 4.1
 
-OCAMLDESTDIR ?= $(DESTDIR)$(shell ocamlfind printconf destdir)
+OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
 
 o= >$@.new && mv -f $@.new $@
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/eventchn/Makefile
--- a/tools/ocaml/libs/eventchn/Makefile
+++ b/tools/ocaml/libs/eventchn/Makefile
@@ -24,12 +24,12 @@ OCAML_LIBRARY = xeneventchn
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
 
 include $(TOPLEVEL)/Makefile.rules
 
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/mmap/Makefile
--- a/tools/ocaml/libs/mmap/Makefile
+++ b/tools/ocaml/libs/mmap/Makefile
@@ -19,12 +19,12 @@ OCAML_LIBRARY = xenmmap
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
 
 include $(TOPLEVEL)/Makefile.rules
 
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/xb/Makefile
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -45,11 +45,11 @@ xenbus.cmo : $(foreach obj, $(OBJS), $(o
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so 
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so 
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/xc/Makefile
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -23,11 +23,11 @@ libs: $(LIBS)
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -56,11 +56,11 @@ libs: $(LIBS)
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r b5de88e7e5c8 tools/ocaml/libs/xs/Makefile
--- a/tools/ocaml/libs/xs/Makefile
+++ b/tools/ocaml/libs/xs/Makefile
@@ -36,12 +36,12 @@ xenstore.cmo : $(foreach obj, $(OBJS), $
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a 
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a 
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
 
 include $(TOPLEVEL)/Makefile.rules

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

* [PATCH v2] tools: update ocamlfind handling
  2013-01-31 14:04 [PATCH] tools: update ocamlfind handling Olaf Hering
@ 2013-01-31 14:28 ` Olaf Hering
  2013-02-05 11:34   ` Ian Campbell
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2013-01-31 14:28 UTC (permalink / raw)
  To: xen-devel

# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1359642490 -3600
# Node ID 10d9f4caffa8986185b9f8824bd5bf0bb41de660
# Parent  6727070b4129cf852199b66b6a81042ee6966a98
tools: update ocamlfind handling

configure checks just for ocamlc, but the tools in tools/ocaml depend
also on ocamlfind. On my workstation I have just ocamlc installed, but
no ocamlfind. As a result make will fail.

Update configure.ac to check also for OCAMLFIND, update various
Makefiles and replace hardcoded ocamlfind string with $(OCAMLFIND)

Please rerun autogen.sh after applying this patch.

v2:
 - fix logic error in configure.ac

Signed-off-by: Olaf Hering <olaf@aepfle.de>

diff -r 6727070b4129 -r 10d9f4caffa8 tools/configure.ac
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -85,7 +85,8 @@ AS_IF([test "x$xapi" = "xy"], [
 ])
 AS_IF([test "x$ocamltools" = "xy"], [
     AC_PROG_OCAML
-    AS_IF([test "x$OCAMLC" = "xno"], [
+    AC_PROG_FINDLIB
+    AS_IF([test "x$OCAMLC" = "xno" || test "x$OCAMLFIND" = "xno"], [
         AS_IF([test "x$enable_ocamltools" = "xyes"], [
             AC_MSG_ERROR([Ocaml tools enabled, but unable to find Ocaml])])
         ocamltools="n"
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/common.make
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -7,6 +7,7 @@ OCAMLMKLIB ?= ocamlmklib
 OCAMLDEP ?= ocamldep
 OCAMLLEX ?= ocamllex
 OCAMLYACC ?= ocamlyacc
+OCAMLFIND ?= ocamlfind
 
 CFLAGS += -fPIC -Werror -I$(shell ocamlc -where)
 
@@ -16,6 +17,6 @@ OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -
 
 VERSION := 4.1
 
-OCAMLDESTDIR ?= $(DESTDIR)$(shell ocamlfind printconf destdir)
+OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
 
 o= >$@.new && mv -f $@.new $@
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/eventchn/Makefile
--- a/tools/ocaml/libs/eventchn/Makefile
+++ b/tools/ocaml/libs/eventchn/Makefile
@@ -24,12 +24,12 @@ OCAML_LIBRARY = xeneventchn
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xeneventchn META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xeneventchn
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xeneventchn
 
 include $(TOPLEVEL)/Makefile.rules
 
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/mmap/Makefile
--- a/tools/ocaml/libs/mmap/Makefile
+++ b/tools/ocaml/libs/mmap/Makefile
@@ -19,12 +19,12 @@ OCAML_LIBRARY = xenmmap
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenmmap META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenmmap
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenmmap
 
 include $(TOPLEVEL)/Makefile.rules
 
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/xb/Makefile
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -45,11 +45,11 @@ xenbus.cmo : $(foreach obj, $(OBJS), $(o
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so 
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenbus META $(LIBS) xenbus.cmo xenbus.cmi xenbus.cmx *.a *.so 
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenbus
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenbus
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/xc/Makefile
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -23,11 +23,11 @@ libs: $(LIBS)
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenctrl META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenctrl
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/xl/Makefile
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -56,11 +56,11 @@ libs: $(LIBS)
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenlight META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenlight
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenlight
 
 include $(TOPLEVEL)/Makefile.rules
diff -r 6727070b4129 -r 10d9f4caffa8 tools/ocaml/libs/xs/Makefile
--- a/tools/ocaml/libs/xs/Makefile
+++ b/tools/ocaml/libs/xs/Makefile
@@ -36,12 +36,12 @@ xenstore.cmo : $(foreach obj, $(OBJS), $
 .PHONY: install
 install: $(LIBS) META
 	mkdir -p $(OCAMLDESTDIR)
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
-	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a 
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
+	$(OCAMLFIND) install -destdir $(OCAMLDESTDIR) -ldconf ignore xenstore META $(LIBS) xenstore.cmo xenstore.cmi xenstore.cmx *.a 
 
 .PHONY: uninstall
 uninstall:
-	ocamlfind remove -destdir $(OCAMLDESTDIR) xenstore
+	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenstore
 
 include $(TOPLEVEL)/Makefile.rules

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

* Re: [PATCH v2] tools: update ocamlfind handling
  2013-01-31 14:28 ` [PATCH v2] " Olaf Hering
@ 2013-02-05 11:34   ` Ian Campbell
  0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2013-02-05 11:34 UTC (permalink / raw)
  To: Olaf Hering; +Cc: xen-devel@lists.xen.org

On Thu, 2013-01-31 at 14:28 +0000, Olaf Hering wrote:
> # HG changeset patch
> # User Olaf Hering <olaf@aepfle.de>
> # Date 1359642490 -3600
> # Node ID 10d9f4caffa8986185b9f8824bd5bf0bb41de660
> # Parent  6727070b4129cf852199b66b6a81042ee6966a98
> tools: update ocamlfind handling
> 
> configure checks just for ocamlc, but the tools in tools/ocaml depend
> also on ocamlfind. On my workstation I have just ocamlc installed, but
> no ocamlfind. As a result make will fail.
> 
> Update configure.ac to check also for OCAMLFIND, update various
> Makefiles and replace hardcoded ocamlfind string with $(OCAMLFIND)
> 
> Please rerun autogen.sh after applying this patch.
> 
> v2:
>  - fix logic error in configure.ac
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Acked + applied, thanks.

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

end of thread, other threads:[~2013-02-05 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 14:04 [PATCH] tools: update ocamlfind handling Olaf Hering
2013-01-31 14:28 ` [PATCH v2] " Olaf Hering
2013-02-05 11:34   ` Ian Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).