public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
@ 2010-09-21 18:24 H.J. Lu
  2011-06-28 19:35 ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2010-09-21 18:24 UTC (permalink / raw)
  To: GDB

This isn't a proper fix since it depends on we load lib/ada.exp before
any Fortran tests.  I think ada.exp is the wrong place to provide
GDB functions.  It should be placed in something like gdb-support.exp and
ada.exp/fortran.exp can just load it.


H.J.
---
2010-09-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/12040
	* lib/ada.exp (gdb_find_gfortran): New.
	(gdb_default_target_compile): Use it.

diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 055d4d3..1e686bc 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -41,6 +41,25 @@ proc gdb_find_gnatmake {} {
     return $GM
 }   
 
+proc gdb_find_gfortran {} {
+    global tool_root_dir
+
+    if ![is_remote host] {
+	set file [lookfor_file $tool_root_dir gfortran]
+	if { $file == "" } {
+	    set file [lookfor_file $tool_root_dir gcc/gfortran]
+	}
+	if { $file != "" } {
+	    set CC "$file -B[file dirname $file]/"
+	} else {
+	    set CC [transform gfortran]
+	}
+    } else {
+	set CC [transform gfortran]
+    }
+    return $CC
+}
+
 # FIXME:brobecker/2004-03-31:
 # The following function is a copy of the function of the same name provided
 # by dejagnu, except that it has been modified to add support for building
@@ -112,7 +131,7 @@ proc gdb_default_target_compile {source destfile type options} {
 	    if [board_info $dest exists f77compiler] {
 		set compiler [target_info f77compiler]
 	    } else {
-		set compiler [find_g77]
+		set compiler [gdb_find_gfortran]
 	    }
 	}
 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-06-30 13:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-21 18:24 PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran H.J. Lu
2011-06-28 19:35 ` Tom Tromey
2011-06-28 19:56   ` H.J. Lu
2011-06-29 14:44     ` Tom Tromey
2011-06-29 14:51       ` H.J. Lu
2011-06-29 14:58         ` Tom Tromey
2011-06-29 17:50           ` Tom Tromey
2011-06-29 17:52             ` H.J. Lu
2011-06-29 18:26               ` Tom Tromey
2011-06-29 18:29                 ` H.J. Lu
2011-06-30 13:29                   ` Tom Tromey
2011-06-29 20:45             ` Jan Kratochvil
2011-06-29 20:49               ` Tom Tromey
2011-06-29 20:56                 ` Jan Kratochvil
2011-06-29 16:10   ` Joel Brobecker
2011-06-29 17:35     ` Tom Tromey
2011-06-29 17:58       ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).