Specify Batch Compiler Options in a Configuration File

The default batch configuration file, /etc/vac.cfg, specifies information that the compiler uses when you invoke it. This file defines values used by the batch compiler to compile C or C++ programs. You can make entries to this file to support specific batch compilation requirements or to support other C or C++ compilation environments.

Most options specified in the batch configuration file override the default settings of the option. Similarly, most options specified in the batch configuration file are in turn overridden by options set in the source file and on the command line. Options that do not follow this scheme are listed in Resolving Conflicting Compiler Options.

Tailor a Configuration File
The default configuration file is /etc/vac.cfg.

You can copy this file and make changes to the copy to support specific compilation requirements or to support other C or C++ compilation environments. To specify a batch configuration file other than the default, you use the -F option.

For example, to make -qnoro the default for the xlC compiler invocation command, add -qnoro to the xlC stanza in your copied version of the batch configuration file.

You can link the compiler invocation command to several different names. The name you specify when you invoke the compiler determines which stanza of the batch configuration file the compiler uses. You can add other stanzas to your copy of the configuration file to customize your own compilation environment. You can use the -F option with the compiler invocation command to make links to select additional stanzas or to specify a stanza or another configuration file. For example:

xlC myfile.c -Fmyconfig:SPECIAL

would compile myfile.c using the SPECIAL stanza in a myconfig.cfg configuration file that you had created.

Configuration File Attributes
A stanza in the batch configuration file can contain the following attributes:

as Path name to be used for the assembler. The default is /bin/as.
asopt List of options for the assembler and not for the compiler. These override all normal processing by the compiler and are directed to the assembler specified in the as stanza. The string is formatted for the AIX getopt() subroutine as a concatenation of flag letters, with a letter followed by a colon (:) if the corresponding flag takes a parameter.
cppcode Path name to be used for the code generation phase of the compiler. The default is /usr/vacpp/exe/xlCcode.
ccomp C Front end. The default is /usr/vacpp/exe/xlcentry.
codeopt List of options for the code-generation phase of the compiler.
comp C++ Front end. The default is /usr/vacpp/exe/xlCentry.
cppopt List of options for the lexical analysis phase of the compiler.
crt Path name of the object file passed as the first parameter to the linkage editor. If you do not specify either the -p or the -pg option, the crt value is used. The default is /lib/crt0.o.
csuffix Suffix for source programs. The default is c (lowercase c).
dis Path name of the disassembler. The default is /usr/vacpp/exe/dis.
gcrt Path name of the object file passed as the first parameter to the linkage editor. If you specify the -pg option, the gcrt value is used. The default is /lib/grt0.o.
ld Path name to be used to link C or C++ programs. The default is /bin/ld.
ldopt List of options that are directed to the linkage editor part of the compiler. These override all normal processing by the compiler and are directed to the linkage editor. If the corresponding flag takes a parameter, the string is formatted for the Aix getopt() subroutine as a concatenation of flag letters, with a letter followed by a colon (:).
libraries2 Library options, separated by commas, that the compiler passes as the last parameters to the linkage editor. libraries2 specifies the libraries that the linkage editor is to use at link-edit time for both profiling and nonprofiling. The default is empty.
mcrt Path name of the object file passed as the first parameter to the linkage editor if you have specified the -p option. The default is /lib/mcrt0.o.
options A string of option flags, separated by commas, to be processed by the compiler as if they had been entered on the command line.
osuffix The suffix for object files. The default is .o.
proflibs Library options, separated by commas, that the compiler passes to the linkage editor when profiling options are specified. proflibs specifies the profiling libraries used by the linkage editor at link-edit time. The default is -L/lib/profiled and -L/usr/lib/profiled.
ssuffix The suffix for assembler files. The default is .s.
use Values for attributes are taken from the named stanza and from the local stanza. For single-valued attributes, values in the use stanza apply if no value is provided in the local, or default, stanza. For comma-separated lists, the values from the use stanza are added to the values from the local stanza.
xlC The path name of the xlC compiler component. The default is /usr/vacpp/bin/xlC.


Batch Compiler Options


Invoke the Batch Compiler
Specify Batch Compiler Options on the Command Line
Specify Batch Compiler Options in Your Source Program


Resolving Conflicting Compiler Options
List of Batch Compiler Options and Their Defaults