[Pkg-ocaml-maint-commits] [SCM] camljava packaging branch, master, updated. upstream/0.3.orig-5-g41faf0a

Stefano Zacchiroli zack at upsilon.cc
Thu Nov 26 14:15:51 UTC 2009


The following commit has been merged in the master branch:
commit f100b78c0eb7da55bd258e58f34124f0feb41d1c
Author: Stefano Zacchiroli <zack at upsilon.cc>
Date:   Thu Nov 26 14:17:16 2009 +0100

    first round of patches

diff --git a/debian/patches/0001-ldflags-for-recent-JDK.patch b/debian/patches/0001-ldflags-for-recent-JDK.patch
new file mode 100644
index 0000000..72b44c7
--- /dev/null
+++ b/debian/patches/0001-ldflags-for-recent-JDK.patch
@@ -0,0 +1,44 @@
+From: Stefano Zacchiroli <zack at upsilon.cc>
+Date: Thu, 26 Nov 2009 13:55:49 +0100
+Subject: [PATCH] ldflags for recent JDK
+
+---
+ Makefile.config |   17 ++++++++++++-----
+ 1 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.config b/Makefile.config
+index 5cd82d8..133cd2d 100644
+--- a/Makefile.config
++++ b/Makefile.config
+@@ -17,7 +17,13 @@ JAVAC=javac -g
+ ## For other platforms, adjust as required and tell us about it.
+ 
+ # Home location for the JDK.  Only used for setting other variables below. 
+-JDKHOME=/usr/local/java_1.4.2
++JDKHOME=/usr/lib/jvm/java-6-sun
++
++# Current architecture identification string, as intended by the JDK.
++# Common values for x86 architectures are "i386" or "amd64". You can find it
++# out by looking for the "*" patch component in the following pattern:
++# $(JDKHOME)/jre/lib/*/libjava.so
++ARCH=amd64
+ 
+ # Where to find the JNI include files (for compiling the OCaml-JNI C stubs)
+ JNIINCLUDES=-I$(JDKHOME)/include -I$(JDKHOME)/include/linux
+@@ -26,10 +32,11 @@ JNIINCLUDES=-I$(JDKHOME)/include -I$(JDKHOME)/include/linux
+ JNILIBS=-ljava
+ 
+ # Additional link-time options to pass to $(CC) when linking with $(JNILIBS)
+-JNILIBOPTS=-L$(JDKHOME)/jre/lib/i386/ \
+-        -Wl,-rpath,$(JDKHOME)/jre/lib/i386/ \
+-        -Wl,-rpath,$(JDKHOME)/jre/lib/i386/client \
+-        -Wl,-rpath,$(JDKHOME)/jre/lib/i386/native_threads
++JNILIBOPTS=-L$(JDKHOME)/jre/lib/$(ARCH)/ \
++        -L$(JDKHOME)/jre/lib/$(ARCH)/server \
++        -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/ \
++        -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/server \
++        -Wl,-rpath,$(JDKHOME)/jre/lib/$(ARCH)/native_threads
+ 
+ # Additional options when compiling the OCaml-JNI C stubs.
+ # -DJDK122_LINUX_HACK works around a nasty thread-related bug of
+-- 
diff --git a/debian/patches/0002-Makefile-misc-fixes.patch b/debian/patches/0002-Makefile-misc-fixes.patch
new file mode 100644
index 0000000..12499eb
--- /dev/null
+++ b/debian/patches/0002-Makefile-misc-fixes.patch
@@ -0,0 +1,69 @@
+From: Stefano Zacchiroli <zack at upsilon.cc>
+Date: Thu, 26 Nov 2009 14:01:59 +0100
+Subject: [PATCH] Makefile misc fixes
+
+- ensure files created during build are removed upon clean
+- split byte/opt targets to ease build and install on non-native archs
+---
+ Makefile      |    2 ++
+ lib/Makefile  |    5 +++--
+ test/Makefile |    3 ++-
+ 3 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index be1060f..6dc07b8 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,7 @@
+ all:
+ 	cd lib; $(MAKE) all
++byte:
++	cd lib; $(MAKE) byte
+ 
+ install:
+ 	cd lib; $(MAKE) install
+diff --git a/lib/Makefile b/lib/Makefile
+index bf56bcc..9f63867 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -7,10 +7,11 @@ OCAMLLIB=`ocamlc -where`
+ CAMLJAVALIB=$(OCAMLLIB)/camljava
+ 
+ all: jni.cma jni.cmxa javaclasses
++byte: jni.cma javaclasses
+ 
+ install:
+ 	mkdir -p $(CAMLJAVALIB)
+-	cp jni.cma jni.cmi jni.cmxa jni.a libcamljni.a jni.mli $(CAMLJAVALIB)
++	cp jni.cma jni.cmi $(wildcard jni.cmxa jni.a) libcamljni.a jni.mli $(CAMLJAVALIB)
+ 	jar cf $(CAMLJAVALIB)/camljava.jar fr/inria/caml/camljava/*.class
+ 
+ jni.cma: jni.cmo libcamljni.a
+@@ -46,7 +47,7 @@ clean::
+ 	rm -f fr/inria/caml/camljava/*.class
+ 
+ clean::
+-	rm -f *.cm? *.[oa]
++	rm -f *.cm? *.[oa] *.cmxa
+ 
+ .SUFFIXES: .ml .mli .cmo .cmi .cmx
+ 
+diff --git a/test/Makefile b/test/Makefile
+index 78eca4c..2e1be64 100644
+--- a/test/Makefile
++++ b/test/Makefile
+@@ -3,7 +3,7 @@ include ../Makefile.config
+ CAMLJAVA=`ocamlc -where`/camljava/camljava.jar
+ 
+ all: jnitest Test.class Testcb.class
+-	./jnitest
++	CLASSPATH=. ./jnitest
+ 
+ jnitest: jnitest.ml
+ 	ocamlc -ccopt -g -o jnitest -I +camljava jni.cma jnitest.ml
+@@ -18,3 +18,4 @@ clean::
+ 
+ clean::
+ 	rm -f *.cm?
++	rm -f *.class
+-- 
diff --git a/debian/patches/0003-GC-global-reference-fix-for-JDK-1.6.patch b/debian/patches/0003-GC-global-reference-fix-for-JDK-1.6.patch
new file mode 100644
index 0000000..cd7cec5
--- /dev/null
+++ b/debian/patches/0003-GC-global-reference-fix-for-JDK-1.6.patch
@@ -0,0 +1,27 @@
+From: Gregoire Henry <Gregoire.Henry at pps.jussieu.fr>
+Date: Thu, 26 Nov 2009 14:15:43 +0100
+Subject: [PATCH] GC global reference fix for JDK 1.6
+
+Starting from JDK 1.6, local references might be cleaned up by the Garbage
+Collector at the end of native methods. Since classes representing OCaml types
+are long lived for CamlJava, they can't be local references otherwise they will
+be collected.
+
+This fix turns references to OCaml type classes into global references.
+---
+ lib/jnistubs.c |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/lib/jnistubs.c b/lib/jnistubs.c
+index 368c03e..5d6b92e 100644
+--- a/lib/jnistubs.c
++++ b/lib/jnistubs.c
+@@ -735,6 +735,7 @@ static int init_caml_classes(JNIEnv * env)
+ {
+ #define INIT_CAML_CLASS(cls,fld,cname,fsig)                                 \
+     cls = (*env)->FindClass(env, cname);                                    \
++    cls = (*env)->NewGlobalRef(env, cls);                                   \
+     if (cls == NULL) return -1;                                             \
+     fld = (*env)->GetFieldID(env, cls, "contents", fsig);                   \
+     if (fld == NULL) return -1;
+-- 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0e4c541
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,3 @@
+0001-ldflags-for-recent-JDK.patch
+0002-Makefile-misc-fixes.patch
+0003-GC-global-reference-fix-for-JDK-1.6.patch

-- 
camljava packaging



More information about the Pkg-ocaml-maint-commits mailing list