Configuring the option mapping

The gxlc and gxlc++ utilities use the configuration file 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 option, and a string for the XL C/C++ option. The three fields must be separated by whitespace. 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 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 gxlc 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"
gxlc and gxlc++ will then expect a value for these options.
c
Controls the processing of the options. The value can be: For example, the gcc option -I- is not supported and must be ignored by gxlc and gxlc++. In this case, the flag is set to i, and the entry is:
nni*        "-I-"
If gxlc and gxlc++ encounters this option as input, it will not process it and will generate a warning.
d
Lets gxlc and gxlc++ include or ignore an option based on the type of compiler. The value can be: 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 gcc or g++ option supported by GNU C, Version . 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, gxlc and gxlc++ 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 or GNU 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 %"

Related information