From d6fcadb293cb886c70e31cf7e806e72c0a919ede Mon Sep 17 00:00:00 2001 From: Andreas Tobler Date: Wed, 19 Nov 2003 05:53:29 +0100 Subject: [PATCH] libjava.exp: Add DYLD_LIBRARY_PATH for darwin. 2003-11-19 Andreas Tobler * lib/libjava.exp: Add DYLD_LIBRARY_PATH for darwin. Look for the right libgcc. Add -multiply_defined suppress and -bind_at_load flags. From-SVN: r73725 --- libjava/ChangeLog | 6 ++++++ libjava/testsuite/lib/libjava.exp | 32 +++++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/libjava/ChangeLog b/libjava/ChangeLog index bcd687e..6e27948 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2003-11-19 Andreas Tobler + + * lib/libjava.exp: Add DYLD_LIBRARY_PATH for darwin. Look for + the right libgcc. Add -multiply_defined suppress and -bind_at_load + flags. + 2003-11-18 Tom Tromey PR libgcj/13026: diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 42732f5..9ae1882 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" -- 2.7.4