Commit 751089b2 by Vincent Celier Committed by Arnaud Charlet

gnatsym.adb: Update Copyright notice

2007-04-20  Vincent Celier  <celier@adacore.com>

	* gnatsym.adb: Update Copyright notice
	(Parse_Cmd_Line): Accept new switch -D
	(Gnatsym): In Direct policy (switch -D) copy reference file to symbol
	 file.

	* prj.ads (Policy): New policy Direct
	(Yes_No_Unknown): New enumeration type
	(Project_Data): New component Libgnarl_Needed

	* prj-nmsc.adb (Check_For_Source): When recording a source file make
	use the untouched pathname casing.
	(Get_Directories): Ensure that the Display_Exec_Directory is using the
	proper casing on non case-sensitive platforms like Windows.
	(Get_Unit): Accept file names x__... and x~... (where x = a, g, i or s)
	on all platforms, as it is not possible to know which one is allowed
	before processing the project files.
	(Check_Stand_Alone_Library): Check that Library_Reference_Symbol_File is
	specified when symbol policy is Direct. Check that when there is a
	symbol file defined (either by default or with attribute
	Library_Symbol_File) it is not the same as the reference symbol file.
	(Check_Stand_Alone_Library): Recognize new symbol policy Direct.
	(Look_For_Sources): Allow Locally_Removed_Files to be declare in non
	extending projects.
	(Record_Ada_Source): Record a source that has been locally removed in an
	imported project.

	* symbols.ads (Policy): New policy Direct

	* symbols-vms.adb (Initialize): Take new policy Direct in case
	statement

From-SVN: r125420
parent 8cc39ff2
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2006, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
-- - (optional) the name of the reference symbol file -- - (optional) the name of the reference symbol file
-- - the names of one or more object files where the symbols are found -- - the names of one or more object files where the symbols are found
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line; with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.OS_Lib; use GNAT.OS_Lib; with GNAT.OS_Lib; use GNAT.OS_Lib;
...@@ -125,7 +128,7 @@ procedure Gnatsym is ...@@ -125,7 +128,7 @@ procedure Gnatsym is
procedure Parse_Cmd_Line is procedure Parse_Cmd_Line is
begin begin
loop loop
case GNAT.Command_Line.Getopt ("c C q r: R s: v V:") is case GNAT.Command_Line.Getopt ("c C D q r: R s: v V:") is
when ASCII.NUL => when ASCII.NUL =>
exit; exit;
...@@ -135,6 +138,9 @@ procedure Gnatsym is ...@@ -135,6 +138,9 @@ procedure Gnatsym is
when 'C' => when 'C' =>
Symbol_Policy := Controlled; Symbol_Policy := Controlled;
when 'D' =>
Symbol_Policy := Direct;
when 'q' => when 'q' =>
Quiet := True; Quiet := True;
...@@ -222,6 +228,56 @@ begin ...@@ -222,6 +228,56 @@ begin
Usage; Usage;
OS_Exit (1); OS_Exit (1);
-- When symbol policy is direct, simply copy the reference symbol file to
-- the symbol file.
elsif Symbol_Policy = Direct then
declare
File_In : Ada.Text_IO.File_Type;
File_Out : Ada.Text_IO.File_Type;
Line : String (1 .. 1_000);
Last : Natural;
begin
begin
Open (File_In, In_File, Reference_Symbol_File_Name.all);
exception
when X : others =>
if not Quiet then
Put_Line
("could not open """ &
Reference_Symbol_File_Name.all
& """");
Put_Line (Exception_Message (X));
end if;
OS_Exit (1);
end;
begin
Create (File_Out, Out_File, Symbol_File_Name.all);
exception
when X : others =>
if not Quiet then
Put_Line
("could not create """ & Symbol_File_Name.all & """");
Put_Line (Exception_Message (X));
end if;
OS_Exit (1);
end;
while not End_Of_File (File_In) loop
Get_Line (File_In, Line, Last);
Put_Line (File_Out, Line (1 .. Last));
end loop;
Close (File_In);
Close (File_Out);
end;
else else
if Verbose then if Verbose then
Write_Str ("Initializing symbol file """); Write_Str ("Initializing symbol file """);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2005 Free Software Foundation, Inc. -- -- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -176,7 +176,7 @@ package body Symbols is ...@@ -176,7 +176,7 @@ package body Symbols is
if Sym_Policy /= Autonomous then if Sym_Policy /= Autonomous then
case Sym_Policy is case Sym_Policy is
when Autonomous => when Autonomous | Direct =>
null; null;
when Compliant | Controlled => when Compliant | Controlled =>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2003-2005, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2007, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
-- several implementations of the body. -- several implementations of the body.
with GNAT.Dynamic_Tables; with GNAT.Dynamic_Tables;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with System.OS_Lib; use System.OS_Lib;
package Symbols is package Symbols is
...@@ -47,10 +48,13 @@ package Symbols is ...@@ -47,10 +48,13 @@ package Symbols is
Controlled, Controlled,
-- Fail if symbols are not the same as those in the reference file -- Fail if symbols are not the same as those in the reference file
Restricted); Restricted,
-- Restrict the symbols to those in the symbol file. Fail if some -- Restrict the symbols to those in the symbol file. Fail if some
-- symbols in the symbol file are not exported from the object files. -- symbols in the symbol file are not exported from the object files.
Direct);
-- The reference symbol file is copied to the symbol file
type Symbol_Kind is (Data, Proc); type Symbol_Kind is (Data, Proc);
-- To distinguish between the different kinds of symbols -- To distinguish between the different kinds of symbols
......
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