WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 14 of 14] Hook RPM build into main mk/Makefile

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 14 of 14] Hook RPM build into main mk/Makefile
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Fri, 28 May 2010 15:20:49 +0100
Delivery-date: Fri, 28 May 2010 07:41:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1275056435@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1275056405 -3600
# Node ID 6310f068b5c8143d1fcb82ae169097196ec5d19b
# Parent  e6aea5fad86ef6f261a3a7cfbc54555f3c2c8c6d
Hook RPM build into main mk/Makefile

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r e6aea5fad86e -r 6310f068b5c8 Makefile
--- a/Makefile  Fri May 28 15:19:58 2010 +0100
+++ b/Makefile  Fri May 28 15:20:05 2010 +0100
@@ -1,6 +1,8 @@
 ifdef B_BASE
 include $(B_BASE)/common.mk
+include $(B_BASE)/rpmbuild.mk
 REPO=$(call hg_loc,xen-dist-ocaml)
+DIST=$(CARBON_DISTFILES)/ocaml
 else
 MY_OUTPUT_DIR ?= $(CURDIR)/output
 MY_OBJ_DIR ?= $(CURDIR)/obj
@@ -8,10 +10,13 @@
 
 RPM_SPECSDIR?=/usr/src/redhat/SPECS
 RPM_SRPMSDIR?=/usr/src/redhat/SRPMS
-RPM_SOURCEDIR?=/usr/src/redhat/SOURCES
-XEN_RELEASE?=unknown
+RPM_RPMSDIR?=/usr/src/redhat/RPMS
+RPM_SOURCESDIR?=/usr/src/redhat/SOURCES
+RPMBUILD?=rpmbuild
 
-CARBON_DISTFILES ?= /data
+DIST?=/data
+
+DOMAIN0_ARCH_OPTIMIZED?=i686
 
 %/.dirstamp:
        @mkdir -p $*
@@ -20,10 +25,7 @@
 
 COMPONENTS=ocaml findlib omake xmlm getopt type-conv
 PREFIX=/opt/xensource
-
-.PHONY: build
-build: $(MY_OUTPUT_DIR)/ocaml-libs.tar.gz $(MY_SOURCES)/MANIFEST
-       @ :
+XEN_RELEASE?=unknown
 
 OCAML_VERSION=3.11.0
 FINDLIB_VERSION=1.1.2pl1
@@ -32,101 +34,44 @@
 GETOPT_VERSION=20040811
 TYPECONV_VERSION=1.6.8
 
+RPM_BINDIR=$(RPM_RPMSDIR)/$(DOMAIN0_ARCH_OPTIMIZED)
+
+.PHONY: build
+build: srpm $(MY_SOURCES)/MANIFEST
+       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb ocaml.spec
+       $(RPM) -ihv $(RPM_BINDIR)/{ocaml-3*.rpm,ocaml-camlp4*.rpm} || echo 
ocaml is already installed
+       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb findlib.spec
+       $(RPM) -ihv $(RPM_BINDIR)/ocaml-findlib*.rpm || echo ocaml-findlib is 
already installed
+       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb omake.spec
+       $(RPM) -ihv $(RPM_BINDIR)/omake* || echo omake is already installed
+       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb xmlm.spec 
getopt.spec type-conv.spec
+
 .PHONY: srpm
 srpm:
-       cp $(CARBON_DISTFILES)/ocaml-${OCAML_VERSION}.tar.bz2 $(RPM_SOURCEDIR)/
-       cp $(CARBON_DISTFILES)/findlib-${FINDLIB_VERSION}.tar.gz 
$(RPM_SOURCEDIR)/
-       cp $(CARBON_DISTFILES)/omake-${OMAKE_VERSION}.tar.gz $(RPM_SOURCEDIR)/
-       cp patches/omake-no-sync $(RPM_SOURCEDIR)/
-       cp $(CARBON_DISTFILES)/xmlm-${XMLM_VERSION}.tbz $(RPM_SOURCEDIR)/
-       cp $(CARBON_DISTFILES)/getopt-${GETOPT_VERSION}.tar.gz $(RPM_SOURCEDIR)/
-       rpmbuild -bs ocaml.spec
-       cp patches/xmlm-do-not-display-none-dtd-on-output $(RPM_SOURCEDIR)/
-       rpmbuild --nodeps -bs findlib.spec
-       rpmbuild --nodeps -bs omake.spec
-       rpmbuild --nodeps -bs xmlm.spec
-       rpmbuild --nodeps -bs getopt.spec
-       rpmbuild --nodeps -bs type-conv.spec
+       mkdir -p $(RPM_SRPMSDIR) $(RPM_SPECSDIR) $(RPM_SOURCESDIR) 
$(RPM_RPMSDIR)
+       cp $(DIST)/ocaml-${OCAML_VERSION}.tar.bz2 $(RPM_SOURCESDIR)/
+       cp $(DIST)/findlib-${FINDLIB_VERSION}.tar.gz $(RPM_SOURCESDIR)/
+       cp $(DIST)/omake-${OMAKE_VERSION}.tar.gz $(RPM_SOURCESDIR)/
+       cp patches/omake-no-sync $(RPM_SOURCESDIR)/
+       cp $(DIST)/xmlm-${XMLM_VERSION}.tbz $(RPM_SOURCESDIR)/
+       cp $(DIST)/getopt-${GETOPT_VERSION}.tar.gz $(RPM_SOURCESDIR)/
+       cp $(DIST)/type-conv-${TYPECONV_VERSION}.tar.bz2 $(RPM_SOURCESDIR)/
+       $(RPMBUILD) -bs ocaml.spec
+       cp patches/xmlm-do-not-display-none-dtd-on-output $(RPM_SOURCESDIR)/
+       $(RPMBUILD) --nodeps -bs findlib.spec
+       $(RPMBUILD) --nodeps -bs omake.spec
+       $(RPMBUILD) --nodeps -bs xmlm.spec
+       $(RPMBUILD) --nodeps -bs getopt.spec
+       $(RPMBUILD) --nodeps -bs type-conv.spec
 
-$(MY_OUTPUT_DIR)/ocaml-libs.tar.gz: $(MY_OUTPUT_DIR)/.dirstamp
-       $(MAKE) $(foreach c,$(COMPONENTS),install-$(c))
-       rm -rf $(MY_OBJ_DIR)/restage
-       mkdir $(MY_OBJ_DIR)/restage
-       for i in $(COMPONENTS); do tar -C $(MY_OBJ_DIR)/restage \
-         -zxf $(MY_OUTPUT_DIR)/$$i.tar.gz; done
-       tar -C $(MY_OBJ_DIR)/restage -zcf $@ .
+$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP)
+       rm -f $@
+       @for srpm in "$(/bin/ls -1 ${MY_OUTPUT_DIR})"; do \
+               path=$(MY_OUTPUT_DIR)/SRPMS/${srpm}; \
+               echo "$(${RPM} --qf "%{name}" -qp ${path}) $(${RPM} --qf 
"%{License}" -qp ${path}) ${path}" >>$@; \
+       done
 
-$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP) 
$(MY_OUTPUT_DIR)/ocaml-libs.tar.gz
-       rm -f $@
-       for i in $(COMPONENTS); do \
-         cat $(MY_OBJ_DIR)/$$i/.sources >> $@; done
-       # assemble patch list
-       $(call mkdir_clean,$(MY_OUTPUT_DIR)/patches)
-       $(MAKE) --no-print-directory patchlist >> $@
-
-define comp_template
-
-$(1)_BUILT=$(MY_OBJ_DIR)/$(1)/.built
-$(1)_DOWNLOADED=$(MY_OBJ_DIR)/$(1)/.downloaded
-$(1)_EXTRACTED=$(MY_OBJ_DIR)/$(1)/.extracted
-$(1)_CONFIGURED=$(MY_OBJ_DIR)/$(1)/.configured
-$(1)_PATCHED=$(MY_OBJ_DIR)/$(1)/.patched
-$(1)_FAKED=$(MY_OBJ_DIR)/$(1)/.faked
-$(1)_SOURCES=$(MY_OBJ_DIR)/$(1)/.sources
-
-.PHONY: $(1)-%
-$(1)-%:
-       @mkdir -p $(MY_OBJ_DIR)/$(1)
-       @$(MAKE) -f $(1).mk MAKEFILES=common.mk OBJDIR=$(MY_OBJ_DIR)/$(1) \
-               DESTDIR=$(MY_OBJ_DIR)/$(1)-staging \
-               COMPONENT=$(1) SRC_DIR=$(CURDIR)/distfiles/$(1) \
-               DISTFILES=$(CARBON_DISTFILES)/ocaml PREFIX=$(PREFIX) \
-               BUILT=$$($(1)_BUILT) FAKED=$$($(1)_FAKED) 
PATCHED=$$($(1)_PATCHED) \
-               DOWNLOADED=$$($(1)_DOWNLOADED) EXTRACTED=$$($(1)_EXTRACTED) 
CONFIGURED=$$($(1)_CONFIGURED) \
-               SOURCES=$$($(1)_SOURCES) $$*
-
-$(MY_OBJ_DIR)/$(1)/.downloaded:
-       $(MAKE) $(1)-download
-       @touch $$@
-
-$(MY_OBJ_DIR)/$(1)/.built:
-       rm -rf $(MY_OBJ_DIR)/$(1)
-       mkdir -p $(MY_OBJ_DIR)/$(1)
-       $(MAKE) $(1)-build
-       @touch $$@
-
-$(MY_OBJ_DIR)/$(1)/.faked:
-       rm -rf $(MY_OBJ_DIR)/$(1)-staging
-       mkdir -p $(MY_OBJ_DIR)/$(1)-staging
-       $(MAKE) $(1)-fake
-       @touch $$@
-
-$(MY_OUTPUT_DIR)/$(1).tar.gz: $(MY_OBJ_DIR)/$(1)/.faked
-       tar -C $(MY_OBJ_DIR)/$(1)-staging -zcf $$@ .
-
-.PHONY: install-$(1)
-install-$(1): $(MY_OUTPUT_DIR)/$(1).tar.gz
-       tar -C / -zxf $$<
-
-endef
-
-$(foreach c,$(COMPONENTS),$(eval $(call comp_template,$(c))))
-
-.PHONY: patchlist
-patchlist:
-       @$(call mkdir_clean,$(MY_OUTPUT_DIR)/patches)
-       @mkdir -p $(MY_OUTPUT_DIR)/patches
-       @for c in $(COMPONENTS); do \
-         for p in `$(MAKE) --no-print-directory $$c-patchlist`; do \
-           echo $$c gpl file $(MY_OUTPUT_DIR)/patches/$$p; \
-           cp $(REPO)/patches/$$p $(MY_OUTPUT_DIR)/patches/$$p; \
-         done; \
-       done
 
 .PHONY: clean
 clean::
-       rm -rf $(foreach c,$(COMPONENTS),$(MY_OBJ_DIR)/$(c) 
$(MY_OBJ_DIR)/$(c)-staging)
-       mkdir -p $(foreach c,$(COMPONENTS),$(MY_OBJ_DIR)/$(c) 
$(MY_OBJ_DIR)/$(c)-staging)
-       rm -f $(foreach c,$(COMPONENTS),$(MY_OUTPUT_DIR)/$(c).tar.gz)
-       rm -rf $(MY_OBJ_DIR)/restage
-       rm -f $(MY_OUTPUT_DIR)/ocaml-libs.tar.gz
+       rm -rf *.rpm
diff -r e6aea5fad86e -r 6310f068b5c8 annot.mk
--- a/annot.mk  Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-V=r26
-
-SRC=$(OBJDIR)/annot-$(V)
-
-$(EXTRACTED):
-       tar -C $(OBJDIR) -jxf $(DISTFILES)/annot-$(V).tar.bz2
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       cd $(SRC) && ./configure --prefix=$(PREFIX)
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) MAKEFILES=
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) install MAKEFILES= BINDIR=$(DESTDIR)$(PREFIX)/bin \
-               MAN1DIR=$(DESTDIR)$(PREFIX)/man/man1
-       @touch $@
-
-$(SOURCES):
-       @touch $@
-
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 common.mk
--- a/common.mk Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-.PHONY: extract
-extract: $(EXTRACTED)
-       @ : 
-
-.PHONY: patch
-patch: $(PATCHED)
-       @ :
-
-$(PATCHED): $(EXTRACTED)
-       cd $(SRC) && for i in $(PATCHES); do \
-         patch -b -p1 < $(CURDIR)/patches/$$i; \
-       done
-       @touch $@
-
-.PHONY: configure
-configure: $(CONFIGURED)
-       @ :
-
-.PHONY: build
-build: $(BUILT)
-       @ :
-
-.PHONY: fake
-fake: $(FAKED) $(SOURCES)
-       @ :
-
-.PHONY: all
-all: $(FAKED)
-       @ :
-
-.PHONY: clean
-clean::
-       rm -f $(EXTRACTED) $(BUILT) $(CONFIGURED) $(FAKED) $(PATCHED)
-
-.PHONY: patchlist
-patchlist:
-       @echo $(PATCHES)
diff -r e6aea5fad86e -r 6310f068b5c8 findlib.mk
--- a/findlib.mk        Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-V=1.1.2pl1
-
-NAME=findlib-$(V)
-PACKAGE=$(NAME).tar.gz
-URL=http://www.ocaml-programming.de/packages/$(PACKAGE)
-
-SRC=$(OBJDIR)/$(NAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       cd $(OBJDIR) && tar -zxf $(SRC_DIR)/$(PACKAGE)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       cd $(SRC) && ./configure -bindir $(PREFIX)/bin -mandir $(PREFIX)/man
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) all opt
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) prefix=$(DESTDIR) install
-       rm -f $(DESTDIR)$(PREFIX)/lib/ocaml
-       @touch $@
-
-$(SOURCES):
-       @touch $@
-
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 getopt.mk
--- a/getopt.mk Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-V=20040811
-
-PATCHES=getopt-install
-
-NAME=getopt-$(V)
-PACKAGE=$(NAME).tar.gz
-URL=http://www.eleves.ens.fr/home/frisch/info/$(PACKAGE)
-
-SRC=$(OBJDIR)/$(NAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       cd $(OBJDIR) && tar -zxf $(SRC_DIR)/$(PACKAGE)
-       mv $(OBJDIR)/getopt $(OBJDIR)/$(NAME)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) all allopt
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) install
-       @touch $@
-
-$(SOURCES):
-       echo ocaml gpl file $(DISTFILES)/$(PACKAGE) > $@
-       
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 ocaml.mk
--- a/ocaml.mk  Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-V=3.11.0
-
-NAME=ocaml-$(V)
-PACKAGE=$(NAME).tar.bz2
-URL=http://caml.inria.fr/pub/distrib/ocaml-3.11/$(PACKAGE)
-
-SRC=$(OBJDIR)/$(NAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       cd $(OBJDIR) && tar -jxf $(SRC_DIR)/$(PACKAGE)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       cd $(SRC) && ./configure -prefix $(PREFIX)
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) world.opt
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) PREFIX=$(DESTDIR)$(PREFIX) install
-       @touch $@
-
-$(SOURCES):
-       echo ocaml gpl file $(DISTFILES)/$(PACKAGE) > $@
-
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 omake.mk
--- a/omake.mk  Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-V=0.9.6.9
-SUBV=1
-
-PATCHES=omake-64bit-build-fixes omake-no-sync
-
-NAME=omake-$(V)
-PACKAGE=$(NAME)-$(SUBV).tar.gz
-URL=http://omake.metaprl.org/downloads/$(PACKAGE)
-
-SRC=$(OBJDIR)/$(NAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       cd $(OBJDIR) && tar -zxf $(SRC_DIR)/$(PACKAGE)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       # this will fail because of bad dependencies
-       -$(MAKE) -C $(SRC) PREFIX=$(PREFIX) boot
-       rm -f $(SRC)/boot/Makefile.dep
-       $(MAKE) -C $(SRC)/boot Makefile.dep
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) PREFIX=$(PREFIX) all
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) PREFIX=$(DESTDIR)$(PREFIX) install
-       @touch $@
-
-$(SOURCES):
-       @touch $@
-
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 patches/getopt-install
--- a/patches/getopt-install    Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
---- getopt/Makefile.orig       2007-01-23 07:45:56.000000000 -0500
-+++ getopt/Makefile    2007-01-23 07:51:07.000000000 -0500
-@@ -22,8 +22,10 @@
- sample: getopt.cma sample.cmo
-       ocamlc -o sample unix.cma getopt.cma sample.cmo
- 
-+install: SITELIB=$(shell ocamlfind printconf destdir)
- install:
--      ocamlfind install getopt META getopt.cmi getopt.cma $(wildcard 
getopt.cmxa) $(wildcard getopt.o) $(wildcard getopt.a)
-+      mkdir -p $(DESTDIR)$(SITELIB)
-+      ocamlfind install -destdir $(DESTDIR)$(SITELIB) getopt META getopt.cmi 
getopt.cma $(wildcard getopt.cmxa) $(wildcard getopt.o) $(wildcard getopt.a)
- 
- uninstall:
-       ocamlfind remove getopt
diff -r e6aea5fad86e -r 6310f068b5c8 patches/ocaml-get-backtrace
--- a/patches/ocaml-get-backtrace       Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-diff -ur ocaml-3.10.0/asmrun/backtrace.c 
ocaml-3.10.0-modified/asmrun/backtrace.c
---- ocaml-3.10.0/asmrun/backtrace.c    2007-01-29 12:10:52.000000000 +0000
-+++ ocaml-3.10.0-modified/asmrun/backtrace.c   2007-05-31 14:50:33.000000000 
+0100
-@@ -97,16 +97,17 @@
- 
- /* Print a backtrace */
- 
--static void print_location(int index, frame_descr * d)
-+static int print_location(int index, frame_descr * d, char *buffer, size_t 
bufsize)
- {
-   uintnat infoptr;
-   uint32 info1, info2, k, n, l, a, b;
-   char * kind;
-+  int ret=0;
- 
-   /* If no debugging information available, print nothing.
-      When everything is compiled with -g, this corresponds to 
-      compiler-inserted re-raise operations. */
--  if ((d->frame_size & 1) == 0) return;
-+  if ((d->frame_size & 1) == 0) return -1;
-   /* Recover debugging info */
-   infoptr = ((uintnat) d +
-              sizeof(char *) + sizeof(short) + sizeof(short) +
-@@ -136,14 +137,42 @@
-   else
-     kind = "Called from";
- 
--  fprintf(stderr, "%s file \"%s\", line %d, characters %d-%d\n",
--          kind, ((char *) infoptr) + n, l, a, b);
-+  ret=snprintf(buffer, bufsize, "%s file \"%s\", line %d, characters %d-%d\n",
-+             kind, ((char *) infoptr) + n, l, a, b);
-+  if(ret>bufsize) 
-+    ret=bufsize;
-+
-+  return ret;
- }
- 
--void caml_print_exception_backtrace(void)
-+CAMLexport size_t caml_get_exception_backtrace(char *buffer, size_t length)
- {
-   int i;
-+  size_t n=length;
-+  int ret;
-+  
-+  char *pos=buffer;
-+  
-+  for(i=0; i<caml_backtrace_pos; i++)
-+    {
-+      ret = print_location(i, (frame_descr *) caml_backtrace_buffer[i], pos, 
n);
-+      if(ret>0)
-+      {
-+        pos += ret;
-+        n -= ret;
-+      }
-+    }
-+
-+  /* Reset the backtrace buffer now */
-+
-+  caml_backtrace_last_exn=Val_unit;
-+  
-+  return(size_t)(pos - buffer);
-+}
- 
--  for (i = 0; i < caml_backtrace_pos; i++)
--    print_location(i, (frame_descr *) caml_backtrace_buffer[i]);
-+void caml_print_exception_backtrace(void)
-+{
-+  char backtracebuffer[1000];
-+  caml_get_exception_backtrace(backtracebuffer,sizeof(backtracebuffer));
-+  fprintf(stderr,"%s",backtracebuffer);
- }
-diff -ur ocaml-3.10.0/byterun/alloc.h ocaml-3.10.0-modified/byterun/alloc.h
---- ocaml-3.10.0/byterun/alloc.h       2005-09-22 15:21:50.000000000 +0100
-+++ ocaml-3.10.0-modified/byterun/alloc.h      2007-05-31 10:55:33.000000000 
+0100
-@@ -16,6 +16,8 @@
- #ifndef CAML_ALLOC_H
- #define CAML_ALLOC_H
- 
-+#define CAML_GOT_GET_BACKTRACE 1
-+
- 
- #ifndef CAML_NAME_SPACE
- #include "compatibility.h"
-diff -ur ocaml-3.10.0/byterun/backtrace.c 
ocaml-3.10.0-modified/byterun/backtrace.c
---- ocaml-3.10.0/byterun/backtrace.c   2007-01-29 12:11:15.000000000 +0000
-+++ ocaml-3.10.0-modified/byterun/backtrace.c  2007-05-31 14:50:11.000000000 
+0100
-@@ -97,6 +97,7 @@
-   }
- }
- 
-+
- /* Read the debugging info contained in the current bytecode executable.
-    Return a Caml array of Caml lists of debug_event records in "events",
-    or Val_false on failure. */
-@@ -168,16 +169,17 @@
- 
- /* Print the location corresponding to the given PC */
- 
--static void print_location(value events, int index)
-+static int print_location(value events, int index, char *buffer, size_t 
bufsize)
- {
-    code_t pc = caml_backtrace_buffer[index];
-   char * info;
-   value ev;
-+  int ret;
- 
-   ev = event_for_location(events, pc);
-   if (caml_is_instruction(*pc, RAISE)) {
-     /* Ignore compiler-inserted raise */
--    if (ev == Val_false) return;
-+    if (ev == Val_false) return -1;
-     /* Initial raise if index == 0, re-raise otherwise */
-     if (index == 0)
-       info = "Raised at";
-@@ -190,7 +192,7 @@
-       info = "Called from";
-   }
-   if (ev == Val_false) {
--    fprintf(stderr, "%s unknown location\n", info);
-+    ret = snprintf(buffer,bufsize, "%s unknown location\n", info);
-   } else {
-     value ev_start = Field (Field (ev, EV_LOC), LOC_START);
-     char *fname = String_val (Field (ev_start, POS_FNAME));
-@@ -199,24 +201,62 @@
-                    - Int_val (Field (ev_start, POS_BOL));
-     int endchr = Int_val (Field (Field (Field (ev, EV_LOC), LOC_END), 
POS_CNUM))
-                  - Int_val (Field (ev_start, POS_BOL));
--    fprintf (stderr, "%s file \"%s\", line %d, characters %d-%d\n", info, 
fname,
--             lnum, startchr, endchr);
-+    ret = snprintf (buffer,bufsize, "%s file \"%s\", line %d, characters 
%d-%d\n", info, fname,
-+                  lnum, startchr, endchr);
-   }
-+  if (ret>bufsize)
-+    ret=bufsize;
-+
-+  return ret;
- }
- 
- /* Print a backtrace */
- 
--CAMLexport void caml_print_exception_backtrace(void)
-+CAMLexport size_t caml_get_exception_backtrace(char *buffer, size_t length)
- {
--  value events;
--  int i;
-+  static value events=0;
-+  char *pos;
-+  int n,i,ret;
-+
-+  if(events==0)
-+    events = read_debug_info();
- 
--  events = read_debug_info();
-   if (events == Val_false) {
--    fprintf(stderr,
--            "(Program not linked with -g, cannot print stack backtrace)\n");
--    return;
--  }
-+    n=snprintf(buffer,length,
-+             "(Program not linked with -g, cannot print stack backtrace)\n");
-+    if(n<0)
-+      return 0;
-+
-+    if(n>length)
-+      return length;
-+
-+    return n;
-+  }
-+  
-+  pos=buffer;
-+  n=length;
-+
-   for (i = 0; i < caml_backtrace_pos; i++)
--    print_location(events, i);
-+    {
-+      ret = print_location(events, i, pos, n);
-+
-+      if(ret>0)
-+      {
-+        pos+=ret;
-+        n-=ret;
-+      }
-+    }
-+
-+  /* Reset the backtrace buffer now */
-+
-+  caml_backtrace_last_exn=Val_unit;
-+
-+  return (size_t)(pos-buffer);
-+}
-+
-+void caml_print_exception_backtrace(void)
-+{
-+  char backtracebuffer[1000];
-+  caml_get_exception_backtrace(backtracebuffer,sizeof(backtracebuffer));
-+  fprintf(stderr,"%s",backtracebuffer);
- }
diff -r e6aea5fad86e -r 6310f068b5c8 patches/ocaml-inotify-install
--- a/patches/ocaml-inotify-install     Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
---- ocaml_inotify-0.5/Makefile 2008-01-06 13:21:02.000000000 +0000
-+++ ocaml_inotify-0.5-fixed/Makefile   2008-01-09 13:55:50.307714000 +0000
-@@ -1,13 +1,14 @@
- CC = gcc
--CFLAGS = -Wall -fPIC -O2
-+CFLAGS := -Wall -fPIC -O2 $(CFLAGS)
- OCAMLC = ocamlc
- OCAMLOPT = ocamlopt
- 
- OCAMLOPTFLAGS =
- 
- OCAMLABI := $(shell ocamlc -version)
--OCAMLLIBDIR := $(shell ocamlc -where)
--OCAMLDESTDIR ?= $(OCAMLLIBDIR)
-+OCAMLLIBDIR ?= $(shell ocamlfind printconf destdir)
-+DESTDIR ?=
-+OCAMLDESTDIR ?= $(DESTDIR)$(OCAMLLIBDIR)
- 
- OCAML_TEST_INC = -I `ocamlfind query oUnit`
- OCAML_TEST_LIB = `ocamlfind query oUnit`/oUnit.cmxa
-@@ -15,11 +16,17 @@
- LIBS = inotify.cmi inotify.cmxa inotify.cma
- PROGRAMS = test.inotify
- 
-+.PHONY: all
- all: $(LIBS)
-+      @ :
- 
-+.PHONY: bins
- bins: $(PROGRAMS)
-+      @ :
- 
-+.PHONY: libs
- libs: $(LIBS)
-+      @ :
- 
- inotify.cmxa: libinotify_stubs.a inotify_stubs.a inotify.cmx
-       $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -cclib -linotify_stubs -o $@ inotify.cmx
-@@ -48,6 +55,7 @@
- 
- .PHONY: install
- install: $(LIBS)
-+      mkdir -p $(OCAMLDESTDIR)
-       ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore inotify META 
inotify.cmi inotify.mli inotify.cma inotify.cmxa *.a *.so *.cmx
- 
- uninstall:
diff -r e6aea5fad86e -r 6310f068b5c8 patches/osqlite3-install
--- a/patches/osqlite3-install  Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
---- ocaml_sqlite3-0.1/Makefile.orig    2007-01-25 10:35:32.000000000 -0500
-+++ ocaml_sqlite3-0.1/Makefile 2007-02-01 23:21:16.000000000 -0500
-@@ -1,5 +1,5 @@
- CC = gcc
--CFLAGS = -Wall -fPIC -O2 `pkg-config --cflags sqlite3`
-+CFLAGS := -Wall -fPIC -O2 `pkg-config --cflags sqlite3` $(CFLAGS)
- OCAMLC = ocamlc
- OCAMLOPT = ocamlopt
- 
-@@ -9,8 +9,9 @@
- OCAML_PKG_NAME = sqlite3
- 
- OCAMLABI := $(shell ocamlc -version)
--OCAMLLIBDIR := $(shell ocamlc -where)
--OCAMLDESTDIR ?= $(OCAMLLIBDIR)
-+OCAMLLIBDIR ?= $(shell ocamlfind printconf destdir)
-+DESTDIR ?=
-+OCAMLDESTDIR ?= $(DESTDIR)$(OCAMLLIBDIR)
- 
- OCAML_TEST_INC = -I `ocamlfind query oUnit`
- OCAML_TEST_LIB = `ocamlfind query oUnit`/oUnit.cmxa
-@@ -21,11 +22,17 @@
- 
- PROGRAMS = test.sqlite3
- 
-+.PHONY: all
- all: check $(LIBS) $(PROGRAMS)
-+      @ :
- 
-+.PHONY: bins
- bins: $(PROGRAMS)
-+      @ :
- 
-+.PHONY: libs
- libs: $(LIBS)
-+      @ :
- 
- sqlite3.cmxa: libsqlite3_stubs.a sqlite3_stubs.a sqlite3.cmx
-       $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -cclib -lsqlite3 -cclib -lsqlite3_stubs 
-o $@ sqlite3.cmx
-@@ -60,6 +67,7 @@
- 
- .PHONY: install
- install: $(LIBS)
-+      mkdir -p $(OCAMLDESTDIR)
-       ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore 
$(OCAML_PKG_NAME) META sqlite3.cmi sqlite3.mli sqlite3.cma sqlite3.cmxa *.a 
*.so *.cmx
- 
- uninstall:
diff -r e6aea5fad86e -r 6310f068b5c8 patches/type-conv-install
--- a/patches/type-conv-install Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-diff -r e2f8e057ee2e Makefile
---- a/lib/Makefile     Mon Oct 19 15:40:26 2009 +0100
-+++ b/lib/Makefile     Mon Oct 19 15:45:06 2009 +0100
-@@ -1,5 +1,6 @@
- RESULT = type-conv
- 
-+SITELIB=$(shell ocamlfind printconf destdir)
- OCAMLMAKEFILE = ../OCamlMakefile
- OCAMLFLAGS = -w Ae
- 
-@@ -11,7 +12,11 @@
- 
- LIBINSTALL_FILES = pa_type_conv.cmi pa_type_conv.cmo
- 
--install:      libinstall
--uninstall:    libuninstall
-+install:
-+      mkdir -p $(DESTDIR)$(SITELIB)
-+      ocamlfind install -destdir $(DESTDIR)$(SITELIB) -ldconf ignore 
$(RESULT) META $(LIBINSTALL_FILES)
-+
-+uninstall:
-+      ocamlfind remove $(RESULT)
- 
- -include $(OCAMLMAKEFILE)
diff -r e6aea5fad86e -r 6310f068b5c8 patches/xml-light-install
--- a/patches/xml-light-install Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
---- xml-light/Makefile.orig    2003-10-12 11:16:12.000000000 -0400
-+++ xml-light/Makefile 2006-10-18 11:58:20.000000000 -0400
-@@ -2,7 +2,6 @@
- # http://tech.motion-twin.com
- .SUFFIXES : .ml .mli .cmo .cmx .cmi .mll .mly
- 
--INSTALLDIR=`ocamlc -where`
- CFLAGS=
- LFLAGS= -a
- LIBS=
-@@ -11,8 +10,10 @@
- 
- opt: xml-light.cmxa test_opt.exe
- 
-+install: SITELIB=$(shell ocamlfind printconf destdir)
- install: all opt
--      cp xml-light.cmxa xml-light.a xml-light.cma xml.mli xmlParser.mli 
dtd.mli xml.cmi xmlParser.cmi dtd.cmi xml.cmx dtd.cmx xmlParser.cmx 
$(INSTALLDIR)
-+      mkdir -p $(DESTDIR)$(SITELIB)
-+      ocamlfind install -destdir $(DESTDIR)$(SITELIB) xml-light META xml.mli 
xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi xml-light.cma 
xml-light.cmxa xml-light.a
- 
- doc:
-       mkdir doc
-@@ -30,6 +31,8 @@
- xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx 
-       ocamlopt -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx 
xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx
- 
-+xml_parser.cmi: xml_parser.mli
-+
- dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi
- 
- dtd.cmx: xml.cmi xml_lexer.cmi dtd.cmi
diff -r e6aea5fad86e -r 6310f068b5c8 patches/xml-light-meta
--- a/patches/xml-light-meta    Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-diff -r b6415f24f044 xml-light/META
---- /dev/null   Thu Jan 01 00:00:00 1970 +0000
-+++ b/META      Wed Jun 14 15:52:54 2006 +0100
-@@ -0,0 +1,4 @@
-+version="2.2"
-+archive(byte)="xml-light.cma"
-+archive(native)="xml-light.cmxa"
-+           
diff -r e6aea5fad86e -r 6310f068b5c8 patches/xml-light-parse-fix
--- a/patches/xml-light-parse-fix       Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-diff -r fd4678359d0c xml-light/xml_lexer.mll
---- a/xml_lexer.mll    Fri Jun 09 15:57:54 2006 +0100
-+++ b/xml_lexer.mll    Fri Jun 09 15:59:20 2006 +0100
-@@ -109,7 +109,7 @@ let newline = ['\n']
- let newline = ['\n']
- let break = ['\r']
- let space = [' ' '\t']
--let identchar =  ['A'-'Z' 'a'-'z' '_' '0'-'9' ':' '-']
-+let identchar =  ['A'-'Z' 'a'-'z' '_' '0'-'9' ':' '-' '.']
- let entitychar = ['A'-'Z' 'a'-'z']
- let pcchar = [^ '\r' '\n' '<' '>' '&']
- 
diff -r e6aea5fad86e -r 6310f068b5c8 type-conv.mk
--- a/type-conv.mk      Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-V=1.6.8
-
-PATCHES=type-conv-install
-
-NAME=type-conv-$(V)
-FILENAME=type-conv-release-$(V)
-ARCHIVE=release-$(V).tar.bz2
-PACKAGE=$(NAME).tar.bz2
-URL=http://hg.ocaml.info/release/type-conv/archive/$(ARCHIVE)
-
-SRC=$(OBJDIR)/$(FILENAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       cd $(OBJDIR) && tar -jxf $(SRC_DIR)/$(PACKAGE)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC)
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) PREFIX=$(DESTDIR)$(PREFIX) install
-       @touch $@
-
-$(SOURCES):
-       echo ocaml gpl file $(DISTFILES)/$(PACKAGE) > $@
-
-clean::
-       rm -rf $(SRC)
diff -r e6aea5fad86e -r 6310f068b5c8 xmlm.mk
--- a/xmlm.mk   Fri May 28 15:19:58 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-V=1.0.1
-
-PATCHES=xmlm-install xmlm-do-not-display-none-dtd-on-output
-
-NAME=xmlm-$(V)
-PACKAGE=$(NAME).tbz
-URL=http://erratique.ch/software/xmlm/releases/$(PACKAGE)
-
-SRC=$(OBJDIR)/$(NAME)
-
-$(DOWNLOADED):
-       echo $(SRC_DIR)
-       @mkdir -p $(SRC_DIR)
-       bash -c 'if [ ! -e $(SRC_DIR)/$(PACKAGE) ]; then if [ -e 
$(DISTFILES)/$(PACKAGE) ]; then cp $(DISTFILES)/$(PACKAGE) $(SRC_DIR); else 
wget $(URL) --output-document=$(SRC_DIR)/$(PACKAGE); fi; fi'
-       @touch $@
-
-$(EXTRACTED): $(DOWNLOADED)
-       rm -rf $(SRC)
-       cd $(OBJDIR) && tar -jxvf $(SRC_DIR)/$(PACKAGE)
-       @touch $@
-
-$(CONFIGURED): $(PATCHED)
-       @touch $@
-
-$(BUILT): $(CONFIGURED)
-       $(MAKE) -C $(SRC) default
-       @touch $@
-
-$(FAKED): $(BUILT)
-       $(MAKE) -C $(SRC) install
-       @touch $@
-
-$(SOURCES):
-       echo ocaml bsd file $(DISTFILES)/$(PACKAGE) > $@
-
-clean::
-       rm -rf $(SRC)

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api