From patchwork Mon Dec 12 11:49:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 130728 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]) by ozlabs.org (Postfix) with SMTP id 591ED1007D1 for ; Mon, 12 Dec 2011 22:50:05 +1100 (EST) Received: (qmail 2604 invoked by alias); 12 Dec 2011 11:50:02 -0000 Received: (qmail 2566 invoked by uid 22791); 12 Dec 2011 11:50:01 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_PR X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Dec 2011 11:49:48 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 19C572BB297; Mon, 12 Dec 2011 06:49:48 -0500 (EST) 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 tIsoj+S-rG5p; Mon, 12 Dec 2011 06:49:48 -0500 (EST) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 058AB2BB294; Mon, 12 Dec 2011 06:49:48 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id E6E7F3FEE8; Mon, 12 Dec 2011 06:49:47 -0500 (EST) Date: Mon, 12 Dec 2011 06:49:47 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] Always get an existing declared object/exec directory Message-ID: <20111212114947.GA4409@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 If an object and/or exec directory exists and is declared in a project with no source, it was not taken into account. This patch correct this. Tested on x86_64-pc-linux-gnu, committed on trunk 2011-12-12 Vincent Celier * prj-nmsc.adb (Get_Directories): For a non extending project, always get a declared object and/or exec directory if it already exists, even when there are no sources, but do not create them. Index: prj-nmsc.adb =================================================================== --- prj-nmsc.adb (revision 182223) +++ prj-nmsc.adb (working copy) @@ -5284,8 +5284,24 @@ "Object_Dir cannot be empty", Object_Dir.Location, Project); - elsif not No_Sources then + elsif Setup_Projects and then + No_Sources and then + Project.Extends = No_Project + then + -- Do not create an object directory for a non extending project + -- with no sources. + Locate_Directory + (Project, + File_Name_Type (Object_Dir.Value), + Path => Project.Object_Directory, + Dir_Exists => Dir_Exists, + Data => Data, + Location => Object_Dir.Location, + Must_Exist => False, + Externally_Built => Project.Externally_Built); + + else -- We check that the specified object directory does exist. -- However, even when it doesn't exist, we set it to a default -- value. This is for the benefit of tools that recover from @@ -5355,8 +5371,23 @@ "Exec_Dir cannot be empty", Exec_Dir.Location, Project); - elsif not No_Sources then + elsif Setup_Projects and then + No_Sources and then + Project.Extends = No_Project + then + -- Do not create an exec directory for a non extending project + -- with no sources. + Locate_Directory + (Project, + File_Name_Type (Exec_Dir.Value), + Path => Project.Exec_Directory, + Dir_Exists => Dir_Exists, + Data => Data, + Location => Exec_Dir.Location, + Externally_Built => Project.Externally_Built); + + else -- We check that the specified exec directory does exist Locate_Directory