diff options
author | John David Anglin <danglin@gcc.gnu.org> | 2004-11-24 04:39:41 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2004-11-24 04:39:41 +0000 |
commit | 1df8e83465739411cbb95cbef1b79d520246ab1e (patch) | |
tree | 01527763d9092da3909d80b1b0942d2439662fc2 /libjava/testsuite | |
parent | be6601c384b7d9adbd0f1439ce004faa0c00f556 (diff) | |
download | gcc-1df8e83465739411cbb95cbef1b79d520246ab1e.zip gcc-1df8e83465739411cbb95cbef1b79d520246ab1e.tar.gz gcc-1df8e83465739411cbb95cbef1b79d520246ab1e.tar.bz2 |
target-libpath.exp: New file defining set_ld_library_path_env_vars and restore_ld_library_path_env_vars.
* lib/target-libpath.exp: New file defining set_ld_library_path_env_vars
and restore_ld_library_path_env_vars.
* g++.dg/compat/compat.exp, lib/g++.exp, lib/gcc-dg.exp,
lib/gfortran.exp, lib/objc.exp, lib/treelang.exp: Use new procs.
* ada/acats/run_acats (LD_LIBRARY_PATH): Add previous LD_LIBRARY_PATH
to LD_LIBRARY_PATH. Export LD_LIBRARY_PATH.
* testsuite/lib/libffi-dg.exp: Use new procs in target-libpath.exp.
* testsuite/lib/libjava.exp,
testsuite/libjava.jacks/jacks.exp: Use new procs in target-libpath.exp.
* testsuite/lib/libmudflap.exp: Use new procs in target-libpath.exp.
* testsuite/lib/libstdc++.exp: Use new procs in target-libpath.exp.
From-SVN: r91137
Diffstat (limited to 'libjava/testsuite')
-rw-r--r-- | libjava/testsuite/lib/libjava.exp | 88 | ||||
-rw-r--r-- | libjava/testsuite/libjava.jacks/jacks.exp | 12 |
2 files changed, 38 insertions, 62 deletions
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp index 3e960a9..955f68a 100644 --- a/libjava/testsuite/lib/libjava.exp +++ b/libjava/testsuite/lib/libjava.exp @@ -1,6 +1,12 @@ # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation -load_lib "libgloss.exp" +proc load_gcc_lib { filename } { + global srcdir + load_file $srcdir/../../gcc/testsuite/lib/$filename +} + +load_lib libgloss.exp +load_gcc_lib target-libpath.exp # GCJ_UNDER_TEST is the compiler under test. @@ -133,7 +139,6 @@ proc libjava_init { args } { global libjava_initialized libjava_uses_threads global GCJ_UNDER_TEST global TOOL_EXECUTABLE - global original_ld_library_path global env objdir global env libgcj_jar global tool_root_dir @@ -177,24 +182,6 @@ proc libjava_init { args } { # Always set encoding used by gcj. append GCJ_UNDER_TEST " --encoding=UTF-8" - if [info exists env(LD_LIBRARY_PATH)] { - set original_ld_library_path $env(LD_LIBRARY_PATH) - # For HP-UX. - } elseif [info exists env(SHLIB_PATH)] { - set original_ld_library_path $env(SHLIB_PATH) - # For Darwin. - } elseif [info exists env(DYLD_LIBRARY_PATH)] { - set original_ld_library_path $env(DYLD_LIBRARY_PATH) - # For Solaris 32 bit. - } elseif [info exists env(LD_LIBRARY_PATH_32)] { - set original_ld_library_path $env(LD_LIBRARY_PATH_32) - # For Solaris 64 bit. - } elseif [info exists env(LD_LIBRARY_PATH_64)] { - set original_ld_library_path $env(LD_LIBRARY_PATH_64) - } else { - set original_ld_library_path "" - } - set wrapper_file ""; set wrap_compile_flags ""; if [target_info exists needs_status_wrapper] { @@ -336,6 +323,7 @@ proc libjava_arguments {{mode compile}} { global tool_root_dir global libgcj_jar global libjava_libgcc_s_path + global ld_library_path global target_triplet if [info exists LIBJAVA] { @@ -369,11 +357,10 @@ proc libjava_arguments {{mode compile}} { # If we wanted to handle an arbitrary value of libjava, # then we'd have to do a lot more work. - # Set variables the dynamic linker looks at. - global original_ld_library_path - setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path" - - verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)" + } # Determine CLASSPATH separator if { [string match "i?86-pc-mingw32*" $target_triplet] } { @@ -466,24 +453,24 @@ proc gcj_link {program main files {options {}}} { # Invoke the program and see what happens. Return 0 on failure. proc gcj_invoke {program expectFile ld_library_additions} { global env - set lib_path $env(LD_LIBRARY_PATH) + global ld_library_path - set newval . + set ld_library_path . if {[llength $ld_library_additions] > 0} { - append newval :[join $ld_library_additions :] + append ld_library_path :[join $ld_library_additions :] } - append newval :$lib_path - - setenv LD_LIBRARY_PATH $newval - verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" + } set result [libjava_load ./$program] set status [lindex $result 0] set output [lindex $result 1] # Restore setting - setenv LD_LIBRARY_PATH $lib_path + restore_ld_library_path_env_vars if {$status != "pass"} { verbose "got $output" @@ -511,18 +498,18 @@ proc gcj_invoke {program expectFile ld_library_additions} { proc libjava_invoke {errname testName optName executable inpfile resultfile ld_library_additions args} { global env - set lib_path $env(LD_LIBRARY_PATH) + global ld_library_path - set newval . + set ld_library_path . if {[llength $ld_library_additions] > 0} { - append newval :[join $ld_library_additions :] + append ld_library_path :[join $ld_library_additions :] } - append newval :$lib_path - - setenv LD_LIBRARY_PATH $newval + set_ld_library_path_env_vars + if [info exists env(LD_LIBRARY_PATH)] { + verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" + } - verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)" upvar $optName opts if {[info exists opts(no-exec)]} { @@ -541,7 +528,7 @@ proc libjava_invoke {errname testName optName executable inpfile resultfile set output [lindex $result 1] # Restore LD_LIBRARY_PATH setting. - setenv LD_LIBRARY_PATH $lib_path + restore_ld_library_path_env_vars if {[info exists opts(xfail-exec)]} then { setup_xfail *-*-* @@ -934,25 +921,6 @@ proc default_libjava_version {} { proc default_libjava_start { } { } -# On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -# called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -# (for the 64-bit ABI). The right way to do this would be to modify -# unix.exp -- but that's not an option since it's part of DejaGNU -# proper, so we do it here, by trickery. -# The same applies to darwin (DYLD_LIBRARY_PATH), solaris 32 bit -# (LD_LIBRARY_PATH_32), solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX -# (SHLIB_PATH). -proc ${tool}_set_ld_library_path { name element op } { - setenv LD_LIBRARYN32_PATH [getenv LD_LIBRARY_PATH] - setenv LD_LIBRARY64_PATH [getenv LD_LIBRARY_PATH] - setenv SHLIB_PATH [getenv LD_LIBRARY_PATH] - setenv DYLD_LIBRARY_PATH [getenv LD_LIBRARY_PATH] - setenv LD_LIBRARY_PATH_32 [getenv LD_LIBRARY_PATH] - setenv LD_LIBRARY_PATH_64 [getenv LD_LIBRARY_PATH] -} - -trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path - # Local Variables: # tcl-indent-level:4 # End: diff --git a/libjava/testsuite/libjava.jacks/jacks.exp b/libjava/testsuite/libjava.jacks/jacks.exp index 228e18f..32529e3 100644 --- a/libjava/testsuite/libjava.jacks/jacks.exp +++ b/libjava/testsuite/libjava.jacks/jacks.exp @@ -1,6 +1,13 @@ # Run the Jacks test suite. # See http://www-124.ibm.com/developerworks/oss/cvs/jikes/~checkout~/jacks/jacks.html +proc load_gcc_lib { filename } { + global srcdir + load_file $srcdir/../../gcc/testsuite/lib/$filename +} + +load_gcc_lib target-libpath.exp + proc gcj_jacks_setup_xfail {ary} { upvar $ary array global srcdir @@ -16,7 +23,7 @@ proc gcj_jacks_write {filename} { global GCJ_UNDER_TEST global libgcj_jar global libjava_libgcc_s_path - global original_ld_library_path + global ld_library_path set gcjl [split $GCJ_UNDER_TEST] set gcj_cmd [lindex $gcjl 0] @@ -43,7 +50,8 @@ proc gcj_jacks_write {filename} { # puts $fd "set tcltest::testConstraints(jvm) 1" close $fd - setenv LD_LIBRARY_PATH $libjava_libgcc_s_path:$original_ld_library_path + set ld_library_path $libjava_libgcc_s_path + set_ld_library_path_env_vars } proc gcj_jacks_parse {file} { |