From patchwork Wed Apr 24 14:33:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 239214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 226DD2C00DA for ; Thu, 25 Apr 2013 00:33:39 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=N/wzT0aALHI+lvu9ngy7lFPA2nIq0zX1wcy3fq+1EuRpHBP0Hn HDqW2fIceJglRikfJIDvDJo4gMo2BbEt6nlUz1AfJ5zgCXOtnbtsmNW9VrJ1oE3Q GgrL2klQWMTDdSrwkBaF96RFl7iAAKEjXPt2tOPbH4HnR8X9DgPLA3rSc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=SBTNa+s7rq27eucp7BRRUqWm0hw=; b=O+eeey6hd49t5KpucqzN sRWssDuce0khzdsq3ia/AIqnDWLCYIFKKsH9A+MVe/fApK37MnI4aaQ5NhtNfGjE kixk3SpBqV8jfc/HcOtrQFKZ4ra2WRz347pvH8d/xrPs3ygkgDnMEyveLuw7Dk8R 2QvMKASaHczArC4v0MytHhU= Received: (qmail 11663 invoked by alias); 24 Apr 2013 14:33:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11654 invoked by uid 89); 24 Apr 2013 14:33:33 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO, TW_RG, WEIRD_QUOTING autolearn=ham version=3.3.1 Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 24 Apr 2013 14:33:32 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F13552ED0C; Wed, 24 Apr 2013 10:33:30 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hpvW1hxahERp; Wed, 24 Apr 2013 10:33:30 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id CF5AA2EB8D; Wed, 24 Apr 2013 10:33:30 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id C4B123FF09; Wed, 24 Apr 2013 10:33:30 -0400 (EDT) Date: Wed, 24 Apr 2013 10:33:30 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] New gnatls switch -aPdir Message-ID: <20130424143330.GA21253@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No A new switch -aPdir is added to gnatls. When gnatls is called with one or several switches -aPdir and also switch -v, the directories specified in the -aP switches are displayed immediately after the current directory in the Project Search Path. A new warning is issued by gnatls for switches that are not recognized by gnatls. The GNAT driver when called as "gnat ls/list -aPdir ..." will also used the switch -aPdir in its invocation of gnatls. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-24 Vincent Celier * gnat_ugn.texi: Document new gnatls switch -aPdir. * gnatcmd.adb: Pass switch -aP to gnatls. * gnatls.adb (Scan_Ls_Arg): Process new switch -aP. Issue a warning for unknown switches. (Usage): Add line for new switch -aPdir. Index: gnatcmd.adb =================================================================== --- gnatcmd.adb (revision 198226) +++ gnatcmd.adb (working copy) @@ -1766,8 +1766,17 @@ (Root_Environment.Project_Path, Argv (Argv'First + 3 .. Argv'Last)); - Remove_Switch (Arg_Num); + -- Pass -aPdir to gnatls + if The_Command = List then + Arg_Num := Arg_Num + 1; + + -- but not to other tools + + else + Remove_Switch (Arg_Num); + end if; + -- -eL Follow links for files elsif Argv.all = "-eL" then Index: gnat_ugn.texi =================================================================== --- gnat_ugn.texi (revision 198236) +++ gnat_ugn.texi (working copy) @@ -16393,6 +16393,10 @@ Source path manipulation. Same meaning as the equivalent @command{gnatmake} flags (@pxref{Switches for gnatmake}). +@item ^-aP^/ADD_PROJECT_SEARCH_DIR=^@var{dir} +@cindex @option{^-aP^/ADD_PROJECT_SEARCH_DIR=^} (@code{gnatls}) +Add @var{dir} at the beginning of the project search dir. + @item --RTS=@var{rts-path} @cindex @option{--RTS} (@code{gnatls}) Specifies the default location of the runtime library. Same meaning as the Index: gnatls.adb =================================================================== --- gnatls.adb (revision 198221) +++ gnatls.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2013, 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- -- @@ -1253,6 +1253,8 @@ FD : File_Descriptor; Len : Integer; + OK : Boolean; + begin pragma Assert (Argv'First = 1); @@ -1260,6 +1262,7 @@ return; end if; + OK := True; if Argv (1) = '-' then if Argv'Length = 1 then Fail ("switch character cannot be followed by a blank"); @@ -1297,6 +1300,11 @@ elsif Argv'Length >= 3 and then Argv (2 .. 3) = "aL" then Add_Lib_Dir (Argv (4 .. Argv'Last)); + -- Processing for -aP + + elsif Argv'Length > 3 and then Argv (1 .. 3) = "-aP" then + Add_Directories (Prj_Path, Argv (4 .. Argv'Last)); + -- Processing for -nostdinc elsif Argv (2 .. Argv'Last) = "nostdinc" then @@ -1316,7 +1324,7 @@ when 'l' => License := True; when 'V' => Very_Verbose_Mode := True; - when others => null; + when others => OK := False; end case; -- Processing for -files=file @@ -1396,6 +1404,9 @@ Opt.No_Stdinc := True; Opt.RTS_Switch := True; end if; + + else + OK := False; end if; -- If not a switch, it must be a file name @@ -1403,6 +1414,13 @@ else Add_File (Argv); end if; + + if not OK then + Write_Str ("warning: unknown switch """); + Write_Str (Argv); + Write_Line (""""); + end if; + end Scan_Ls_Arg; ----------- @@ -1484,6 +1502,11 @@ Write_Str (" -aOdir specify object files search path"); Write_Eol; + -- Line for -aP switch + + Write_Str (" -aPdir specify project search path"); + Write_Eol; + -- Line for -I switch Write_Str (" -Idir like -aIdir -aOdir");