[Main]
Title=Environment Variables Affecting CPP

[Top]
This section describes the environment variables that affect how CPP
operates.  You can use them to specify directories or prefixes to use
when searching for include files, or to control dependency output.
<BR><BR>
Note that you can also specify places to search using options such as
<B>'-I'</B>, and control dependency output with options like
<B>'-M'</B> (see <A HREF="$$LINK(SEC44)">Invocation</A>).  These take precedence over
environment variables, which in turn take precedence over the
configuration of GCC.
<DL>
<DT><B>CPATH</B>
<BR><B>C_INCLUDE_PATH</B>
<BR><B>CPLUS_INCLUDE_PATH</B>
<BR><B>OBJC_INCLUDE_PATH</B>
<DD>Each variable's value is a list of directories separated by a special
character, much like <CODE>PATH</CODE>, in which to look for header files.
The special character, <CODE>PATH_SEPARATOR</CODE>, is target-dependent and
determined at GCC build time.  For Windows-based targets it is a
semicolon, and for almost all other targets it is a colon.
<BR><BR>
<CODE>CPATH</CODE> specifies a list of directories to be searched as if
specified with <B>'-I'</B>, but after any paths given with <B>'-I'</B>
options on the command line.  This environment variable is used
regardless of which language is being preprocessed.
<BR><BR>
The remaining environment variables apply only when preprocessing the
particular language indicated.  Each specifies a list of directories
to be searched as if specified with <B>'-isystem'</B>, but after any
paths given with <B>'-isystem'</B> options on the command line.
<BR><BR>
In all these variables, an empty element instructs the compiler to
search its current working directory.  Empty elements can appear at the
beginning or end of a path.  For instance, if the value of
<CODE>CPATH</CODE> is <CODE>:/special/include</CODE>, that has the same
effect as <CODE>-I.&nbsp;-I/special/include</CODE>.
<BR><BR>
<DT><B>DEPENDENCIES_OUTPUT</B>
<DD>If this variable is set, its value specifies how to output
dependencies for Make based on the non-system header files processed
by the compiler.  System header files are ignored in the dependency
output.
<BR><BR>
The value of <CODE>DEPENDENCIES_OUTPUT</CODE> can be just a file name, in
which case the Make rules are written to that file, guessing the target
name from the source file name.  Or the value can have the form
<CODE><I>file</I>&nbsp;<I>target</I></CODE>, in which case the rules are written to
file <I>file</I> using <I>target</I> as the target name.
<BR><BR>
In other words, this environment variable is equivalent to combining
the options <B>'-MM'</B> and <B>'-MF'</B>
(see <A HREF="$$LINK(SEC44)">Invocation</A>),
with an optional <B>'-MT'</B> switch too.
<BR><BR>
<DT><B>SUNPRO_DEPENDENCIES</B>
<DD>This variable is the same as <CODE>DEPENDENCIES_OUTPUT</CODE> (see above),
except that system header files are not ignored, so it implies
<B>'-M'</B> rather than <B>'-MM'</B>.  However, the dependence on the
main input file is omitted.
See <A HREF="$$LINK(SEC44)">Invocation</A>.
</DL>
