[project @ 2005-01-28 14:41:23 by simonmar]
authorsimonmar <unknown>
Fri, 28 Jan 2005 14:41:23 +0000 (14:41 +0000)
committersimonmar <unknown>
Fri, 28 Jan 2005 14:41:23 +0000 (14:41 +0000)
x-ref INCLUDE pragmas

ghc/docs/users_guide/phases.xml

index cd687a7..b5d087f 100644 (file)
@@ -500,12 +500,20 @@ $ cat foo.hspp</screen>
 
     <para>If you are compiling with lots of foreign calls, you may
     need to tell the C&nbsp;compiler about some
-    <literal>&num;include</literal> files.  There is no real pretty
-    way to do this, but you can use this hack from the
-    command-line:</para>
+    <literal>&num;include</literal> files.  The Right Way to do this is to
+      add an <literal>INCLUDE</literal> pragma to the top of your source file
+      (<xref linkend="include-pragma" />):</para>
+
+<programlisting>{-# INCLUDE &lt;X/Xlib.h&gt; #-}</programlisting>
+      
+    <para>Sometimes this isn't convenient.  In those cases there's an
+      equivalent command-line option:</para>
 
 <screen>% ghc -c '-#include &lt;X/Xlib.h&gt;' Xstuff.lhs</screen>
 
+    <indexterm><primary><option>-#include</option></primary>
+    </indexterm>
+
   </sect2>
 
   <sect2 id="options-codegen">