Chapter 4. GCC Command Options
%{
|
:
}
S
P
X
Substitutes
if either
X
sequences as well, although they have a stronger binding than the
alternatives must be starred, and only the first matching alternative is substituted.
For example, a spec string like this:
%{.c:-foo} %{!.c:-bar} %{.c|d:-baz} %{!.c|d:-boggle}
will output the following command-line options from the following input command-line options:
fred.c
jim.d
-d fred.c
-d jim.d
%{S:X; T:Y; :D}
If
was given to GCC, substitues
S
There can be as many clauses as you need. This may be combined with
The conditional text
spaces, or even newlines. They are processed as usual, as described above. Trailing white space in
is ignored. White space may also appear anywhere on the left side of the colon in these constructs,
except between
or
.
The
,
,
, and
-O
-f
-m
-W
the negated form of a
is ignored, except with {
The character
at the beginning of the predicate text is used to indicate that a command should be
|
piped to the following command, but only if
It is built into GCC which switches take arguments and which do not. (You might think it would be
useful to generalize this to allow each compiler's spec to say which switches take arguments. But this
cannot be done in a consistent fashion. GCC cannot even decide which input files have been specified
without knowing which switches take arguments, and it must know which input files to compile in
order to tell which compilers to run).
GCC also knows implicitly that arguments starting in
passed to the linker in their proper position among the other output files.
4.16. Specifying Target Machine and Compiler Version
The usual way to run GCC is to run the executable called
compiling, or
machine -gcc- version
last. Sometimes this is inconvenient, so GCC provides options that will switch to another cross-
compiler or version.
-b
machine
The argument
machine
The value to use for
GCC as a cross-compiler.
-V
version
The argument
versions are installed. For example,
The
and
options work by running the
-V
-b
no real reason to use them if you can just run that directly.
or
was given to GCC. This may be combined with
-S
-P
-foo -baz
-bar -boggle
-foo -baz -boggle
-bar -baz -boggle
; else if
X
in a %{
:
} or similar construct may contain other nested
X
S
X
and the corresponding word.
*
switches are handled specifically in these constructs. If another value of
,
, or
switch is found later in the command line, the earlier switch value
-f
-m
-W
*} where
is just one letter, which passes all matching options.
S
S
specifies the target machine for compilation.
is the same as was specified as the machine type when configuring
machine
specifies which version of GCC to run. This is useful when multiple
version
version
was given to GCC, substitues
T
is specified.
-pipe
are to be treated as compiler output files, and
-l
, or
gcc
to run a version other than the one that was installed
might be
, meaning to run GCC version 2.0.
2.0
machine -gcc- version
,
!
. If
appears in
, all of the
|
%*
X
; else substitutes
Y
,
,
, and
as needed.
.
!
|
*
constructs or
%
when cross-
machine -gcc
executable, so there's
83
, and
.
*
.
D
X
or
-O
Need help?
Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?
Questions and answers