prj-nmsc.adb: Minor reformatting.
authorPascal Obry <obry@adacore.com>
Mon, 5 Sep 2011 14:03:26 +0000 (14:03 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 5 Sep 2011 14:03:26 +0000 (16:03 +0200)
2011-09-05  Pascal Obry  <obry@adacore.com>

* prj-nmsc.adb: Minor reformatting.
Add support for standalone aggregate library.
(Check_Stand_Alone_Library): Handle standalone aggregate library.
* projects.texi: Fix documentation for aggregate library projects.

From-SVN: r178546

gcc/ada/ChangeLog
gcc/ada/prj-nmsc.adb
gcc/ada/projects.texi

index 852f937..0b6ae3f 100644 (file)
@@ -1,3 +1,10 @@
+2011-09-05  Pascal Obry  <obry@adacore.com>
+
+       * prj-nmsc.adb: Minor reformatting.
+       Add support for standalone aggregate library.
+       (Check_Stand_Alone_Library): Handle standalone aggregate library.
+       * projects.texi: Fix documentation for aggregate library projects.
+
 2011-09-05  Robert Dewar  <dewar@adacore.com>
 
        * sem_ch6.adb: Minor reformatting.
index bf6f4cb..9ebd300 100644 (file)
@@ -2717,8 +2717,8 @@ package body Prj.Nmsc is
                   Source := Prj.Element (Iter);
                   exit when Source = No_Source;
 
-                  if Source.Unit /= No_Unit_Index and then
-                     Source.Unit.Name = Name_Id (Name)
+                  if Source.Unit /= No_Unit_Index
+                    and then Source.Unit.Name = Name_Id (Name)
                   then
                      if not Source.Locally_Removed then
                         Source.In_Interfaces := True;
@@ -2870,8 +2870,8 @@ package body Prj.Nmsc is
                   end if;
                end if;
 
-            elsif Project.Library_Kind /= Static and then
-                  Proj.Library_Kind = Static
+            elsif Project.Library_Kind /= Static
+              and then Proj.Library_Kind = Static
             then
                Error_Msg_Name_1 := Project.Name;
                Error_Msg_Name_2 := Proj.Name;
@@ -3193,8 +3193,8 @@ package body Prj.Nmsc is
                      Lib_ALI_Dir.Location, Project);
                end if;
 
-               if (not Project.Externally_Built) and then
-                  Project.Library_ALI_Dir /= Project.Library_Dir
+               if not Project.Externally_Built
+                 and then Project.Library_ALI_Dir /= Project.Library_Dir
                then
                   --  The library ALI directory cannot be the same as the
                   --  Object directory.
@@ -4435,7 +4435,18 @@ package body Prj.Nmsc is
                   Error_Msg_Name_1 := Unit;
 
                   Next_Proj := Project.Extends;
-                  Iter := For_Each_Source (Data.Tree, Project);
+
+                  if Project.Qualifier = Aggregate_Library then
+
+                     --  For an aggregate library we want to consider sources
+                     --  of all aggregated projects.
+
+                     Iter := For_Each_Source (Data.Tree);
+
+                  else
+                     Iter := For_Each_Source (Data.Tree, Project);
+                  end if;
+
                   loop
                      while Prj.Element (Iter) /= No_Source
                        and then
@@ -4467,6 +4478,7 @@ package body Prj.Nmsc is
                   if Source /= No_Source then
                      if Source.Project /= Project
                        and then not Is_Extending (Project, Source.Project)
+                       and then Project.Qualifier /= Aggregate_Library
                      then
                         Source := No_Source;
                      end if;
@@ -4952,10 +4964,10 @@ package body Prj.Nmsc is
         and then Name_Len > 3
         and then Name_Buffer (2 .. 3) = "__"
         and then
-          ((Name_Buffer (1) = 'a') or else
-           (Name_Buffer (1) = 'g') or else
-           (Name_Buffer (1) = 'i') or else
-           (Name_Buffer (1) = 's'))
+          (Name_Buffer (1) = 'a' or else
+           Name_Buffer (1) = 'g' or else
+           Name_Buffer (1) = 'i' or else
+           Name_Buffer (1) = 's')
       then
          Name_Buffer (2) := '.';
          Name_Buffer (3 .. Name_Len - 1) := Name_Buffer (4 .. Name_Len);
@@ -5054,8 +5066,8 @@ package body Prj.Nmsc is
       OK := OK and then not Need_Letter and then not Last_Underscore;
 
       if OK then
-         if First /= Name'First and then
-           Is_Reserved (The_Name (First .. The_Name'Last))
+         if First /= Name'First
+           and then Is_Reserved (The_Name (First .. The_Name'Last))
          then
             return;
          end if;
index 46f1497..fbaa345 100644 (file)
@@ -2695,7 +2695,6 @@ project. Here is the (non exhaustive) list:
 @item Source_Files, Source_List_File and other attributes dealing with
   list of sources.
 @item Source_Dirs, Exec_Dir and Object_Dir
-@item Library_Dir, Library_Name and other library-related attributes
 @item Main
 @item Roots
 @item Externally_Built