The gxlc and gxlc++ utilities
use the configuration file /opt/ibmcmp/vac/11.1/etc/gxlc.cfg
to translate GNU C and C++ options to XL C/C++ options.
Each entry in gxlc.cfg describes how the utility should map a GNU C or C++
option to an XL C/C++ option
and how to process it.
An entry consists of a string of flags for the processing instructions,
a string for the GNU C/C++ option,
and a string for the XL C/C++ option.
The three fields must be separated by white space. If an entry contains only
the first two fields and the XL C/C++ option
string is omitted, the GNU C option in the second field will be recognized
by gxlc or gxlc++ and
silently ignored.
The # character is used to insert comments in the configuration
file. A comment can be placed on its own line, or at the end of an entry.
The following syntax is used for an entry in
gxlc.cfg:
abcd "gcc_or_g++_option" "xlc_or_xlc++_option"
where:
- a
- Lets you disable the option by adding no- as a prefix. The value
is either y for yes, or n for no. For example, if the flag is
set to y, then finline can be disabled as fno-inline,
and the entry is:
ynn* "-finline" "-qinline"
If
given -fno-inline, then the utility will translate it to -qnoinline.
- b
- Informs the utility that the XL C/C++ option
has an associated value. The value is either y for yes, or n for
no. For example, if option -fmyvalue=n maps to -qmyvalue=n,
then the flag is set to y, and the entry is:
nyn* "-fmyvalue" "-qmyvalue"
The
utility will then expect a value for these options.
- c
- Controls the processing of the options. The value can be any of the following:
- n
- Tells the utility to process the option listed in the gcc_or_g++_option field
- i
- Tells the utility to ignore the option listed in the gcc_or_g++_option field.
The utility will generate a message that this has been done, and continue
processing the given options.
- e
- Tells the utility to halt processing if the option listed in the gcc_or_g++_option field is encountered. The utility
will also generate an error message.
For example, the GCC option -I- is not supported
and must be ignored by gxlc or gxlc++.
In this case, the flag is set to i, and the entry is: nni* "-I-"
If
the utility encounters this option as input, it will not process it and will
generate a warning.
- d
- Lets gxlc or gxlc++ include
or ignore an option based on the type of compiler. The value can be any of
the following:
- c
- Tells the utility to translate the option only for C.
- x
- Tells the utility to translate the option only for C++.
- *
- Tells gxlc or gxlc++ to
translate the option for C and C++.
For example, -fwritable-strings is supported by both
compilers, and maps to -qnoro. The entry is: nnn* "-fwritable-strings" "-qnoro"
- "gcc_or_g++_option"
- Is a string representing a GNU C/C++ option.
This field is required and must appear in double quotation marks.
- "xlc__or_xlc++_option"
- Is a string representing an XL C/C++ option.
This field is optional, and, if present, must appear in double quotation marks.
If left blank, the utility ignores the gcc_or_g++_option in
that entry.
It is possible to create an entry that will map a range of options. This
is accomplished by using the asterisk (
*) as a wildcard. For example,
the GCC
-D option requires a user-defined name and can take an optional
value. It is possible to have the following series of options:
-DCOUNT1=100
-DCOUNT2=200
-DCOUNT3=300
-DCOUNT4=400
Instead of creating an entry for each version of this
option, the single entry is:
nnn* "-D*" "-D*"
where
the asterisk will be replaced by any string following the
-D option.
Conversely, you can use the asterisk to exclude a range of options. For
example, if you want
gxlc or gxlc++ to
ignore all the
-std options, then the entry would be:
nni* "-std*"
When the asterisk is used in an option definition, option flags a and b are
not applicable to these entries.
The character
% is used with a
GNU C/C++ option
to signify that the option has associated parameters. This is used to insure
that
gxlc or gxlc++ will
ignore the parameters associated with an option that is ignored. For example,
the
-isystem option is not supported and uses a parameter. Both must
be ignored by the application. In this case, the entry is:
nni* "-isystem %"