[patch] jni testsuite darwin specific

Andreas Tobler andreast-list@fgznet.ch
Thu Dec 6 19:03:00 GMT 2007


Andrew Haley wrote:
> Andreas Tobler writes:
>  > Hi all,
>  > 
>  > the patch below makes the testsuite recognize the right library path 
>  > when compiled for multilib under darwin.
>  > 
>  > ok for trunk?
> 
> Why is this different for Darwin?  Looks fairly generic to me.

The difference is only that Darwin needs more libraries to be linked 
with. And the code path is Darwin only.
To find the right library path, this is generic, yes.

Do you find the below a better approach?

Thanks for review.

Andreas

Index: testsuite/libjava.jni/jni.exp
===================================================================
--- testsuite/libjava.jni/jni.exp       (revision 130635)
+++ testsuite/libjava.jni/jni.exp       (working copy)
@@ -241,6 +241,14 @@
  }

  proc gcj_jni_get_cxxflags_invocation {} {
+  global LIBJAVA
+  if [info exists LIBJAVA] {
+      set libjava $LIBJAVA;
+  } else {
+      set libjava [libjava_find_lib libjava gcj]
+  }
+  set cxxflags "$libjava -ljvm"
+
    # Darwin needs -liconv linked, otherwise we get some unresolved.
    # If you're building the compiler with --prefix set to a place
    # where it's not yet installed, then the linker won't be able to
@@ -249,15 +257,7 @@
    # to just make the linker find libgcc using -L options.
    # Similar logic applies to libgcj.
    if { [istarget "*-*-darwin*"] } {
-      set cxxflags "-L../.libs -shared-libgcc -ljvm -lgcj -liconv"
-  } else {
-      global LIBJAVA
-      if [info exists LIBJAVA] {
-         set libjava $LIBJAVA;
-      } else {
-         set libjava [libjava_find_lib libjava gcj]
-      }
-      set cxxflags "$libjava -ljvm"
+    lappend cxxflags -shared-libgcc -lgcj -liconv
    }

    if { [istarget "*-*-solaris*"] } {



More information about the Java-patches mailing list