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