Commit 3a4ec5cc by Vincent Celier Committed by Arnaud Charlet

bindusg.adb (Display): Update line for -R

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
parent 47d3b920
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> 2010-06-22 Robert Dewar <dewar@adacore.com>
* lib-writ.ads, errout.adb, einfo.adb, einfo.ads: Minor reformatting. * lib-writ.ads, errout.adb, einfo.adb, einfo.ads: Minor reformatting.
......
...@@ -181,7 +181,7 @@ package body Bindusg is ...@@ -181,7 +181,7 @@ package body Bindusg is
-- Line for -R switch -- Line for -R switch
Write_Line Write_Line
(" -R List sources referenced in closure (implies -c)"); (" -R List sources referenced in closure");
-- Line for -s switch -- Line for -s switch
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
with GNAT.Case_Util; use GNAT.Case_Util; with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.Dynamic_HTables; with GNAT.Dynamic_HTables;
with GNAT.Table;
with Err_Vars; use Err_Vars; with Err_Vars; use Err_Vars;
with Opt; use Opt; with Opt; use Opt;
...@@ -157,6 +158,20 @@ package body Prj.Nmsc is ...@@ -157,6 +158,20 @@ package body Prj.Nmsc is
-- This data must be initialized before processing any project, and the -- This data must be initialized before processing any project, and the
-- same data is used for processing all projects in the tree. -- 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 procedure Initialize
(Data : out Tree_Processing_Data; (Data : out Tree_Processing_Data;
Tree : Project_Tree_Ref; Tree : Project_Tree_Ref;
...@@ -4083,9 +4098,46 @@ package body Prj.Nmsc is ...@@ -4083,9 +4098,46 @@ package body Prj.Nmsc is
end; end;
end if; 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; Project.Extends.Library := False;
end if; 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; end Check_Library_Attributes;
--------------------------------- ---------------------------------
......
...@@ -366,7 +366,6 @@ package body Switch.B is ...@@ -366,7 +366,6 @@ package body Switch.B is
when 'R' => when 'R' =>
Ptr := Ptr + 1; Ptr := Ptr + 1;
Check_Only := True;
List_Closure := True; List_Closure := True;
-- Processing for s switch -- Processing for s switch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment