Blame SOURCES/dejagnu-1.5-gfortran.patch

eb856e
diff -U0 dejagnu-1.5/ChangeLog.gfortran dejagnu-1.5/ChangeLog
eb856e
--- dejagnu-1.5/ChangeLog.gfortran	2011-03-09 05:29:16.000000000 +0100
eb856e
+++ dejagnu-1.5/ChangeLog	2012-05-14 18:38:36.316469119 +0200
eb856e
@@ -0,0 +1,8 @@
eb856e
+2011-06-30  Tom Tromey  <tromey@redhat.com>
eb856e
+
eb856e
+	* doc/ref.xml: Document find_gfortran.
eb856e
+	* doc/dejagnu.texi: Regenerate.
eb856e
+	* lib/target.exp (default_target_compile): Handle f90.
eb856e
+	(default_target_compile): Likewise.
eb856e
+	* lib/libgloss.exp (find_gfortran): New proc.
eb856e
+
eb856e
diff -up dejagnu-1.5/doc/dejagnu.texi.gfortran dejagnu-1.5/doc/dejagnu.texi
eb856e
--- dejagnu-1.5/doc/dejagnu.texi.gfortran	2011-03-08 01:26:30.000000000 +0100
eb856e
+++ dejagnu-1.5/doc/dejagnu.texi	2012-05-14 18:38:36.317469122 +0200
eb856e
@@ -6548,6 +6548,7 @@ executable image for an embedded systems
eb856e
 * Find_gcj Procedure: find_gcj procedure.
eb856e
 * Find_g++ Procedure: find_g++ procedure.
eb856e
 * Find_g77 Procedure: find_g77 procedure.
eb856e
+* Find_gfortran Procedure: find_gfortran procedure.
eb856e
 * Process_multilib_options Procedure: process_multilib_options procedure.
eb856e
 * Add_multilib_option Procedure: add_multilib_option procedure.
eb856e
 * Find_gas Procedure: find_gas procedure.
eb856e
@@ -6752,7 +6753,7 @@ executable image for an embedded systems
eb856e
 @t{@b{find_g++}(@i{});}
eb856e
 @end quotation
eb856e
 
eb856e
-@node find_g77 procedure, process_multilib_options procedure, find_g++ procedure, Libgloss
eb856e
+@node find_g77 procedure, find_gfortran procedure, find_g++ procedure, Libgloss
eb856e
 @subsubsection Find_g77 Procedure
eb856e
 
eb856e
 
eb856e
@@ -6761,7 +6762,16 @@ executable image for an embedded systems
eb856e
 @t{@b{find_g77}(@i{});}
eb856e
 @end quotation
eb856e
 
eb856e
-@node process_multilib_options procedure, add_multilib_option procedure, find_g77 procedure, Libgloss
eb856e
+@node find_gfortran procedure, process_multilib_options procedure, find_g77 procedure, Libgloss
eb856e
+@subsubsection Find_gfortran Procedure
eb856e
+
eb856e
+
eb856e
+@quotation
eb856e
+
eb856e
+@t{@b{find_gfortran}(@i{});}
eb856e
+@end quotation
eb856e
+
eb856e
+@node process_multilib_options procedure, add_multilib_option procedure, find_gfortran procedure, Libgloss
eb856e
 @subsubsection Process_multilib_options Procedure
eb856e
 
eb856e
 
eb856e
diff -up dejagnu-1.5/doc/ref.xml.gfortran dejagnu-1.5/doc/ref.xml
eb856e
--- dejagnu-1.5/doc/ref.xml.gfortran	2011-03-03 22:38:25.000000000 +0100
eb856e
+++ dejagnu-1.5/doc/ref.xml	2012-05-14 18:38:36.333469167 +0200
eb856e
@@ -4146,6 +4146,19 @@
eb856e
         </funcsynopsis>
eb856e
 	</sect4>
eb856e
 
eb856e
+	<sect4 id="findgfortran" xreflabel="find_gfortran procedure">
eb856e
+	  <title>Find_gfortran Procedure</title>
eb856e
+
eb856e
+	  <para></para>
eb856e
+
eb856e
+	<funcsynopsis role="tcl">
eb856e
+          <funcprototype>
eb856e
+            <funcdef><function>find_gfortran</function></funcdef>
eb856e
+	    <paramdef><parameter></parameter></paramdef>
eb856e
+           </funcprototype>
eb856e
+        </funcsynopsis>
eb856e
+	</sect4>
eb856e
+
eb856e
 	
eb856e
 	procedure">
eb856e
 	  <title>Process_multilib_options Procedure</title>
eb856e
diff -up dejagnu-1.5/lib/libgloss.exp.gfortran dejagnu-1.5/lib/libgloss.exp
eb856e
--- dejagnu-1.5/lib/libgloss.exp.gfortran	2011-03-03 10:58:56.000000000 +0100
eb856e
+++ dejagnu-1.5/lib/libgloss.exp	2012-05-14 18:38:36.364469259 +0200
eb856e
@@ -1,5 +1,5 @@
eb856e
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
eb856e
-# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
eb856e
+# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
eb856e
 #
eb856e
 # This file is part of DejaGnu.
eb856e
 #
eb856e
@@ -701,6 +701,25 @@ proc find_g77 {} {
eb856e
     }
eb856e
     return $CC
eb856e
 }
eb856e
+
eb856e
+proc find_gfortran {} {
eb856e
+    global tool_root_dir
eb856e
+
eb856e
+    if {![is_remote host]} {
eb856e
+	set file [lookfor_file $tool_root_dir gfortran]
eb856e
+	if { $file == "" } {
eb856e
+	    set file [lookfor_file $tool_root_dir gcc/gfortran]
eb856e
+	}
eb856e
+	if { $file != "" } {
eb856e
+	    set CC "$file -B[file dirname $file]/"
eb856e
+	} else {
eb856e
+	    set CC [transform gfortran]
eb856e
+	}
eb856e
+    } else {
eb856e
+	set CC [transform gfortran]
eb856e
+    }
eb856e
+    return $CC
eb856e
+}
eb856e
 
eb856e
 proc find_gnatmake {} {
eb856e
     global tool_root_dir
eb856e
diff -up dejagnu-1.5/lib/target.exp.gfortran dejagnu-1.5/lib/target.exp
eb856e
--- dejagnu-1.5/lib/target.exp.gfortran	2011-03-03 10:58:56.000000000 +0100
eb856e
+++ dejagnu-1.5/lib/target.exp	2012-05-14 18:38:36.399469362 +0200
eb856e
@@ -1,5 +1,5 @@
eb856e
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
eb856e
-# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
eb856e
+# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
eb856e
 #
eb856e
 # This file is part of DejaGnu.
eb856e
 #
eb856e
@@ -367,6 +367,18 @@ proc default_target_compile {source dest
eb856e
 	    }
eb856e
 	}
eb856e
 
eb856e
+	if { $i == "f90" } {
eb856e
+	    set compiler_type "f90"
eb856e
+	    if {[board_info $dest exists f90flags]} {
eb856e
+		append add_flags " [target_info f90flags]"
eb856e
+	    }
eb856e
+	    if {[board_info $dest exists f90compiler]} {
eb856e
+		set compiler [target_info f90compiler]
eb856e
+	    } else {
eb856e
+		set compiler [find_gfortran]
eb856e
+	    }
eb856e
+	}
eb856e
+
eb856e
 	if {[regexp "^dest=" $i]} {
eb856e
 	    regsub "^dest=" $i "" tmp
eb856e
 	    if {[board_info $tmp exists name]} {
eb856e
@@ -420,6 +432,7 @@ proc default_target_compile {source dest
eb856e
     global CC_FOR_TARGET
eb856e
     global CXX_FOR_TARGET
eb856e
     global F77_FOR_TARGET
eb856e
+    global F90_FOR_TARGET
eb856e
     global GNATMAKE_FOR_TARGET
eb856e
 
eb856e
     if {[info exists GNATMAKE_FOR_TARGET]} {
eb856e
@@ -446,6 +459,12 @@ proc default_target_compile {source dest
eb856e
 	}
eb856e
     }
eb856e
 
eb856e
+    if {[info exists F90_FOR_TARGET]} {
eb856e
+	if { $compiler_type == "f90" } {
eb856e
+	    set compiler $F90_FOR_TARGET
eb856e
+	}
eb856e
+    }
eb856e
+
eb856e
     if { $compiler == "" } {
eb856e
 	set compiler [board_info $dest compiler]
eb856e
 	if { $compiler == "" } {