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
This commit is contained in:
parent
70e1b8fc74
commit
fb80b07d22
2 changed files with 33 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2003-03-22 Andreas Tobler <a.tobler@schweiz.ch>
|
||||||
|
|
||||||
|
* libjava.jni/jni.exp: Add compilation/link fix dor darwin dylibs.
|
||||||
|
|
||||||
2003-03-22 Tom Tromey <tromey@redhat.com>
|
2003-03-22 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* lib/libjava.exp (gcj_invoke): Moved...
|
* lib/libjava.exp (gcj_invoke): Moved...
|
||||||
|
|
|
@ -5,11 +5,26 @@
|
||||||
# success.
|
# success.
|
||||||
proc gcj_jni_compile_c_to_so {file {options {}}} {
|
proc gcj_jni_compile_c_to_so {file {options {}}} {
|
||||||
global srcdir
|
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 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.
|
# Find the generated header.
|
||||||
lappend options "additional_flags=-I. -I.."
|
lappend options "additional_flags=-I. -I.."
|
||||||
# Find jni.h.
|
# 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.
|
# Do all the work for a single JNI test. Return 0 on failure.
|
||||||
proc gcj_jni_test_one {file} {
|
proc gcj_jni_test_one {file} {
|
||||||
global runtests
|
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.
|
# The base name. We use it for several purposes.
|
||||||
set main [file rootname [file tail $file]]
|
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.
|
# 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
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue