選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Environment-Variables.html 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1987-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation. A copy of
  7. the license is included in the
  8. section entitled "GNU Free Documentation License".
  9. This manual contains no Invariant Sections. The Front-Cover Texts are
  10. (a) (see below), and the Back-Cover Texts are (b) (see below).
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Environment Variables (The C Preprocessor)</title>
  21. <meta name="description" content="Environment Variables (The C Preprocessor)">
  22. <meta name="keywords" content="Environment Variables (The C Preprocessor)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Index-of-Directives.html#Index-of-Directives" rel="index" title="Index of Directives">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="index.html#Top" rel="up" title="Top">
  30. <link href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License" rel="next" title="GNU Free Documentation License">
  31. <link href="Invocation.html#Invocation" rel="prev" title="Invocation">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Environment-Variables"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="Invocation.html#Invocation" accesskey="p" rel="prev">Invocation</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html#Index-of-Directives" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Environment-Variables-1"></a>
  68. <h2 class="chapter">13 Environment Variables</h2>
  69. <a name="index-environment-variables"></a>
  70. <p>This section describes the environment variables that affect how CPP
  71. operates. You can use them to specify directories or prefixes to use
  72. when searching for include files, or to control dependency output.
  73. </p>
  74. <p>Note that you can also specify places to search using options such as
  75. <samp>-I</samp>, and control dependency output with options like
  76. <samp>-M</samp> (see <a href="Invocation.html#Invocation">Invocation</a>). These take precedence over
  77. environment variables, which in turn take precedence over the
  78. configuration of GCC.
  79. </p>
  80. <dl compact="compact">
  81. <dt><code>CPATH</code>
  82. <a name="index-CPATH"></a>
  83. </dt>
  84. <dt><code>C_INCLUDE_PATH</code>
  85. <a name="index-C_005fINCLUDE_005fPATH"></a>
  86. </dt>
  87. <dt><code>CPLUS_INCLUDE_PATH</code>
  88. <a name="index-CPLUS_005fINCLUDE_005fPATH"></a>
  89. </dt>
  90. <dt><code>OBJC_INCLUDE_PATH</code>
  91. <a name="index-OBJC_005fINCLUDE_005fPATH"></a>
  92. </dt>
  93. <dd><p>Each variable&rsquo;s value is a list of directories separated by a special
  94. character, much like <code>PATH</code>, in which to look for header files.
  95. The special character, <code>PATH_SEPARATOR</code>, is target-dependent and
  96. determined at GCC build time. For Microsoft Windows-based targets it is a
  97. semicolon, and for almost all other targets it is a colon.
  98. </p>
  99. <p><code>CPATH</code> specifies a list of directories to be searched as if
  100. specified with <samp>-I</samp>, but after any paths given with <samp>-I</samp>
  101. options on the command line. This environment variable is used
  102. regardless of which language is being preprocessed.
  103. </p>
  104. <p>The remaining environment variables apply only when preprocessing the
  105. particular language indicated. Each specifies a list of directories
  106. to be searched as if specified with <samp>-isystem</samp>, but after any
  107. paths given with <samp>-isystem</samp> options on the command line.
  108. </p>
  109. <p>In all these variables, an empty element instructs the compiler to
  110. search its current working directory. Empty elements can appear at the
  111. beginning or end of a path. For instance, if the value of
  112. <code>CPATH</code> is <code>:/special/include</code>, that has the same
  113. effect as &lsquo;<samp><span class="nolinebreak">-I.</span>&nbsp;<span class="nolinebreak">-I/special/include</span><!-- /@w --></samp>&rsquo;.
  114. </p>
  115. <p>See also <a href="Search-Path.html#Search-Path">Search Path</a>.
  116. </p>
  117. </dd>
  118. <dt><code>DEPENDENCIES_OUTPUT</code>
  119. <a name="index-DEPENDENCIES_005fOUTPUT"></a>
  120. </dt>
  121. <dd><a name="index-dependencies-for-make-as-output"></a>
  122. <p>If this variable is set, its value specifies how to output
  123. dependencies for Make based on the non-system header files processed
  124. by the compiler. System header files are ignored in the dependency
  125. output.
  126. </p>
  127. <p>The value of <code>DEPENDENCIES_OUTPUT</code> can be just a file name, in
  128. which case the Make rules are written to that file, guessing the target
  129. name from the source file name. Or the value can have the form
  130. &lsquo;<samp><var>file</var> <var>target</var></samp>&rsquo;, in which case the rules are written to
  131. file <var>file</var> using <var>target</var> as the target name.
  132. </p>
  133. <p>In other words, this environment variable is equivalent to combining
  134. the options <samp>-MM</samp> and <samp>-MF</samp>
  135. (see <a href="Invocation.html#Invocation">Invocation</a>),
  136. with an optional <samp>-MT</samp> switch too.
  137. </p>
  138. </dd>
  139. <dt><code>SUNPRO_DEPENDENCIES</code>
  140. <a name="index-SUNPRO_005fDEPENDENCIES"></a>
  141. </dt>
  142. <dd><a name="index-dependencies-for-make-as-output-1"></a>
  143. <p>This variable is the same as <code>DEPENDENCIES_OUTPUT</code> (see above),
  144. except that system header files are not ignored, so it implies
  145. <samp>-M</samp> rather than <samp>-MM</samp>. However, the dependence on the
  146. main input file is omitted.
  147. See <a href="Invocation.html#Invocation">Invocation</a>.
  148. </p>
  149. </dd>
  150. <dt><code>SOURCE_DATE_EPOCH</code>
  151. <a name="index-SOURCE_005fDATE_005fEPOCH"></a>
  152. </dt>
  153. <dd><p>If this variable is set, its value specifies a UNIX timestamp to be
  154. used in replacement of the current date and time in the <code>__DATE__</code>
  155. and <code>__TIME__</code> macros, so that the embedded timestamps become
  156. reproducible.
  157. </p>
  158. <p>The value of <code>SOURCE_DATE_EPOCH</code> must be a UNIX timestamp,
  159. defined as the number of seconds (excluding leap seconds) since
  160. 01 Jan 1970 00:00:00 represented in ASCII; identical to the output of
  161. &lsquo;<samp><code>date +%s</code></samp>&rsquo; on GNU/Linux and other systems that support the
  162. <code>%s</code> extension in the <code>date</code> command.
  163. </p>
  164. <p>The value should be a known timestamp such as the last modification
  165. time of the source or package and it should be set by the build
  166. process.
  167. </p>
  168. </dd>
  169. </dl>
  170. <hr>
  171. <div class="header">
  172. <p>
  173. Next: <a href="GNU-Free-Documentation-License.html#GNU-Free-Documentation-License" accesskey="n" rel="next">GNU Free Documentation License</a>, Previous: <a href="Invocation.html#Invocation" accesskey="p" rel="prev">Invocation</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index-of-Directives.html#Index-of-Directives" title="Index" rel="index">Index</a>]</p>
  174. </div>
  175. </body>
  176. </html>