diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-20 12:40:48 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2016-04-20 12:40:48 +0200 |
commit | 0c61772a122cc888d0aafffbaa35d4c95cc7abcc (patch) | |
tree | d453a67df3e66d1b84843f68fa59727adf489147 /gcc/ada/make.adb | |
parent | 61d1b085b96c6f9aa6cc952e7161c4f0e41794c8 (diff) | |
download | gcc-0c61772a122cc888d0aafffbaa35d4c95cc7abcc.zip gcc-0c61772a122cc888d0aafffbaa35d4c95cc7abcc.tar.gz gcc-0c61772a122cc888d0aafffbaa35d4c95cc7abcc.tar.bz2 |
[multiple changes]
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.
From-SVN: r235260
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 a072513..a2c4c9e 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); |