aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatcmd.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-05-12 10:36:45 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-12 10:36:45 +0200
commitf8dae9bb29d4dffc332c5a0670ff814816c87731 (patch)
tree57218611df0267da5328f2edf73b0d2ae8c2c482 /gcc/ada/gnatcmd.adb
parent73cc8f6230c672fab16f0d43a661c62744b5f0cb (diff)
downloadgcc-f8dae9bb29d4dffc332c5a0670ff814816c87731.zip
gcc-f8dae9bb29d4dffc332c5a0670ff814816c87731.tar.gz
gcc-f8dae9bb29d4dffc332c5a0670ff814816c87731.tar.bz2
[multiple changes]
2015-05-12 Robert Dewar <dewar@adacore.com> * sem_ch3.adb: Minor reformatting. 2015-05-12 Vincent Celier <celier@adacore.com> * gnatcmd.adb: If we want to invoke gnatmake (gnatclean) with -P, then check if gprbuild (gprclean) is available; if it is, use gprbuild (gprclean) instead of gnatmake (gnatclean). 2015-05-12 Robert Dewar <dewar@adacore.com> * debug.adb: Add flag -gnatd.3 to output diagnostic info from Exp_Unst. * einfo.ad, einfo.adb: Reorganize (and remove most of) flags used by Exp_Unst. * exp_ch6.adb (Unest_Bodies): Table for delayed calls to Unnest_Subprogram (Expand_N_Subprogram_Body): Add entry to table for later call instead of calling Unnest_Subprogram directly (Initialize): New procedure (Unnest_Subprograms): New procedure * exp_ch6.ads (Add_Extra_Actual_To_Call): Move into proper alpha order. (Initialize): New procedure. (Unnest_Subprograms): New procedure. * exp_unst.adb (Unnest_Subprogram): Major rewrite, moving all processing to this routine which is now called late after instantiating bodies. Fully handles the case of generic instantiations now. * exp_unst.ads: Major rewrite, moving all processing to Unnest_Subprogram. * frontend.adb (Frontend): Add call to Exp_Ch6.Initialize. (Frontend): Add call to Unnest_Subprograms. * sem_ch8.adb (Find_Direct_Name): Back to old calling sequence for Check_Nested_Access. * sem_util.adb (Build_Default_Subtype): Minor reformatting (Check_Nested_Access): Back to original VM-only form (we now do all the processing for Unnest_Subprogram at the time it is called. (Denotes_Same_Object): Minor reformatting (Note_Possible_Modification): Old calling sequence for Check_Nested_Access. * sem_util.ads (Check_Nested_Access): Back to original VM-only form (we now do all the processing for Unnest_Subprogram at the time it is called. From-SVN: r223043
Diffstat (limited to 'gcc/ada/gnatcmd.adb')
-rw-r--r--gcc/ada/gnatcmd.adb43
1 files changed, 41 insertions, 2 deletions
diff --git a/gcc/ada/gnatcmd.adb b/gcc/ada/gnatcmd.adb
index 33c4be2..dcc3a85 100644
--- a/gcc/ada/gnatcmd.adb
+++ b/gcc/ada/gnatcmd.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2015, Free Software Foundation, Inc. --
-- --
-- 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- --
@@ -57,6 +57,12 @@ with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure GNATCmd is
+ Gprbuild : constant String := "gprbuild";
+ Gnatmake : constant String := "gnatmake";
+
+ Gprclean : constant String := "gprclean";
+ Gnatclean : constant String := "gnatclean";
+
Normal_Exit : exception;
-- Raise this exception for normal program termination
@@ -1166,7 +1172,6 @@ begin
begin
if The_Command = Stack then
-
-- Never call gnatstack with a prefix
Program := new String'(Command_List (The_Command).Unixcmd.all);
@@ -1174,6 +1179,40 @@ begin
else
Program :=
Program_Name (Command_List (The_Command).Unixcmd.all, "gnat");
+
+ -- If we want to invoke gnatmake/gnatclean with -P, then check if
+ -- gprbuild/gprclean is available; if it is, use gprbuild/gprclean
+ -- instead of gnatmake/gnatclean.
+
+ if Program.all = Gnatmake or else Program.all = Gnatclean then
+ declare
+ Project_File_Used : Boolean := False;
+ Switch : String_Access;
+
+ begin
+ for J in 1 .. Last_Switches.Last loop
+ Switch := Last_Switches.Table (J);
+ if Switch'Length >= 2 and then
+ Switch (Switch'First .. Switch'First + 1) = "-P"
+ then
+ Project_File_Used := True;
+ exit;
+ end if;
+ end loop;
+
+ if Project_File_Used then
+ if Program.all = Gnatmake
+ and then Locate_Exec_On_Path (Gprbuild) /= null
+ then
+ Program := new String'(Gprbuild);
+ elsif Program.all = Gnatclean
+ and then Locate_Exec_On_Path (Gprclean) /= null
+ then
+ Program := new String'(Gprclean);
+ end if;
+ end if;
+ end;
+ end if;
end if;
-- For the tools where the GNAT driver processes the project files,