aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/make.adb
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2007-09-26 12:44:55 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2007-09-26 12:44:55 +0200
commit15cf0748477830cc0b490111a345dc36bb06de14 (patch)
tree843e004295b9af3ff36cb24860ace43160446c8f /gcc/ada/make.adb
parent0a8e311d153cabafc215ec3deecc2f4b49af9a79 (diff)
downloadgcc-15cf0748477830cc0b490111a345dc36bb06de14.zip
gcc-15cf0748477830cc0b490111a345dc36bb06de14.tar.gz
gcc-15cf0748477830cc0b490111a345dc36bb06de14.tar.bz2
makeutl.ads (Main_Config_Project): Moved to gpr_util.ads
2007-09-26 Vincent Celier <celier@adacore.com> * makeutl.ads (Main_Config_Project): Moved to gpr_util.ads * prj.ads, prj.adb (Default_Language): Remove function, no longer used Replace components Compiler_Min_Options and Binder_Min_Options with Compiler_Required_Switches and Binder_Required_Switches in record Language_Config. Remove components Default_Language and Config in Project_Tree_Data, no longer used. * prj-attr.adb: New attributes Required_Switches (<language>) in packages Compiler and Binder. * prj-nmsc.adb: Major rewrite of the processing of configuration attributes for gprbuild. No impact on GNAT tools. * prj-proc.ads, prj-proc.adb (Process_Project_Tree_Phase_2): No longer process configuration attributes: this is done in Prj.Nmsc.Check. (Recursive_Process): Make a full copy of packages inherited from project being extended, instead of a shallow copy. (Process_Project_Tree_Phase_1): New procedure (Process_Project_Tree_Phase_1): New procedure (Process): Implementation now uses the two new procedures * prj-util.adb (Executable_Of): Get the suffix and the default suffix from the project config, not the tree config that no longer exists. From-SVN: r128796
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r--gcc/ada/make.adb65
1 files changed, 46 insertions, 19 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index eb87005..c2c10ad 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -76,6 +76,10 @@ package body Make is
-- Every program depends on this package, that must then be checked,
-- especially when -f and -a are used.
+ procedure Kill (Pid : Process_Id; Sig_Num : Integer; Close : Integer);
+ pragma Import (C, Kill, "__gnat_kill");
+ -- Called by Sigint_Intercepted to kill all spawned compilation processes
+
type Sigint_Handler is access procedure;
procedure Install_Int_Handler (Handler : Sigint_Handler);
@@ -86,6 +90,28 @@ package body Make is
-- Called when the program is interrupted by Ctrl-C to delete the
-- temporary mapping files and configuration pragmas files.
+ No_Mapping_File : constant Natural := 0;
+
+ type Compilation_Data is record
+ Pid : Process_Id;
+ Full_Source_File : File_Name_Type;
+ Lib_File : File_Name_Type;
+ Source_Unit : Unit_Name_Type;
+ Mapping_File : Natural := No_Mapping_File;
+ Project : Project_Id := No_Project;
+ Syntax_Only : Boolean := False;
+ Output_Is_Object : Boolean := True;
+ end record;
+ -- Data recorded for each compilation process spawned
+
+ type Comp_Data_Arr is array (Positive range <>) of Compilation_Data;
+ type Comp_Data_Ptr is access Comp_Data_Arr;
+ Running_Compile : Comp_Data_Ptr;
+ -- Used to save information about outstanding compilations
+
+ Outstanding_Compiles : Natural := 0;
+ -- Current number of outstanding compiles
+
-------------------------
-- Note on terminology --
-------------------------
@@ -2442,25 +2468,6 @@ package body Make is
Initialize_ALI_Data : Boolean := True;
Max_Process : Positive := 1)
is
- No_Mapping_File : constant Natural := 0;
-
- type Compilation_Data is record
- Pid : Process_Id;
- Full_Source_File : File_Name_Type;
- Lib_File : File_Name_Type;
- Source_Unit : Unit_Name_Type;
- Mapping_File : Natural := No_Mapping_File;
- Project : Project_Id := No_Project;
- Syntax_Only : Boolean := False;
- Output_Is_Object : Boolean := True;
- end record;
-
- Running_Compile : array (1 .. Max_Process) of Compilation_Data;
- -- Used to save information about outstanding compilations
-
- Outstanding_Compiles : Natural := 0;
- -- Current number of outstanding compiles
-
Source_Unit : Unit_Name_Type;
-- Current source unit
@@ -3150,6 +3157,9 @@ package body Make is
begin
pragma Assert (Args'First = 1);
+ Outstanding_Compiles := 0;
+ Running_Compile := new Comp_Data_Arr (1 .. Max_Process);
+
-- Package and Queue initializations
Good_ALI.Init;
@@ -5401,6 +5411,15 @@ package body Make is
Bad_Compilation.Init;
+ -- If project files are used, create the mapping of all the sources,
+ -- so that the correct paths will be found. Otherwise, if there is
+ -- a file which is not a source with the same name in a source directory
+ -- this file may be incorrectly found.
+
+ if Main_Project /= No_Project then
+ Prj.Env.Create_Mapping (Project_Tree);
+ end if;
+
Current_Main_Index := Main_Index;
-- Here is where the make process is started
@@ -7378,10 +7397,18 @@ package body Make is
------------------------
procedure Sigint_Intercepted is
+ SIGINT : constant := 2;
begin
Set_Standard_Error;
Write_Line ("*** Interrupted ***");
Delete_All_Temp_Files;
+
+ -- Send SIGINT to all oustanding compilation processes spawned
+
+ for J in 1 .. Outstanding_Compiles loop
+ Kill (Running_Compile (J).Pid, SIGINT, 1);
+ end loop;
+
OS_Exit (1);
end Sigint_Intercepted;