OSDN Git Service

* gcc.c-torture/unsorted/dump-noaddr.x (dump_compare): Use --dumpbase
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / lib / file-format.exp
index 7be398e..491cf12 100644 (file)
@@ -1,8 +1,8 @@
-#   Copyright (C) 1999 Free Software Foundation, Inc.
+#   Copyright (C) 1999, 2007 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
 # 
 # This program is distributed in the hope that it will be useful,
@@ -11,8 +11,8 @@
 # GNU General Public License for more details.
 # 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
+# along with GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
 
 # Please email any bugs, comments, and/or additions to this file to:
 # gcc-bugs@gcc.gnu.org
@@ -32,6 +32,13 @@ proc gcc_target_object_format { } {
     } elseif { [string match "*-*-darwin*" $target_triplet] } {
        # Darwin doesn't necessarily have objdump, so hand-code it.
        set gcc_target_object_format_saved mach-o
+    } elseif { [string match "hppa*-*-hpux*" $target_triplet] } {
+       # HP-UX doesn't necessarily have objdump, so hand-code it.
+       if { [string match "hppa*64*-*-hpux*" $target_triplet] } {
+         set gcc_target_object_format_saved elf
+       } else {
+         set gcc_target_object_format_saved som
+       }
     } else {
         set objdump_name [find_binutils_prog objdump]
         set open_file [open objfmtst.c w]
@@ -39,10 +46,10 @@ proc gcc_target_object_format { } {
         close $open_file
         
         ${tool}_target_compile objfmtst.c objfmtst.o object ""
+       file delete objfmtst.c       
         
-       catch {
-          set output [exec $objdump_name --file-headers objfmtst.o ]
-        } output
+       set output [remote_exec host "$objdump_name" "--file-headers objfmtst.o"]
+       set output [lindex $output 1]
 
         file delete objfmtst.o
         
@@ -66,6 +73,9 @@ proc gcc_target_object_format { } {
                 pe       {
                     set gcc_target_object_format_saved pe
                 }
+                som          {
+                    set gcc_target_object_format_saved som
+                } 
                 default      {
                     verbose "Unknown file format: $objformat" 3
                     set gcc_target_object_format_saved unknown