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