summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorcchavva <cchavva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-14 17:06:06 +0000
committercchavva <cchavva@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-14 17:06:06 +0000
commit7a6882ca319bac210ef0603e1ae8c5be13aafd97 (patch)
tree82fcb7ad57d0d0955376822c31e00ce79fcaf5b2 /gcc/gcc.c
parent6c6c03f208f86bc53fd6e10ac974eacebc88f801 (diff)
downloadgcc-7a6882ca319bac210ef0603e1ae8c5be13aafd97.tar.gz
New option --target-help.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37456 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 206b02a4718..fa9b7cda953 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -136,6 +136,10 @@ static int print_help_list;
static int verbose_flag;
+/* Flag indicating to print target specific command line options. */
+
+static int target_help_flag;
+
/* Flag indicating whether we should report subprocess execution times
(if this is supported by the system - see pexecute.c). */
@@ -597,6 +601,7 @@ static const char *cc1_options =
%{g*} %{O*} %{W*} %{w} %{pedantic*} %{std*} %{ansi}\
%{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
%{aux-info*} %{Qn:-fno-ident} %{--help:--help}\
+ %{--target-help:--target-help}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j}";
@@ -2760,6 +2765,7 @@ display_help ()
fputs (_(" -pass-exit-codes Exit with highest error code from a phase\n"), stdout);
fputs (_(" --help Display this information\n"), stdout);
+ fputs (_(" --target-help Display target specific command line options\n"), stdout);
if (! verbose_flag)
fputs (_(" (Use '-v --help' to display command line options of sub-processes)\n"), stdout);
fputs (_(" -dumpspecs Display all of the built in spec strings\n"), stdout);
@@ -3085,6 +3091,19 @@ process_command (argc, argv)
add_assembler_option ("--help", 6);
add_linker_option ("--help", 6);
}
+ else if (strcmp (argv[i], "-ftarget-help") == 0)
+ {
+ /* translate_options() has turned --target-help into -ftarget-help. */
+ target_help_flag = 1;
+
+ /* We will be passing a dummy file on to the sub-processes. */
+ n_infiles++;
+ n_switches++;
+
+ add_preprocessor_option ("--target-help", 13);
+ add_assembler_option ("--target-help", 13);
+ add_linker_option ("--target-help", 13);
+ }
else if (! strcmp (argv[i], "-pass-exit-codes"))
{
pass_exit_codes = 1;
@@ -3525,6 +3544,22 @@ process_command (argc, argv)
;
else if (! strcmp (argv[i], "-print-multi-directory"))
;
+ else if (strcmp (argv[i], "-ftarget-help") == 0)
+ {
+ /* Create a dummy input file, so that we can pass --target-help on to
+ the various sub-processes. */
+ infiles[n_infiles].language = "c";
+ infiles[n_infiles++].name = "target-dummy";
+
+ /* Preserve the --target-help switch so that it can be caught by
+ the cc1 spec string. */
+ switches[n_switches].part1 = "--target-help";
+ switches[n_switches].args = 0;
+ switches[n_switches].live_cond = SWITCH_OK;
+ switches[n_switches].validated = 0;
+
+ n_switches++;
+ }
else if (strcmp (argv[i], "-fhelp") == 0)
{
if (verbose_flag)
@@ -5487,6 +5522,16 @@ main (argc, argv)
return (0);
}
+ if (target_help_flag)
+ {
+ /* Print if any target specific options.*/
+
+ /* We do not exit here. Instead we have created a fake input file
+ called 'target-dummy' which needs to be compiled, and we pass this
+ on to the various sub-processes, along with the --target-help
+ switch. */
+ }
+
if (print_help_list)
{
display_help ();