Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
55d795e2
Commit
55d795e2
authored
Jan 11, 2005
by
simonmar
Browse files
[project @ 2005-01-11 16:06:56 by simonmar]
Rename OPTIONS to OPTIONS_GHC.
parent
13177436
Changes
2
Hide whitespace changes
Inline
Side-by-side
ghc/docs/users_guide/glasgow_exts.xml
View file @
55d795e2
...
...
@@ -4373,16 +4373,19 @@ key_function :: Int -> String -> (Bool, Double)
</sect2>
<sect2
id=
"options-pragma"
>
<title>
OPTIONS pragma
</title>
<indexterm><primary>
OPTIONS
</primary>
<title>
OPTIONS
_GHC
pragma
</title>
<indexterm><primary>
OPTIONS
_GHC
</primary>
</indexterm>
<indexterm><primary>
pragma
</primary><secondary>
OPTIONS
</secondary>
<indexterm><primary>
pragma
</primary><secondary>
OPTIONS
_GHC
</secondary>
</indexterm>
<para>
The
<literal>
OPTIONS
</literal>
pragma is used to specify
<para>
The
<literal>
OPTIONS
_GHC
</literal>
pragma is used to specify
additional options that are given to the compiler when compiling
this source file. See
<xref
linkend=
"source-file-options"
/>
for
details.
</para>
<para>
Previous versions of GHC accepted
<literal>
OPTIONS
</literal>
rather
than
<literal>
OPTIONS_GHC
</literal>
, but that is now deprecated.
</para>
</sect2>
<sect2
id=
"rules"
>
...
...
ghc/docs/users_guide/using.xml
View file @
55d795e2
...
...
@@ -51,35 +51,35 @@ ghc [argument...]
<option>
-fglasgow-exts
</option>
option. Rather than maintaining
the list of per-file options in a
<filename>
Makefile
</filename>
,
it is possible to do this directly in the source file using the
<literal>
OPTIONS
</literal>
pragma
<indexterm><primary>
OPTIONS
<literal>
OPTIONS
_GHC
</literal>
pragma
<indexterm><primary>
OPTIONS
_GHC
pragma
</primary></indexterm>
:
</para>
<programlisting>
{-# OPTIONS -fglasgow-exts #-}
{-# OPTIONS
_GHC
-fglasgow-exts #-}
module X where
...
</programlisting>
<para><literal>
OPTIONS
</literal>
pragmas are only looked for at
<para><literal>
OPTIONS
_GHC
</literal>
pragmas are only looked for at
the top of your source files, upto the first
(non-literate,non-empty) line not containing
<literal>
OPTIONS
</literal>
. Multiple
<literal>
OPTIONS
</literal>
<literal>
OPTIONS
_GHC
</literal>
. Multiple
<literal>
OPTIONS
_GHC
</literal>
pragmas are recognised. Note that your command shell does not
get to the source file options, they are just included literally
in the array of command-line arguments the compiler driver
maintains internally, so you'll be desperately disappointed if
you try to glob etc. inside
<literal>
OPTIONS
</literal>
.
</para>
you try to glob etc. inside
<literal>
OPTIONS
_GHC
</literal>
.
</para>
<para>
NOTE: the contents of OPTIONS are prepended to the
<para>
NOTE: the contents of OPTIONS
_GHC
are prepended to the
command-line options, so you
<emphasis>
do
</emphasis>
have the
ability to override OPTIONS settings via the command
ability to override OPTIONS
_GHC
settings via the command
line.
</para>
<para>
It is not recommended to move all the contents of your
Makefiles into your source files, but in some circumstances, the
<literal>
OPTIONS
</literal>
pragma is the Right Thing. (If you
<literal>
OPTIONS
_GHC
</literal>
pragma is the Right Thing. (If you
use
<option>
-keep-hc-file-too
</option>
and have OPTION flags in
your module, the OPTIONS will get put into the generated .hc
your module, the OPTIONS
_GHC
will get put into the generated .hc
file).
</para>
</sect2>
...
...
@@ -102,7 +102,7 @@ module X where
<para>
Each of GHC's command line options is classified as either
<firstterm>
static
</firstterm>
or
<firstterm>
dynamic
</firstterm>
.
A static flag may only be specified on the command line, whereas a
dynamic flag may also be given in an
<literal>
OPTIONS
</literal>
dynamic flag may also be given in an
<literal>
OPTIONS
_GHC
</literal>
pragma in a source file or set from the GHCi command-line with
<literal>
:set
</literal>
.
</para>
...
...
@@ -354,7 +354,7 @@ ghc ––make Main.hs
<option>
––
make
</option>
, but note that any options
you give on the command line will apply to all the source files
compiled, so if you want any options to apply to a single source
file only, you'll need to use an
<literal>
OPTIONS
</literal>
file only, you'll need to use an
<literal>
OPTIONS
_GHC
</literal>
pragma (see
<xref
linkend=
"source-file-options"
/>
).
</para>
<para>
If the program needs to be linked with additional objects
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment