<sect2 id="replacing-phases">
<title>Replacing the program for one or more phases</title>
<indexterm><primary>phases, changing</primary></indexterm>
<sect2 id="replacing-phases">
<title>Replacing the program for one or more phases</title>
<indexterm><primary>phases, changing</primary></indexterm>
<para>You may specify that a different program be used for one
of the phases of the compilation system, in place of whatever
the <command>ghc</command> has wired into it. For example, you
<para>You may specify that a different program be used for one
of the phases of the compilation system, in place of whatever
the <command>ghc</command> has wired into it. For example, you
<option>-pgms</option> <replaceable>cmd</replaceable>
<indexterm><primary><option>-pgms</option></primary></indexterm>
</term>
<option>-pgms</option> <replaceable>cmd</replaceable>
<indexterm><primary><option>-pgms</option></primary></indexterm>
</term>
<para>don't work with <option>-cpp</option>;
<filename>/usr/bin/cpp</filename> elides the backslash-newline
pairs.</para>
<para>don't work with <option>-cpp</option>;
<filename>/usr/bin/cpp</filename> elides the backslash-newline
pairs.</para>
<indexterm><primary>pre-processing: custom</primary></indexterm>
<indexterm><primary>Pre-processor options</primary></indexterm>
<indexterm><primary>pre-processing: custom</primary></indexterm>
<indexterm><primary>Pre-processor options</primary></indexterm>
However, if all the modules are otherwise up to date, you may need to force
recompilation both of the module where the new "main" is, and of the
module where the "main" function used to be;
However, if all the modules are otherwise up to date, you may need to force
recompilation both of the module where the new "main" is, and of the
module where the "main" function used to be;
enough to figure out that they both need recompiling. You can
force recompilation by removing the object file, or by using the
<option>-fforce-recomp</option> flag.
enough to figure out that they both need recompiling. You can
force recompilation by removing the object file, or by using the
<option>-fforce-recomp</option> flag.
<listitem>
<para>Parallelism<indexterm><primary>parallelism</primary></indexterm> on a multiprocessor<indexterm><primary>multiprocessor</primary></indexterm><indexterm><primary>SMP</primary></indexterm> or multicore<indexterm><primary>multicore</primary></indexterm>
machine. See <xref linkend="using-smp" />.</para>
<listitem>
<para>Parallelism<indexterm><primary>parallelism</primary></indexterm> on a multiprocessor<indexterm><primary>multiprocessor</primary></indexterm><indexterm><primary>SMP</primary></indexterm> or multicore<indexterm><primary>multicore</primary></indexterm>
machine. See <xref linkend="using-smp" />.</para>
<option>-with-rtsopts="-H128m"</option> sets the default heap size to 128MB.
This will always be the default heap size for this program, unless the user overrides it.
(Depending on the setting of the <option>-rtsopts</option> option, the user might
<option>-with-rtsopts="-H128m"</option> sets the default heap size to 128MB.
This will always be the default heap size for this program, unless the user overrides it.
(Depending on the setting of the <option>-rtsopts</option> option, the user might
<listitem>
<para>On Windows, GHC normally generates a
<firstterm>manifest</firstterm><indexterm><primary>manifest</primary>
<listitem>
<para>On Windows, GHC normally generates a
<firstterm>manifest</firstterm><indexterm><primary>manifest</primary>
manifest is placed in the file
<literal><replaceable>prog</replaceable>.exe.manifest</literal>
where <replaceable>prog.exe</replaceable> is the name of the
manifest is placed in the file
<literal><replaceable>prog</replaceable>.exe.manifest</literal>
where <replaceable>prog.exe</replaceable> is the name of the
system using the security control panel, but GHC by default
generates binaries that don't depend on the user having disabled
installer detection.</para>
system using the security control panel, but GHC by default
generates binaries that don't depend on the user having disabled
installer detection.</para>
<para>The <option>-fno-gen-manifest</option> disables generation of
the manifest file. One reason to do this would be if you had
a manifest file of your own, for example.</para>
<para>The <option>-fno-gen-manifest</option> disables generation of
the manifest file. One reason to do this would be if you had
a manifest file of your own, for example.</para>
</indexterm>; to see exactly what GHC does to embed the manifest,
use the <option>-v</option> flag. A GHC installation comes with
its own copy of <literal>windres</literal> for this reason.</para>
</indexterm>; to see exactly what GHC does to embed the manifest,
use the <option>-v</option> flag. A GHC installation comes with
its own copy of <literal>windres</literal> for this reason.</para>
disk-space cost of creating this import library, which can be substantial - it
might require as much space as the code itself, as Haskell DLLs tend to export
lots of symbols.</para>
disk-space cost of creating this import library, which can be substantial - it
might require as much space as the code itself, as Haskell DLLs tend to export
lots of symbols.</para>
<para>As long as you are happy to only be able to link to the DLL using
<literal>GetProcAddress</literal> and friends, you can supply the
<option>-fno-shared-implib</option> flag to disable the creation of the import
<para>As long as you are happy to only be able to link to the DLL using
<literal>GetProcAddress</literal> and friends, you can supply the
<option>-fno-shared-implib</option> flag to disable the creation of the import