aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Elliston <bje@gnu.org>2006-05-22 04:38:42 +0000
committerBen Elliston <bje@gnu.org>2006-05-22 04:38:42 +0000
commitb6feeb81729c431a93264a920e3d4ac93f6b96f5 (patch)
tree5f67575c57bbb6029582d6478d1255249bbfd4a4
parent752549198513cf5f7b2fed288216285d01a4a699 (diff)
* lib/framework.exp (open_logs): Use file join where applicable.pre-if-stmt-braces
* lib/libgloss.exp (libgloss_link_flags, newlib_link_flags, newlib_include_flags, g++_link_flags, libstdc++_link_flags, get_multilibs, winsup_include_flags, winsup_link_flags): Likewise. * lib/utils.exp (which): Likewise. * runtest.exp (search_and_load_file, lookfor_file, load_tool_init): Likewise.
-rw-r--r--ChangeLog8
-rw-r--r--lib/framework.exp4
-rw-r--r--lib/libgloss.exp30
-rw-r--r--lib/utils.exp8
-rwxr-xr-xruntest.exp16
5 files changed, 37 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index c78baae..d3a1e42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2006-05-22 Ben Elliston <bje@gnu.org>
+ * lib/framework.exp (open_logs): Use file join where applicable.
+ * lib/libgloss.exp (libgloss_link_flags, newlib_link_flags,
+ newlib_include_flags, g++_link_flags, libstdc++_link_flags,
+ get_multilibs, winsup_include_flags, winsup_link_flags): Likewise.
+ * lib/utils.exp (which): Likewise.
+ * runtest.exp (search_and_load_file, lookfor_file,
+ load_tool_init): Likewise.
+
* lib/debugger.exp (watcharray): Add `array' parameter. Rename
`type' parameter to `op' and update all uses in the proc.
(watchvar): Add `ignore' parameter for scalar variables.
diff --git a/lib/framework.exp b/lib/framework.exp
index 1a42448..2dd4a3b 100644
--- a/lib/framework.exp
+++ b/lib/framework.exp
@@ -71,10 +71,10 @@ proc open_logs { } {
set tool testrun
}
catch "exec rm -f $outdir/$tool.sum"
- set sum_file [open "$outdir/$tool.sum" w]
+ set sum_file [open [file join $outdir $tool.sum] w]
if { $xml } {
catch "exec rm -f $outdir/$tool.xml"
- set xml_file [open "$outdir/$tool.xml" w]
+ set xml_file [open [file join $outdir $tool.xml] w]
xml_output "<?xml version=\"1.0\"?>"
insertdtd
xml_output "<testsuite>"
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index 2871004..376d46a 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -86,7 +86,7 @@ proc libgloss_link_flags { args } {
if { $gloss_srcdir == "" } {
return ""
}
- if [file exists $gccpath/libgloss/$cpu] {
+ if [file exists [file join $gccpath libgloss $cpu]] {
verbose "Libgloss path is $gccpath/libgloss/$cpu" 2
return "-B$gccpath/libgloss/$cpu/ -L$gccpath/libgloss/$cpu -L$gloss_srcdir"
} else {
@@ -127,7 +127,7 @@ proc newlib_link_flags { args } {
set gccpath "[get_multilibs]"
verbose "Looking for $gccpath/newlib"
- if [file exists $gccpath/newlib] {
+ if [file exists [file join $gccpath newlib]] {
verbose "Newlib path is $gccpath/newlib"
return "$result -B$gccpath/newlib/ -L$gccpath/newlib"
} else {
@@ -149,7 +149,7 @@ proc newlib_include_flags { args } {
set gccpath "[get_multilibs]"
- if [file exists $gccpath/newlib] {
+ if [file exists [file join $gccpath newlib]] {
verbose "Newlib path is $gccpath/newlib"
set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h]
@@ -266,25 +266,25 @@ proc g++_link_flags { args } {
set ld_library_path "."
if { $gccpath != "" } {
- if [file exists "${gccpath}/lib/libstdc++.a"] {
+ if [file exists [file join ${gccpath} lib libstdc++.a]] {
append ld_library_path ":${gccpath}/lib"
}
- if [file exists "${gccpath}/libg++/libg++.a"] {
+ if [file exists [file join ${gccpath} libg++ libg++.a]] {
append flags "-L${gccpath}/libg++ "
append ld_library_path ":${gccpath}/libg++"
}
- if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
+ if [file exists [file join ${gccpath} libstdc++ libstdc++.a]] {
append flags "-L${gccpath}/libstdc++ "
append ld_library_path ":${gccpath}/libstdc++"
}
- if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] {
+ if [file exists [file join ${gccpath} libstdc++-v3 src .libs libstdc++.a]] {
append flags "-L${gccpath}/libstdc++-v3/src/.libs "
append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs"
}
- if [file exists "${gccpath}/libiberty/libiberty.a"] {
+ if [file exists [file join ${gccpath} libiberty libiberty.a]] {
append flags "-L${gccpath}/libiberty "
}
- if [file exists "${gccpath}/librx/librx.a"] {
+ if [file exists [file join ${gccpath} librx librx.a]] {
append flags "-L${gccpath}/librx "
}
} else {
@@ -354,14 +354,14 @@ proc libstdc++_link_flags { args } {
set flags ""
if { $gccpath != "" } {
- if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
+ if [file exists [file join ${gccpath} libstdc++ libstdc++.a]] {
append flags "-L${gccpath}/libstdc++ "
append ld_library_path ":${gccpath}/libstdc++"
}
- if [file exists "${gccpath}/libiberty/libiberty.a"] {
+ if [file exists [file join ${gccpath} libiberty libiberty.a]] {
append flags "-L${gccpath}/libiberty "
}
- if [file exists "${gccpath}/librx/librx.a"] {
+ if [file exists [file join ${gccpath} librx librx.a]] {
append flags "-L${gccpath}/librx "
}
} else {
@@ -585,7 +585,7 @@ proc get_multilibs { args } {
verbose "gccpath is $gccpath" 3
- if [file exists $multitop/$gccpath] {
+ if [file exists [file join $multitop $gccpath]] {
verbose "GCC path is $multitop/$gccpath" 3
if { [llength $args] == 0 } {
set board_info($target_board,multitop) "$multitop/$gccpath"
@@ -894,7 +894,7 @@ proc winsup_include_flags { args } {
set gccpath "[get_multilibs]"
- if [file exists $gccpath/winsup] {
+ if [file exists [file join $gccpath winsup]] {
verbose "Winsup path is $gccpath/winsup"
set winsup_dir [lookfor_file ${srcdir} winsup/include/windows.h]
@@ -925,7 +925,7 @@ proc winsup_link_flags { args } {
set gccpath "[get_multilibs]"
verbose "Looking for $gccpath/winsup"
- if [file exists $gccpath/winsup] {
+ if [file exists [file join $gccpath winsup]] {
verbose "Winsup path is $gccpath/newlib"
return "-B$gccpath/winsup/ -L$gccpath/winsup"
} else {
diff --git a/lib/utils.exp b/lib/utils.exp
index 428a85a..abfbd1f 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -138,11 +138,11 @@ proc which { file } {
foreach i $path {
verbose "Checking against $i" 3
- if [file exists $i/$file] {
- if [file executable $i/$file] {
- return $i/$file
+ if [file exists [file join $i $file]] {
+ if [file executable [file join $i $file]] {
+ return [file join $i $file]
} else {
- warning "$i/$file exists but is not an executable"
+ warning "[file join $i $file] exists but is not an executable"
}
}
}
diff --git a/runtest.exp b/runtest.exp
index 492b2b2..19d7b41 100755
--- a/runtest.exp
+++ b/runtest.exp
@@ -340,7 +340,7 @@ proc search_and_load_file { type filelist dirlist } {
foreach dir $dirlist {
foreach initfile $filelist {
verbose "Looking for $type ${dir}/${initfile}" 2
- if [file exists ${dir}/${initfile}] {
+ if [file exists [file join ${dir} ${initfile}]] {
set found 1
set error ""
if { ${type} != "library file" } {
@@ -573,8 +573,8 @@ if [string match "" $logname] {
proc lookfor_file { dir name } {
foreach x ".. ../.. ../../.. ../../../.." {
verbose "$dir/$name" 2
- if [file exists $dir/$name] {
- return $dir/$name
+ if [file exists [file join $dir $name]] {
+ return [file join $dir $name]
}
set dir [remote_file build dirname $dir]
}
@@ -638,7 +638,7 @@ if [expr [string match "." $objdir] || [string match $srcdir $objdir]] {
# Well, this just demonstrates the real problem...
if ![info exists tool_root_dir] {
set tool_root_dir [file dirname $objdir]
- if [file exists "$tool_root_dir/testsuite"] {
+ if [file exists [file join $tool_root_dir testsuite]] {
set tool_root_dir [file dirname $tool_root_dir]
}
}
@@ -686,9 +686,9 @@ if [expr { $build_triplet == "" && $host_triplet == ""} ] {
# find config.guess
foreach dir "$libdir $libdir/libexec $libdir/.. $execpath $srcdir $srcdir/.. $srcdir/../.." {
verbose "Looking for ${dir}/config.guess" 2
- if [file exists ${dir}/config.guess] {
- set config_guess ${dir}/config.guess
- verbose "Found ${dir}/config.guess"
+ if [file exists [file join ${dir} config.guess]] {
+ set config_guess [file join [${dir} config.guess]]
+ verbose "Found [file join ${dir} config.guess]"
break
}
}
@@ -933,7 +933,7 @@ proc load_tool_init { file } {
set loaded_libs($file) ""
- if [file exists ${srcdir}/lib/$file] {
+ if [file exists [file join ${srcdir} lib $file]] {
verbose "Loading library file ${srcdir}/lib/$file"
if { [catch "uplevel #0 source ${srcdir}/lib/$file"] == 1 } {
send_error "ERROR: tcl error sourcing library file ${srcdir}/lib/$file.\n"