diff options
author | Andreas Tobler <a.tobler@schweiz.ch> | 2003-03-22 11:45:04 +0100 |
---|---|---|
committer | Andreas Tobler <andreast@gcc.gnu.org> | 2003-03-22 11:45:04 +0100 |
commit | fb80b07d22c010b3d8a545922145f1ad4179b482 (patch) | |
tree | 69ae42fbcd92f4ef32b7e84724b373bfc06349e5 /libjava/testsuite/libjava.jni/jni.exp | |
parent | 70e1b8fc746e1dfa471f3a39ef27166a5063c6ae (diff) | |
download | gcc-fb80b07d22c010b3d8a545922145f1ad4179b482.zip gcc-fb80b07d22c010b3d8a545922145f1ad4179b482.tar.gz gcc-fb80b07d22c010b3d8a545922145f1ad4179b482.tar.bz2 |
jni.exp: Add compilation/link fix dor darwin dylibs.
2003-03-22 Andreas Tobler <a.tobler@schweiz.ch>
* libjava.jni/jni.exp: Add compilation/link fix dor darwin dylibs.
From-SVN: r64704
Diffstat (limited to 'libjava/testsuite/libjava.jni/jni.exp')
-rw-r--r-- | libjava/testsuite/libjava.jni/jni.exp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/libjava/testsuite/libjava.jni/jni.exp b/libjava/testsuite/libjava.jni/jni.exp index 6d6c93d..7dad519 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 } |