summaryrefslogtreecommitdiffstats
path: root/gcc/ada/switch.ads
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-31 10:19:18 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2007-08-31 10:19:18 +0000
commita723873ac68caf7f6355582fd214698aff9173d0 (patch)
treec8c87d18a9109794633d5e936943a3f76d7e949f /gcc/ada/switch.ads
parent0fc62fac18791458a32a16fc74766c775ddd6a34 (diff)
downloadppe42-gcc-a723873ac68caf7f6355582fd214698aff9173d0.tar.gz
ppe42-gcc-a723873ac68caf7f6355582fd214698aff9173d0.zip
2007-08-30 Vincent Celier <celier@adacore.com>
PR ada/4720 * gnatchop.adb, gnatfind.adb, gnatlink.adb, gnatls.adb, gnatname.adb, gnatxref.adb, gprep.adb, clean.adb gnatbind.adb (Check_Version_And_Help): New procedure in package Switch to process switches --version and --help. Use Check_Version_And_Help in GNAT tools * make.adb: Ditto. (Compile_Sources): Make sure that sources that are "excluded" are not compiled. (Gnatmake): Do not issue -aO. to gnatbind and only issue -I- if a project file is used. (Version_Switch): Remove, moved to Switch (Help_Switch): Remove, moved to Switch (Display_Version): Remove, moved to Switch * switch.ads, switch.adb (Check_Version_And_Help): New procedure in package Switch to process switches --version and --help. (Display_Version): New procedure * gnatvsn.ads, gnatvsn.adb (Copyright_Holder): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127967 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/switch.ads')
-rw-r--r--gcc/ada/switch.ads33
1 files changed, 23 insertions, 10 deletions
diff --git a/gcc/ada/switch.ads b/gcc/ada/switch.ads
index dce2f12d8f8..470ea93c48e 100644
--- a/gcc/ada/switch.ads
+++ b/gcc/ada/switch.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2007, 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- --
@@ -31,30 +31,43 @@
-- switches that are recognized. In addition, package Debug documents
-- the otherwise undocumented debug switches that are also recognized.
+with Gnatvsn;
with Types; use Types;
package Switch is
- -- Note: The default switch character is indicated by Switch_Character,
- -- but regardless of what it is, a hyphen is always allowed as an
- -- (alternative) switch character.
+ -- Common switches for GNU tools
- -- Note: In GNAT, the case of switches is not significant if
- -- Switches_Case_Sensitive is False. If this is the case, switch
- -- characters, or letters appearing in the parameter to a switch, may be
- -- either upper case or lower case.
+ Version_Switch : constant String := "--version";
+ Help_Switch : constant String := "--help";
-----------------
-- Subprograms --
-----------------
+ type Procedure_Ptr is access procedure;
+
+ procedure Check_Version_And_Help
+ (Tool_Name : String;
+ Initial_Year : String;
+ Usage : Procedure_Ptr;
+ Version_String : String := Gnatvsn.Gnat_Version_String);
+ -- Check if switches --version or --help is used. If one of this switch
+ -- is used, issue the proper messages and end the process.
+
+ procedure Display_Version
+ (Tool_Name : String;
+ Initial_Year : String;
+ Version_String : String := Gnatvsn.Gnat_Version_String);
+ -- Display version of a tool when switch --version is used
+
function Is_Switch (Switch_Chars : String) return Boolean;
-- Returns True iff Switch_Chars is at least two characters long,
- -- and the first character indicates it is a switch.
+ -- and the first character is an hyphen ('-').
function Is_Front_End_Switch (Switch_Chars : String) return Boolean;
-- Returns True iff Switch_Chars represents a front-end switch,
- -- ie. it starts with -I or -gnat.
+ -- ie. it starts with -I, -gnat or -?RTS.
private
OpenPOWER on IntegriCloud