* lib.ads: (Enable_Switch_Storing): Declare.
* lib.adb: (Enable_Switch_Storing): New procedure.
* switch-c.adb (Scan_Front_End_Switches): Add support for -gnatea.
* make.adb: (Compile_Sources.Compile): Add -gnatea as first option.
(Display): Never display -gnatea
* gcc-interface/lang-specs.h: If -gnatea is present, pass -gnatez.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141673
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-11-07 Bechir Zalila <bechir.zalila@gmail.com>
+ Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/34289
+ * lib.ads: (Enable_Switch_Storing): Declare.
+ * lib.adb: (Enable_Switch_Storing): New procedure.
+ * switch-c.adb (Scan_Front_End_Switches): Add support for -gnatea.
+ * make.adb: (Compile_Sources.Compile): Add -gnatea as first option.
+ (Display): Never display -gnatea
+ * gcc-interface/lang-specs.h: If -gnatea is present, pass -gnatez.
+
2008-11-07 Thomas Quinot <quinot@adacore.com>
* gcc-interface/trans.c (Attribute_to_gnu, case Attr_Length): Check
gnat1 %{I*} %{k8:-gnatk8} %{Wall:-gnatwa} %{w:-gnatws} %{!Q:-quiet}\
%{nostdinc*} %{nostdlib*}\
-dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\
- %{O*} %{W*} %{w} %{p} %{pg:-p} %{a} %{f*} %{d*} %{g*&m*} "
+ %{O*} %{W*} %{w} %{p} %{pg:-p} %{a} %{f*} %{d*}\
+ %{gnatea:-gnatez} %{g*&m*} "
#if defined(TARGET_VXWORKS_RTP)
"%{fRTS=rtp:-mrtp} "
#endif
package body Lib is
Switch_Storing_Enabled : Boolean := True;
- -- Set to False by Disable_Switch_Storing
+ -- Controlled by Enable_Switch_Storing/Disable_Switch_Storing
-----------------------
-- Local Subprograms --
return Compilation_Switches.Last;
end Compilation_Switches_Last;
+ ---------------------------
+ -- Enable_Switch_Storing --
+ ---------------------------
+
+ procedure Enable_Switch_Storing is
+ begin
+ Switch_Storing_Enabled := True;
+ end Enable_Switch_Storing;
+
+ ----------------------------
+ -- Disable_Switch_Storing --
+ ----------------------------
+
procedure Disable_Switch_Storing is
begin
Switch_Storing_Enabled := False;
-- which may influence the generated output file(s). Switch is the text of
-- the switch to store (except that -fRTS gets changed back to --RTS).
+ procedure Enable_Switch_Storing;
+ -- Enable registration of switches by Store_Compilation_Switch. Used to
+ -- avoid registering switches added automatically by the gcc driver at the
+ -- beginning of the command line.
+
procedure Disable_Switch_Storing;
-- Disable registration of switches by Store_Compilation_Switch. Used to
- -- avoid registering switches added automatically by the gcc driver.
+ -- avoid registering switches added automatically by the gcc driver at the
+ -- end of the command line.
procedure Store_Linker_Option_String (S : String_Id);
-- This procedure is called to register the string from a pragma
Source_Index : Int;
Args : Argument_List) return Process_Id
is
- Comp_Args : Argument_List (Args'First .. Args'Last + 9);
+ Comp_Args : Argument_List (Args'First .. Args'Last + 10);
Comp_Next : Integer := Args'First;
Comp_Last : Integer;
Arg_Index : Integer;
end if;
end loop;
+ Comp_Args (Comp_Next) := new String'("-gnatea");
+ Comp_Next := Comp_Next + 1;
+
Comp_Args (Comp_Next) := Comp_Flag;
Comp_Next := Comp_Next + 1;
for J in Args'Range loop
- -- Never display -gnatez
+ -- Never display -gnatea nor -gnatez
- if Args (J).all /= "-gnatez" then
+ if Args (J).all /= "-gnatea" and then
+ Args (J).all /= "-gnatez"
+ then
-- Do not display the mapping file argument automatically
-- created when using a project file.
case Switch_Chars (Ptr) is
+ when 'a' =>
+ Store_Switch := False;
+ Enable_Switch_Storing;
+ Ptr := Ptr + 1;
+
-- -gnatec (configuration pragmas)
when 'c' =>