This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [patch] jni testsuite darwin specific
- From: Andreas Tobler <andreast-list at fgznet dot ch>
- To: Andrew Haley <aph at redhat dot com>
- Cc: Java Patches <java-patches at gcc dot gnu dot org>
- Date: Thu, 06 Dec 2007 20:03:31 +0100
- Subject: Re: [patch] jni testsuite darwin specific
- References: <475712B5.4000206@fgznet.ch> <18263.50916.668322.401292@zebedee.pink>
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*"] } {