1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Osint; use Osint;
27 with Output; use Output;
28 with Switch; use Switch;
30 with System.WCh_Con; use System.WCh_Con;
32 package body Bindusg is
34 Already_Displayed : Boolean := False;
35 -- Set True if Display called, used to avoid showing usage information
44 if Already_Displayed then
47 Already_Displayed := True;
52 Write_Str ("Usage: ");
55 Write_Str ("switches lfile");
59 Display_Usage_Version_And_Help;
61 -- Line for @response_file
64 (" @<resp_file> Get arguments from response file");
67 -- Line for -aO switch
70 (" -aOdir Specify library files search path");
72 -- Line for -aI switch
75 (" -aIdir Specify source files search path");
80 (" -a Automatically initialize elaboration procedure");
82 -- Lines for -A switch
85 (" -A Give list of ALI files in partition");
87 (" -A=file Write ALI file list to named file");
92 (" -b Generate brief messages to stderr even if verbose mode "
98 (" -c Check only, no generation of binder output file");
100 -- Line for -d switch
103 (" -dnn[k|m] Default primary stack size = nn [kilo|mega] bytes");
108 (" -Dnn[k|m] Default secondary stack size = nn [kilo|mega] bytes");
110 -- Line for -e switch
113 (" -e Output complete list of elaboration order dependencies");
115 -- Line for -E switch
118 (" -Ea Store tracebacks in exception occurrences");
120 (" -Es Store tracebacks in exception occurrences,");
122 (" and enable symbolic tracebacks");
126 -- Line for -f switch
129 (" -ffile Force elaboration order from given file");
131 -- Line for -F switch
134 (" -F Force checking of elaboration Flags");
136 -- Line for -G switch
139 (" -G Generate binder file suitable for CCG");
141 -- Line for -h switch
144 (" -h Output this usage (help) information");
146 -- Line for -H switch
149 (" -H Legacy elaboration order model enabled");
151 -- Lines for -I switch
154 (" -Idir Specify library and source files search path");
156 (" -I- Don't look for sources & library files in default "
159 -- Line for -K switch
162 (" -K Give list of linker options specified for link");
164 -- Line for -l switch
167 (" -l Output chosen elaboration order");
172 (" -Lxyz Library build: adainit/final renamed to xyzinit/final, "
175 -- Line for -m switch
178 (" -mnnn Limit number of detected errors/warnings to nnn "
181 -- Line for -minimal switch
184 (" -minimal Generate binder file suitable for space-constrained "
187 -- Line for -M switch
190 (" -Mxyz Rename generated main program from main to xyz");
192 -- Line for -n switch
195 (" -n No Ada main program (foreign main routine)");
197 -- Line for -nostdinc
200 (" -nostdinc Don't look for source files in the system default "
203 -- Line for -nostdlib
206 (" -nostdlib Don't look for library files in the system default "
209 -- Line for -o switch
212 (" -o file Give the output file name (default is b~xxx.adb)");
214 -- Line for -O switch
217 (" -O Give list of objects required for link");
219 -- Line for -p switch
222 (" -p Pessimistic (worst-case) elaboration order");
224 -- Line for -P switch
227 (" -P Generate binder file suitable for CodePeer");
232 (" -Qnnn Generate nnn default-sized secondary stacks");
234 -- Line for -r switch
237 (" -r List restrictions that could be applied to this "
240 -- Line for -R switch
243 (" -R List sources referenced in closure");
245 -- Line for -s switch
248 (" -s Require all source files to be present");
250 -- Line for -S?? switch
253 (" -S?? Sin/lo/hi/xx/ev Initialize_Scalars "
254 & "invalid/low/high/hex/env var");
259 (" -static Link against a static GNAT run time");
264 (" -shared Link against a shared GNAT run time");
266 -- Line for -t switch
269 (" -t Tolerate time stamp and other consistency errors");
271 -- Line for -T switch
274 (" -Tn Set time slice value to n milliseconds (n >= 0)");
276 -- Line for -u switch
279 (" -un Enable dynamic stack analysis, with n results stored");
281 -- Line for -v switch
284 (" -v Verbose mode. Error messages, header, summary output to "
287 -- Line for -V switch
290 (" -Vkey=val Record bind-time variable key with value val");
291 -- Line for -w switch
294 (" -wx Warning mode. (x=s/e for suppress/treat as error)");
296 -- Line for -W switch
299 (" -W? Wide character encoding method (");
301 for J in WC_Encoding_Method loop
302 Write_Char (WC_Encoding_Letters (J));
304 if J = WC_Encoding_Method'Last then
313 -- Line for -x switch
316 (" -x Exclude source files (check object consistency only)");
318 -- Line for -X switch
321 (" -Xnnn Default exit status value = nnn");
323 -- Line for -y switch
326 (" -y Enable leap seconds");
328 -- Line for -z switch
331 (" -z No main subprogram (zero main)");
333 -- Line for -Z switch
336 (" -Z Zero formatting in auxiliary outputs (-e, -K, -l, -R)");
341 (" --RTS=dir Specify the default source and object search path");
346 (" lfile Library file names");