diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1992-12-31 13:05:40 -0800 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1992-12-31 13:05:40 -0800 |
commit | a99bf70c252a6164bd924892c14ac7994c482249 (patch) | |
tree | fdb63418d8ee9e7e929f78df377a7eb771deab78 /gcc | |
parent | cf8a904b921aa116f2842d281c4f191590a3dae9 (diff) | |
download | gcc-a99bf70c252a6164bd924892c14ac7994c482249.zip gcc-a99bf70c252a6164bd924892c14ac7994c482249.tar.gz gcc-a99bf70c252a6164bd924892c14ac7994c482249.tar.bz2 |
(input_from_pipe): New variable.
(do_spec): Set/clear input_from_pipe as appropriate. Translate %|
to "-" if input_from_pipe is true.
From-SVN: r3018
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gcc.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -251,6 +251,7 @@ or with constant text in a single argument. %C process CPP_SPEC as a spec. A capital C is actually used here. %1 process CC1_SPEC as a spec. %2 process CC1PLUS_SPEC as a spec. + %| output "-" if the input for the current command is coming from a pipe. %* substitute the variable part of a matched option. (See below.) Note that each comma in the substituted string is replaced by a single space. @@ -2306,6 +2307,9 @@ static int this_is_output_file; search dirs for it. */ static int this_is_library_file; +/* Nonzero means that the input of this command is coming from a pipe. */ +static int input_from_pipe; + /* Process the spec SPEC and run the commands specified therein. Returns 0 if the spec is successfully processed; -1 if failed. */ @@ -2320,6 +2324,7 @@ do_spec (spec) delete_this_arg = 0; this_is_output_file = 0; this_is_library_file = 0; + input_from_pipe = 0; value = do_spec_1 (spec, 0, NULL_PTR); @@ -2392,6 +2397,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) Otherwise, execute now and don't pass the `|' as an arg. */ if (i < n_switches) { + input_from_pipe = 1; switches[i].valid = 1; break; } @@ -2411,6 +2417,7 @@ do_spec_1 (spec, inswitch, soft_matched_part) delete_this_arg = 0; this_is_output_file = 0; this_is_library_file = 0; + input_from_pipe = 0; break; case '|': @@ -2984,6 +2991,11 @@ do_spec_1 (spec, inswitch, soft_matched_part) } break; + case '|': + if (input_from_pipe) + do_spec_1 ("-", 0, NULL_PTR); + break; + default: abort (); } |