aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/gcc-dg.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/lib/gcc-dg.exp')
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp70
1 files changed, 22 insertions, 48 deletions
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index 1244462..92de9f7 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 1997, 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1997, 1999, 2000, 2003, 2004 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
@@ -21,6 +21,7 @@ load_lib scanasm.exp
load_lib scantree.exp
load_lib prune.exp
load_lib libgloss.exp
+load_lib target-libpath.exp
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
@@ -51,55 +52,28 @@ if ![info exists GCC_UNDER_TEST] {
}
global rootme
-set libgcc_s_path "${rootme}"
-set compiler [lindex $GCC_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 libgcc_s_path ":${rootme}/${mldir}"
+global ld_library_path
+global orig_environment_saved
+
+# This file may be sourced, so don't override environment settings
+# that have been previously setup.
+if { $orig_environment_saved == 0 } {
+ set ld_library_path "${rootme}"
+ set compiler [lindex $GCC_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}"
+ }
}
}
-}
-
-# 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.
-# Doing this does cause trouble when testing cross-compilers.
-if {![is_remote target]} {
- if [info exists env(LD_LIBRARY_PATH)] {
- setenv LD_LIBRARY_PATH "$libgcc_s_path:$env(LD_LIBRARY_PATH)"
- } else {
- setenv LD_LIBRARY_PATH $libgcc_s_path
- }
- if [info exists env(SHLIB_PATH)] {
- setenv SHLIB_PATH "$libgcc_s_path:$env(SHLIB_PATH)"
- } else {
- setenv SHLIB_PATH $libgcc_s_path
- }
- if [info exists env(LD_LIBRARYN32_PATH)] {
- setenv LD_LIBRARYN32_PATH "$libgcc_s_path:$env(LD_LIBRARYN32_PATH)"
- } else {
- setenv LD_LIBRARYN32_PATH $libgcc_s_path
- }
- if [info exists env(LD_LIBRARY64_PATH)] {
- setenv LD_LIBRARY64_PATH "$libgcc_s_path:$env(LD_LIBRARY64_PATH)"
- } else {
- setenv LD_LIBRARY64_PATH $libgcc_s_path
- }
- if [info exists env(DYLD_LIBRARY_PATH)] {
- setenv DYLD_LIBRARY_PATH "$libgcc_s_path:$env(DYLD_LIBRARY_PATH)"
- } else {
- setenv DYLD_LIBRARY_PATH $libgcc_s_path
- }
+ set_ld_library_path_env_vars
}
# Split TORTURE_OPTIONS into two choices: one for testcases with loops and