1*ec02198aSmrg@c Copyright (C) 1999-2020 Free Software Foundation, Inc.
210d565efSmrg@c This is part of the CPP and GCC manuals.
310d565efSmrg@c For copying conditions, see the file gcc.texi.
410d565efSmrg
510d565efSmrg@c ---------------------------------------------------------------------
610d565efSmrg@c Environment variables affecting the preprocessor
710d565efSmrg@c ---------------------------------------------------------------------
810d565efSmrg
910d565efSmrg@c If this file is included with the flag ``cppmanual'' set, it is
1010d565efSmrg@c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
1110d565efSmrg
1210d565efSmrg@vtable @env
1310d565efSmrg@item CPATH
1410d565efSmrg@itemx C_INCLUDE_PATH
1510d565efSmrg@itemx CPLUS_INCLUDE_PATH
1610d565efSmrg@itemx OBJC_INCLUDE_PATH
1710d565efSmrg@c Commented out until ObjC++ is part of GCC:
1810d565efSmrg@c @itemx OBJCPLUS_INCLUDE_PATH
1910d565efSmrgEach variable's value is a list of directories separated by a special
2010d565efSmrgcharacter, much like @env{PATH}, in which to look for header files.
2110d565efSmrgThe special character, @code{PATH_SEPARATOR}, is target-dependent and
2210d565efSmrgdetermined at GCC build time.  For Microsoft Windows-based targets it is a
2310d565efSmrgsemicolon, and for almost all other targets it is a colon.
2410d565efSmrg
2510d565efSmrg@env{CPATH} specifies a list of directories to be searched as if
2610d565efSmrgspecified with @option{-I}, but after any paths given with @option{-I}
2710d565efSmrgoptions on the command line.  This environment variable is used
2810d565efSmrgregardless of which language is being preprocessed.
2910d565efSmrg
3010d565efSmrgThe remaining environment variables apply only when preprocessing the
3110d565efSmrgparticular language indicated.  Each specifies a list of directories
3210d565efSmrgto be searched as if specified with @option{-isystem}, but after any
3310d565efSmrgpaths given with @option{-isystem} options on the command line.
3410d565efSmrg
3510d565efSmrgIn all these variables, an empty element instructs the compiler to
3610d565efSmrgsearch its current working directory.  Empty elements can appear at the
3710d565efSmrgbeginning or end of a path.  For instance, if the value of
3810d565efSmrg@env{CPATH} is @code{:/special/include}, that has the same
3910d565efSmrgeffect as @samp{@w{-I. -I/special/include}}.
4010d565efSmrg
4110d565efSmrg@c man end
4210d565efSmrg@ifset cppmanual
4310d565efSmrgSee also @ref{Search Path}.
4410d565efSmrg@end ifset
4510d565efSmrg@c man begin ENVIRONMENT
4610d565efSmrg
4710d565efSmrg@item DEPENDENCIES_OUTPUT
4810d565efSmrg@cindex dependencies for make as output
4910d565efSmrgIf this variable is set, its value specifies how to output
5010d565efSmrgdependencies for Make based on the non-system header files processed
5110d565efSmrgby the compiler.  System header files are ignored in the dependency
5210d565efSmrgoutput.
5310d565efSmrg
5410d565efSmrgThe value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
5510d565efSmrgwhich case the Make rules are written to that file, guessing the target
5610d565efSmrgname from the source file name.  Or the value can have the form
5710d565efSmrg@samp{@var{file} @var{target}}, in which case the rules are written to
5810d565efSmrgfile @var{file} using @var{target} as the target name.
5910d565efSmrg
6010d565efSmrgIn other words, this environment variable is equivalent to combining
6110d565efSmrgthe options @option{-MM} and @option{-MF}
6210d565efSmrg@ifset cppmanual
6310d565efSmrg(@pxref{Invocation}),
6410d565efSmrg@end ifset
6510d565efSmrg@ifclear cppmanual
6610d565efSmrg(@pxref{Preprocessor Options}),
6710d565efSmrg@end ifclear
6810d565efSmrgwith an optional @option{-MT} switch too.
6910d565efSmrg
7010d565efSmrg@item SUNPRO_DEPENDENCIES
7110d565efSmrg@cindex dependencies for make as output
7210d565efSmrgThis variable is the same as @env{DEPENDENCIES_OUTPUT} (see above),
7310d565efSmrgexcept that system header files are not ignored, so it implies
7410d565efSmrg@option{-M} rather than @option{-MM}.  However, the dependence on the
7510d565efSmrgmain input file is omitted.
7610d565efSmrg@ifset cppmanual
7710d565efSmrg@xref{Invocation}.
7810d565efSmrg@end ifset
7910d565efSmrg@ifclear cppmanual
8010d565efSmrg@xref{Preprocessor Options}.
8110d565efSmrg@end ifclear
8210d565efSmrg
8310d565efSmrg@item CPP_RESTRICTED
8410d565efSmrg@cindex only open regular files
8510d565efSmrgIf this variable is defined, cpp will skip any include file which is not a
8610d565efSmrgregular file, and will continue searching for the requested name (this is
8710d565efSmrgalways done if the found file is a directory).
8810d565efSmrg@ifset cppmanual
8910d565efSmrg@xref{Invocation}.
9010d565efSmrg@end ifset
9110d565efSmrg@ifclear cppmanual
9210d565efSmrg@xref{Preprocessor Options}.
9310d565efSmrg@end ifclear
9410d565efSmrg
9510d565efSmrg@item SOURCE_DATE_EPOCH
9610d565efSmrgIf this variable is set, its value specifies a UNIX timestamp to be
9710d565efSmrgused in replacement of the current date and time in the @code{__DATE__}
9810d565efSmrgand @code{__TIME__} macros, so that the embedded timestamps become
9910d565efSmrgreproducible.
10010d565efSmrg
10110d565efSmrgThe value of @env{SOURCE_DATE_EPOCH} must be a UNIX timestamp,
10210d565efSmrgdefined as the number of seconds (excluding leap seconds) since
10310d565efSmrg01 Jan 1970 00:00:00 represented in ASCII; identical to the output of
10410d565efSmrg@samp{@command{date +%s}} on GNU/Linux and other systems that support the
10510d565efSmrg@code{%s} extension in the @code{date} command.
10610d565efSmrg
10710d565efSmrgThe value should be a known timestamp such as the last modification
10810d565efSmrgtime of the source or package and it should be set by the build
10910d565efSmrgprocess.
11010d565efSmrg
11110d565efSmrg@end vtable
112