From patchwork Tue Jun 22 13:47:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 56497 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 CC373B6F07 for ; Tue, 22 Jun 2010 23:47:27 +1000 (EST) Received: (qmail 703 invoked by alias); 22 Jun 2010 13:47:22 -0000 Received: (qmail 672 invoked by uid 22791); 22 Jun 2010 13:47:19 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jun 2010 13:47:10 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id B1183CB0297; Tue, 22 Jun 2010 15:47:11 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rz14lQxRKxAR; Tue, 22 Jun 2010 15:47:11 +0200 (CEST) Received: from saumur.act-europe.fr (saumur.act-europe.fr [10.10.0.183]) by mel.act-europe.fr (Postfix) with ESMTP id 9DB4DCB026C; Tue, 22 Jun 2010 15:47:11 +0200 (CEST) Received: by saumur.act-europe.fr (Postfix, from userid 525) id 94826D9BB4; Tue, 22 Jun 2010 15:47:11 +0200 (CEST) Date: Tue, 22 Jun 2010 15:47:11 +0200 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Vincent Celier Subject: [Ada] New switch --unchecked-shared-lib-imports Message-ID: <20100622134711.GA18515@adacore.com> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.9i X-IsSubscribed: yes 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 A new switch --unchecked-shared-lib-imports is added to gnatmake and gnatclean. When this switch is specified on the command line, shared library projects are allowed to import static library projects. Tested on x86_64-pc-linux-gnu, committed on trunk 2010-06-22 Vincent Celier * clean.adb (Parse_Cmd_Line): Recognize switch --unchecked-shared-lib-imports. (Usage): Add line for switch --unchecked-shared-lib-imports * makeusg.adb: Add line for switch --unchecked-shared-lib-imports * makeutl.ads: (Unchecked_Shared_Lib_Imports): New constant string moved from GPR_Util. * switch-m.adb (Scan_Make_Switches): Recognize switch --unchecked-shared-lib-imports. * vms_data.ads: Add VMS qualifiers /UNCHECKED_SHARED_LIB_IMPORTS. * gnat_ugn.texi: Add documentation for new switch --unchecked-shared-lib-imports. Add also documentation for --subdirs. Index: clean.adb =================================================================== --- clean.adb (revision 161073) +++ clean.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2003-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2003-2010, 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- -- @@ -1677,6 +1677,9 @@ package body Clean is new String' (Arg (Subdirs_Option'Length + 1 .. Arg'Last)); + elsif Arg = Makeutl.Unchecked_Shared_Lib_Imports then + Opt.Unchecked_Shared_Lib_Imports := True; + else Bad_Argument; end if; @@ -1957,6 +1960,8 @@ package body Clean is New_Line; Put_Line (" --subdirs=dir real obj/lib/exec dirs are subdirs"); + Put_Line (" " & Makeutl.Unchecked_Shared_Lib_Imports); + Put_Line (" Allow shared libraries to import static libraries"); New_Line; Put_Line (" -c Only delete compiler generated files"); Index: gnat_ugn.texi =================================================================== --- gnat_ugn.texi (revision 161158) +++ gnat_ugn.texi (working copy) @@ -9193,6 +9193,15 @@ itself must not include any embedded spa @end ifclear +@item ^--subdirs^/SUBDIRS^=subdir +Actual object directory of each project file is the subdirectory subdir of the +object directory specified or defauted in the project file. + +@item ^--unchecked-shared-lib-imports^/UNCHECKED_SHARED_LIB_IMPORTS^ +By default, shared library projects are not allowed to import static library +projects. When this switch is used on the command line, this restriction is +relaxed. + @item ^-a^/ALL_FILES^ @cindex @option{^-a^/ALL_FILES^} (@command{gnatmake}) Consider all files in the make process, even the GNAT internal system @@ -15329,6 +15338,15 @@ Display Copyright and version, then exit If @option{--version} was not used, display usage, then exit disregarding all other options. +@item ^--subdirs^/SUBDIRS^=subdir +Actual object directory of each project file is the subdirectory subdir of the +object directory specified or defauted in the project file. + +@item ^--unchecked-shared-lib-imports^/UNCHECKED_SHARED_LIB_IMPORTS^ +By default, shared library projects are not allowed to import static library +projects. When this switch is used on the command line, this restriction is +relaxed. + @item ^-c^/COMPILER_FILES_ONLY^ @cindex @option{^-c^/COMPILER_FILES_ONLY^} (@code{gnatclean}) Only attempt to delete the files produced by the compiler, not those produced Index: makeusg.adb =================================================================== --- makeusg.adb (revision 161073) +++ makeusg.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2008, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2010, 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- -- @@ -23,6 +23,7 @@ -- -- ------------------------------------------------------------------------------ +with Makeutl; with Osint; use Osint; with Output; use Output; with Usage; @@ -311,6 +312,14 @@ begin Write_Str (" --subdirs=dir real obj/lib/exec dirs are subdirs"); Write_Eol; + + -- Line for --unchecked-shared-lib-imports + + Write_Str (" "); + Write_Str (Makeutl.Unchecked_Shared_Lib_Imports); + Write_Eol; + Write_Str (" Allow shared libraries to import static libraries"); + Write_Eol; Write_Eol; -- General Compiler, Binder, Linker switches Index: makeutl.ads =================================================================== --- makeutl.ads (revision 161073) +++ makeutl.ads (working copy) @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2010, 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- -- @@ -47,6 +47,11 @@ package Makeutl is -- Switch used to indicate that the real directories (object, exec, -- library, ...) are subdirectories of those in the project file. + Unchecked_Shared_Lib_Imports : constant String := + "--unchecked-shared-lib-imports"; + -- Command line switch to allow shared library projects to import projects + -- that are not shared library projects. + procedure Add (Option : String_Access; To : in out String_List_Access; Index: switch-m.adb =================================================================== --- switch-m.adb (revision 161073) +++ switch-m.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2001-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2001-2010, 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- -- @@ -584,6 +584,9 @@ package body Switch.M is (Switch_Chars'First + Subdirs_Option'Length .. Switch_Chars'Last)); + elsif Switch_Chars = Makeutl.Unchecked_Shared_Lib_Imports then + Opt.Unchecked_Shared_Lib_Imports := True; + elsif Switch_Chars (Ptr) = '-' then Bad_Switch (Switch_Chars); Index: vms_data.ads =================================================================== --- vms_data.ads (revision 161153) +++ vms_data.ads (working copy) @@ -1154,6 +1154,14 @@ package VMS_Data is -- of the directory specified in the project file. If the subdirectory -- does not exist, it is created automatically. + S_Clean_Unc_Shared_Libs : aliased constant S := + "/UNCHECKED_SHARED_LIB_IMPORTS " & + "--unchecked-shared-lib-imports"; + -- /NOUNCHECKED_SHARED_LIB_IMPORTS (D) + -- /UNCHECKED_SHARED_LIB_IMPORTS + -- + -- Allow shared library projects to import static library projects + S_Clean_Verbose : aliased constant S := "/VERBOSE " & "-v"; -- /NOVERBOSE (D) @@ -1179,7 +1187,8 @@ package VMS_Data is S_Clean_Recurs 'Access, S_Clean_Search 'Access, S_Clean_Subdirs'Access, - S_Clean_Verbose'Access); + S_Clean_Verbose'Access, + S_Clean_Unc_Shared_Libs'Access); ------------------------------- -- Switches for GNAT COMPILE -- @@ -4860,6 +4869,14 @@ package VMS_Data is -- For example, -O -O2 is different than -O2 -O, but -g -O is equivalent -- to -O -g. + S_Make_Unc_Shared_Libs : aliased constant S := + "/UNCHECKED_SHARED_LIB_IMPORTS " & + "--unchecked-shared-lib-imports"; + -- /NOUNCHECKED_SHARED_LIB_IMPORTS (D) + -- /UNCHECKED_SHARED_LIB_IMPORTS + -- + -- Allow shared library projects to import static library projects + S_Make_Unique : aliased constant S := "/UNIQUE " & "-u"; -- /NOUNIQUE (D) @@ -4937,6 +4954,7 @@ package VMS_Data is S_Make_Stand 'Access, S_Make_Subdirs 'Access, S_Make_Switch 'Access, + S_Make_Unc_Shared_Libs'Access, S_Make_Unique 'Access, S_Make_Use_Map 'Access, S_Make_Verbose 'Access);