dejagnu
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch for gfortran


From: Tom Tromey
Subject: Re: patch for gfortran
Date: Wed, 29 Jun 2011 07:56:37 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Ben> doc/ref.xml.  Just do your best and I'll make sure it builds with all
Ben> of the requisite Docbook tools.

I just cut-and-pasted the f77 stuff.  There doesn't seem to be any
actual text there... I'm not sure where it could go, as I don't know
Docbook.

I guess the .texi file is not maintained?  That is too bad; I generally
prefer info format for online docs, since I live in Emacs.  I tried
running the XML through db2x_texixml (yum install docbook2X), but it
gives tons of errors.  I'm not sure if that is due to bugs in ref.xml or
the converter.

Tom

diff --git a/ChangeLog b/ChangeLog
index 92ea733..fca8df5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-29  Tom Tromey  <address@hidden>
+
+       * doc/ref.xml: Document find_gfortran.
+       * lib/target.exp (default_target_compile): Handle f90.
+       (default_target_compile): Likewise.
+       * lib/libgloss.exp (find_gfortran): New proc.
+
 2011-04-12  Ben Elliston  <address@hidden>
 
        * config/vxworks.exp (vxworks_file): Use "file delete", not "exec
diff --git a/doc/ref.xml b/doc/ref.xml
index 570fbc0..b54d2ff 100644
--- a/doc/ref.xml
+++ b/doc/ref.xml
@@ -4146,6 +4146,19 @@
         </funcsynopsis>
        </sect4>
 
+       <sect4 id="findgfortran" xreflabel="find_gfortran procedure">
+         <title>Find_gfortran Procedure</title>
+
+         <para></para>
+
+       <funcsynopsis role="tcl">
+          <funcprototype>
+            <funcdef><function>find_gfortran</function></funcdef>
+           <paramdef><parameter></parameter></paramdef>
+           </funcprototype>
+        </funcsynopsis>
+       </sect4>
+
        <sect4 id="processmultiliboptions" xreflabel="process_multilib_options
        procedure">
          <title>Process_multilib_options Procedure</title>
diff --git a/lib/libgloss.exp b/lib/libgloss.exp
index e651eb6..77150cb 100644
--- a/lib/libgloss.exp
+++ b/lib/libgloss.exp
@@ -1,5 +1,5 @@
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 
Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -702,6 +702,25 @@ proc find_g77 {} {
     return $CC
 }
 
+proc 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
+}
+
 proc find_gnatmake {} {
     global tool_root_dir
 
diff --git a/lib/target.exp b/lib/target.exp
index c9fde2c..ec9fff2 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -1,5 +1,5 @@
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software 
Foundation, Inc.
 #
 # This file is part of DejaGnu.
 #
@@ -367,6 +367,18 @@ proc default_target_compile {source destfile type options} 
{
            }
        }
 
+       if { $i == "f90" } {
+           set compiler_type "f90"
+           if {[board_info $dest exists f90flags]} {
+               append add_flags " [target_info f90flags]"
+           }
+           if {[board_info $dest exists f90compiler]} {
+               set compiler [target_info f90compiler]
+           } else {
+               set compiler [find_gfortran]
+           }
+       }
+
        if {[regexp "^dest=" $i]} {
            regsub "^dest=" $i "" tmp
            if {[board_info $tmp exists name]} {
@@ -420,6 +432,7 @@ proc default_target_compile {source destfile type options} {
     global CC_FOR_TARGET
     global CXX_FOR_TARGET
     global F77_FOR_TARGET
+    global F90_FOR_TARGET
     global GNATMAKE_FOR_TARGET
 
     if {[info exists GNATMAKE_FOR_TARGET]} {
@@ -446,6 +459,12 @@ proc default_target_compile {source destfile type options} 
{
        }
     }
 
+    if {[info exists F90_FOR_TARGET]} {
+       if { $compiler_type == "f90" } {
+           set compiler $F90_FOR_TARGET
+       }
+    }
+
     if { $compiler == "" } {
        set compiler [board_info $dest compiler]
        if { $compiler == "" } {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]