|
Packit |
62fe53 |
# Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
Packit |
62fe53 |
#
|
|
Packit |
62fe53 |
# This file is part of DejaGnu.
|
|
Packit |
62fe53 |
#
|
|
Packit |
62fe53 |
# DejaGnu is free software; you can redistribute it and/or modify it
|
|
Packit |
62fe53 |
# under the terms of the GNU General Public License as published by
|
|
Packit |
62fe53 |
# the Free Software Foundation; either version 3 of the License, or
|
|
Packit |
62fe53 |
# (at your option) any later version.
|
|
Packit |
62fe53 |
#
|
|
Packit |
62fe53 |
# DejaGnu is distributed in the hope that it will be useful, but
|
|
Packit |
62fe53 |
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
62fe53 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
62fe53 |
# General Public License for more details.
|
|
Packit |
62fe53 |
#
|
|
Packit |
62fe53 |
# You should have received a copy of the GNU General Public License
|
|
Packit |
62fe53 |
# along with DejaGnu; if not, write to the Free Software Foundation,
|
|
Packit |
62fe53 |
# Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
# find_sid -- find a usable SID simulator.
|
|
Packit |
62fe53 |
# This proc is local to this file and is used to locate a SID to use.
|
|
Packit |
62fe53 |
# Search the build tree, then $PATH.
|
|
Packit |
62fe53 |
#
|
|
Packit |
62fe53 |
# Written by Ben Elliston (bje@redhat.com).
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
proc find_sid { target_alias } {
|
|
Packit |
62fe53 |
global env
|
|
Packit |
62fe53 |
global tool_root_dir
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
set try [lookfor_file ${tool_root_dir} sid/bsp/${target_alias}-sid]
|
|
Packit |
62fe53 |
if { $try != "" } {
|
|
Packit |
62fe53 |
set sid_build [lookfor_file ${tool_root_dir} sid/main/dynamic/sid]
|
|
Packit |
62fe53 |
if { $sid_build != "" } { set env(SID) $sid_build }
|
|
Packit |
62fe53 |
return $try
|
|
Packit |
62fe53 |
}
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
# In this case, the bsp script must be available on the PATH.
|
|
Packit |
62fe53 |
# Just hope for the best!
|
|
Packit |
62fe53 |
return ${target_alias}-sid
|
|
Packit |
62fe53 |
}
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
# find_sid_conf -- find a usable pre-generated SID config file.
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
proc find_sid_conf { config } {
|
|
Packit |
62fe53 |
global env
|
|
Packit |
62fe53 |
global srcdir
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
set try [lookfor_file ${srcdir} sid/bsp/pregen/${config}.conf]
|
|
Packit |
62fe53 |
if { $try == "" } then { return ${config}.conf } else { return $try }
|
|
Packit |
62fe53 |
}
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
# find_rawsid -- find a usable SID simulator.
|
|
Packit |
62fe53 |
# This proc is local to this file and is used to locate a SID to use.
|
|
Packit |
62fe53 |
# Search the build tree, then $PATH.
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
proc find_rawsid { } {
|
|
Packit |
62fe53 |
global env
|
|
Packit |
62fe53 |
global tool_root_dir
|
|
Packit |
62fe53 |
global srcdir
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
set try [lookfor_file ${tool_root_dir} sid/main/dynamic/sid]
|
|
Packit |
62fe53 |
if { $try == "" } {
|
|
Packit |
62fe53 |
set try "sid"
|
|
Packit |
62fe53 |
} else {
|
|
Packit |
62fe53 |
# testing build tree
|
|
Packit |
62fe53 |
set env(SID_LIBRARY_PATH) [join [glob "${tool_root_dir}/sid/component/*" "$srcdir/sid/component/*"] ":"]
|
|
Packit |
62fe53 |
# srcdir=/..../sid/component/testsuite
|
|
Packit |
62fe53 |
set tcl_library "$srcdir/tcl/library"
|
|
Packit |
62fe53 |
global host_os
|
|
Packit |
62fe53 |
switch -glob -- $host_os {
|
|
Packit |
62fe53 |
{cygwin*} { set tcl_library [exec cygpath -w $tcl_library] }
|
|
Packit |
62fe53 |
}
|
|
Packit |
62fe53 |
set env(TCL_LIBRARY) $tcl_library
|
|
Packit |
62fe53 |
}
|
|
Packit |
62fe53 |
|
|
Packit |
62fe53 |
return $try
|
|
Packit |
62fe53 |
}
|