Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

240 lines
11KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-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; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  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>Option file format (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Option file format (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Option file format (GNU Compiler Collection (GCC) Internals)">
  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="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Options.html#Options" rel="up" title="Options">
  30. <link href="Option-properties.html#Option-properties" rel="next" title="Option properties">
  31. <link href="Options.html#Options" rel="prev" title="Options">
  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="Option-file-format"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Option-properties.html#Option-properties" accesskey="n" rel="next">Option properties</a>, Up: <a href="Options.html#Options" accesskey="u" rel="up">Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Option-file-format-1"></a>
  68. <h3 class="section">8.1 Option file format</h3>
  69. <p>Option files are a simple list of records in which each field occupies
  70. its own line and in which the records themselves are separated by
  71. blank lines. Comments may appear on their own line anywhere within
  72. the file and are preceded by semicolons. Whitespace is allowed before
  73. the semicolon.
  74. </p>
  75. <p>The files can contain the following types of record:
  76. </p>
  77. <ul>
  78. <li> A language definition record. These records have two fields: the
  79. string &lsquo;<samp>Language</samp>&rsquo; and the name of the language. Once a language
  80. has been declared in this way, it can be used as an option property.
  81. See <a href="Option-properties.html#Option-properties">Option properties</a>.
  82. </li><li> A target specific save record to save additional information. These
  83. records have two fields: the string &lsquo;<samp>TargetSave</samp>&rsquo;, and a
  84. declaration type to go in the <code>cl_target_option</code> structure.
  85. </li><li> A variable record to define a variable used to store option
  86. information. These records have two fields: the string
  87. &lsquo;<samp>Variable</samp>&rsquo;, and a declaration of the type and name of the
  88. variable, optionally with an initializer (but without any trailing
  89. &lsquo;<samp>;</samp>&rsquo;). These records may be used for variables used for many
  90. options where declaring the initializer in a single option definition
  91. record, or duplicating it in many records, would be inappropriate, or
  92. for variables set in option handlers rather than referenced by
  93. <code>Var</code> properties.
  94. </li><li> A variable record to define a variable used to store option
  95. information. These records have two fields: the string
  96. &lsquo;<samp>TargetVariable</samp>&rsquo;, and a declaration of the type and name of the
  97. variable, optionally with an initializer (but without any trailing
  98. &lsquo;<samp>;</samp>&rsquo;). &lsquo;<samp>TargetVariable</samp>&rsquo; is a combination of &lsquo;<samp>Variable</samp>&rsquo;
  99. and &lsquo;<samp>TargetSave</samp>&rsquo; records in that the variable is defined in the
  100. <code>gcc_options</code> structure, but these variables are also stored in
  101. the <code>cl_target_option</code> structure. The variables are saved in the
  102. target save code and restored in the target restore code.
  103. </li><li> A variable record to record any additional files that the
  104. <samp>options.h</samp> file should include. This is useful to provide
  105. enumeration or structure definitions needed for target variables.
  106. These records have two fields: the string &lsquo;<samp>HeaderInclude</samp>&rsquo; and the
  107. name of the include file.
  108. </li><li> A variable record to record any additional files that the
  109. <samp>options.c</samp> or <samp>options-save.c</samp> file should include. This
  110. is useful to provide
  111. inline functions needed for target variables and/or <code>#ifdef</code>
  112. sequences to properly set up the initialization. These records have
  113. two fields: the string &lsquo;<samp>SourceInclude</samp>&rsquo; and the name of the
  114. include file.
  115. </li><li> An enumeration record to define a set of strings that may be used as
  116. arguments to an option or options. These records have three fields:
  117. the string &lsquo;<samp>Enum</samp>&rsquo;, a space-separated list of properties and help
  118. text used to describe the set of strings in <samp>--help</samp> output.
  119. Properties use the same format as option properties; the following are
  120. valid:
  121. <dl compact="compact">
  122. <dt><code>Name(<var>name</var>)</code></dt>
  123. <dd><p>This property is required; <var>name</var> must be a name (suitable for use
  124. in C identifiers) used to identify the set of strings in <code>Enum</code>
  125. option properties.
  126. </p>
  127. </dd>
  128. <dt><code>Type(<var>type</var>)</code></dt>
  129. <dd><p>This property is required; <var>type</var> is the C type for variables set
  130. by options using this enumeration together with <code>Var</code>.
  131. </p>
  132. </dd>
  133. <dt><code>UnknownError(<var>message</var>)</code></dt>
  134. <dd><p>The message <var>message</var> will be used as an error message if the
  135. argument is invalid; for enumerations without <code>UnknownError</code>, a
  136. generic error message is used. <var>message</var> should contain a single
  137. &lsquo;<samp>%qs</samp>&rsquo; format, which will be used to format the invalid argument.
  138. </p></dd>
  139. </dl>
  140. </li><li> An enumeration value record to define one of the strings in a set
  141. given in an &lsquo;<samp>Enum</samp>&rsquo; record. These records have two fields: the
  142. string &lsquo;<samp>EnumValue</samp>&rsquo; and a space-separated list of properties.
  143. Properties use the same format as option properties; the following are
  144. valid:
  145. <dl compact="compact">
  146. <dt><code>Enum(<var>name</var>)</code></dt>
  147. <dd><p>This property is required; <var>name</var> says which &lsquo;<samp>Enum</samp>&rsquo; record
  148. this &lsquo;<samp>EnumValue</samp>&rsquo; record corresponds to.
  149. </p>
  150. </dd>
  151. <dt><code>String(<var>string</var>)</code></dt>
  152. <dd><p>This property is required; <var>string</var> is the string option argument
  153. being described by this record.
  154. </p>
  155. </dd>
  156. <dt><code>Value(<var>value</var>)</code></dt>
  157. <dd><p>This property is required; it says what value (representable as
  158. <code>int</code>) should be used for the given string.
  159. </p>
  160. </dd>
  161. <dt><code>Canonical</code></dt>
  162. <dd><p>This property is optional. If present, it says the present string is
  163. the canonical one among all those with the given value. Other strings
  164. yielding that value will be mapped to this one so specs do not need to
  165. handle them.
  166. </p>
  167. </dd>
  168. <dt><code>DriverOnly</code></dt>
  169. <dd><p>This property is optional. If present, the present string will only
  170. be accepted by the driver. This is used for cases such as
  171. <samp>-march=native</samp> that are processed by the driver so that
  172. &lsquo;<samp>gcc -v</samp>&rsquo; shows how the options chosen depended on the system on
  173. which the compiler was run.
  174. </p></dd>
  175. </dl>
  176. </li><li> An option definition record. These records have the following fields:
  177. <ol>
  178. <li> the name of the option, with the leading &ldquo;-&rdquo; removed
  179. </li><li> a space-separated list of option properties (see <a href="Option-properties.html#Option-properties">Option properties</a>)
  180. </li><li> the help text to use for <samp>--help</samp> (omitted if the second field
  181. contains the <code>Undocumented</code> property).
  182. </li></ol>
  183. <p>By default, all options beginning with &ldquo;f&rdquo;, &ldquo;W&rdquo; or &ldquo;m&rdquo; are
  184. implicitly assumed to take a &ldquo;no-&rdquo; form. This form should not be
  185. listed separately. If an option beginning with one of these letters
  186. does not have a &ldquo;no-&rdquo; form, you can use the <code>RejectNegative</code>
  187. property to reject it.
  188. </p>
  189. <p>The help text is automatically line-wrapped before being displayed.
  190. Normally the name of the option is printed on the left-hand side of
  191. the output and the help text is printed on the right. However, if the
  192. help text contains a tab character, the text to the left of the tab is
  193. used instead of the option&rsquo;s name and the text to the right of the
  194. tab forms the help text. This allows you to elaborate on what type
  195. of argument the option takes.
  196. </p>
  197. </li><li> A target mask record. These records have one field of the form
  198. &lsquo;<samp>Mask(<var>x</var>)</samp>&rsquo;. The options-processing script will automatically
  199. allocate a bit in <code>target_flags</code> (see <a href="Run_002dtime-Target.html#Run_002dtime-Target">Run-time Target</a>) for
  200. each mask name <var>x</var> and set the macro <code>MASK_<var>x</var></code> to the
  201. appropriate bitmask. It will also declare a <code>TARGET_<var>x</var></code>
  202. macro that has the value 1 when bit <code>MASK_<var>x</var></code> is set and
  203. 0 otherwise.
  204. <p>They are primarily intended to declare target masks that are not
  205. associated with user options, either because these masks represent
  206. internal switches or because the options are not available on all
  207. configurations and yet the masks always need to be defined.
  208. </p></li></ul>
  209. <hr>
  210. <div class="header">
  211. <p>
  212. Next: <a href="Option-properties.html#Option-properties" accesskey="n" rel="next">Option properties</a>, Up: <a href="Options.html#Options" accesskey="u" rel="up">Options</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  213. </div>
  214. </body>
  215. </html>