2004-03-29 Joel Brobecker <brobecker@gnat.com>
authorRob Savoye <rob@welcomehome.org>
Wed, 21 Apr 2004 16:50:23 +0000 (16:50 +0000)
committerRob Savoye <rob@welcomehome.org>
Wed, 21 Apr 2004 16:50:23 +0000 (16:50 +0000)
* lib/libgloss.exp (find_gnatmake): New procedure.
* lib/target.exp (default_target_compile): Add support for Ada.

ChangeLog
lib/libgloss.exp
lib/target.exp

index 8b5bf90..38df135 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-03-29  Joel Brobecker  <brobecker@gnat.com>
+
+       * lib/libgloss.exp (find_gnatmake): New procedure.
+       * lib/target.exp (default_target_compile): Add support for Ada.
+
 2004-04-16  Kazuhiro Inaoka  <inaoka dot kazuhiro at renesas dot com>
                                                                                 
         * baseboards/m32r-linux-sim.exp: Add New file.
index ebdf299..7c6d13f 100644 (file)
@@ -695,6 +695,26 @@ proc find_g77 {} {
     return $CC
 }
 
+proc find_gnatmake {} {
+    global tool_root_dir
+
+    set root "$tool_root_dir/gcc"
+    set GM ""
+
+    if ![is_remote host] {
+        set file [lookfor_file $root gnatmake]
+        if { $file != "" } {
+            set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
+        }
+    }
+
+    if {$GM == ""} {
+        set GM [transform gnatmake]
+    }
+
+    return $GM
+}
+
 proc find_nm {} {
     global tool_root_dir
 
index 80edcd0..fe4b714 100644 (file)
@@ -333,6 +333,20 @@ proc default_target_compile {source destfile type options} {
     }
 
     foreach i $options {
+
+       if { $i == "ada" } {
+           set compiler_type "ada"
+           if [board_info $dest exists adaflags] {
+               append add_flags " [target_info adaflags]"
+           }
+           # append add_flags " [gnatmake_include_flags]";
+           if [board_info $dest exists gnatmake] {
+               set compiler [target_info gnatmake];
+           } else {
+               set compiler [find_gnatmake];
+           }
+       }
+       
        if { $i == "c++" } {
            set compiler_type "c++"
            if [board_info $dest exists cxxflags] {
@@ -412,6 +426,13 @@ proc default_target_compile {source destfile type options} {
     global CC_FOR_TARGET
     global CXX_FOR_TARGET
     global F77_FOR_TARGET
+    global GNATMAKE_FOR_TARGET
+
+    if [info exists GNATMAKE_FOR_TARGET] {
+       if { $compiler_type == "ada" } {
+           set compiler $GNATMAKE_FOR_TARGET
+       }
+    }
 
     if [info exists CC_FOR_TARGET] {
        if { $compiler == "" } {