]> gcc.gnu.org Git - gcc.git/commitdiff
bindusg.adb (Display): Update line for -R
authorVincent Celier <celier@adacore.com>
Tue, 22 Jun 2010 10:15:49 +0000 (10:15 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 22 Jun 2010 10:15:49 +0000 (12:15 +0200)
2010-06-22  Vincent Celier  <celier@adacore.com>

* bindusg.adb (Display): Update line for -R
* switch-b.adb (Scan_Binder_Switches): Allow generation of the binder
generated files when -R is used.

2010-06-22  Vincent Celier  <celier@adacore.com>

* prj-nmsc.adb (Lib_Data_Table): New table.
(Check_Library_Attributes): Check if the same library name is used in
two different projects that do not extend each other.

From-SVN: r161161

gcc/ada/ChangeLog
gcc/ada/bindusg.adb
gcc/ada/prj-nmsc.adb
gcc/ada/switch-b.adb

index 2b2728cfeba11bb21d4f43dafee2a5d78c296281..df1bc715f5dbe1509282c47930237b3cda0bf639 100644 (file)
@@ -1,3 +1,15 @@
+2010-06-22  Vincent Celier  <celier@adacore.com>
+
+       * bindusg.adb (Display): Update line for -R
+       * switch-b.adb (Scan_Binder_Switches): Allow generation of the binder
+       generated files when -R is used.
+
+2010-06-22  Vincent Celier  <celier@adacore.com>
+
+       * prj-nmsc.adb (Lib_Data_Table): New table.
+       (Check_Library_Attributes): Check if the same library name is used in
+       two different projects that do not extend each other.
+
 2010-06-22  Robert Dewar  <dewar@adacore.com>
 
        * lib-writ.ads, errout.adb, einfo.adb, einfo.ads: Minor reformatting.
index 4702d82095ba95abe29ec3c08dde54e25b2dcded..bfab363734426c4bb29e17043de5b384bc93a5fe 100644 (file)
@@ -181,7 +181,7 @@ package body Bindusg is
       --  Line for -R switch
 
       Write_Line
-        ("  -R        List sources referenced in closure (implies -c)");
+        ("  -R        List sources referenced in closure");
 
       --  Line for -s switch
 
index 498a01eb9fadb95c232dfcd1b59061ec4035999a..f16f6e7bd9bde0a94b913a6e4a95edceb35c74bd 100644 (file)
@@ -26,6 +26,7 @@
 with GNAT.Case_Util;             use GNAT.Case_Util;
 with GNAT.Directory_Operations;  use GNAT.Directory_Operations;
 with GNAT.Dynamic_HTables;
+with GNAT.Table;
 
 with Err_Vars; use Err_Vars;
 with Opt;      use Opt;
@@ -157,6 +158,20 @@ package body Prj.Nmsc is
    --  This data must be initialized before processing any project, and the
    --  same data is used for processing all projects in the tree.
 
+   type Lib_Data is record
+      Name : Name_Id;
+      Proj : Project_Id;
+   end record;
+
+   package Lib_Data_Table is new GNAT.Table
+     (Table_Component_Type => Lib_Data,
+      Table_Index_Type     => Positive,
+      Table_Low_Bound      => 1,
+      Table_Initial        => 10,
+      Table_Increment      => 100);
+   --  A table to record library names in order to check that two library
+   --  projects do not have the same library names.
+
    procedure Initialize
      (Data  : out Tree_Processing_Data;
       Tree  : Project_Tree_Ref;
@@ -4083,9 +4098,46 @@ package body Prj.Nmsc is
          end;
       end if;
 
-      if Project.Extends /= No_Project then
+      if Project.Extends /= No_Project and then Project.Extends.Library then
+
+         --  Remove the library name from Lib_Data_Table
+
+         for J in 1 .. Lib_Data_Table.Last loop
+            if Lib_Data_Table.Table (J).Proj = Project.Extends then
+               Lib_Data_Table.Table (J) :=
+                 Lib_Data_Table.Table (Lib_Data_Table.Last);
+               Lib_Data_Table.Set_Last (Lib_Data_Table.Last - 1);
+               exit;
+            end if;
+         end loop;
+
          Project.Extends.Library := False;
       end if;
+
+      if Project.Library and then not Lib_Name.Default then
+
+         --  Check if the same library name is used in an other library project
+
+         for J in 1 .. Lib_Data_Table.Last loop
+            if Lib_Data_Table.Table (J).Name = Project.Library_Name then
+               Error_Msg_Name_1 := Lib_Data_Table.Table (J).Proj.Name;
+               Error_Msg
+                 (Data.Flags,
+                  "Library name cannot be the same as in project %%",
+                  Lib_Name.Location, Project);
+               Project.Library := False;
+               exit;
+            end if;
+         end loop;
+      end if;
+
+      if Project.Library then
+
+         --  Record the library name
+
+         Lib_Data_Table.Append
+           ((Name => Project.Library_Name, Proj => Project));
+      end if;
    end Check_Library_Attributes;
 
    ---------------------------------
index 705f9a3b5f066397f9b69ed9edb38089ffa42498..8a22eb0c231a99a205f91dc9ed76e30f11c8a488 100644 (file)
@@ -366,7 +366,6 @@ package body Switch.B is
 
          when 'R' =>
             Ptr := Ptr + 1;
-            Check_Only   := True;
             List_Closure := True;
 
          --  Processing for s switch
This page took 0.087084 seconds and 5 git commands to generate.