OSDN Git Service

2010-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / ada / bindusg.adb
index 31b0ba8..2529c35 100644 (file)
@@ -6,18 +6,17 @@
 --                                                                          --
 --                                B o d y                                   --
 --                                                                          --
---          Copyright (C) 1992-2005 Free Software Foundation, Inc.          --
+--          Copyright (C) 1992-2009, 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- --
--- ware  Foundation;  either version 2,  or (at your option) any later ver- --
+-- ware  Foundation;  either version 3,  or (at your option) any later ver- --
 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
 -- for  more details.  You should have  received  a copy of the GNU General --
--- Public License  distributed with GNAT;  see file COPYING.  If not, write --
--- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
--- MA 02111-1307, USA.                                                      --
+-- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
+-- http://www.gnu.org/licenses for a complete copy of the license.          --
 --                                                                          --
 -- GNAT was originally developed  by the GNAT team at  New York University. --
 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
 with Osint;  use Osint;
 with Output; use Output;
 
-procedure Bindusg is
+with System.WCh_Con; use System.WCh_Con;
 
---  Start of processing for Bindusg
+package body Bindusg is
 
-begin
-   --  Usage line
+   Already_Displayed : Boolean := False;
+   --  Set True if Display called, used to avoid showing usage information
+   --  more than once.
 
-   Write_Str ("Usage: ");
-   Write_Program_Name;
-   Write_Char (' ');
-   Write_Str ("switches lfile");
-   Write_Eol;
-   Write_Eol;
+   -------------
+   -- Display --
+   -------------
 
-   --  Line for -aO switch
+   procedure Display is
+   begin
+      if Already_Displayed then
+         return;
+      else
+         Already_Displayed := True;
+      end if;
 
-   Write_Str ("  -aOdir    Specify library files search path");
-   Write_Eol;
+      --  Usage line
 
-   --  Line for -aI switch
+      Write_Str ("Usage: ");
+      Write_Program_Name;
+      Write_Char (' ');
+      Write_Str ("switches lfile");
+      Write_Eol;
+      Write_Eol;
 
-   Write_Str ("  -aIdir    Specify source files search path");
-   Write_Eol;
+      --  Line for @response_file
 
-   --  Line for A switch
+      Write_Line ("  @<resp_file> Get arguments from response file");
+      Write_Eol;
 
-   Write_Str ("  -A        Generate binder program in Ada (default)");
-   Write_Eol;
+      --  Line for -aO switch
 
-   --  Line for -b switch
+      Write_Line ("  -aOdir    Specify library files search path");
 
-   Write_Str ("  -b        Generate brief messages to std");
-   Write_Str ("err even if verbose mode set");
-   Write_Eol;
+      --  Line for -aI switch
 
-   --  Line for -c switch
+      Write_Line ("  -aIdir    Specify source files search path");
 
-   Write_Str ("  -c        Check only, no generation of b");
-   Write_Str ("inder output file");
-   Write_Eol;
+      --  Line for a switch
 
-   --  Line for C switch
+      Write_Line ("  -a        Automatically initialize elaboration " &
+                  "procedure");
 
-   Write_Str ("  -C        Generate binder program in C");
-   Write_Eol;
+      --  Line for A switch
 
-   --  Line for D switch
+      Write_Line ("  -A        Generate binder program in Ada (default)");
 
-   Write_Str ("  -Dnnn     Default secondary stack size = nnn bytes");
-   Write_Eol;
+      --  Line for -b switch
 
-   --  Line for -e switch
+      Write_Line ("  -b        Generate brief messages to stderr " &
+                  "even if verbose mode set");
 
-   Write_Str ("  -e        Output complete list of elabor");
-   Write_Str ("ation order dependencies");
-   Write_Eol;
+      --  Line for -c switch
 
-   --  Line for -E switch
+      Write_Line ("  -c        Check only, no generation of " &
+                  "binder output file");
 
-   Write_Str ("  -E        Store tracebacks in Exception occurrences");
-   Write_Eol;
+      --  Line for C switch
 
-   --  The -f switch is voluntarily omitted, because it is obsolete
+      Write_Line ("  -C        Generate binder program in C");
 
-   --  Line for -F switch
+      --  Line for -d switch
 
-   Write_Str ("  -F        Force checking of elaboration Flags");
-   Write_Eol;
+      Write_Line ("  -dnn[k|m] Default primary stack " &
+                  "size = nn [kilo|mega] bytes");
 
-   --  Line for -h switch
+      --  Line for D switch
 
-   Write_Str ("  -h        Output this usage (help) infor");
-   Write_Str ("mation");
-   Write_Eol;
+      Write_Line ("  -Dnn[k|m] Default secondary stack " &
+                  "size = nn [kilo|mega] bytes");
 
-   --  Lines for -I switch
+      --  Line for -e switch
 
-   Write_Str ("  -Idir     Specify library and source files search path");
-   Write_Eol;
+      Write_Line ("  -e        Output complete list of elaboration " &
+                  "order dependencies");
 
-   Write_Str ("  -I-       Don't look for sources & library files");
-   Write_Str (" in default directory");
-   Write_Eol;
+      --  Line for -E switch
 
-   --  Line for -K switch
+      Write_Line ("  -E        Store tracebacks in exception occurrences");
 
-   Write_Str ("  -K        Give list of linker options specified for link");
-   Write_Eol;
+      --  The -f switch is voluntarily omitted, because it is obsolete
 
-   --  Line for -l switch
+      --  Line for -F switch
 
-   Write_Str ("  -l        Output chosen elaboration order");
-   Write_Eol;
+      Write_Line ("  -F        Force checking of elaboration Flags");
 
-   --  Line of -L switch
+      --  Line for -h switch
 
-   Write_Str ("  -Lxyz     Library build: adainit/final ");
-   Write_Str ("renamed to xyzinit/final, implies -n");
-   Write_Eol;
+      Write_Line ("  -h        Output this usage (help) information");
 
-   --  Line for -M switch
+      --  Lines for -I switch
 
-   Write_Str ("  -Mxyz     Rename generated main program from main to xyz");
-   Write_Eol;
+      Write_Line ("  -Idir     Specify library and source files search path");
+      Write_Line ("  -I-       Don't look for sources & library files " &
+                  "in default directory");
 
-   --  Line for -m switch
+      --  Line for -K switch
 
-   Write_Str ("  -mnnn     Limit number of detected error");
-   Write_Str ("s to nnn (1-999999)");
-   Write_Eol;
+      Write_Line ("  -K        Give list of linker options specified " &
+                  "for link");
 
-   --  Line for -n switch
+      --  Line for -l switch
 
-   Write_Str ("  -n        No Ada main program (foreign main routine)");
-   Write_Eol;
+      Write_Line ("  -l        Output chosen elaboration order");
 
-   --  Line for -nostdinc
+      --  Line of -L switch
 
-   Write_Str ("  -nostdinc Don't look for source files");
-   Write_Str (" in the system default directory");
-   Write_Eol;
+      Write_Line ("  -Lxyz     Library build: adainit/final " &
+                  "renamed to xyzinit/final, implies -n");
 
-   --  Line for -nostdlib
+      --  Line for -m switch
 
-   Write_Str ("  -nostdlib Don't look for library files");
-   Write_Str (" in the system default directory");
-   Write_Eol;
+      Write_Line ("  -mnnn     Limit number of detected errors/warnings " &
+                  "to nnn (1-999999)");
 
-   --  Line for -o switch
+      --  Line for -M switch
 
-   Write_Str ("  -o file   Give the output file name (default is b~xxx.adb) ");
-   Write_Eol;
+      Write_Line ("  -Mxyz     Rename generated main program from " &
+                  "main to xyz");
 
-   --  Line for -O switch
+      --  Line for -n switch
 
-   Write_Str ("  -O        Give list of objects required for link");
-   Write_Eol;
+      Write_Line ("  -n        No Ada main program (foreign main routine)");
 
-   --  Line for -p switch
+      --  Line for -nostdinc
 
-   Write_Str ("  -p        Pessimistic (worst-case) elaborat");
-   Write_Str ("ion order");
-   Write_Eol;
+      Write_Line ("  -nostdinc Don't look for source files " &
+                  "in the system default directory");
 
-   --  Line for -r switch
+      --  Line for -nostdlib
 
-   Write_Str ("  -r        List restrictions that could be a");
-   Write_Str ("pplied to this partition");
-   Write_Eol;
+      Write_Line ("  -nostdlib Don't look for library files " &
+                  "in the system default directory");
 
-   --  Line for -s switch
+      --  Line for -o switch
 
-   Write_Str ("  -s        Require all source files to be");
-   Write_Str (" present");
-   Write_Eol;
+      Write_Line ("  -o file   Give the output file name " &
+                  "(default is b~xxx.adb)");
 
-   --  Line for -Sxx switch
+      --  Line for -O switch
 
-   Write_Str ("  -S??      Sin/lo/hi/xx for Initialize_Scalars");
-   Write_Str (" invalid/low/high/hex");
-   Write_Eol;
+      Write_Line ("  -O        Give list of objects required for link");
 
-   --  Line for -static
+      --  Line for -p switch
 
-   Write_Str ("  -static   Link against a static GNAT run time");
-   Write_Eol;
+      Write_Line ("  -p        Pessimistic (worst-case) elaboration order");
 
-   --  Line for -shared
+      --  Line for -r switch
 
-   Write_Str ("  -shared   Link against a shared GNAT run time");
-   Write_Eol;
+      Write_Line ("  -r        List restrictions that could be applied " &
+                  "to this partition");
 
-   --  Line for -t switch
+      --  Line for -R switch
 
-   Write_Str ("  -t        Tolerate time stamp and other consistency errors");
-   Write_Eol;
+      Write_Line
+        ("  -R        List sources referenced in closure (implies -c)");
 
-   --  Line for -T switch
+      --  Line for -s switch
 
-   Write_Str ("  -Tn       Set time slice value to n milliseconds (n >= 0)");
-   Write_Eol;
+      Write_Line ("  -s        Require all source files to be present");
 
-   --  Line for -v switch
+      --  Line for -S?? switch
 
-   Write_Str ("  -v        Verbose mode. Error messages, ");
-   Write_Str ("header, summary output to stdout");
-   Write_Eol;
+      Write_Line ("  -S??      Sin/lo/hi/xx/ev Initialize_Scalars " &
+                  "invalid/low/high/hex/env var");
 
-   --  Lines for -w switch
+      --  Line for -static
 
-   Write_Str ("  -wx       Warning mode. (x=s/e for supp");
-   Write_Str ("ress/treat as error)");
-   Write_Eol;
+      Write_Line ("  -static   Link against a static GNAT run time");
 
-   --  Line for -x switch
+      --  Line for -shared
 
-   Write_Str ("  -x        Exclude source files (check ob");
-   Write_Str ("ject consistency only)");
-   Write_Eol;
+      Write_Line ("  -shared   Link against a shared GNAT run time");
 
-   --  Line for X switch
+      --  Line for -t switch
 
-   Write_Str ("  -Xnnn     Default exit status value = nnn");
-   Write_Eol;
+      Write_Line ("  -t        Tolerate time stamp and other " &
+                  "consistency errors");
 
-   --  Line for -z switch
+      --  Line for -T switch
 
-   Write_Str ("  -z        No main subprogram (zero main)");
-   Write_Eol;
+      Write_Line ("  -Tn       Set time slice value to n " &
+                  "milliseconds (n >= 0)");
 
-   --  Line for --RTS
+      --  Line for -u switch
 
-   Write_Str ("  --RTS=dir specify the default source and object search path");
-   Write_Eol;
+      Write_Line ("  -un       Enable dynamic stack analysis, with " &
+                  "n results stored");
 
-   --  Line for sfile
+      --  Line for -v switch
 
-   Write_Str ("  lfile     Library file names");
-   Write_Eol;
+      Write_Line ("  -v        Verbose mode. Error messages, " &
+                  "header, summary output to stdout");
+
+      --  Line for -w switch
+
+      Write_Line ("  -wx       Warning mode. (x=s/e for " &
+                  "suppress/treat as error)");
+
+      --  Line for -W switch
+
+      Write_Str  ("  -W?       Wide character encoding method (");
+
+      for J in WC_Encoding_Method loop
+         Write_Char (WC_Encoding_Letters (J));
+
+         if J = WC_Encoding_Method'Last then
+            Write_Char (')');
+         else
+            Write_Char ('/');
+         end if;
+      end loop;
+
+      Write_Eol;
+
+      --  Line for -x switch
+
+      Write_Line ("  -x        Exclude source files (check object " &
+                  "consistency only)");
+
+      --  Line for -X switch
+
+      Write_Line ("  -Xnnn     Default exit status value = nnn");
+
+      --  Line for -y switch
+
+      Write_Line ("  -y        Enable leap seconds");
+
+      --  Line for -z switch
+
+      Write_Line ("  -z        No main subprogram (zero main)");
+
+      --  Line for --RTS
+
+      --  Line for -Z switch
+
+      Write_Line ("  -Z        " &
+                  "Zero formatting in auxiliary outputs (-e, -K, -l, -R)");
+
+      --  Line for --RTS
+
+      Write_Line ("  --RTS=dir Specify the default source and " &
+                  "object search path");
+
+      --  Line for sfile
+
+      Write_Line ("  lfile     Library file names");
+   end Display;
 
 end Bindusg;