xref: /dflybsd-src/contrib/gcc-4.7/gcc/doc/cppenv.texi (revision 04febcfb30580676d3e95f58a16c5137ee478b32)
1*e4b17023SJohn Marino@c Copyright (c) 1999, 2000, 2001, 2002, 2004
2*e4b17023SJohn Marino@c Free Software Foundation, Inc.
3*e4b17023SJohn Marino@c This is part of the CPP and GCC manuals.
4*e4b17023SJohn Marino@c For copying conditions, see the file gcc.texi.
5*e4b17023SJohn Marino
6*e4b17023SJohn Marino@c ---------------------------------------------------------------------
7*e4b17023SJohn Marino@c Environment variables affecting the preprocessor
8*e4b17023SJohn Marino@c ---------------------------------------------------------------------
9*e4b17023SJohn Marino
10*e4b17023SJohn Marino@c If this file is included with the flag ``cppmanual'' set, it is
11*e4b17023SJohn Marino@c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
12*e4b17023SJohn Marino
13*e4b17023SJohn Marino@vtable @env
14*e4b17023SJohn Marino@item CPATH
15*e4b17023SJohn Marino@itemx C_INCLUDE_PATH
16*e4b17023SJohn Marino@itemx CPLUS_INCLUDE_PATH
17*e4b17023SJohn Marino@itemx OBJC_INCLUDE_PATH
18*e4b17023SJohn Marino@c Commented out until ObjC++ is part of GCC:
19*e4b17023SJohn Marino@c @itemx OBJCPLUS_INCLUDE_PATH
20*e4b17023SJohn MarinoEach variable's value is a list of directories separated by a special
21*e4b17023SJohn Marinocharacter, much like @env{PATH}, in which to look for header files.
22*e4b17023SJohn MarinoThe special character, @code{PATH_SEPARATOR}, is target-dependent and
23*e4b17023SJohn Marinodetermined at GCC build time.  For Microsoft Windows-based targets it is a
24*e4b17023SJohn Marinosemicolon, and for almost all other targets it is a colon.
25*e4b17023SJohn Marino
26*e4b17023SJohn Marino@env{CPATH} specifies a list of directories to be searched as if
27*e4b17023SJohn Marinospecified with @option{-I}, but after any paths given with @option{-I}
28*e4b17023SJohn Marinooptions on the command line.  This environment variable is used
29*e4b17023SJohn Marinoregardless of which language is being preprocessed.
30*e4b17023SJohn Marino
31*e4b17023SJohn MarinoThe remaining environment variables apply only when preprocessing the
32*e4b17023SJohn Marinoparticular language indicated.  Each specifies a list of directories
33*e4b17023SJohn Marinoto be searched as if specified with @option{-isystem}, but after any
34*e4b17023SJohn Marinopaths given with @option{-isystem} options on the command line.
35*e4b17023SJohn Marino
36*e4b17023SJohn MarinoIn all these variables, an empty element instructs the compiler to
37*e4b17023SJohn Marinosearch its current working directory.  Empty elements can appear at the
38*e4b17023SJohn Marinobeginning or end of a path.  For instance, if the value of
39*e4b17023SJohn Marino@env{CPATH} is @code{:/special/include}, that has the same
40*e4b17023SJohn Marinoeffect as @samp{@w{-I. -I/special/include}}.
41*e4b17023SJohn Marino
42*e4b17023SJohn Marino@c man end
43*e4b17023SJohn Marino@ifset cppmanual
44*e4b17023SJohn MarinoSee also @ref{Search Path}.
45*e4b17023SJohn Marino@end ifset
46*e4b17023SJohn Marino@c man begin ENVIRONMENT
47*e4b17023SJohn Marino
48*e4b17023SJohn Marino@item DEPENDENCIES_OUTPUT
49*e4b17023SJohn Marino@cindex dependencies for make as output
50*e4b17023SJohn MarinoIf this variable is set, its value specifies how to output
51*e4b17023SJohn Marinodependencies for Make based on the non-system header files processed
52*e4b17023SJohn Marinoby the compiler.  System header files are ignored in the dependency
53*e4b17023SJohn Marinooutput.
54*e4b17023SJohn Marino
55*e4b17023SJohn MarinoThe value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
56*e4b17023SJohn Marinowhich case the Make rules are written to that file, guessing the target
57*e4b17023SJohn Marinoname from the source file name.  Or the value can have the form
58*e4b17023SJohn Marino@samp{@var{file} @var{target}}, in which case the rules are written to
59*e4b17023SJohn Marinofile @var{file} using @var{target} as the target name.
60*e4b17023SJohn Marino
61*e4b17023SJohn MarinoIn other words, this environment variable is equivalent to combining
62*e4b17023SJohn Marinothe options @option{-MM} and @option{-MF}
63*e4b17023SJohn Marino@ifset cppmanual
64*e4b17023SJohn Marino(@pxref{Invocation}),
65*e4b17023SJohn Marino@end ifset
66*e4b17023SJohn Marino@ifclear cppmanual
67*e4b17023SJohn Marino(@pxref{Preprocessor Options}),
68*e4b17023SJohn Marino@end ifclear
69*e4b17023SJohn Marinowith an optional @option{-MT} switch too.
70*e4b17023SJohn Marino
71*e4b17023SJohn Marino@item SUNPRO_DEPENDENCIES
72*e4b17023SJohn Marino@cindex dependencies for make as output
73*e4b17023SJohn MarinoThis variable is the same as @env{DEPENDENCIES_OUTPUT} (see above),
74*e4b17023SJohn Marinoexcept that system header files are not ignored, so it implies
75*e4b17023SJohn Marino@option{-M} rather than @option{-MM}.  However, the dependence on the
76*e4b17023SJohn Marinomain input file is omitted.
77*e4b17023SJohn Marino@ifset cppmanual
78*e4b17023SJohn Marino@xref{Invocation}.
79*e4b17023SJohn Marino@end ifset
80*e4b17023SJohn Marino@ifclear cppmanual
81*e4b17023SJohn Marino@xref{Preprocessor Options}.
82*e4b17023SJohn Marino@end ifclear
83*e4b17023SJohn Marino@end vtable
84