summaryrefslogtreecommitdiff
path: root/gcc/ada/switch-c.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-29 13:48:13 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-29 13:48:13 +0000
commitb47d9d2fb810b5a5c95253f65195eb5a2cacd04b (patch)
tree95f9e15c4186644e62210590592f754ec3248b41 /gcc/ada/switch-c.adb
parent5d3736198c15f480152d427b9cddf68016dfc556 (diff)
downloadgcc-b47d9d2fb810b5a5c95253f65195eb5a2cacd04b.tar.gz
2014-07-29 Doug Rupp <rupp@adacore.com>
* sigtramp-armvxw.c: Enhance to handle RTP trampolining. * init.c: Remove guard on sigtramp for ARM VxWorks RTP. 2014-07-29 Vincent Celier <celier@adacore.com> * switch-c.adb (Scan_Front_End_Switches): Do not fail when two runtime directorie specified with two switches --RTS= designate the same directory, even when there are no literarily the same. 2014-07-29 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Minor documentation clarification. * switch-c.adb: Minor reformatting. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213187 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch-c.adb')
-rw-r--r--gcc/ada/switch-c.adb91
1 files changed, 54 insertions, 37 deletions
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index 04a6fa188f3..76b4c5d8001 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -38,6 +38,7 @@ with Warnsw; use Warnsw;
with Ada.Unchecked_Deallocation;
with System.WCh_Con; use System.WCh_Con;
+with System.OS_Lib;
package body Switch.C is
@@ -207,54 +208,70 @@ package body Switch.C is
or else Switch_Chars (Ptr + 3) /= '='
then
Osint.Fail ("missing path for --RTS");
+
else
- -- Check that this is the first time --RTS is specified or if
- -- it is not the first time, the same path has been specified.
+ declare
+ Runtime_Dir : String_Access;
- if RTS_Specified = null then
- RTS_Specified := new String'(Switch_Chars (Ptr + 4 .. Max));
+ begin
+ if System.OS_Lib.Is_Absolute_Path
+ (Switch_Chars (Ptr + 4 .. Max))
+ then
+ Runtime_Dir :=
+ new String'
+ (System.OS_Lib.Normalize_Pathname
+ (Switch_Chars (Ptr + 4 .. Max)));
- elsif
- RTS_Specified.all /= Switch_Chars (Ptr + 4 .. Max)
- then
- Osint.Fail ("--RTS cannot be specified multiple times");
- end if;
+ else
+ Runtime_Dir :=
+ new String'(Switch_Chars (Ptr + 4 .. Max));
+ end if;
- -- Valid --RTS switch
+ -- Check that this is the first time --RTS is specified
+ -- or if it is not the first time, the same path has been
+ -- specified.
- Opt.No_Stdinc := True;
- Opt.RTS_Switch := True;
+ if RTS_Specified = null then
+ RTS_Specified := Runtime_Dir;
- RTS_Src_Path_Name :=
- Get_RTS_Search_Dir
- (Switch_Chars (Ptr + 4 .. Max), Include);
+ elsif RTS_Specified.all /= Runtime_Dir.all then
+ Osint.Fail ("--RTS cannot be specified multiple times");
+ end if;
- RTS_Lib_Path_Name :=
- Get_RTS_Search_Dir
- (Switch_Chars (Ptr + 4 .. Max), Objects);
+ -- Valid --RTS switch
- if RTS_Src_Path_Name /= null
- and then RTS_Lib_Path_Name /= null
- then
- -- Store the -fRTS switch (Note: Store_Compilation_Switch
- -- changes -fRTS back into --RTS for the actual output).
+ Opt.No_Stdinc := True;
+ Opt.RTS_Switch := True;
- Store_Compilation_Switch (Switch_Chars);
+ RTS_Src_Path_Name :=
+ Get_RTS_Search_Dir (Runtime_Dir.all, Include);
- elsif RTS_Src_Path_Name = null
- and then RTS_Lib_Path_Name = null
- then
- Osint.Fail ("RTS path not valid: missing " &
- "adainclude and adalib directories");
+ RTS_Lib_Path_Name :=
+ Get_RTS_Search_Dir (Runtime_Dir.all, Objects);
- elsif RTS_Src_Path_Name = null then
- Osint.Fail ("RTS path not valid: missing " &
- "adainclude directory");
+ if RTS_Src_Path_Name /= null
+ and then RTS_Lib_Path_Name /= null
+ then
+ -- Store the -fRTS switch (Note: Store_Compilation_Switch
+ -- changes -fRTS back into --RTS for the actual output).
- elsif RTS_Lib_Path_Name = null then
- Osint.Fail ("RTS path not valid: missing " &
- "adalib directory");
- end if;
+ Store_Compilation_Switch (Switch_Chars);
+
+ elsif RTS_Src_Path_Name = null
+ and then RTS_Lib_Path_Name = null
+ then
+ Osint.Fail ("RTS path not valid: missing "
+ & "adainclude and adalib directories");
+
+ elsif RTS_Src_Path_Name = null then
+ Osint.Fail ("RTS path not valid: missing "
+ & "adainclude directory");
+
+ elsif RTS_Lib_Path_Name = null then
+ Osint.Fail ("RTS path not valid: missing "
+ & "adalib directory");
+ end if;
+ end;
end if;
-- There are no other switches not starting with -gnat
@@ -363,7 +380,7 @@ package body Switch.C is
if C = 'b'
and then (Ptr /= First_Ptr + 1
- or else not First_Switch)
+ or else not First_Switch)
then
Osint.Fail
("-gnatd.b must be first if combined "