diff options
Diffstat (limited to 'gcc/ada/gnatxref.adb')
-rw-r--r-- | gcc/ada/gnatxref.adb | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb index 3f688738fcb..7e429585b93 100644 --- a/gcc/ada/gnatxref.adb +++ b/gcc/ada/gnatxref.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2003 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- -- @@ -19,6 +19,9 @@ -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- +-- GNAT was originally developed by the GNAT team at New York University. -- +-- Extensive contributions were provided by Ada Core Technologies Inc. -- +-- -- ------------------------------------------------------------------------------ with Xr_Tabls; use Xr_Tabls; @@ -32,6 +35,7 @@ with Opt; with Ada.Strings.Fixed; use Ada.Strings.Fixed; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Command_Line; use GNAT.Command_Line; +with GNAT.Strings; use GNAT.Strings; procedure Gnatxref is @@ -46,6 +50,9 @@ procedure Gnatxref is Have_File : Boolean := False; Der_Info : Boolean := False; + RTS_Specified : String_Access := null; + -- Used to detect multiple use of --RTS= switch + procedure Parse_Cmd_Line; -- Parse every switch on the command line @@ -120,15 +127,24 @@ procedure Gnatxref is -- The only switch starting with -- recognized is --RTS when '-' => + -- Check that it is the first time we see this switch + + if RTS_Specified = null then + RTS_Specified := new String'(GNAT.Command_Line.Parameter); + + elsif RTS_Specified.all /= GNAT.Command_Line.Parameter then + Osint.Fail ("--RTS cannot be specified multiple times"); + end if; + Opt.No_Stdinc := True; Opt.RTS_Switch := True; declare - Src_Path_Name : String_Ptr := + Src_Path_Name : constant String_Ptr := Get_RTS_Search_Dir (GNAT.Command_Line.Parameter, Include); - Lib_Path_Name : String_Ptr := + Lib_Path_Name : constant String_Ptr := Get_RTS_Search_Dir (GNAT.Command_Line.Parameter, Objects); @@ -197,7 +213,7 @@ procedure Gnatxref is begin Put_Line ("GNATXREF " & Gnatvsn.Gnat_Version_String - & " Copyright 1998-2002, Ada Core Technologies Inc."); + & " Copyright 1998-2003, Ada Core Technologies Inc."); Put_Line ("Usage: gnatxref [switches] file1 file2 ..."); New_Line; Put_Line (" file ... list of source files to xref, " & |