This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: GDB <gdb-patches at sourceware dot org>
- Date: Mon, 20 Sep 2010 06:58:56 -0700
- Subject: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
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]
}
}