From db89aef26f919982e402fcd7733dbe719173341c Mon Sep 17 00:00:00 2001 From: Robert Dewar Date: Tue, 31 Oct 2006 18:50:47 +0100 Subject: [PATCH] bindusg.ads, [...]: Change to package and rename procedure as Display... 2006-10-31 Robert Dewar * bindusg.ads, bindusg.adb: Change to package and rename procedure as Display, which now ensures that it only outputs usage information once. From-SVN: r118246 --- gcc/ada/bindusg.adb | 282 ++++++++++++++++++++------------------------ gcc/ada/bindusg.ads | 9 +- 2 files changed, 136 insertions(+), 155 deletions(-) diff --git a/gcc/ada/bindusg.adb b/gcc/ada/bindusg.adb index d39789a8ad5..42779346795 100644 --- a/gcc/ada/bindusg.adb +++ b/gcc/ada/bindusg.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, 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- -- @@ -27,242 +27,218 @@ with Osint; use Osint; with Output; use Output; -procedure Bindusg is +package body Bindusg is --- Start of processing for Bindusg + Already_Displayed : Boolean := False; + -- Set True if Display called, used to avoid showing usage information + -- more than once. -begin - -- Usage line + ------------- + -- Display -- + ------------- - Write_Str ("Usage: "); - Write_Program_Name; - Write_Char (' '); - Write_Str ("switches lfile"); - Write_Eol; - Write_Eol; + procedure Display is + begin + if Already_Displayed then + return; + else + Already_Displayed := True; + end if; - -- Line for -aO switch + -- Usage line - Write_Str (" -aOdir Specify library files search path"); - Write_Eol; + Write_Str ("Usage: "); + Write_Program_Name; + Write_Char (' '); + Write_Str ("switches lfile"); + Write_Eol; + Write_Eol; - -- Line for -aI switch + -- Line for -aO switch - Write_Str (" -aIdir Specify source files search path"); - Write_Eol; + Write_Line (" -aOdir Specify library files search path"); - -- Line for a switch + -- Line for -aI switch - Write_Str (" -a Automatically initialize elaboration procedure"); - Write_Eol; + Write_Line (" -aIdir Specify source files search path"); - -- Line for A switch + -- Line for a switch - Write_Str (" -A Generate binder program in Ada (default)"); - Write_Eol; + Write_Line (" -a Automatically initialize elaboration " & + "procedure"); - -- Line for -b switch + -- Line for A switch - Write_Str (" -b Generate brief messages to std"); - Write_Str ("err even if verbose mode set"); - Write_Eol; + Write_Line (" -A Generate binder program in Ada (default)"); - -- Line for -c switch + -- Line for -b switch - Write_Str (" -c Check only, no generation of b"); - Write_Str ("inder output file"); - Write_Eol; + Write_Line (" -b Generate brief messages to stderr " & + "even if verbose mode set"); - -- Line for C switch + -- Line for -c switch - Write_Str (" -C Generate binder program in C"); - Write_Eol; + Write_Line (" -c Check only, no generation of " & + "binder output file"); - -- Line for -d switch + -- Line for C switch - Write_Str (" -dnn[k|m] Default primary stack size = nn [kilo|mega] "); - Write_Str ("bytes "); - Write_Eol; + Write_Line (" -C Generate binder program in C"); - -- Line for D switch + -- Line for -d switch - Write_Str (" -Dnn[k|m] Default secondary stack size = nnn [kilo|mega] "); - Write_Str ("bytes"); - Write_Eol; + Write_Line (" -dnn[k|m] Default primary stack " & + "size = nn [kilo|mega] bytes"); - -- Line for -e switch + -- Line for D switch - Write_Str (" -e Output complete list of elabor"); - Write_Str ("ation order dependencies"); - Write_Eol; + Write_Line (" -Dnn[k|m] Default secondary stack " & + "size = nnn [kilo|mega] bytes"); - -- Line for -E switch + -- Line for -e switch - Write_Str (" -E Store tracebacks in Exception occurrences"); - Write_Eol; + Write_Line (" -e Output complete list of elaboration " & + "order dependencies"); - -- The -f switch is voluntarily omitted, because it is obsolete + -- Line for -E switch - -- Line for -F switch + Write_Line (" -E Store tracebacks in Exception occurrences"); - Write_Str (" -F Force checking of elaboration Flags"); - Write_Eol; + -- The -f switch is voluntarily omitted, because it is obsolete - -- Line for -h switch + -- Line for -F switch - Write_Str (" -h Output this usage (help) infor"); - Write_Str ("mation"); - Write_Eol; + Write_Line (" -F Force checking of elaboration Flags"); - -- Lines for -I switch + -- Line for -h switch - Write_Str (" -Idir Specify library and source files search path"); - Write_Eol; + Write_Line (" -h Output this usage (help) information"); - Write_Str (" -I- Don't look for sources & library files"); - Write_Str (" in default directory"); - Write_Eol; + -- Lines for -I switch - -- Line for -K switch + Write_Line (" -Idir Specify library and source files search path"); + Write_Line (" -I- Don't look for sources & library files " & + "in default directory"); - Write_Str (" -K Give list of linker options specified for link"); - Write_Eol; + -- Line for -K switch - -- Line for -l switch + Write_Line (" -K Give list of linker options specified " & + "for link"); - Write_Str (" -l Output chosen elaboration order"); - Write_Eol; + -- Line for -l switch - -- Line of -L switch + Write_Line (" -l Output chosen elaboration order"); - Write_Str (" -Lxyz Library build: adainit/final "); - Write_Str ("renamed to xyzinit/final, implies -n"); - Write_Eol; + -- Line of -L switch - -- Line for -m switch + Write_Line (" -Lxyz Library build: adainit/final " & + "renamed to xyzinit/final, implies -n"); - Write_Str (" -mnnn Limit number of detected error"); - Write_Str ("s to nnn (1-999999)"); - Write_Eol; + -- Line for -m switch - -- Line for -M switch + Write_Line (" -mnnn Limit number of detected errors " & + "to nnn (1-999999)"); - Write_Str (" -Mxyz Rename generated main program from main to xyz"); - Write_Eol; + -- Line for -M switch - -- Line for -n switch + Write_Line (" -Mxyz Rename generated main program from " & + "main to xyz"); - Write_Str (" -n No Ada main program (foreign main routine)"); - Write_Eol; + -- Line for -n switch - -- Line for -nostdinc + Write_Line (" -n No Ada main program (foreign main routine)"); - Write_Str (" -nostdinc Don't look for source files"); - Write_Str (" in the system default directory"); - Write_Eol; + -- Line for -nostdinc - -- Line for -nostdlib + Write_Line (" -nostdinc Don't look for source files " & + "in the system default directory"); - Write_Str (" -nostdlib Don't look for library files"); - Write_Str (" in the system default directory"); - Write_Eol; + -- Line for -nostdlib - -- Line for -o switch + Write_Line (" -nostdlib Don't look for library files " & + "in the system default directory"); - Write_Str (" -o file Give the output file name (default is b~xxx.adb) "); - Write_Eol; + -- Line for -o switch - -- Line for -O switch + Write_Line (" -o file Give the output file name " & + "(default is b~xxx.adb)"); - Write_Str (" -O Give list of objects required for link"); - Write_Eol; + -- Line for -O switch - -- Line for -p switch + Write_Line (" -O Give list of objects required for link"); - Write_Str (" -p Pessimistic (worst-case) elaborat"); - Write_Str ("ion order"); - Write_Eol; + -- Line for -p switch - -- Line for -r switch + Write_Line (" -p Pessimistic (worst-case) elaboration order"); - Write_Str (" -r List restrictions that could be a"); - Write_Str ("pplied to this partition"); - Write_Eol; + -- Line for -r switch - -- Line for -s switch + Write_Line (" -r List restrictions that could be applied " & + "to this partition"); - Write_Str (" -s Require all source files to be"); - Write_Str (" present"); - Write_Eol; + -- Line for -s switch - -- Line for -Sxx switch + Write_Line (" -s Require all source files to be present"); - Write_Str (" -S?? Sin/lo/hi/xx for Initialize_Scalars"); - Write_Str (" invalid/low/high/hex"); - Write_Eol; + -- Line for -Sxx switch - -- Line for -static + Write_Line (" -S?? Sin/lo/hi/xx for Initialize_Scalars " & + "invalid/low/high/hex"); - Write_Str (" -static Link against a static GNAT run time"); - Write_Eol; + -- Line for -static - -- Line for -shared + Write_Line (" -static Link against a static GNAT run time"); - Write_Str (" -shared Link against a shared GNAT run time"); - Write_Eol; + -- Line for -shared - -- Line for -t switch + Write_Line (" -shared Link against a shared GNAT run time"); - Write_Str (" -t Tolerate time stamp and other consistency errors"); - Write_Eol; + -- Line for -t switch - -- Line for -T switch + Write_Line (" -t Tolerate time stamp and other " & + "consistency errors"); - Write_Str (" -Tn Set time slice value to n milliseconds (n >= 0)"); - Write_Eol; + -- Line for -T switch - -- Line for -u switch + Write_Line (" -Tn Set time slice value to n " & + "milliseconds (n >= 0)"); - Write_Str (" -un Enable dynamic stack analysis, with n results "); - Write_Str ("stored"); - Write_Eol; + -- Line for -u switch - -- Line for -v switch + Write_Line (" -un Enable dynamic stack analysis, with " & + "n results stored"); - Write_Str (" -v Verbose mode. Error messages, "); - Write_Str ("header, summary output to stdout"); - Write_Eol; + -- Line for -v switch - -- Lines for -w switch + Write_Line (" -v Verbose mode. Error messages, " & + "header, summary output to stdout"); - Write_Str (" -wx Warning mode. (x=s/e for supp"); - Write_Str ("ress/treat as error)"); - Write_Eol; + -- Lines for -w switch - -- Line for -x switch + Write_Line (" -wx Warning mode. (x=s/e for " & + "suppress/treat as error)"); - Write_Str (" -x Exclude source files (check ob"); - Write_Str ("ject consistency only)"); - Write_Eol; + -- Line for -x switch - -- Line for X switch + Write_Line (" -x Exclude source files (check object " & + "consistency only)"); - Write_Str (" -Xnnn Default exit status value = nnn"); - Write_Eol; + -- Line for X switch - -- Line for -z switch + Write_Line (" -Xnnn Default exit status value = nnn"); - Write_Str (" -z No main subprogram (zero main)"); - Write_Eol; + -- Line for -z switch - -- Line for --RTS + Write_Line (" -z No main subprogram (zero main)"); - Write_Str (" --RTS=dir specify the default source and object search path"); - Write_Eol; + -- Line for --RTS - -- Line for sfile + Write_Line (" --RTS=dir specify the default source and " & + "object search path"); - Write_Str (" lfile Library file names"); - Write_Eol; + -- Line for sfile + + Write_Line (" lfile Library file names"); + end Display; end Bindusg; diff --git a/gcc/ada/bindusg.ads b/gcc/ada/bindusg.ads index 7c73bd043cb..e56852b7be5 100644 --- a/gcc/ada/bindusg.ads +++ b/gcc/ada/bindusg.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992,1993,1994 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2006, 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- -- @@ -26,4 +26,9 @@ -- Procedure to generate screen of usage information if no file name present -procedure Bindusg; +package Bindusg is + + procedure Display; + -- Display binder usage if not already displayed + +end Bindusg; -- 2.30.2