Home | History | Annotate | Line # | Download | only in config
      1 # Basic expect script for libsframe decoder tests.
      2 #   Copyright (C) 2022-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 (at) cygnus.com)
     22 #
     23 
     24 if ![info exists ld] then {
     25     set ld [findfile $base_dir/../ld/ld-new $base_dir/../ld/ld-new [transform ld]]
     26 }
     27 
     28 if ![info exists as] then {
     29     set as [findfile $base_dir/../gas/as-new $base_dir/../gas/as-new [transform as]]
     30 }
     31 
     32 remote_exec host "mkdir -p tmpdir"
     33 
     34 # Make symlinks from tmpdir/libsframe to the linker and assembler in the
     35 # build tree, so that we can use a -B option to gcc to force it to use
     36 # the newly built linker and assembler.
     37 if {![file isdirectory tmpdir/libsframe]} then {
     38     catch "exec mkdir tmpdir/libsframe" status
     39     catch "exec ln -s ../../../ld/ld-new tmpdir/libsframe/ld" status
     40     catch "exec ln -s ld tmpdir/libsframe/collect-ld" status
     41     catch "exec ln -s ../../../gas/as-new tmpdir/libsframe/as" status
     42 }
     43 set gcc_B_opt "-B[pwd]/tmpdir/libsframe/"
     44 set ld_L_opt ""
     45 
     46 if {![info exists CC]} {
     47     set CC gcc
     48 }
     49 if {![info exists CFLAGS]} {
     50     set CFLAGS "-g -O2"
     51 }
     52 if {![info exists CFLAGS_FOR_TARGET]} {
     53     set CFLAGS_FOR_TARGET $CFLAGS
     54 }
     55