Commit 1086c39b by Vincent Celier Committed by Arnaud Charlet

make.adb (Collect_Arguments): Call Test_If_Relative_Path with Including_Non_Switch set to False.

2007-08-16  Vincent Celier  <celier@adacore.com>

	* make.adb (Collect_Arguments): Call Test_If_Relative_Path with
	Including_Non_Switch set to False.
	(Gnatmake): For the compiler, call Test_If_Relative_Path with
	Including_Non_Switch set to False.

	* makeutl.adb, makeutl.ads (Test_If_Relative_Path): New Boolean
	parameter Including_Non_Switch, defaulted to True. When
	Including_Non_Switch is False, options that are not switches and
	appear as relative path are not converted to absolute paths.

From-SVN: r127542
parent c17fc6f6
...@@ -2372,7 +2372,8 @@ package body Make is ...@@ -2372,7 +2372,8 @@ package body Make is
new String'(Name_Buffer (1 .. Name_Len)); new String'(Name_Buffer (1 .. Name_Len));
Test_If_Relative_Path Test_If_Relative_Path
(New_Args (Last_New), (New_Args (Last_New),
Parent => Data.Dir_Path); Parent => Data.Dir_Path,
Including_Non_Switch => False);
end if; end if;
Current := Element.Next; Current := Element.Next;
...@@ -2399,7 +2400,9 @@ package body Make is ...@@ -2399,7 +2400,9 @@ package body Make is
begin begin
Test_If_Relative_Path Test_If_Relative_Path
(New_Args (1), Parent => Data.Dir_Path); (New_Args (1),
Parent => Data.Dir_Path,
Including_Non_Switch => False);
Add_Arguments Add_Arguments
(Configuration_Pragmas_Switch (Arguments_Project) & (Configuration_Pragmas_Switch (Arguments_Project) &
New_Args & The_Saved_Gcc_Switches.all); New_Args & The_Saved_Gcc_Switches.all);
...@@ -5315,12 +5318,16 @@ package body Make is ...@@ -5315,12 +5318,16 @@ package body Make is
for J in 1 .. Gcc_Switches.Last loop for J in 1 .. Gcc_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
(Gcc_Switches.Table (J), Parent => Dir_Path); (Gcc_Switches.Table (J),
Parent => Dir_Path,
Including_Non_Switch => False);
end loop; end loop;
for J in 1 .. Saved_Gcc_Switches.Last loop for J in 1 .. Saved_Gcc_Switches.Last loop
Test_If_Relative_Path Test_If_Relative_Path
(Saved_Gcc_Switches.Table (J), Parent => Current_Work_Dir); (Saved_Gcc_Switches.Table (J),
Parent => Current_Work_Dir,
Including_Non_Switch => False);
end loop; end loop;
end; end;
end if; end if;
......
...@@ -553,7 +553,8 @@ package body Makeutl is ...@@ -553,7 +553,8 @@ package body Makeutl is
procedure Test_If_Relative_Path procedure Test_If_Relative_Path
(Switch : in out String_Access; (Switch : in out String_Access;
Parent : String_Access; Parent : String_Access;
Including_L_Switch : Boolean := True) Including_L_Switch : Boolean := True;
Including_Non_Switch : Boolean := True)
is is
begin begin
if Switch /= null then if Switch /= null then
...@@ -608,7 +609,7 @@ package body Makeutl is ...@@ -608,7 +609,7 @@ package body Makeutl is
end if; end if;
end if; end if;
else elsif Including_Non_Switch then
if not Is_Absolute_Path (Sw) then if not Is_Absolute_Path (Sw) then
if Parent = null or else Parent'Length = 0 then if Parent = null or else Parent'Length = 0 then
Do_Fail Do_Fail
......
...@@ -126,7 +126,8 @@ package Makeutl is ...@@ -126,7 +126,8 @@ package Makeutl is
procedure Test_If_Relative_Path procedure Test_If_Relative_Path
(Switch : in out String_Access; (Switch : in out String_Access;
Parent : String_Access; Parent : String_Access;
Including_L_Switch : Boolean := True); Including_L_Switch : Boolean := True;
Including_Non_Switch : Boolean := True);
-- Test if Switch is a relative search path switch. -- Test if Switch is a relative search path switch.
-- If it is, fail if Parent is null, otherwise prepend the path with -- If it is, fail if Parent is null, otherwise prepend the path with
-- Parent. This subprogram is only called when using project files. -- Parent. This subprogram is only called when using project files.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment