Commit 6d566287 by Arnaud Charlet

gnatbind.adb (Scan_Bind_Arg): Replace error by warning on -M and native platforms.

	* gnatbind.adb (Scan_Bind_Arg): Replace error by warning on -M and
	native platforms.
	(Gnatbind): Do not call Exit_Program (E_Success) at the end, so that
	finalization can occur normally.

From-SVN: r111074
parent 987b2901
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2006, 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- --
...@@ -364,13 +364,14 @@ procedure Gnatbind is ...@@ -364,13 +364,14 @@ procedure Gnatbind is
-- -Mname -- -Mname
elsif Argv'Length >= 3 and then Argv (2) = 'M' then elsif Argv'Length >= 3 and then Argv (2) = 'M' then
if Is_Cross_Compiler then if not Is_Cross_Compiler then
Opt.Bind_Alternate_Main_Name := True; Write_Line
Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last)); ("gnatbind: -M not expected to be used on native platforms");
else
Fail ("-M option only valid for a cross-compiler");
end if; end if;
Opt.Bind_Alternate_Main_Name := True;
Opt.Alternate_Main_Name := new String'(Argv (3 .. Argv'Last));
-- All other options are single character and are handled by -- All other options are single character and are handled by
-- Scan_Binder_Switches. -- Scan_Binder_Switches.
...@@ -525,7 +526,9 @@ begin ...@@ -525,7 +526,9 @@ begin
Write_Str ("GNATBIND "); Write_Str ("GNATBIND ");
Write_Str (Gnat_Version_String); Write_Str (Gnat_Version_String);
Write_Eol; Write_Eol;
Write_Str ("Copyright 1995-2005 Free Software Foundation, Inc."); Write_Str ("Copyright 1995-" &
Current_Year &
", Free Software Foundation, Inc.");
Write_Eol; Write_Eol;
end if; end if;
...@@ -720,10 +723,15 @@ begin ...@@ -720,10 +723,15 @@ begin
if Total_Errors > 0 then if Total_Errors > 0 then
Exit_Program (E_Errors); Exit_Program (E_Errors);
elsif Total_Warnings > 0 then elsif Total_Warnings > 0 then
Exit_Program (E_Warnings); Exit_Program (E_Warnings);
else else
Exit_Program (E_Success); -- Do not call Exit_Program (E_Success), so that finalization occurs
-- normally.
null;
end if; end if;
end Gnatbind; end Gnatbind;
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