<para>This section describes other program(s) which we distribute,
that help with the Great Haskell Programming Task.</para>
-<!-- comment: hasktags documentation loosely based on that for hstags -->
+<!-- comment: hasktags was dropped in GHC 6.12
<sect1 id ="hasktags">
<title>Ctags and Etags for Haskell: <command>hasktags</command></title>
</sect1>
+-->
<!-- comment: hstags doesn't work anymore
<sect1 id="hstags">
<literal>––cc=PROG</literal></term>
<listitem>
<para>The C compiler to use (default:
- <command>ghc</command>)</para>
+ <command>gcc</command>)</para>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry>
+ <term><literal>-k</literal> or
+ <literal>––keep-files</literal></term>
+ <listitem>
+ <para>Proceed as normal, but do not delete any intermediate files.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>-x</literal> or
+ <literal>––cross-compile</literal></term>
+ <listitem>
+ <para>Activate cross-compilation mode (see <xref linkend="hsc2hs_cross"/>).</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><literal>––cross-safe</literal></term>
+ <listitem>
+ <para>Restrict the .hsc directives to those supported by the
+ <literal>--cross-compile</literal> mode (see <xref linkend="hsc2hs_cross"/>).
+ This should be useful if your <literal>.hsc</literal> files
+ must be safely cross-compiled and you wish to keep
+ non-cross-compilable constructs from creeping into them.</para>
+ </listitem>
+ </varlistentry>
+
+
+ <varlistentry>
<term><literal>-?</literal> or <literal>––help</literal></term>
<listitem>
<para>Display a summary of the available flags and exit successfully.</para>
<literal>inline</literal>, <literal>struct</literal> or
<literal>typedef</literal> keyword must come just after
<literal>def</literal>.</para>
-
- <note><para>A <literal>foreign import</literal> of a
- C function may be inlined across a module boundary,
- in which case you must arrange for the importing
- module to <literal>#include</literal> the C header
- file generated by <command>hsc2hs</command> (see
- <xref linkend="glasgow-foreign-headers"/>).
- For this reason we avoid using <literal>#def</literal>
- in the libraries.</para></note>
</listitem>
</varlistentry>
</sect2>
+ <sect2 id="hsc2hs_cross">
+ <title>Cross-compilation</title>
+
+ <para><command>hsc2hs</command> normally operates by creating, compiling,
+ and running a C program. That approach doesn't work when cross-compiling --
+ in this case, the C compiler's generates code for the target machine,
+ not the host machine. For this situation, there's
+ a special mode <command>hsc2hs --cross-compile</command> which can generate
+ the .hs by extracting information from compilations only -- specifically,
+ whether or not compilation fails.
+ </para>
+
+ <para>Only a subset of <literal>.hsc</literal> syntax is supported by
+ <literal>--cross-compile</literal>. The following are unsupported:
+ <itemizedlist>
+ <listitem><literal>#{const_str}</literal></listitem>
+ <listitem><literal>#{let}</literal></listitem>
+ <listitem><literal>#{def}</literal></listitem>
+ <listitem>Custom constructs</listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
</sect1>
</chapter>
<!-- Emacs stuff:
;;; Local Variables: ***
- ;;; mode: xml ***
;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
;;; End: ***
-->