This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: jni support for darwin


Hi,

this patch together with these two:

http://gcc.gnu.org/ml/java-patches/2003-q1/msg00687.html
http://gcc.gnu.org/ml/java-patches/2003-q1/msg00675.html

Brings the jni testcases under darwin to work, except one. Will figure out later.

The first part omits an underscore in ltdl.c. This underscore is handled by dlcompat. Dlcompat is a wrapper library which offers support for dl functions under darwin. Dlcompat is necessary right now to handle dynamic libraries on darwin.

The second part modifies posix.h, it changes the suffix for shared libraries under darwin to dylib. It is too less to generate an own file for this.

The 'if defined uses' the builtins from darwin gcc, I didn't find another solution.

Tested on 3.4 and 3.3. Ok to commit?

Thanks,
Andreas

Running /Volumes/xufs/gcc-cvs/gcc/libjava/testsuite/libjava.jni/jni.exp ...
FAIL: cxxtest.c compilation

=== libjava Summary ===

# of expected passes            62
# of unexpected failures        1


2003-03-10 Andreas Tobler <a dot tobler at schweiz dot ch>


* include/posix.h: Add suffix for darwin dynamic libraries.

2003-03-10 Andreas Tobler <a dot tobler at schweiz dot ch>

* libltdl/ltdl.c: Omit underscore under darwin.



Index: libltdl/ltdl.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/libltdl/ltdl.c,v
retrieving revision 1.3
diff -u -r1.3 ltdl.c
--- libltdl/ltdl.c	10 Sep 2000 08:04:40 -0000	1.3
+++ libltdl/ltdl.c	10 Mar 2003 18:34:44 -0000
@@ -337,8 +337,12 @@
 	return address;
 }
 
+/* On darwin if we use dlcompat it introduces an underscore there.
+ * So we omit it here in sys_dl.
+ * We should change to real darwin library load routines.
+ */
 static struct lt_user_dlloader sys_dl = {
-#  ifdef NEED_USCORE
+#  if defined (NEED_USCORE) && !defined(__APPLE__) && !defined(__MACH__)
 	   "_",
 #  else
 	   0,
Index: include/posix.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/posix.h,v
retrieving revision 1.16
diff -u -r1.16 posix.h
--- include/posix.h	19 Feb 2003 16:28:37 -0000	1.16
+++ include/posix.h	10 Mar 2003 18:34:44 -0000
@@ -42,7 +42,11 @@
 
 // Prefix and suffix for shared libraries.
 #define _Jv_platform_solib_prefix "lib"
+#if defined(__APPLE__) && defined(__MACH__) && defined(__ppc__)
+#define _Jv_platform_solib_suffix ".dylib"
+#else
 #define _Jv_platform_solib_suffix ".so"
+#endif
 
 #ifndef DISABLE_JAVA_NET
 #include <java/net/InetAddress.h>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]