1# Basic expect script for libctf lookup tests 2# Copyright (C) 1993-2024 Free Software Foundation, Inc. 3# 4# This file is part of the GNU Binutils. 5# 6# This file is free software; you can redistribute it and/or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 3 of the License, or 9# (at your option) any later version. 10# 11# This program is distributed in the hope that it will be useful, 12# but WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14# GNU General Public License for more details. 15# 16# You should have received a copy of the GNU General Public License 17# along with this program; if not, write to the Free Software 18# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 19# MA 02110-1301, USA. 20# 21# Written by Jeffrey Wheat (cassidy@cygnus.com) 22# 23 24# Don't run anything if Tcl is too old to have try / catch. 25if { ! $have_tcl_try } { 26 log_and_exit 27} 28 29if ![info exists ld] then { 30 set ld [findfile $base_dir/../ld/ld-new $base_dir/../ld/ld-new [transform ld]] 31} 32 33if ![info exists as] then { 34 set as [findfile $base_dir/../gas/as-new $base_dir/../gas/as-new [transform as]] 35} 36 37remote_exec host "mkdir -p tmpdir" 38 39# Make symlinks from tmpdir/libctf to the linker and assembler in the 40# build tree, so that we can use a -B option to gcc to force it to use 41# the newly built linker and assembler. 42if {![file isdirectory tmpdir/libctf]} then { 43 catch "exec mkdir tmpdir/libctf" status 44 catch "exec ln -s ../../../ld/ld-new tmpdir/libctf/ld" status 45 catch "exec ln -s ld tmpdir/libctf/collect-ld" status 46 catch "exec ln -s ../../../gas/as-new tmpdir/libctf/as" status 47} 48set gcc_B_opt "-B[pwd]/tmpdir/libctf/" 49set ld_L_opt "" 50 51if {![info exists CC]} { 52 set CC gcc 53} 54if {![info exists CFLAGS]} { 55 set CFLAGS "-g -O2" 56} 57if {![info exists CC_FOR_TARGET]} { 58 set CC_FOR_TARGET [find_gcc] 59} 60if {![info exists CFLAGS_FOR_TARGET]} { 61 set CFLAGS_FOR_TARGET $CFLAGS 62} 63if ![info exists AR] then { 64 set AR [findfile $base_dir/../binutils/ar] 65} 66 67if {![info exists OBJDUMP]} { 68 set OBJDUMP [findfile $base_dir/../binutils/objdump] 69} 70 71# load the utility procedures 72load_lib ctf-lib.exp 73