From patchwork Wed Apr 24 13:13:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 239204 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 38AC32C00ED for ; Wed, 24 Apr 2013 23:13:54 +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=F8boUfyZngUXE1LgoGsSzx6QtNInvGCBWMoUzhprNuT7zMz8fU B2xHQJhfT4GtIllix7dKZ3O/WPUY8LvCOiK3la0IvAr6JlphR8i1A69GffSMqfym P/E1ef1JHULWd7v/MC5WL7e5vLKiNxlIVHg9jcckGmOSA95KWr4W3CxGc= 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=4wMLhgBKgUmMmuRQa5uHwaBGXXA=; b=nDyX6SyRJLzrFOZYW1ny CudEcU/mBEvLbvJqaHhRPp6LPKT+NadDSJCf+kQbSu/nzdA/lztlEyFBK5KVmUvp OdlahJD2Spr5y8tJVKh5W0uDD0i8K/EXYI1+Kwgp50MO84Lca4F/5ruVN6NSHifT ++SbQBjJPZZa7XLMQhytTRg= Received: (qmail 17717 invoked by alias); 24 Apr 2013 13:13:40 -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 17671 invoked by uid 89); 24 Apr 2013 13:13:40 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO 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 13:13:39 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9CF892ED02; Wed, 24 Apr 2013 09:13:37 -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 VP79eUPPxDz4; Wed, 24 Apr 2013 09:13:37 -0400 (EDT) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 758722E7A6; Wed, 24 Apr 2013 09:13:37 -0400 (EDT) Received: by kwai.gnat.com (Postfix, from userid 4192) id 7447A3FF09; Wed, 24 Apr 2013 09:13:37 -0400 (EDT) Date: Wed, 24 Apr 2013 09:13:37 -0400 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] Correct project search path when using switch -aP Message-ID: <20130424131337.GA14973@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Found: No gnatmake, gnatclean and the GNAT driver were incorrectly putting directories that are specified with switches -aP after the default project search directories in the project search path. This patch ensures that the default project search directories are always at the end of the project search path. Tested on x86_64-pc-linux-gnu, committed on trunk 2013-04-24 Vincent Celier * clean.adb (Gnatclean): Add the default project search directories in the project search path after scanning the switches on the command line. (Initialize): Do not put the default project search directories in the project search path. * gnatcmd.adb (GNATcmd): Add the default project search directories in the project search path after scanning the switches on the command line. * make.adb (Initialize): Add the default project search directories in the project search path after scanning the switches on the command line. Index: gnatcmd.adb =================================================================== --- gnatcmd.adb (revision 198221) +++ gnatcmd.adb (working copy) @@ -1395,9 +1395,6 @@ Snames.Initialize; Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags); - Prj.Env.Initialize_Default_Project_Path - (Root_Environment.Project_Path, - Target_Name => Sdefault.Target_Name.all); Project_Node_Tree := new Project_Node_Tree_Data; Prj.Tree.Initialize (Project_Node_Tree); @@ -1911,6 +1908,13 @@ end Inspect_Switches; end if; + -- Add the default project search directories now, after the directories + -- that have been specified by switches -aP. + + Prj.Env.Initialize_Default_Project_Path + (Root_Environment.Project_Path, + Target_Name => Sdefault.Target_Name.all); + -- If there is a project file specified, parse it, get the switches -- for the tool and setup PATH environment variables. Index: make.adb =================================================================== --- make.adb (revision 198221) +++ make.adb (working copy) @@ -6392,8 +6392,6 @@ -- the command line switches Prj.Tree.Initialize (Env, Gnatmake_Flags); - Prj.Env.Initialize_Default_Project_Path - (Env.Project_Path, Target_Name => Sdefault.Target_Name.all); Project_Node_Tree := new Project_Node_Tree_Data; Prj.Tree.Initialize (Project_Node_Tree); @@ -6492,6 +6490,12 @@ Usage; end if; + -- Add the default project search directories now, after the directories + -- that have been specified by switches -aP. + + Prj.Env.Initialize_Default_Project_Path + (Env.Project_Path, Target_Name => Sdefault.Target_Name.all); + -- Test for trailing -P switch if Project_File_Name_Present and then Project_File_Name = null then Index: clean.adb =================================================================== --- clean.adb (revision 198221) +++ clean.adb (working copy) @@ -1377,6 +1377,13 @@ Parse_Cmd_Line; + -- Add the default project search directories now, after the directories + -- that have been specified by switches -aP. + + Prj.Env.Initialize_Default_Project_Path + (Root_Environment.Project_Path, + Target_Name => Sdefault.Target_Name.all); + if Verbose_Mode then Display_Copyright; end if; @@ -1550,9 +1557,6 @@ Snames.Initialize; Prj.Tree.Initialize (Root_Environment, Gnatmake_Flags); - Prj.Env.Initialize_Default_Project_Path - (Root_Environment.Project_Path, - Target_Name => Sdefault.Target_Name.all); Project_Node_Tree := new Project_Node_Tree_Data; Prj.Tree.Initialize (Project_Node_Tree);