diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2016-02-23 07:58:41 +1100 |
---|---|---|
committer | Ben Elliston <bje@gnu.org> | 2016-02-23 07:58:41 +1100 |
commit | 3637775afa01ab249ad400102c152586307d94f2 (patch) | |
tree | 675ff94997680b1393880ec9e0e56d50c91e0019 /lib | |
parent | bd40ff1e65b596da52cbdd9bab3f775957e09bbc (diff) | |
download | dejagnu-3637775afa01ab249ad400102c152586307d94f2.zip dejagnu-3637775afa01ab249ad400102c152586307d94f2.tar.gz dejagnu-3637775afa01ab249ad400102c152586307d94f2.tar.bz2 |
* lib/libgloss.exp (find_gdc): New proc.
* lib/target.exp (default_target_compile): Add D support.
* NEWS: Update.
Signed-off-by: Ben Elliston <bje@gnu.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libgloss.exp | 19 | ||||
-rw-r--r-- | lib/target.exp | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/lib/libgloss.exp b/lib/libgloss.exp index 77150cb..0017d05 100644 --- a/lib/libgloss.exp +++ b/lib/libgloss.exp @@ -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 diff --git a/lib/target.exp b/lib/target.exp index e8c9047..323a155 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -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 |