clean.adb (Gnatclean): Fail if main project is an aggregate project or if...
authorVincent Celier <celier@adacore.com>
Wed, 29 Jan 2014 15:36:37 +0000 (15:36 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 29 Jan 2014 15:36:37 +0000 (16:36 +0100)
2014-01-29  Vincent Celier  <celier@adacore.com>

* clean.adb (Gnatclean): Fail if main project is an aggregate
project or if there is an aggregate library project in the
project tree.
* gnatcmd.adb: Fail if the main project is an aggregate project
or if there is an aggegate library project in the project tree.
* make.adb (Initialize): : Fail if main project is an aggregate
project or if there is an aggregate library project in the
project tree.
* makeutl.ads (Aggregate_Libraries_In): New Boolean function.
* prj-makr.adb (Initialize): Fail if the main project is an
aggregate project or an aggregate library project.

From-SVN: r207255

gcc/ada/ChangeLog
gcc/ada/clean.adb
gcc/ada/gnatcmd.adb
gcc/ada/make.adb
gcc/ada/makeutl.adb
gcc/ada/makeutl.ads
gcc/ada/prj-makr.adb

index 24d4801f8568a8886c177015901dfefdb0c33415..57624ead7c1a263f494895e00ff9643c99ac76e6 100644 (file)
@@ -1,3 +1,17 @@
+2014-01-29  Vincent Celier  <celier@adacore.com>
+
+       * clean.adb (Gnatclean): Fail if main project is an aggregate
+       project or if there is an aggregate library project in the
+       project tree.
+       * gnatcmd.adb: Fail if the main project is an aggregate project
+       or if there is an aggegate library project in the project tree.
+       * make.adb (Initialize): : Fail if main project is an aggregate
+       project or if there is an aggregate library project in the
+       project tree.
+       * makeutl.ads (Aggregate_Libraries_In): New Boolean function.
+       * prj-makr.adb (Initialize): Fail if the main project is an
+       aggregate project or an aggregate library project.
+
 2014-01-29  Vincent Celier  <celier@adacore.com>
 
        * prj-part.adb (Check_Import_Aggregate): New procedure
index cbaaa61c7d02c91822202b72390c79f5e12bc934..83e81cbe84004ce81bc919a944f87fae54ea50b9 100644 (file)
@@ -1416,6 +1416,12 @@ package body Clean is
 
          if Main_Project = No_Project then
             Fail ("""" & Project_File_Name.all & """ processing failed");
+
+         elsif Main_Project.Qualifier = Aggregate then
+            Fail ("aggregate projects are not supported");
+
+         elsif Aggregate_Libraries_In (Project_Tree) then
+            Fail ("aggregate library projects are not supported");
          end if;
 
          if Opt.Verbose_Mode then
index d879cb7813a11475267711e469f34039e1b1cd5e..1bca7d80f4696efea3c259d61914bda1a79290ea 100644 (file)
@@ -1939,6 +1939,12 @@ begin
 
          if Project = Prj.No_Project then
             Fail ("""" & Project_File.all & """ processing failed");
+
+         elsif Project.Qualifier = Aggregate then
+            Fail ("aggregate projects are not supported");
+
+         elsif Aggregate_Libraries_In (Project_Tree) then
+            Fail ("aggregate library projects are not supported");
          end if;
 
          --  Check if a package with the name of the tool is in the project
index c8c605313e10498af1069bd70fa60c156c0d8214..5078f0e1163b52353c76446e12983118242700d5 100644 (file)
@@ -6617,6 +6617,13 @@ package body Make is
               ("""" & Project_File_Name.all & """ processing failed");
          end if;
 
+         if Main_Project.Qualifier = Aggregate then
+            Make_Failed ("aggregate projects are not supported");
+
+         elsif Aggregate_Libraries_In (Project_Tree) then
+            Make_Failed ("aggregate library projects are not supported");
+         end if;
+
          Create_Mapping_File := True;
 
          if Verbose_Mode then
index c54693150850ab18553d0a2ac45c3f2da4df9a3d..a220cbec0e27438656da18963c58486ff1b3727a 100644 (file)
@@ -171,6 +171,26 @@ package body Makeutl is
       end;
    end Absolute_Path;
 
+   ----------------------------
+   -- Aggregate_Libraries_In --
+   ----------------------------
+
+   function Aggregate_Libraries_In (Tree : Project_Tree_Ref) return Boolean is
+      List : Project_List;
+
+   begin
+      List := Tree.Projects;
+      while List /= null loop
+         if List.Project.Qualifier = Aggregate_Library then
+            return True;
+         end if;
+
+         List := List.Next;
+      end loop;
+
+      return False;
+   end Aggregate_Libraries_In;
+
    -------------------------
    -- Base_Name_Index_For --
    -------------------------
index e5f430440ec72099ea927de0209c149333ed3b9a..88c9c988cbe3dc4d012c7a823ac9049d4a920b2c 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 S p e c                                  --
 --                                                                          --
---          Copyright (C) 2004-2012, Free Software Foundation, Inc.         --
+--          Copyright (C) 2004-2013, 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- --
@@ -216,6 +216,10 @@ package Makeutl is
    --  The source directories of imported projects are only included if one
    --  of the declared languages is in the list Languages.
 
+   function Aggregate_Libraries_In (Tree : Project_Tree_Ref) return Boolean;
+   --  Return True iff there is one or more aggregate library projects in
+   --  the project tree Tree.
+
    procedure Write_Path_File (FD : File_Descriptor);
    --  Write in the specified open path file the directories in table
    --  Directories, then closed the path file.
index 7de436943f593bc0b5d1e86ee060b8f059b6e094..f6d71f46b90efa7225be7d1042a4da642e454128 100644 (file)
@@ -889,6 +889,14 @@ package body Prj.Makr is
             if No (Project_Node) then
                Prj.Com.Fail ("parsing of existing project file failed");
 
+            elsif Project_Qualifier_Of (Project_Node, Tree) = Aggregate then
+               Prj.Com.Fail ("aggregate projects are not supported");
+
+            elsif Project_Qualifier_Of (Project_Node, Tree) =
+                                                    Aggregate_Library
+            then
+               Prj.Com.Fail ("aggregate library projects are not supported");
+
             else
                --  If parsing was successful, remove the components that are
                --  automatically generated, if any, so that they will be