-# Copyright (C) 1993, 1994, 1997 Free Software Foundation, Inc.
+# Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001
+# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
proc binutil_version { prog } {
if ![is_remote host] {
- set path [which $prog];
+ set path [which $prog]
if {$path == 0} then {
perror "$prog can't be run, file not found."
return ""
} else {
set path $prog
}
- set state [remote_exec host $prog --version];
- set tmp "[lindex $state 1]\n";
+ set state [remote_exec host $prog --version]
+ set tmp "[lindex $state 1]\n"
# Should find a way to discard constant parts, keep whatever's
# left, so the version string could be almost anything at all...
regexp "\[^\n\]* (cygnus-|)(\[-0-9.a-zA-Z-\]+)\[\r\n\].*" "$tmp" version cyg number
regsub -all "\\$" "$progargs" "\\$" progargs
set state [remote_exec host $prog $progargs]
- set exec_output [prune_warnings [lindex $state 1]];
+ set exec_output [prune_warnings [lindex $state 1]]
if {![string match "" $exec_output]} then {
send_log "$exec_output\n"
verbose "$exec_output"
set sed_file $srcdir/config/hppa.sed
send_log "sed -f $sed_file < $source > asm.s\n"
verbose "sed -f $sed_file < $source > asm.s"
- catch "exec sed -f $sed_file < $source > asm.s";
+ catch "exec sed -f $sed_file < $source > asm.s"
set source asm.s
}
- set exec_output [target_assemble $source $object ""];
+ set exec_output [target_assemble $source $object ""]
set exec_output [prune_warnings $exec_output]
if [string match "" $exec_output] {
}
}
-if ![info exists target_assemble] {
#
-# Stolen from dejagnu/lib/target.exp--please remove after 1/1/98.
+# is_elf_format
+# true if the object format is known to be ELF
#
-uplevel #0 {
- proc target_assemble { source destfile flags } {
- return [default_target_assemble $source $destfile $flags];
+proc is_elf_format {} {
+ if { ![istarget *-*-sysv4*] \
+ && ![istarget *-*-unixware*] \
+ && ![istarget *-*-elf*] \
+ && ![istarget *-*-eabi*] \
+ && ![istarget hppa*64*-*-hpux*] \
+ && ![istarget ia64-*-hpux*] \
+ && ![istarget *-*-linux*] \
+ && ![istarget *-*-irix5*] \
+ && ![istarget *-*-irix6*] \
+ && ![istarget *-*-netbsd*] \
+ && ![istarget *-*-solaris2*] } {
+ return 0
}
- proc default_target_assemble { source destfile flags } {
- global AS_FOR_TARGET;
- global ASFLAGS_FOR_TARGET;
-
- if [info exists AS_FOR_TARGET] {
- set AS "$AS_FOR_TARGET";
- } else {
- if ![board_info target exists assembler] {
- set AS [find_gas];
- } else {
- set AS [board_info target assembler];
- }
- }
-
- if [info exists ASFLAGS_FOR_TARGET] {
- append flags " $ASFLAGS_FOR_TARGET";
- }
-
- if [is_remote host] {
- set source [remote_download host $source];
- set dest "a.out"
- } else {
- set dest $destfile
- }
- set status [remote_exec host "$AS $source $flags -o $dest"]
- if [is_remote host] {
- remote_upload host $dest $destfile
- }
+ if { [istarget *-*-linux*aout*] \
+ || [istarget *-*-linux*oldld*] } {
+ return 0
+ }
- set comp_output [prune_warnings [lindex $status 1]];
- if { [lindex $status 0] != 0 } {
- verbose -log "assembler exited with status [lindex $status 0]";
- }
- if { [lindex $status 1] != "" } {
- verbose -log "assembler output is:\n[lindex $status 1]" 2;
- }
- return ${comp_output};
-}
-}
+ if { ![istarget *-*-netbsdelf*] \
+ && ([istarget *-*-netbsd*aout*] \
+ || [istarget *-*-netbsdpe*] \
+ || [istarget arm*-*-netbsd*] \
+ || [istarget sparc-*-netbsd*] \
+ || [istarget i*86-*-netbsd*] \
+ || [istarget m68*-*-netbsd*] \
+ || [istarget vax-*-netbsd*] \
+ || [istarget ns32k-*-netbsd*]) } {
+ return 0
+ }
+ return 1
}