diff options
Diffstat (limited to 'gcc/testsuite/lib/g++.exp')
-rw-r--r-- | gcc/testsuite/lib/g++.exp | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp index 274a0965201..4fb903eed66 100644 --- a/gcc/testsuite/lib/g++.exp +++ b/gcc/testsuite/lib/g++.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 +# Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -108,6 +109,7 @@ proc g++_link_flags { paths } { global rootme global srcdir global ld_library_path + global GXX_UNDER_TEST set gccpath ${paths} set libio_dir "" @@ -137,6 +139,20 @@ proc g++_link_flags { paths } { append flags "-L${gccpath}/librx " } append ld_library_path ":${rootme}" + set compiler [lindex $GXX_UNDER_TEST 0] + if { [is_remote host] == 0 && [which $compiler] != 0 } { + foreach i "[exec $compiler --print-multi-lib]" { + set mldir "" + regexp -- "\[a-z0-9=/\.-\]*;" $i mldir + set mldir [string trimright $mldir "\;@"] + if { "$mldir" == "." } { + continue + } + if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] == 1 } { + append ld_library_path ":${rootme}/${mldir}" + } + } + } } else { global tool_root_dir; @@ -159,6 +175,18 @@ proc g++_link_flags { paths } { append flags "-L${librx} "; } } + + # 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. We really only need to do + # this on IRIX, but it shouldn't hurt to do it anywhere else. + setenv LD_LIBRARY_PATH $ld_library_path + setenv SHLIB_PATH $ld_library_path + setenv LD_LIBRARYN32_PATH $ld_library_path + setenv LD_LIBRARY64_PATH $ld_library_path + return "$flags" } @@ -279,23 +307,6 @@ proc g++_target_compile { source dest type options } { } # -# g++_set_ld_library_path -- -# 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. We really only need to do -# this on IRIX, but it shouldn't hurt to do it anywhere else. -# - -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] -} - -trace variable env(LD_LIBRARY_PATH) w ${tool}_set_ld_library_path - -# # ${tool}_option_help # |