runtest.exp: add libdirs list for load_lib() libgomp wants to load .exp files from ../gcc/testsuite/lib. Instrument load_lib to be able to find the files. Previously we used to have a helper proc that had to first load all dependent .exp manually and then, again manually, the desired .exp. 2012-03-16 Bernhard Reutner-Fischer * runtest.exp (libdirs): New global list. (load_lib): Append libdirs to search_and_load_files directories. diff --git a/runtest.exp b/runtest.exp index 4bfed83..8e6a7de 100644 --- a/runtest.exp +++ b/runtest.exp @@ -589,7 +589,7 @@ proc lookfor_file { dir name } { # source tree, (up one or two levels), then in the current dir. # proc load_lib { file } { - global verbose libdir srcdir base_dir execpath tool + global verbose libdir libdirs srcdir base_dir execpath tool global loaded_libs if {[info exists loaded_libs($file)]} { @@ -597,8 +597,11 @@ proc load_lib { file } { } set loaded_libs($file) "" - - if { [search_and_load_file "library file" $file [list ../lib $libdir $libdir/lib [file dirname [file dirname $srcdir]]/dejagnu/lib $srcdir/lib $execpath/lib . [file dirname [file dirname [file dirname $srcdir]]]/dejagnu/lib]] == 0 } { + set search_dirs [list ../lib $libdir $libdir/lib [file dirname [file dirname $srcdir]]/dejagnu/lib $srcdir/lib $execpath/lib . [file dirname [file dirname [file dirname $srcdir]]]/dejagnu/lib] + if {[info exists libdirs]} { + lappend search_dirs $libdirs + } + if { [search_and_load_file "library file" $file $search_dirs ] == 0 } { send_error "ERROR: Couldn't find library file $file.\n" exit 1 } @@ -652,6 +655,8 @@ set libdir [file dirname $execpath]/dejagnu if {[info exists env(DEJAGNULIBS)]} { set libdir $env(DEJAGNULIBS) } +# list of extra directories for load_lib +set libdirs {} verbose "Using $libdir to find libraries"