* lib/libgloss.exp (find_gdc): New proc.
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 22 Feb 2016 20:58:41 +0000 (07:58 +1100)
committerBen Elliston <bje@gnu.org>
Mon, 22 Feb 2016 20:58:41 +0000 (07:58 +1100)
* lib/target.exp (default_target_compile): Add D support.
* NEWS: Update.

Signed-off-by: Ben Elliston <bje@gnu.org>
ChangeLog
NEWS
lib/libgloss.exp
lib/target.exp

index ba363ff..7bca566 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-02-23  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       * lib/libgloss.exp (find_gdc): New proc.
+       * lib/target.exp (default_target_compile): Add D support.
+       * NEWS: Update.
+
 2016-02-20  Ben Elliston  <bje@gnu.org>
 
        * lib/utils.exp (diff): Replace calls to verbose followed by
diff --git a/NEWS b/NEWS
index cd326a6..3387ab1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Changes since 1.5.3:
    and `slay' have been removed.  If a testsuite uses any of these
    procedures, a copy of the procedure should be made and placed in
    the lib directory of the testsuite.
+5. Support was added for testing the D compiler.
 
 
 Changes since 1.4.4:
index 77150cb..0017d05 100644 (file)
@@ -683,6 +683,25 @@ proc find_g++ {} {
     return $CC
 }
 
+proc find_gdc {} {
+    global tool_root_dir
+
+    if {![is_remote host]} {
+       set file [lookfor_file $tool_root_dir gdc]
+       if { $file == "" } {
+           set file [lookfor_file $tool_root_dir gcc/gdc]
+       }
+       if { $file != "" } {
+           set CC "$file -B[file dirname $file]/"
+       } else {
+           set CC [transform gdc]
+       }
+    } else {
+       set CC [transform gdc]
+    }
+    return $CC
+}
+
 proc find_g77 {} {
     global tool_root_dir
 
index e8c9047..323a155 100644 (file)
@@ -362,6 +362,18 @@ proc default_target_compile {source destfile type options} {
            }
        }
 
+       if { $i == "d" } {
+           set compiler_type "d"
+           if {[board_info $dest exists dflags]} {
+               append add_flags " [target_info dflags]"
+           }
+           if {[board_info $dest exists dcompiler]} {
+               set compiler [target_info dcompiler]
+           } else {
+               set compiler [find_gdc]
+           }
+       }
+
        if { $i == "f77" } {
            set compiler_type "f77"
            if {[board_info $dest exists f77flags]} {
@@ -438,6 +450,7 @@ proc default_target_compile {source destfile type options} {
 
     global CC_FOR_TARGET
     global CXX_FOR_TARGET
+    global D_FOR_TARGET
     global F77_FOR_TARGET
     global F90_FOR_TARGET
     global GNATMAKE_FOR_TARGET
@@ -460,6 +473,12 @@ proc default_target_compile {source destfile type options} {
        }
     }
 
+    if {[info exists D_FOR_TARGET]} {
+       if { $compiler_type == "d" } {
+           set compiler $D_FOR_TARGET
+       }
+    }
+
     if {[info exists F77_FOR_TARGET]} {
        if { $compiler_type == "f77" } {
            set compiler $F77_FOR_TARGET