begin
Add_Lib_Search_Dir (N);
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding object directory """);
Write_Str (N);
Write_Str (""".");
begin
Add_Src_Search_Dir (N);
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding source directory """);
Write_Str (N);
Write_Str (""".");
-- modified.
begin
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str (" Adding ");
Write_Line (Argv);
end if;
-- We need a copy, because Name_Buffer may be modified
begin
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str (" Adding ");
Write_Line (Argv);
end if;
if Read_Only then
declare
Saved_Check_Object_Consistency : constant Boolean :=
- Opt.Check_Object_Consistency;
+ Check_Object_Consistency;
begin
- Opt.Check_Object_Consistency := False;
+ Check_Object_Consistency := False;
Text := Read_Library_Info (Lib_File);
- Opt.Check_Object_Consistency := Saved_Check_Object_Consistency;
+ Check_Object_Consistency := Saved_Check_Object_Consistency;
end;
else
-- Don't take Ali file into account if it was generated without
-- object.
- if Opt.Operating_Mode /= Opt.Check_Semantics
+ if Operating_Mode /= Check_Semantics
and then ALIs.Table (ALI).No_Object
then
Verbose_Msg (Full_Lib_File, "has no corresponding object");
-- Check for matching compiler switches if needed
- if Opt.Check_Switches then
+ if Check_Switches then
-- First, collect all the switches
end loop;
if not Switch_Found then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Verbose_Msg (ALIs.Table (ALI).Sfile,
"switch mismatch """ &
Switches_To_Check.Table (J).all & '"');
Integer (Units.Table (ALIs.Table (ALI).First_Unit).Last_Arg -
Units.Table (ALIs.Table (ALI).First_Unit).First_Arg + 1)
then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Verbose_Msg (ALIs.Table (ALI).Sfile,
"different number of switches");
if Modified_Source /= No_File then
ALI := No_ALI_Id;
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Source_Name := Full_Source_Name (Modified_Source);
if Source_Name /= No_File then
if New_Spec /= No_File then
ALI := No_ALI_Id;
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Source_Name := Full_Source_Name (New_Spec);
if Source_Name /= No_File then
end if;
-- The following two flags affect the behavior of ALI.Set_Source_Table.
- -- We set Opt.Check_Source_Files to True to ensure that source file
- -- time stamps are checked, and we set Opt.All_Sources to False to
+ -- We set Check_Source_Files to True to ensure that source file
+ -- time stamps are checked, and we set All_Sources to False to
-- avoid checking the presence of the source files listed in the
-- source dependency section of an ali file (which would be a mistake
-- since the ali file may be obsolete).
- Opt.Check_Source_Files := True;
- Opt.All_Sources := False;
+ Check_Source_Files := True;
+ All_Sources := False;
Insert_Q (Main_Source);
Mark (Main_Source);
declare
Saved_Object_Consistency : constant Boolean :=
- Opt.Check_Object_Consistency;
+ Check_Object_Consistency;
begin
-- If compilation was not OK, or if output is not an
-- object file and we don't do the bind step, don't check
-- for object consistency.
- Opt.Check_Object_Consistency :=
- Opt.Check_Object_Consistency
+ Check_Object_Consistency :=
+ Check_Object_Consistency
and Compilation_OK
and (Output_Is_Object or Do_Bind_Step);
Text := Read_Library_Info (Lib_File);
-- Restore Check_Object_Consistency to its initial value
- Opt.Check_Object_Consistency := Saved_Object_Consistency;
+ Check_Object_Consistency := Saved_Object_Consistency;
end;
-- If an ALI file was generated by this compilation, scan
-- If we could not read the ALI file that was just generated
-- then there could be a problem reading either the ALI or the
- -- corresponding object file (if Opt.Check_Object_Consistency
+ -- corresponding object file (if Check_Object_Consistency
-- is set Read_Library_Info checks that the time stamp of the
-- object file is more recent than that of the ALI). For an
-- example of problems caught by this test see [6625-009].
-- If we have a special runtime, we add the standard
-- library only if we can find it.
- if Opt.RTS_Switch then
+ if RTS_Switch then
Add_It := Find_File (Sfile, Osint.Source) /= No_File;
end if;
end if;
end loop;
- if Opt.Display_Compilation_Progress then
+ if Display_Compilation_Progress then
Write_Str ("completed ");
Write_Int (Int (Q_Front));
Write_Str (" out of ");
if (not Debug.Debug_Flag_N) and Main_Project /= No_Project then
for Project in 1 .. Projects.Last loop
if Projects.Table (Project).Config_File_Temp then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Deleting temp configuration file """);
Write_Str (Get_Name_String
(Projects.Table (Project).Config_File_Name));
-- Do not check for an object file (".o") when compiling to
-- Java bytecode since ".class" files are generated instead.
- Opt.Check_Object_Consistency := False;
+ Check_Object_Consistency := False;
end if;
-- Special case when switch -B was specified
end if;
end if;
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Eol;
Write_Str ("GNATMAKE ");
Write_Str (Gnatvsn.Gnat_Version_String);
-- If -M was specified, behave as if -n was specified
- if Opt.List_Dependencies then
- Opt.Do_Not_Execute := True;
+ if List_Dependencies then
+ Do_Not_Execute := True;
end if;
-- Note that Osint.Next_Main_Source will always return the (possibly
Add_Switch ("-I-", Compiler, And_Save => True);
if Main_Project = No_Project then
- if Opt.Look_In_Primary_Dir then
+ if Look_In_Primary_Dir then
Add_Switch
("-I" &
-- sources for other compilation units, when there are extending
-- projects.
- Opt.Look_In_Primary_Dir := False;
+ Look_In_Primary_Dir := False;
end if;
-- If the user wants a program without a main subprogram, add the
-- appropriate switch to the binder.
- if Opt.No_Main_Subprogram then
+ if No_Main_Subprogram then
Add_Switch ("-z", Binder, And_Save => True);
end if;
-- We only output the main source file if there is only one
- if Opt.Verbose_Mode and then Osint.Number_Of_Files = 1 then
+ if Verbose_Mode and then Osint.Number_Of_Files = 1 then
Write_Str ("Main source file: """);
Write_Str (Main_Unit_File_Name
(Pos + 1 .. Main_Unit_File_Name'Last));
-- switches (if any).
if Osint.Number_Of_Files = 1 then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding gnatmake switches for """);
Write_Str (Main_Unit_File_Name);
Write_Line (""".");
begin
if Defaults /= Nil_Variable_Value then
- if (not Opt.Quiet_Output)
+ if (not Quiet_Output)
and then Switches /= No_Array_Element
then
Write_Line
The_Package => Builder_Package,
Program => None);
- elsif (not Opt.Quiet_Output)
+ elsif (not Quiet_Output)
and then Switches /= No_Array_Element
then
Write_Line
-- Add binder switches from the project file for the first main
if Do_Bind_Step and Binder_Package /= No_Package then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding binder switches for """);
Write_Str (Main_Unit_File_Name);
Write_Line (""".");
-- Add linker switches from the project file for the first main
if Do_Link_Step and Linker_Package /= No_Package then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding linker switches for""");
Write_Str (Main_Unit_File_Name);
Write_Line (""".");
Make_Failed ("*** make failed.");
end;
- Display_Commands (not Opt.Quiet_Output);
+ Display_Commands (not Quiet_Output);
Check_Steps;
not MLib.Tgt.Library_Exists_For (Proj);
if Projects.Table (Proj).Flag1 then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str
("Library file does not exist for project """);
Write_Str
-- precedence.
if Saved_Maximum_Processes = 0 then
- Saved_Maximum_Processes := Opt.Maximum_Processes;
+ Saved_Maximum_Processes := Maximum_Processes;
end if;
-- Allocate as many temporary mapping file names as the maximum
Most_Recent_Obj_Stamp => Youngest_Obj_Stamp,
Main_Unit => Is_Main_Unit,
Compilation_Failures => Compilation_Failures,
- Check_Readonly_Files => Opt.Check_Readonly_Files,
- Do_Not_Execute => Opt.Do_Not_Execute,
- Force_Compilations => Opt.Force_Compilations,
- In_Place_Mode => Opt.In_Place_Mode,
- Keep_Going => Opt.Keep_Going,
+ Check_Readonly_Files => Check_Readonly_Files,
+ Do_Not_Execute => Do_Not_Execute,
+ Force_Compilations => Force_Compilations,
+ In_Place_Mode => In_Place_Mode,
+ Keep_Going => Keep_Going,
Initialize_ALI_Data => True,
Max_Process => Saved_Maximum_Processes);
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("End of compilation");
Write_Eol;
end if;
Total_Compilation_Failures + Compilation_Failures;
if Total_Compilation_Failures /= 0 then
- if Opt.Keep_Going then
+ if Keep_Going then
goto Next_Main;
else
end loop;
end if;
- if Opt.List_Dependencies then
+ if List_Dependencies then
if First_Compiled_File /= No_File then
Inform
(First_Compiled_File,
elsif First_Compiled_File = No_File
and then not Do_Bind_Step
- and then not Opt.Quiet_Output
+ and then not Quiet_Output
and then not Library_Rebuilt
and then Osint.Number_Of_Files = 1
then
Inform (Msg => "objects up to date.");
- elsif Opt.Do_Not_Execute
+ elsif Do_Not_Execute
and then First_Compiled_File /= No_File
then
Write_Name (First_Compiled_File);
-- 4) Made unit cannot be a main unit
- if (Opt.Do_Not_Execute
- or Opt.List_Dependencies
+ if (Do_Not_Execute
+ or List_Dependencies
or not Do_Bind_Step
or not Is_Main_Unit)
and then not No_Main_Subprogram
-- and otherwise motivate the relink/rebind.
if not Executable_Obsolete then
- if not Opt.Quiet_Output then
+ if not Quiet_Output then
Inform (Executable, "up to date.");
end if;
-- library path. In this case, use the corresponding library file
-- name.
- if Main_ALI_File = No_File and then Opt.In_Place_Mode then
+ if Main_ALI_File = No_File and then In_Place_Mode then
Get_Name_String (Get_Directory (Full_Source_Name (Src_File)));
Get_Name_String_And_Append (ALI_File);
Main_ALI_File := Name_Find;
exception
when Link_Failed =>
- if Osint.Number_Of_Files = 1 or not Opt.Keep_Going then
+ if Osint.Number_Of_Files = 1 or not Keep_Going then
raise;
else
-- if any.
if Do_Bind_Step and Binder_Package /= No_Package then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding binder switches for """);
Write_Str (Main_Unit_File_Name);
Write_Line (""".");
-- if any.
if Do_Link_Step and Linker_Package /= No_Package then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding linker switches for""");
Write_Str (Main_Unit_File_Name);
Write_Line (""".");
-- GNATMAKE since we do not need to check source consistency
-- again once GNATMAKE has looked at the sources to check.
- Opt.Check_Object_Consistency := True;
+ Check_Object_Consistency := True;
-- Package initializations. The order of calls is important here.
-- Test for trailing -o switch
- elsif Opt.Output_File_Name_Present
+ elsif Output_File_Name_Present
and then not Output_File_Name_Seen
then
Make_Failed ("output file name missing after -o");
-- Test for trailing -D switch
- elsif Opt.Object_Directory_Present
+ elsif Object_Directory_Present
and then not Object_Directory_Seen then
Make_Failed ("object directory missing after -D");
end if;
-- A project file was specified by a -P switch
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Eol;
Write_Str ("Parsing Project File """);
Write_Str (Project_File_Name.all);
-- Avoid looking in the current directory for ALI files
- -- Opt.Look_In_Primary_Dir := False;
+ -- Look_In_Primary_Dir := False;
-- Set the project parsing verbosity to whatever was specified
-- by a possible -vP switch.
Make_Failed ("""", Project_File_Name.all, """ processing failed");
end if;
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Eol;
Write_Str ("Parsing of Project File """);
Write_Str (Project_File_Name.all);
-- is not marked.
if Sfile /= No_Name and then not Is_Marked (Sfile) then
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding """);
Write_Str (Get_Name_String (Sfile));
Write_Line (""" to the queue");
-- queue. This will allow parallel compilation processes if -jx
-- switch is used.
- if Opt.Verbose_Mode then
+ if Verbose_Mode then
Write_Str ("Adding """);
Write_Str (Get_Name_String (Sfile));
Write_Line (""" as if on the command line");
-- We have to provide the full library file name in In_Place_Mode
- if Opt.In_Place_Mode then
+ if In_Place_Mode then
Lib_Name := Full_Lib_File_Name (Lib_Name);
end if;
then
null;
else
- if not Opt.Quiet_Output then
+ if not Quiet_Output then
Src_Name := Full_Source_Name (Src_Name);
end if;
-- flag (that is we have seen a -o), then the next argument is
-- the name of the output executable.
- elsif Opt.Output_File_Name_Present
+ elsif Output_File_Name_Present
and then not Output_File_Name_Seen
then
Output_File_Name_Seen := True;
-- (that is we have seen a -D), then the next argument is
-- the path name of the object directory..
- elsif Opt.Object_Directory_Present
+ elsif Object_Directory_Present
and then not Object_Directory_Seen
then
Object_Directory_Seen := True;
if Argv'Length > 2 and then Argv (1 .. 2) = "-I" then
if Argv (3 .. Argv'Last) = "-" then
- Opt.Look_In_Primary_Dir := False;
+ Look_In_Primary_Dir := False;
elsif Program_Args = Compiler then
if Argv (3 .. Argv'Last) /= "-" then
-- Valid --RTS switch
- Opt.No_Stdinc := True;
- Opt.No_Stdlib := True;
- Opt.RTS_Switch := True;
+ No_Stdinc := True;
+ No_Stdlib := True;
+ RTS_Switch := True;
declare
Src_Path_Name : constant String_Ptr :=
-- -I-
elsif Argv (2 .. Argv'Last) = "I-" then
- Opt.Look_In_Primary_Dir := False;
+ Look_In_Primary_Dir := False;
-- Forbid -?- or -??- where ? is any character
elsif Argv (2) = 'd'
and then Argv'Last = 2
then
- Opt.Display_Compilation_Progress := True;
+ Display_Compilation_Progress := True;
-- -i
elsif Argv (2) = 'm'
and then Argv'Last = 2
then
- Opt.Minimal_Recompilation := True;
+ Minimal_Recompilation := True;
-- -u
and then Argv'Last = 2
then
Unique_Compile := True;
- Opt.Compile_Only := True;
+ Compile_Only := True;
Do_Bind_Step := False;
Do_Link_Step := False;
then
Unique_Compile_All_Projects := True;
Unique_Compile := True;
- Opt.Compile_Only := True;
+ Compile_Only := True;
Do_Bind_Step := False;
Do_Link_Step := False;
-- step are not executed.
Add_Switch (Argv, Compiler, And_Save => And_Save);
- Opt.Operating_Mode := Opt.Check_Semantics;
- Opt.Check_Object_Consistency := False;
- Opt.Compile_Only := True;
+ Operating_Mode := Check_Semantics;
+ Check_Object_Consistency := False;
+ Compile_Only := True;
Do_Bind_Step := False;
Do_Link_Step := False;
-- Don't pass -nostdlib to gnatlink, it will disable
-- linking with all standard library files.
- Opt.No_Stdlib := True;
+ No_Stdlib := True;
Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
-- Pass -nostdinc to the Compiler and to gnatbind
- Opt.No_Stdinc := True;
+ No_Stdinc := True;
Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
-- By default all switches with more than one character
-- or one character switches which are not in 'a' .. 'z'
- -- (except 'C', 'F', and 'M') are passed to the compiler,
+ -- (except 'C', 'F', 'M' and 'B') are passed to the compiler,
-- unless we are dealing with a debug switch (starts with 'd')
elsif Argv (2) /= 'd'
and then Argv (2 .. Argv'Last) /= "C"
and then Argv (2 .. Argv'Last) /= "F"
and then Argv (2 .. Argv'Last) /= "M"
+ and then Argv (2 .. Argv'Last) /= "B"
and then (Argv'Length > 2 or else Argv (2) not in 'a' .. 'z')
then
Add_Switch (Argv, Compiler, And_Save => And_Save);
Prefix : String := " -> ")
is
begin
- if not Opt.Verbose_Mode then
+ if not Verbose_Mode then
return;
end if;