[Pkg-xen-devel] [PATCH 6/9] Fix the ocaml libraries to install correctly under /usr/lib/xen-4.1/lib/ocaml

Ian Campbell ijc at hellion.org.uk
Tue Oct 25 15:22:36 UTC 2011


On Tue, 2011-10-25 at 16:16 +0100, Jonathan Ludlam wrote:
> Yes, ocamlmklib does it all. We probably do want it upstream. I suspect this patch will simply apply to xen-unstable.hg, so I could probably post it quite quickly.

You'd need to split out the use of the /u/l/xen-4.1 path stuff for
upstream.

Ian.

> 
> Jon
> 
> On 25 Oct 2011, at 15:57, Ian Campbell wrote:
> 
> > I'm assuming that this "OCAMLMKLIB" tool takes care of creating the cmxa
> > and stubs etc?
> > 
> > Is this something we want upstream?
> > 
> > Is $(XEN_VERSION) not available here?
> > 
> > The next patch in the series (add the comments to this new file) could
> > be merged into this one.
> > 
> > Ian.
> > 
> > On Tue, 2011-10-25 at 13:37 +0100, Jon Ludlam wrote:
> >> ---
> >> xen/debian/patches/series                     |    1 +
> >> xen/debian/patches/tools-ocaml-fix-rpath.diff |   20 ++++++++++++++++++++
> >> 2 files changed, 21 insertions(+), 0 deletions(-)
> >> create mode 100644 xen/debian/patches/tools-ocaml-fix-rpath.diff
> >> 
> >> diff --git a/xen/debian/patches/series b/xen/debian/patches/series
> >> index c72ea3c..564dd62 100644
> >> --- a/xen/debian/patches/series
> >> +++ b/xen/debian/patches/series
> >> @@ -59,3 +59,4 @@ tools-ocaml-fix-xc-dependencies.diff
> >> tools-ocaml-remove-uuid.diff
> >> tools-ocaml-remove-log.diff
> >> tools-ocaml-fix-xc.diff
> >> +tools-ocaml-fix-rpath.diff
> >> diff --git a/xen/debian/patches/tools-ocaml-fix-rpath.diff b/xen/debian/patches/tools-ocaml-fix-rpath.diff
> >> new file mode 100644
> >> index 0000000..760476a
> >> --- /dev/null
> >> +++ b/xen/debian/patches/tools-ocaml-fix-rpath.diff
> >> @@ -0,0 +1,20 @@
> >> +--- a/tools/ocaml/Makefile.rules
> >> ++++ b/tools/ocaml/Makefile.rules
> >> +@@ -58,14 +58,9 @@
> >> + 
> >> + # define a library target <name>.cmxa and <name>.cma
> >> + define OCAML_LIBRARY_template
> >> +- $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
> >> +-	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
> >> +- $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo)
> >> +-	$(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+)
> >> +- $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
> >> +-	$(call mk-caml-stubs,$$@, $$+)
> >> +- lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
> >> +-	$(call mk-caml-lib-stubs,$$@, $$+, $(LIBS_$(1)))
> >> ++ $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmx $(obj).cmo) $(foreach obj,$($(1)_C_OBJS),$(obj).o) 
> >> ++	$(OCAMLMKLIB) -o $1 -oc $(1)_stubs $(foreach obj,$($(1)_OBJS),$(obj).cmx $(obj).cmo) -L/usr/lib/xen-4.1/lib -ccopt -Wl,-R/usr/lib/xen-4.1/lib/ocaml/stublibs -ccopt -Wl,-R/usr/lib/xen-4.1/lib $(foreach obj,$($(1)_C_OBJS),$(obj).o) $(LIBS_$(1))
> >> ++	gcc -shared -o ./dll$(1)_stubs.so $(foreach obj,$($(1)_C_OBJS),$(obj).o) -L/usr/lib/xen-4.1/lib -L../../../../tools/libxc  $(LIBS_$(1)) -Wl,-R/usr/lib/xen-4.1/lib
> >> + endef
> >> + 
> >> + define OCAML_NOC_LIBRARY_template
> > 
> > -- 
> > Ian Campbell
> > 
> > "You, sir, are nothing but a pathetically lame salesdroid!
> > I fart in your general direction!"
> > 		-- Randseed on #Linux
> > 
> 
> 

-- 
Ian Campbell

As I currently don't have a floppy drive in my computer, I'd like to
make an `emergency cdrom' ;)
		-- Eugene Crosser 




More information about the Pkg-xen-devel mailing list