summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.jni
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-22 10:45:04 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-22 10:45:04 +0000
commitc439b32f29f249151c7f4140ad9e0ebaead54576 (patch)
tree69ae42fbcd92f4ef32b7e84724b373bfc06349e5 /libjava/testsuite/libjava.jni
parent1269aca3eccdc121e4fdfd35e79770b60044ff09 (diff)
downloadgcc-c439b32f29f249151c7f4140ad9e0ebaead54576.tar.gz
2003-03-22 Andreas Tobler <a.tobler@schweiz.ch>
* libjava.jni/jni.exp: Add compilation/link fix dor darwin dylibs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64704 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite/libjava.jni')
-rw-r--r--libjava/testsuite/libjava.jni/jni.exp34
1 files changed, 30 insertions, 4 deletions
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp
index 6d6c93d9197..7dad519d415 100644
--- a/libjava/testsuite/libjava.jni/jni.exp
+++ b/libjava/testsuite/libjava.jni/jni.exp
@@ -5,11 +5,26 @@
# success.
proc gcj_jni_compile_c_to_so {file {options {}}} {
global srcdir
-
+ global host_triplet
+ verbose "options: $options"
+ set options_cxx $options
+ set options ""
+
+# apple uses a different extension for shared/dynamic libraries
+# so we check against powerpc-apple-darwin and set them to
+# dylib, else we assume it's .so
+
+ if { [ regexp {powerpc-apple-darwin} $host_triplet] } {
+ set so_extension "dylib"
+ set so_flag "-dynamiclib"
+ } else {
+ set so_extension "so"
+ set so_flag "-shared"
+ }
set name [file rootname [file tail $file]]
- set soname lib${name}.so
+ set soname lib${name}.${so_extension}
- lappend options "additional_flags=-shared -fPIC"
+ lappend options "additional_flags=${so_flag} -fPIC"
# Find the generated header.
lappend options "additional_flags=-I. -I.."
# Find jni.h.
@@ -46,6 +61,17 @@ proc gcj_jni_build_header {file} {
# Do all the work for a single JNI test. Return 0 on failure.
proc gcj_jni_test_one {file} {
global runtests
+ global host_triplet
+
+# apple uses a different extension for shared/dynamic libraries
+# so we check against powerpc-apple-darwin and set them to
+# dylib, else we assume it's .so
+
+ if { [ regexp {powerpc-apple-darwin} $host_triplet] } {
+ set so_extension "dylib"
+ } else {
+ set so_extension "so"
+ }
# The base name. We use it for several purposes.
set main [file rootname [file tail $file]]
@@ -112,7 +138,7 @@ proc gcj_jni_test_one {file} {
}
# When we succeed we remove all our clutter.
- eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main lib${main}.so]
+ eval gcj_cleanup [glob -nocomplain -- ${main}.*] [list $main lib${main}.${so_extension}]
return 1
}