===================================================================
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
+-- Copyright (C) 2001-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- --
@@ -229,17 +229,6 @@
new String'(Switch_Chars (Ptr + 4 .. Max));
end if;
- -- Check that this is the first time --RTS is specified
- -- or if it is not the first time, the same path has been
- -- specified.
-
- if RTS_Specified = null then
- RTS_Specified := Runtime_Dir;
-
- elsif RTS_Specified.all /= Runtime_Dir.all then
- Osint.Fail ("--RTS cannot be specified multiple times");
- end if;
-
-- Valid --RTS switch
Opt.No_Stdinc := True;
@@ -251,13 +240,23 @@
RTS_Lib_Path_Name :=
Get_RTS_Search_Dir (Runtime_Dir.all, Objects);
- if RTS_Src_Path_Name /= null
+ if RTS_Specified /= null then
+ if RTS_Src_Path_Name = null
+ or else RTS_Lib_Path_Name = null
+ or else RTS_Specified.all /= RTS_Lib_Path_Name.all
+ then
+ Osint.Fail
+ ("--RTS cannot be specified multiple times");
+ end if;
+
+ elsif 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).
Store_Compilation_Switch (Switch_Chars);
+ RTS_Specified := new String'(RTS_Lib_Path_Name.all);
elsif RTS_Src_Path_Name = null
and then RTS_Lib_Path_Name = null