Commit a96cf763 by Andreas Tobler Committed by Andreas Tobler

libjava.exp (libjava_init): Use the same target check for Darwin.

2005-03-11  Andreas Tobler  <a.tobler@schweiz.ch>

	* testsuite/lib/libjava.exp (libjava_init): Use the same target
	check for Darwin.
	(libjava_arguments): Likewise.

	* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Likewise.
	(gcj_jni_test_one): Likewise.
	(gcj_jni_invocation_compile_c_to_binary): Likewise.
	Add flags to keep the Darwin linker quiet.
	(gcj_jni_invocation_test_one): Use the same target check for Darwin.
	Add -liconv for Darwin.

From-SVN: r96311
parent f817d5d4
2005-03-11 Andreas Tobler <a.tobler@schweiz.ch>
* testsuite/lib/libjava.exp (libjava_init): Use the same target
check for Darwin.
(libjava_arguments): Likewise.
* testsuite/libjava.jni/jni.exp (gcj_jni_compile_c_to_so): Likewise.
(gcj_jni_test_one): Likewise.
(gcj_jni_invocation_compile_c_to_binary): Likewise.
Add flags to keep the Darwin linker quiet.
(gcj_jni_invocation_test_one): Use the same target check for Darwin.
Add -liconv for Darwin.
2005-03-11 Tom Tromey <tromey@redhat.com> 2005-03-11 Tom Tromey <tromey@redhat.com>
* gnu/gcj/tools/gcj_dbtool/Main.java (main): Handle '-p'. * gnu/gcj/tools/gcj_dbtool/Main.java (main): Handle '-p'.
......
...@@ -197,8 +197,8 @@ proc libjava_init { args } { ...@@ -197,8 +197,8 @@ proc libjava_init { args } {
# Finally, add the gcc build directory so that we can find the # Finally, add the gcc build directory so that we can find the
# shared libgcc. This, like much of dejagnu, is hideous. # shared libgcc. This, like much of dejagnu, is hideous.
set libjava_libgcc_s_path {} set libjava_libgcc_s_path {}
if { [string match "powerpc-*-darwin*" $target_triplet] } { if { [istarget "*-*-darwin*"] } {
set so_extension "dylib" set so_extension "dylib"
} else { } else {
set so_extension "so" set so_extension "so"
......
...@@ -14,7 +14,7 @@ proc gcj_jni_compile_c_to_so {file {options {}}} { ...@@ -14,7 +14,7 @@ proc gcj_jni_compile_c_to_so {file {options {}}} {
# so we check against powerpc-apple-darwin and set them to # so we check against powerpc-apple-darwin and set them to
# dylib, else we assume it's .so # dylib, else we assume it's .so
if { [ regexp {powerpc-apple-darwin} $host_triplet] } { if { [istarget "*-*-darwin*"] } {
set so_extension "dylib" set so_extension "dylib"
set so_flag "-dynamiclib" set so_flag "-dynamiclib"
} else { } else {
...@@ -77,10 +77,10 @@ proc gcj_jni_test_one {file} { ...@@ -77,10 +77,10 @@ proc gcj_jni_test_one {file} {
global INTERPRETER global INTERPRETER
# apple uses a different extension for shared/dynamic libraries # apple uses a different extension for shared/dynamic libraries
# so we check against powerpc-apple-darwin and set them to # so we check against powerpc-apple-darwin and set them to
# dylib, else we assume it's .so # dylib, else we assume it's .so
if { [ regexp {powerpc-apple-darwin} $host_triplet] } { if { [istarget "*-*-darwin*"] } {
set so_extension "dylib" set so_extension "dylib"
} else { } else {
set so_extension "so" set so_extension "so"
...@@ -134,12 +134,12 @@ proc gcj_jni_test_one {file} { ...@@ -134,12 +134,12 @@ proc gcj_jni_test_one {file} {
# Darwin does not yet have a libgcc_s.dylib library. # Darwin does not yet have a libgcc_s.dylib library.
# So we add it here. If the libgcc_s is installed, the libstdc++ # So we add it here. If the libgcc_s is installed, the libstdc++
# would pick it up. # would pick it up.
if { [ regexp {powerpc-apple-darwin} $host_triplet] } { if { [istarget "*-*-darwin*"] } {
lappend cxxflaglist "-lgcc_s -lstdc++" lappend cxxflaglist "-lgcc_s -lstdc++"
} else { } else {
lappend cxxflaglist "-lstdc++" lappend cxxflaglist "-lstdc++"
} }
set cxxflags [join $cxxflaglist] set cxxflags [join $cxxflaglist]
} }
...@@ -194,6 +194,10 @@ proc gcj_jni_invocation_compile_c_to_binary {file {options {}}} { ...@@ -194,6 +194,10 @@ proc gcj_jni_invocation_compile_c_to_binary {file {options {}}} {
set filename [file tail $file] set filename [file tail $file]
set name [file rootname $filename] set name [file rootname $filename]
# Set some darwin specific options
if { [istarget "*-*-darwin*"] } {
lappend options "additional_flags=-multiply_defined suppress"
}
# Find the generated header. # Find the generated header.
lappend options "additional_flags=-I. -I.." lappend options "additional_flags=-I. -I.."
...@@ -238,7 +242,12 @@ proc gcj_jni_invocation_test_one {file} { ...@@ -238,7 +242,12 @@ proc gcj_jni_invocation_test_one {file} {
pass "bytecompile $file" pass "bytecompile $file"
set cfile [file rootname $file].c set cfile [file rootname $file].c
set cxxflags "-L../.libs -lgcj" # Darwin needs -liconv linked, otherwise we get some unresolved.
if { [istarget "*-*-darwin*"] } {
set cxxflags "-L../.libs -lgcj -liconv"
} else {
set cxxflags "-L../.libs -lgcj"
}
if {! [gcj_jni_invocation_compile_c_to_binary $cfile $cxxflags]} { if {! [gcj_jni_invocation_compile_c_to_binary $cfile $cxxflags]} {
# FIXME # FIXME
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment