5.1.2 Environment Variables

The variables in this section are optional, but, if defined, they will be used by the compiler. The compiler driver, or other subprogram, may choose to determine an appropriate value for some of the following environment variables if they are not set. The driver, or other subprogram, takes advantage of internal knowledge about the installation of the compiler. As long as the installation structure remains intact, with all subdirectories and executables remaining in the same relative position, the driver or subprogram will be able to determine a usable value. The “XC32” variables should be used for new projects; however, the “PIC32” variables may be used for legacy projects.

Table 5-1. COMPILER-RELATED ENVIRONMENT VARIABLES
Option Definition
XC32_C_INCLUDE_PATH

PIC32_C_INCLUDE_PATH

This variable’s value is a semicolon-separated list of directories, much like PATH. When the compiler searches for header files, it tries the directories listed in the variable, after the directories specified with -I but before the standard header file directories.

If the environment variable is undefined, the preprocessor chooses an appropriate value based on the standard installation. By default, the following directories are searched for include files:

<install-path>\xc32\include

XC32_COMPILER_PATH

PIC32_COMPILER_PATH

The value of XC32_COMPILER_PATH is a semicolon-separated list of directories, much like PATH. The compiler tries the directories thus specified when searching for subprograms, if it can’t find the subprograms using XC32_EXEC_PREFIX.
XC32_EXEC_PREFIX

PIC32_EXEC_PREFIX

If XC32_EXEC_PREFIX is set, it specifies a prefix to use in the names of subprograms executed by the compiler. No directory delimiter is added when this prefix is combined with the name of a subprogram, but you can specify a prefix that ends with a slash if you wish. If the compiler cannot find the subprogram using the specified prefix, it tries looking in your PATH environment variable.

If the XC32_EXEC_PREFIX environment variable is unset or set to an empty value, the compiler driver chooses an appropriate value based on the standard installation. If the installation has not been modified, this will result in the driver being able to locate the required subprograms.

Other prefixes specified with the -B command line option take precedence over the user- or driver-defined value of XC32_EXEC_PREFIX.

Under normal circumstances it is best to leave this value undefined and let the driver locate subprograms itself.

XC32_LIBRARY_PATH

PIC32_LIBRARY_PATH

This variable’s value is a semicolon-separated list of directories, much like PATH. This variable specifies a list of directories to be passed to the linker. The driver’s default evaluation of this variable is:

<install-path>\lib; <install-path>\xc32\lib.

TMPDIR If TMPDIR is set, it specifies the directory to use for temporary files. The compiler uses temporary files to hold the output of one stage of compilation that is to be used as input to the next stage: for example, the output of the preprocessor, which is the input to the compiler proper.