diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-20 10:40:48 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-20 10:40:48 +0000 |
commit | 527674cb82c1df36e2c9d9b0058ab924be9d8652 (patch) | |
tree | d453a67df3e66d1b84843f68fa59727adf489147 /gcc/ada/make.adb | |
parent | 982fceeceb789e138dd6af1c6bb6842b346d9282 (diff) | |
download | gcc-527674cb82c1df36e2c9d9b0058ab924be9d8652.tar.gz |
2016-04-20 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
ls" includes the switch -V.
* clean.adb: "<target>-gnatclean -P" now calls "gprclean
--target=<target>"
* make.adb: "<target>-gnatmake -P" now calls "gprbuild
--target=<target>"
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch12.adb (Qualify_Type): Do not perform
partial qualification when the immediate scope is a generic unit.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/make.adb')
-rw-r--r-- | gcc/ada/make.adb | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index a072513a288..a2c4c9e278f 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -6413,16 +6413,29 @@ 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. + -- First, check for switch -P and, if found and gprbuild is available, + -- silently invoke gprbuild, with switch --target if not on a native + -- platform. - Find_Program_Name; + declare + Arg_Len : Positive := Argument_Count; + Call_Gprbuild : Boolean := False; + Gprbuild : String_Access := null; + Pos : Natural := 0; + Success : Boolean; + Target : String_Access := null; - if Name_Buffer (1 .. Name_Len) = "gnatmake" then - declare - Call_Gprbuild : Boolean := False; + begin + Find_Program_Name; + + if Name_Len >= 8 + and then Name_Buffer (Name_Len - 7 .. Name_Len) = "gnatmake" + then + if Name_Len > 8 then + Target := new String'(Name_Buffer (1 .. Name_Len - 9)); + Arg_Len := Arg_Len + 1; + end if; - begin for J in 1 .. Argument_Count loop declare Arg : constant String := Argument (J); @@ -6437,16 +6450,20 @@ package body Make is 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; + Gprbuild := Locate_Exec_On_Path (Exec_Name => "gprbuild"); + + if Gprbuild /= null then + declare + Args : Argument_List (1 .. Arg_Len); + begin + if Target /= null then + Args (1) := new String'("--target=" & Target.all); + Pos := 1; + end if; - begin - if Gprbuild /= null then for J in 1 .. Argument_Count loop - Args (J) := new String'(Argument (J)); + Pos := Pos + 1; + Args (Pos) := new String'(Argument (J)); end loop; Spawn (Gprbuild.all, Args, Success); @@ -6456,11 +6473,11 @@ package body Make is if Success then Exit_Program (E_Success); end if; - end if; - end; + end; + end if; end if; - end; - end if; + end if; + end; Scan_Args : for Next_Arg in 1 .. Argument_Count loop Scan_Make_Arg (Env, Argument (Next_Arg), And_Save => True); |