X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fada%2Fgnatfind.adb;h=c59ae499106e7f3c14e2d96eeff3d570d0de7577;hb=e86087cf20ba6b25f3147c3c3ad21c794a68936f;hp=541ad4bf766dfe73f57703e65adb84f89b58207b;hpb=f15731c43ae5e8cea424ea40f905c19afa1bd2e4;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/ada/gnatfind.adb b/gcc/ada/gnatfind.adb index 541ad4bf766..c59ae499106 100644 --- a/gcc/ada/gnatfind.adb +++ b/gcc/ada/gnatfind.adb @@ -6,9 +6,7 @@ -- -- -- B o d y -- -- -- --- $Revision$ --- -- --- Copyright (C) 1998-2002 Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2004 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- -- @@ -21,14 +19,15 @@ -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- --- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). -- +-- 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; -with Xref_Lib; use Xref_Lib; -with Osint; use Osint; -with Types; use Types; +with Xr_Tabls; use Xr_Tabls; +with Xref_Lib; use Xref_Lib; +with Osint; use Osint; +with Types; use Types; with Gnatvsn; with Opt; @@ -36,13 +35,12 @@ 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; --------------- -- Gnatfind -- --------------- procedure Gnatfind is - Output_Ref : Boolean := False; Pattern : Xref_Lib.Search_Pattern; Local_Symbols : Boolean := True; @@ -62,6 +60,9 @@ procedure Gnatfind is Has_File_In_Entity : Boolean := False; -- Will be true if a file name was specified in the entity + RTS_Specified : String_Access := null; + -- Used to detect multiple use of --RTS= switch + procedure Parse_Cmd_Line; -- Parse every switch on the command line @@ -141,14 +142,23 @@ procedure Gnatfind is -- 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); @@ -229,7 +239,7 @@ procedure Gnatfind is procedure Write_Usage is begin Put_Line ("GNATFIND " & Gnatvsn.Gnat_Version_String - & " Copyright 1998-2002, Ada Core Technologies Inc."); + & " Copyright 1998-2004, Ada Core Technologies Inc."); Put_Line ("Usage: gnatfind pattern[:sourcefile[:line[:column]]] " & "[file1 file2 ...]"); New_Line;