jamvm: Added support for variable JNI path.
authorRobert Schuster <thebohemian@gmx.net>
Sat, 9 Feb 2008 03:14:56 +0000 (03:14 +0000)
committerRobert Schuster <thebohemian@gmx.net>
Sat, 9 Feb 2008 03:14:56 +0000 (03:14 +0000)
packages/jamvm/files/debian-jni.patch [new file with mode: 0644]
packages/jamvm/jamvm.inc
packages/jamvm/jamvm_1.5.0.bb

diff --git a/packages/jamvm/files/debian-jni.patch b/packages/jamvm/files/debian-jni.patch
new file mode 100644 (file)
index 0000000..040163d
--- /dev/null
@@ -0,0 +1,19 @@
+--- src/dll.c.orig     2004-09-09 15:48:45.000000000 +0000
++++ src/dll.c  2004-09-09 15:50:32.000000000 +0000
+@@ -189,6 +189,16 @@
+ #ifndef NO_JNI
+     /* Init hash table, and create lock */
+     initHashTable(hash_table, HASHTABSZE, TRUE);
++
++    /* XXX: Add Debian JNI directory.  */
++    char* path = getenv("LD_LIBRARY_PATH");
++
++    if (path != NULL)
++      path = strcat(path, ":OE_LIBDIR_JNI");
++    else
++      path = "OE_LIBDIR_JNI";
++    
++    setenv("LD_LIBRARY_PATH", path, 1);
+ #endif
+ }
index 3637837..930159e 100644 (file)
@@ -12,7 +12,7 @@ RPROVIDES_jamvm = "java2-runtime"
 # This uses 32 bit arm, so force the instruction set to arm, not thumb
 ARM_INSTRUCTION_SET = "arm"
 
-inherit autotools update-alternatives
+inherit java autotools update-alternatives
 
 EXTRA_OECONF = "--with-classpath-install-dir=${prefix}"
 CFLAGS += "-DDEFAULT_MAX_HEAP=16*MB"
index efa959f..366658d 100644 (file)
@@ -1,5 +1,12 @@
 require jamvm.inc
 
-PR = "r0"
+SRC_URI += "file://debian-jni.patch;patch=1;pnum=0"
 
+PR = "r1"
+
+do_configure_prepend() {
+  # Replaces the placeholder OE_LIBDIR_JNI with the JNI library directory
+  # configured in OE.
+  sed -i -e "s|OE_LIBDIR_JNI|${libdir_jni}|" src/dll.c
+}