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