xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/doc/cppenv.texi (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
1*8feb0f0bSmrg@c Copyright (C) 1999-2020 Free Software Foundation, Inc.
21debfc3dSmrg@c This is part of the CPP and GCC manuals.
31debfc3dSmrg@c For copying conditions, see the file gcc.texi.
41debfc3dSmrg
51debfc3dSmrg@c ---------------------------------------------------------------------
61debfc3dSmrg@c Environment variables affecting the preprocessor
71debfc3dSmrg@c ---------------------------------------------------------------------
81debfc3dSmrg
91debfc3dSmrg@c If this file is included with the flag ``cppmanual'' set, it is
101debfc3dSmrg@c formatted for inclusion in the CPP manual; otherwise the main GCC manual.
111debfc3dSmrg
121debfc3dSmrg@vtable @env
131debfc3dSmrg@item CPATH
141debfc3dSmrg@itemx C_INCLUDE_PATH
151debfc3dSmrg@itemx CPLUS_INCLUDE_PATH
161debfc3dSmrg@itemx OBJC_INCLUDE_PATH
171debfc3dSmrg@c Commented out until ObjC++ is part of GCC:
181debfc3dSmrg@c @itemx OBJCPLUS_INCLUDE_PATH
191debfc3dSmrgEach variable's value is a list of directories separated by a special
201debfc3dSmrgcharacter, much like @env{PATH}, in which to look for header files.
211debfc3dSmrgThe special character, @code{PATH_SEPARATOR}, is target-dependent and
221debfc3dSmrgdetermined at GCC build time.  For Microsoft Windows-based targets it is a
231debfc3dSmrgsemicolon, and for almost all other targets it is a colon.
241debfc3dSmrg
251debfc3dSmrg@env{CPATH} specifies a list of directories to be searched as if
261debfc3dSmrgspecified with @option{-I}, but after any paths given with @option{-I}
271debfc3dSmrgoptions on the command line.  This environment variable is used
281debfc3dSmrgregardless of which language is being preprocessed.
291debfc3dSmrg
301debfc3dSmrgThe remaining environment variables apply only when preprocessing the
311debfc3dSmrgparticular language indicated.  Each specifies a list of directories
321debfc3dSmrgto be searched as if specified with @option{-isystem}, but after any
331debfc3dSmrgpaths given with @option{-isystem} options on the command line.
341debfc3dSmrg
351debfc3dSmrgIn all these variables, an empty element instructs the compiler to
361debfc3dSmrgsearch its current working directory.  Empty elements can appear at the
371debfc3dSmrgbeginning or end of a path.  For instance, if the value of
381debfc3dSmrg@env{CPATH} is @code{:/special/include}, that has the same
391debfc3dSmrgeffect as @samp{@w{-I. -I/special/include}}.
401debfc3dSmrg
411debfc3dSmrg@c man end
421debfc3dSmrg@ifset cppmanual
431debfc3dSmrgSee also @ref{Search Path}.
441debfc3dSmrg@end ifset
451debfc3dSmrg@c man begin ENVIRONMENT
461debfc3dSmrg
471debfc3dSmrg@item DEPENDENCIES_OUTPUT
481debfc3dSmrg@cindex dependencies for make as output
491debfc3dSmrgIf this variable is set, its value specifies how to output
501debfc3dSmrgdependencies for Make based on the non-system header files processed
511debfc3dSmrgby the compiler.  System header files are ignored in the dependency
521debfc3dSmrgoutput.
531debfc3dSmrg
541debfc3dSmrgThe value of @env{DEPENDENCIES_OUTPUT} can be just a file name, in
551debfc3dSmrgwhich case the Make rules are written to that file, guessing the target
561debfc3dSmrgname from the source file name.  Or the value can have the form
571debfc3dSmrg@samp{@var{file} @var{target}}, in which case the rules are written to
581debfc3dSmrgfile @var{file} using @var{target} as the target name.
591debfc3dSmrg
601debfc3dSmrgIn other words, this environment variable is equivalent to combining
611debfc3dSmrgthe options @option{-MM} and @option{-MF}
621debfc3dSmrg@ifset cppmanual
631debfc3dSmrg(@pxref{Invocation}),
641debfc3dSmrg@end ifset
651debfc3dSmrg@ifclear cppmanual
661debfc3dSmrg(@pxref{Preprocessor Options}),
671debfc3dSmrg@end ifclear
681debfc3dSmrgwith an optional @option{-MT} switch too.
691debfc3dSmrg
701debfc3dSmrg@item SUNPRO_DEPENDENCIES
711debfc3dSmrg@cindex dependencies for make as output
721debfc3dSmrgThis variable is the same as @env{DEPENDENCIES_OUTPUT} (see above),
731debfc3dSmrgexcept that system header files are not ignored, so it implies
741debfc3dSmrg@option{-M} rather than @option{-MM}.  However, the dependence on the
751debfc3dSmrgmain input file is omitted.
761debfc3dSmrg@ifset cppmanual
771debfc3dSmrg@xref{Invocation}.
781debfc3dSmrg@end ifset
791debfc3dSmrg@ifclear cppmanual
801debfc3dSmrg@xref{Preprocessor Options}.
811debfc3dSmrg@end ifclear
821debfc3dSmrg
831debfc3dSmrg@item CPP_RESTRICTED
841debfc3dSmrg@cindex only open regular files
851debfc3dSmrgIf this variable is defined, cpp will skip any include file which is not a
861debfc3dSmrgregular file, and will continue searching for the requested name (this is
871debfc3dSmrgalways done if the found file is a directory).
881debfc3dSmrg@ifset cppmanual
891debfc3dSmrg@xref{Invocation}.
901debfc3dSmrg@end ifset
911debfc3dSmrg@ifclear cppmanual
921debfc3dSmrg@xref{Preprocessor Options}.
931debfc3dSmrg@end ifclear
941debfc3dSmrg
951debfc3dSmrg@item SOURCE_DATE_EPOCH
961debfc3dSmrgIf this variable is set, its value specifies a UNIX timestamp to be
971debfc3dSmrgused in replacement of the current date and time in the @code{__DATE__}
981debfc3dSmrgand @code{__TIME__} macros, so that the embedded timestamps become
991debfc3dSmrgreproducible.
1001debfc3dSmrg
1011debfc3dSmrgThe value of @env{SOURCE_DATE_EPOCH} must be a UNIX timestamp,
1021debfc3dSmrgdefined as the number of seconds (excluding leap seconds) since
1031debfc3dSmrg01 Jan 1970 00:00:00 represented in ASCII; identical to the output of
1041debfc3dSmrg@samp{@command{date +%s}} on GNU/Linux and other systems that support the
1051debfc3dSmrg@code{%s} extension in the @code{date} command.
1061debfc3dSmrg
1071debfc3dSmrgThe value should be a known timestamp such as the last modification
1081debfc3dSmrgtime of the source or package and it should be set by the build
1091debfc3dSmrgprocess.
1101debfc3dSmrg
1111debfc3dSmrg@end vtable
112