summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:55:59 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-16 08:55:59 +0000
commitd25effa88fc45b26bb1ac6135a42785ddb699037 (patch)
treee18aa2d051b82c7946e9a78cc5fbd846d4e04e46 /gcc
parentca2aad1bf7ecfd40b8b8cf58fa918af06fc22161 (diff)
downloadgcc-d25effa88fc45b26bb1ac6135a42785ddb699037.tar.gz
2005-06-14 Vincent Celier <celier@adacore.com>
* makegpr.adb (Compile_Link_With_Gnatmake): Invoke gnatmake with -d if gprmake was invoked with -d. (Compile_Sources): If -d was used, output the "completed ..." message for each compilation. (Scan_Arg): Recognize new switch -d When -c and at least one main is specified, set Unique_Compile to True to guarantee that no other sources will be compiled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/makegpr.adb60
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/ada/makegpr.adb b/gcc/ada/makegpr.adb
index 3cc8ad5e173..aad0ec4b7ff 100644
--- a/gcc/ada/makegpr.adb
+++ b/gcc/ada/makegpr.adb
@@ -280,6 +280,8 @@ package body Makegpr is
Dash_c : constant String_Access := Dash_c_String'Access;
Dash_cargs_String : aliased String := "-cargs";
Dash_cargs : constant String_Access := Dash_cargs_String'Access;
+ Dash_d_String : aliased String := "-d";
+ Dash_d : constant String_Access := Dash_d_String'Access;
Dash_f_String : aliased String := "-f";
Dash_f : constant String_Access := Dash_f_String'Access;
Dash_k_String : aliased String := "-k";
@@ -2494,6 +2496,12 @@ package body Makegpr is
Add_Argument (Dash_c, True);
end if;
+ -- -d
+
+ if Display_Compilation_Progress then
+ Add_Argument (Dash_d, True);
+ end if;
+
-- -k
if Keep_Going then
@@ -2604,7 +2612,28 @@ package body Makegpr is
Need_To_Rebuild_Archive : Boolean := Force_Compilations;
-- True when the archive needs to be built/rebuilt unconditionally
+ Total_Number_Of_Sources : Int := 0;
+
+ Current_Source_Number : Int := 0;
+
begin
+ -- First, get the number of sources
+
+ for Project in Project_Table.First ..
+ Project_Table.Last (Project_Tree.Projects)
+ loop
+ Data := Project_Tree.Projects.Table (Project);
+
+ if (not Data.Virtual) and then Data.Other_Sources_Present then
+ Source_Id := Data.First_Other_Source;
+ while Source_Id /= No_Other_Source loop
+ Source := Project_Tree.Other_Sources.Table (Source_Id);
+ Total_Number_Of_Sources := Total_Number_Of_Sources + 1;
+ Source_Id := Source.Next;
+ end loop;
+ end if;
+ end loop;
+
-- Loop through project files
for Project in Project_Table.First ..
@@ -2636,7 +2665,9 @@ package body Makegpr is
-- Process each source one by one
while Source_Id /= No_Other_Source loop
+
Source := Project_Tree.Other_Sources.Table (Source_Id);
+ Current_Source_Number := Current_Source_Number + 1;
Need_To_Compile := Force_Compilations;
-- Check if compilation is needed
@@ -2656,6 +2687,18 @@ package body Makegpr is
Compile (Source_Id, Data, Local_Errors);
end if;
+ if Display_Compilation_Progress then
+ Write_Str ("completed ");
+ Write_Int (Current_Source_Number);
+ Write_Str (" out of ");
+ Write_Int (Total_Number_Of_Sources);
+ Write_Str (" (");
+ Write_Int
+ ((Current_Source_Number * 100) / Total_Number_Of_Sources);
+ Write_Str ("%)...");
+ Write_Eol;
+ end if;
+
-- Next source, if any
Source_Id := Source.Next;
@@ -4031,6 +4074,16 @@ package body Makegpr is
if Arg = "-c" then
Compile_Only := True;
+ -- Make sure that when a main is specified and switch -c is used,
+ -- only the main(s) is/are compiled.
+
+ if Mains.Number_Of_Mains > 0 then
+ Unique_Compile := True;
+ end if;
+
+ elsif Arg = "-d" then
+ Display_Compilation_Progress := True;
+
elsif Arg = "-f" then
Force_Compilations := True;
@@ -4103,6 +4156,13 @@ package body Makegpr is
-- Not a switch: must be a main
Mains.Add_Main (Arg);
+
+ -- Make sure that when a main is specified and switch -c is used,
+ -- only the main(s) is/are compiled.
+
+ if Compile_Only then
+ Unique_Compile := True;
+ end if;
end if;
end Scan_Arg;