OSDN Git Service

2011-08-05 Yannick Moy <moy@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / bindusg.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             B I N D U S G                                --
6 --                                                                          --
7 --                                B o d y                                   --
8 --                                                                          --
9 --          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 3,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT; see file COPYING3.  If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license.          --
20 --                                                                          --
21 -- GNAT was originally developed  by the GNAT team at  New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
23 --                                                                          --
24 ------------------------------------------------------------------------------
25
26 with Osint;  use Osint;
27 with Output; use Output;
28
29 with System.WCh_Con; use System.WCh_Con;
30
31 package body Bindusg is
32
33    Already_Displayed : Boolean := False;
34    --  Set True if Display called, used to avoid showing usage information
35    --  more than once.
36
37    -------------
38    -- Display --
39    -------------
40
41    procedure Display is
42    begin
43       if Already_Displayed then
44          return;
45       else
46          Already_Displayed := True;
47       end if;
48
49       --  Usage line
50
51       Write_Str ("Usage: ");
52       Write_Program_Name;
53       Write_Char (' ');
54       Write_Str ("switches lfile");
55       Write_Eol;
56       Write_Eol;
57
58       --  Line for @response_file
59
60       Write_Line ("  @<resp_file> Get arguments from response file");
61       Write_Eol;
62
63       --  Line for -aO switch
64
65       Write_Line ("  -aOdir    Specify library files search path");
66
67       --  Line for -aI switch
68
69       Write_Line ("  -aIdir    Specify source files search path");
70
71       --  Line for a switch
72
73       Write_Line ("  -a        Automatically initialize elaboration " &
74                   "procedure");
75
76       --  Line for -A switch
77
78       Write_Line ("  -A        Give list of ALI files in partition");
79
80       --  Line for -b switch
81
82       Write_Line ("  -b        Generate brief messages to stderr " &
83                   "even if verbose mode set");
84
85       --  Line for -c switch
86
87       Write_Line ("  -c        Check only, no generation of " &
88                   "binder output file");
89
90       --  Line for -d switch
91
92       Write_Line ("  -dnn[k|m] Default primary stack " &
93                   "size = nn [kilo|mega] bytes");
94
95       --  Line for D switch
96
97       Write_Line ("  -Dnn[k|m] Default secondary stack " &
98                   "size = nn [kilo|mega] bytes");
99
100       --  Line for -e switch
101
102       Write_Line ("  -e        Output complete list of elaboration " &
103                   "order dependencies");
104
105       --  Line for -E switch
106
107       Write_Line ("  -E        Store tracebacks in exception occurrences");
108
109       --  The -f switch is voluntarily omitted, because it is obsolete
110
111       --  Line for -F switch
112
113       Write_Line ("  -F        Force checking of elaboration Flags");
114
115       --  Line for -h switch
116
117       Write_Line ("  -h        Output this usage (help) information");
118
119       --  Line for -H switch
120
121       Write_Line ("  -Hnn      Use nn bit heap where nn is 32 or 64 " &
122                   "(VMS Only)");
123
124       --  Lines for -I switch
125
126       Write_Line ("  -Idir     Specify library and source files search path");
127       Write_Line ("  -I-       Don't look for sources & library files " &
128                   "in default directory");
129
130       --  Line for -K switch
131
132       Write_Line ("  -K        Give list of linker options specified " &
133                   "for link");
134
135       --  Line for -l switch
136
137       Write_Line ("  -l        Output chosen elaboration order");
138
139       --  Line of -L switch
140
141       Write_Line ("  -Lxyz     Library build: adainit/final " &
142                   "renamed to xyzinit/final, implies -n");
143
144       --  Line for -m switch
145
146       Write_Line ("  -mnnn     Limit number of detected errors/warnings " &
147                   "to nnn (1-999999)");
148
149       --  Line for -M switch
150
151       Write_Line ("  -Mxyz     Rename generated main program from " &
152                   "main to xyz");
153
154       --  Line for -n switch
155
156       Write_Line ("  -n        No Ada main program (foreign main routine)");
157
158       --  Line for -nostdinc
159
160       Write_Line ("  -nostdinc Don't look for source files " &
161                   "in the system default directory");
162
163       --  Line for -nostdlib
164
165       Write_Line ("  -nostdlib Don't look for library files " &
166                   "in the system default directory");
167
168       --  Line for -o switch
169
170       Write_Line ("  -o file   Give the output file name " &
171                   "(default is b~xxx.adb)");
172
173       --  Line for -O switch
174
175       Write_Line ("  -O        Give list of objects required for link");
176
177       --  Line for -p switch
178
179       Write_Line ("  -p        Pessimistic (worst-case) elaboration order");
180
181       --  Line for -P switch
182
183       Write_Line ("  -P        Generate binder file suitable for CodePeer");
184
185       --  Line for -r switch
186
187       Write_Line ("  -r        List restrictions that could be applied " &
188                   "to this partition");
189
190       --  Line for -R switch
191
192       Write_Line
193         ("  -R        List sources referenced in closure");
194
195       --  Line for -s switch
196
197       Write_Line ("  -s        Require all source files to be present");
198
199       --  Line for -S?? switch
200
201       Write_Line ("  -S??      Sin/lo/hi/xx/ev Initialize_Scalars " &
202                   "invalid/low/high/hex/env var");
203
204       --  Line for -static
205
206       Write_Line ("  -static   Link against a static GNAT run time");
207
208       --  Line for -shared
209
210       Write_Line ("  -shared   Link against a shared GNAT run time");
211
212       --  Line for -t switch
213
214       Write_Line ("  -t        Tolerate time stamp and other " &
215                   "consistency errors");
216
217       --  Line for -T switch
218
219       Write_Line ("  -Tn       Set time slice value to n " &
220                   "milliseconds (n >= 0)");
221
222       --  Line for -u switch
223
224       Write_Line ("  -un       Enable dynamic stack analysis, with " &
225                   "n results stored");
226
227       --  Line for -v switch
228
229       Write_Line ("  -v        Verbose mode. Error messages, " &
230                   "header, summary output to stdout");
231
232       --  Line for -w switch
233
234       Write_Line ("  -wx       Warning mode. (x=s/e for " &
235                   "suppress/treat as error)");
236
237       --  Line for -W switch
238
239       Write_Str  ("  -W?       Wide character encoding method (");
240
241       for J in WC_Encoding_Method loop
242          Write_Char (WC_Encoding_Letters (J));
243
244          if J = WC_Encoding_Method'Last then
245             Write_Char (')');
246          else
247             Write_Char ('/');
248          end if;
249       end loop;
250
251       Write_Eol;
252
253       --  Line for -x switch
254
255       Write_Line ("  -x        Exclude source files (check object " &
256                   "consistency only)");
257
258       --  Line for -X switch
259
260       Write_Line ("  -Xnnn     Default exit status value = nnn");
261
262       --  Line for -y switch
263
264       Write_Line ("  -y        Enable leap seconds");
265
266       --  Line for -z switch
267
268       Write_Line ("  -z        No main subprogram (zero main)");
269
270       --  Line for --RTS
271
272       --  Line for -Z switch
273
274       Write_Line ("  -Z        " &
275                   "Zero formatting in auxiliary outputs (-e, -K, -l, -R)");
276
277       --  Line for --RTS
278
279       Write_Line ("  --RTS=dir Specify the default source and " &
280                   "object search path");
281
282       --  Line for sfile
283
284       Write_Line ("  lfile     Library file names");
285    end Display;
286
287 end Bindusg;