OSDN Git Service

* s-linux-sparc.ads: New file.
[pf3gnuchains/gcc-fork.git] / gcc / ada / switch-m.adb
index 7be075d..a7a8d19 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 2001-2008, Free Software Foundation, Inc.         --
+--          Copyright (C) 2001-2009, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -24,6 +24,7 @@
 ------------------------------------------------------------------------------
 
 with Debug;    use Debug;
+with Makeutl;  use Makeutl;
 with Osint;    use Osint;
 with Opt;      use Opt;
 with Prj;      use Prj;
@@ -83,7 +84,7 @@ package body Switch.M is
          if Switches = null then
             Switches := new Argument_List (1 .. Initial_Number_Of_Switches);
 
-         --  otherwise, if Switches is full, extend it
+         --  Otherwise, if Switches is full, extend it
 
          elsif Last = Switches'Last then
             declare
@@ -406,6 +407,8 @@ package body Switch.M is
                         end if;
                      end if;
 
+                     --  Loop through remaining switch characters in string
+
                      while Ptr <= Max loop
                         C := Switch_Chars (Ptr);
                         Ptr := Ptr + 1;
@@ -435,7 +438,16 @@ package body Switch.M is
                                 (Storing (Storing'First .. Last_Stored));
                            end if;
 
-                           --  All other switches are -gnatxx
+                        --  --gnatx.x
+
+                        elsif C = '.' and then Ptr <= Max then
+                           Storing (First_Stored + 1) := '.';
+                           Storing (First_Stored + 2) := Switch_Chars (Ptr);
+                           Ptr := Ptr + 1;
+                           Add_Switch_Component
+                             (Storing (Storing'First .. First_Stored + 2));
+
+                        --  All other switches are -gnatxx
 
                         else
                            Storing (First_Stored + 1) := C;
@@ -501,8 +513,7 @@ package body Switch.M is
    end Normalize_Compiler_Switches;
 
    function Normalize_Compiler_Switches
-     (Switch_Chars : String)
-      return         Argument_List
+     (Switch_Chars : String) return Argument_List
    is
       Last : Natural;
 
@@ -514,7 +525,6 @@ package body Switch.M is
       else
          return Global_Switches (Global_Switches'First .. Last);
       end if;
-
    end Normalize_Compiler_Switches;
 
    ------------------------
@@ -522,8 +532,9 @@ package body Switch.M is
    ------------------------
 
    procedure Scan_Make_Switches
-     (Switch_Chars : String;
-      Success      : out Boolean)
+     (Project_Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
+      Switch_Chars      : String;
+      Success           : out Boolean)
    is
       Ptr : Integer          := Switch_Chars'First;
       Max : constant Integer := Switch_Chars'Last;
@@ -580,7 +591,8 @@ package body Switch.M is
            and then Switch_Chars (Ptr .. Ptr + 1) = "aP"
          then
             Add_Search_Project_Directory
-              (Switch_Chars (Ptr + 2 .. Switch_Chars'Last));
+              (Project_Node_Tree,
+               Switch_Chars (Ptr + 2 .. Switch_Chars'Last));
 
          elsif C = 'v' and then Switch_Chars'Length = 3 then
             Ptr := Ptr + 1;
@@ -644,6 +656,7 @@ package body Switch.M is
 
                   else
                      Follow_Links_For_Files := True;
+                     Follow_Links_For_Dirs  := True;
                   end if;
 
                --  Processing for eS switch