aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/make.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 14:45:14 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-05-22 14:45:14 +0200
commitccd6f4147ce06511cbcc8df80bdcea21d8afe639 (patch)
treeb16b5d2a728ab8a0162f8e588476afbd69f54938 /gcc/ada/make.adb
parent167b47d9da9a82c0c8f426f1853a961f10322be0 (diff)
downloadgcc-ccd6f4147ce06511cbcc8df80bdcea21d8afe639.zip
gcc-ccd6f4147ce06511cbcc8df80bdcea21d8afe639.tar.gz
gcc-ccd6f4147ce06511cbcc8df80bdcea21d8afe639.tar.bz2
[multiple changes]
2015-05-22 Robert Dewar <dewar@adacore.com> * sem_ch12.adb, prj.ads, makeutl.ads, sem_ch6.adb, prj-nmsc.adb, prj-conf.adb, sem_disp.adb: Minor reformatting. 2015-05-22 Vincent Celier <celier@adacore.com> * clean.adb (Parse_Cmd_Line): For native gnatclean, check for switch -P and, if found and gprclean is available, invoke silently gprclean. * make.adb (Initialize): For native gnatmake, check for switch -P and, if found and gprbuild is available, invoke silently gprbuild. 2015-05-22 Eric Botcazou <ebotcazou@adacore.com> * sem_ch13.adb (Validate_Unchecked_Conversions): Also issue specific warning for discrete types when the source is larger than the target. From-SVN: r223555
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r--gcc/ada/make.adb51
1 files changed, 50 insertions, 1 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 8fc4763..d3324e7 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-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- --
@@ -6442,6 +6442,55 @@ package body Make is
-- Scan again the switch and arguments, now that we are sure that they
-- do not include --version or --help.
+ -- First, for native gnatmake, check for switch -P and, if found and
+ -- gprbuild is available, silently invoke gprbuild.
+
+ Find_Program_Name;
+
+ if Name_Buffer (1 .. Name_Len) = "gnatmake" then
+ declare
+ Call_Gprbuild : Boolean := False;
+
+ begin
+ for J in 1 .. Argument_Count loop
+ declare
+ Arg : constant String := Argument (J);
+ begin
+ if Arg'Length >= 2
+ and then Arg (Arg'First .. Arg'First + 1) = "-P"
+ then
+ Call_Gprbuild := True;
+ exit;
+ end if;
+ end;
+ end loop;
+
+ if Call_Gprbuild then
+ declare
+ Gprbuild : String_Access :=
+ Locate_Exec_On_Path (Exec_Name => "gprbuild");
+ Args : Argument_List (1 .. Argument_Count);
+ Success : Boolean;
+
+ begin
+ if Gprbuild /= null then
+ for J in 1 .. Argument_Count loop
+ Args (J) := new String'(Argument (J));
+ end loop;
+
+ Spawn (Gprbuild.all, Args, Success);
+
+ Free (Gprbuild);
+
+ if Success then
+ Exit_Program (E_Success);
+ end if;
+ end if;
+ end;
+ end if;
+ end;
+ end if;
+
Scan_Args : for Next_Arg in 1 .. Argument_Count loop
Scan_Make_Arg (Env, Argument (Next_Arg), And_Save => True);
end loop Scan_Args;