Specifying Alternate Tools and Paths

You can direct the compiler to go outside default paths and tools to specify alternate tools for preprocessing, compilation, assembly, and linking. Further, you can invoke options specific to your alternate tools on the command line. The following sections explain how to use -Qlocation and -Qoption to do this.

How to Specify an Alternate Component

Use -Qlocation to specify an alternate path for a tool. This option accepts two arguments using the following syntax:

prompt>-Qlocation,tool,path

tool Description
cpp Specifies the compiler front-end preprocessor.
c Specifies the C++ compiler.
asm Specifies the assembler.
ld Specifies the linker.

path is the complete path to the tool.

How to Pass Options to Other Programs (-Qoption, tool, optlist)

Use -Qoption to pass an option specified by optlist to a tool, where optlist is a comma-separated list of options. The syntax for this command is the following:

prompt>-Qoption,tool,optlist

tool Description
cpp Specifies the compiler front-end preprocessor.
c Specifies the C++ compiler.
asm Specifies the assembler.
ld Specifies the linker.

-oplist Indicates one or more valid argument strings for the designated program. If the argument is a command-line option, you must include the hyphen. If the argument contains a space or tab character, you must enclose the entire argument in quotation characters (""). You must separate multiple arguments with commas. The following example directs the linker to create a memory map when the compiler produces the executable file from the source.

The -Qoption, link option in the preceding example is passing the -map option to the linker. This is an explicit way to pass arguments to other tools in the compilation process.