Download MPLAB XC8 C Compiler User's Guide

Transcript
XC8 Command-line Driver
4.2.2
Environment Variables
When hosted on a Windows environment, the compiler uses the registry to store information relating to the compiler installation directory and activation details, along with
other configuration settings. That information is required whether the compiler is run on
the command line or from within an IDE.
Under Linux® and Mac OS® X environments, the registry is replaced by an XML file that
stores the same information.
On non-Windows hosts, the compiler searches for the XML file in the following ways:
1. The compiler looks for the presence of an environment variable called XC_XML.
If present, this variable should contain the full path to the XML file (including the
file’s name).
2. If this variable is not defined, the compiler then searches for an environment variable called HOME. This variable typically contains the path to the user’s home
directory. The compiler looks for the XML with a name .xc.xml in the directory
indicated by the HOME variable.
3. If the HOME environment variable is not defined, the compiler tries to open the file
/etc/xc.xml.
4. If none of these methods finds the XML file, an error is generated.
When running the compiler on the command line, you can wish to set the PATH environment variable. This allows you to run the compiler driver without specifying the full
compiler path with the driver name. Note that the directories specified by the PATH variable are only used to locate the compiler driver. Once the driver is running, it uses the
registry or XML file, described above, to locate the internal compiler applications, such
as the parser, assembler and linker, etc. The directories specified in the PATH variable
do not override the information contained in the registry or XML file. The MPLAB IDE
allows the compiler to be selected via a dialog and execution of the compiler does not
depend on the PATH variable.
 2012-2013 Microchip Technology Inc.
DS50002053D-page 79