summaryrefslogtreecommitdiff
path: root/libjava/testsuite
diff options
context:
space:
mode:
authorandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-19 04:53:29 +0000
committerandreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-19 04:53:29 +0000
commit85c0a7718ba922fc8746e5ffd244f77a956d3bb0 (patch)
tree8d484c369d3c2f01fb5ee0e06447fd809f45addb /libjava/testsuite
parentc983ebca636b27fdb3d48b557d12529b23df2420 (diff)
downloadgcc-85c0a7718ba922fc8746e5ffd244f77a956d3bb0.tar.gz
2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
* lib/libjava.exp: Add DYLD_LIBRARY_PATH for darwin. Look for the right libgcc. Add -multiply_defined suppress and -bind_at_load flags. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/testsuite')
-rw-r--r--libjava/testsuite/lib/libjava.exp32
1 files changed, 25 insertions, 7 deletions
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 42732f59e6c..9ae18821b1c 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -137,6 +137,7 @@ proc libjava_init { args } {
global env libgcj_jar
global tool_root_dir
global libjava_libgcc_s_path
+ global target_triplet
if { $libjava_initialized == 1 } { return; }
@@ -177,7 +178,11 @@ proc libjava_init { args } {
if [info exists env(SHLIB_PATH)] {
set original_ld_library_path $env(SHLIB_PATH)
} else {
- set original_ld_library_path ""
+ if [info exists env(DYLD_LIBRARY_PATH)] {
+ set original_ld_library_path $env(DYLD_LIBRARY_PATH)
+ } else {
+ set original_ld_library_path ""
+ }
}
}
@@ -196,7 +201,13 @@ proc libjava_init { args } {
# Finally, add the gcc build directory so that we can find the
# shared libgcc. This, like much of dejagnu, is hideous.
set libjava_libgcc_s_path {}
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
+
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ set so_extension "dylib"
+ } else {
+ set so_extension "so"
+ }
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
@@ -210,7 +221,7 @@ proc libjava_init { args } {
if { "$mldir" == "." } {
continue
}
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] == 1 } {
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] == 1 } {
lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
}
}
@@ -228,7 +239,7 @@ proc libjava_init { args } {
# paths. However we can't simply use those libraries; we still need
# libtool for linking.
# Don't return the the lib${name}.la files here, since this causes the
-# libraries to be linked twice: once as lib${name}.so and another time
+# libraries to be linked twice: once as lib${name}.so/dylib and another time
# via gcj's implicit -l${name}. This is both unnecessary and causes the
# Solaris ld to warn: attempted multiple inclusion of file. This warning
# is not ignored by the dejagnu framework and cannot be disabled.
@@ -352,6 +363,7 @@ proc libjava_arguments {{mode compile}} {
global original_ld_library_path
setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
+ setenv DYLD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
@@ -401,9 +413,13 @@ proc libjava_arguments {{mode compile}} {
# Avoid libtool wrapper scripts when possible.
# but not if libtool warnings results in FAILs
if {$mode == "link"} {
- if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
- lappend args "additional_flags=-no-install"
- }
+ if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
+ lappend args "additional_flags=-no-install"
+ }
+ if { [istarget "*-*-darwin*"] } {
+ lappend args "additional_flags=-bind_at_load"
+ lappend args "additional_flags=-multiply_defined suppress"
+ }
}
return $args
@@ -444,6 +460,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
setenv LD_LIBRARY_PATH $newval
setenv SHLIB_PATH $newval
+ setenv DYLD_LIBRARY_PATH $newval
verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
@@ -454,6 +471,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
# Restore setting
setenv LD_LIBRARY_PATH $lib_path
setenv SHLIB_PATH $lib_path
+ setenv DYLD_LIBRAY_PATH $lib_path
if {$status != "pass"} {
verbose "got $output"