Tweak the start of the bin-dist docs in teh users guide
[ghc-hetmet.git] / docs / users_guide / installing.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <chapter id="installing-bin-distrib">
3   <title>Installing GHC</title>
4 <indexterm><primary>binary installations</primary></indexterm>
5 <indexterm><primary>installation, of binaries</primary></indexterm>
6
7 <para>
8 Installing from binary distributions is easiest, and recommended!
9 (Why binaries? Because GHC is a Haskell compiler written in Haskell,
10 so you've got to bootstrap it somehow.  We provide machine-generated
11 C-files-from-Haskell for this purpose, but it's really quite a pain to
12 use them.  If you must build GHC from its sources, using a
13 binary-distributed GHC to do so is a sensible way to proceed.)
14 </para>
15
16 <para>This guide is in several parts:</para>
17
18   <itemizedlist>
19     <listitem>
20       <para> Installing on Unix-a-likes (<xref
21       linkend="unix-a-likes"/>). </para>
22     </listitem>
23     <listitem>
24       <para> Installing on Windows (<xref
25       linkend="install-windows"/>).  </para>
26     </listitem>
27     <listitem>
28       <para> The layout of installed files (<xref
29       linkend="install-files"/>).  You don't need to know this to
30       install GHC, but it's useful if you are changing the
31       implementation.</para>
32     </listitem>
33   </itemizedlist>
34   
35   <sect1 id="unix-a-likes"><title>Installing on Unix-a-likes</title>
36
37     <sect2>
38       <title>When a platform-specific package is available</title>
39       
40       <para>Most common OSes provide GHC binaries packaged
41       using the native package format for the platform.  This is
42       likely to be by far the best way to install GHC for your
43       platform if one of these packages is available, since
44       dependencies will automatically be handled and the package
45       system normally provides a way to uninstall the package at a
46       later date.</para>
47
48       <para>Check the <ulink url="http://www.haskell.org/ghc/distribution_packages.html">distribution packages</ulink> page to see if there is a package available for your platform.</para>
49     </sect2>
50
51 <sect2>
52 <title>GHC binary distributions</title>
53
54 <para>
55 <indexterm><primary>bundles of binary stuff</primary></indexterm>
56 </para>
57
58 <para>
59 Binary distributions come in &ldquo;bundles,&rdquo; called
60 <literal>ghc-<replaceable>version</replaceable>-<replaceable>platform</replaceable>.tar.bz2</literal>. (See the <ulink url="http://hackage.haskell.org/trac/ghc/wiki/Building">building guide</ulink> for the definition of a platform.)  Suppose that you untar a binary-distribution bundle, thus:
61 </para>
62
63 <para>
64 <screen>
65 % cd /your/scratch/space
66 % bunnzip2 &#60; ghc-<replaceable>version</replaceable>-<replaceable>platform</replaceable>.tar.bz2 | tar xvf -</screen>
67 </para>
68
69 <para>
70 Then you should find a single directory,
71 <literal>ghc-<replaceable>version</replaceable></literal>, with the
72 following structure:
73 </para>
74
75 <para>
76 <indexterm><primary>binary distribution, layout</primary></indexterm>
77 <indexterm><primary>directory layout (binary distributions)</primary></indexterm>
78 <variablelist>
79
80 <varlistentry>
81 <term><literal>Makefile.in</literal></term>
82 <listitem>
83 <para>
84 the raw material from which the <literal>Makefile</literal>
85 will be made (<xref linkend="install"/>).
86 </para>
87 </listitem></varlistentry>
88 <varlistentry>
89 <term><literal>configure</literal></term>
90 <listitem>
91 <para>
92 the configuration script (<xref linkend="install"/>).
93 </para>
94 </listitem></varlistentry>
95 <varlistentry>
96 <term><literal>README</literal></term>
97 <listitem>
98 <para>
99 Contains this file summary.
100 </para>
101 </listitem></varlistentry>
102 <varlistentry>
103 <term><literal>INSTALL</literal></term>
104 <listitem>
105 <para>
106 Contains this description of how to install
107 the bundle.
108 </para>
109 </listitem></varlistentry>
110 <varlistentry>
111 <term><literal>ANNOUNCE</literal></term>
112 <listitem>
113 <para>
114 The announcement message for the bundle.
115 </para>
116 </listitem></varlistentry>
117 <varlistentry>
118 <term><literal>NEWS</literal></term>
119 <listitem>
120 <para>
121 release notes for the bundle&mdash;a longer version
122 of <literal>ANNOUNCE</literal>.  For GHC, the release notes are contained in the User
123 Guide and this file isn't present.
124 </para>
125 </listitem></varlistentry>
126 <varlistentry>
127             <term><literal>bin/<replaceable>platform</replaceable></literal></term>
128 <listitem>
129 <para>
130 contains platform-specific executable
131 files to be invoked directly by the user.  These are the files that
132 must end up in your path.
133 </para>
134 </listitem></varlistentry>
135 <varlistentry>
136 <term><literal>lib/<replaceable>platform</replaceable>/</literal></term>
137 <listitem>
138 <para>
139 contains platform-specific support
140 files for the installation.  Typically there is a subdirectory for
141 each <literal>fptools</literal> project, whose name is the name of the project with its
142 version number.  For example, for GHC there would be a sub-directory
143 <literal>ghc-x.xx</literal>/ where <literal>x.xx</literal> is the version number of GHC in the bundle.
144 </para>
145
146 <para>
147 These sub-directories have the following general structure:
148 </para>
149
150 <para>
151 <variablelist>
152
153 <varlistentry>
154 <term><literal>libHSstd.a</literal> etc:</term>
155 <listitem>
156 <para>
157 supporting library archives.
158 </para>
159 </listitem></varlistentry>
160 <varlistentry>
161 <term><literal>ghc-iface.prl</literal> etc:</term>
162 <listitem>
163 <para>
164 support scripts.
165 </para>
166 </listitem></varlistentry>
167 <varlistentry>
168 <term><literal>import/</literal></term>
169 <listitem>
170 <para>
171 <indexterm><primary>Interface files</primary></indexterm> (<literal>.hi</literal>) for the prelude.
172 </para>
173 </listitem></varlistentry>
174 <varlistentry>
175 <term><literal>include/</literal></term>
176 <listitem>
177 <para>
178 A few C <literal>&num;include</literal> files.
179 </para>
180 </listitem></varlistentry>
181 </variablelist>
182 </para>
183 </listitem></varlistentry>
184 <varlistentry>
185 <term><literal>share/</literal></term>
186 <listitem>
187 <para>
188 contains platform-independent support files
189 for the installation.  Again, there is a sub-directory for each
190 <literal>fptools</literal> project.
191 </para>
192 </listitem></varlistentry>
193 <varlistentry>
194 <term><literal>html/</literal></term>
195 <listitem>
196 <para>
197 contains HTML documentation files (one
198 sub-directory per project).
199 </para>
200 </listitem></varlistentry>
201 </variablelist>
202 </para>
203
204 <sect3 id="install">
205 <title>Installing</title>
206
207 <para>
208 OK, so let's assume that you have unpacked your chosen bundles. What
209 next? Well, you will at least need to run the
210 <literal>configure</literal><indexterm><primary>configure</primary></indexterm>
211 script by changing directory into the top-level directory for the
212 bundle and typing <literal>./configure</literal>.  That should convert
213 <literal>Makefile.in</literal> to <literal>Makefile</literal>.
214 </para>
215
216 <para>
217 <indexterm><primary>installing in-place</primary></indexterm>
218 <indexterm><primary>in-place installation</primary></indexterm>
219 You can now either start using the tools <emphasis>in-situ</emphasis> without going
220 through any installation process, just type <literal>make in-place</literal> to set the
221 tools up for this. You'll also want to add the path which <literal>make</literal> will
222 now echo to your <literal>PATH</literal> environment variable. This option is useful if
223 you simply want to try out the package and/or you don't have the
224 necessary privileges (or inclination) to properly install the tools
225 locally. Note that if you do decide to install the package `properly'
226 at a later date, you have to go through the installation steps that
227 follow.
228 </para>
229
230 <para>
231 To install a package, you'll have to do the following:
232 </para>
233
234 <para>
235
236 <orderedlist>
237 <listitem>
238
239 <para>
240  Edit the <literal>Makefile</literal> and check the settings of the following variables:
241
242 <indexterm><primary>directories, installation</primary></indexterm>
243 <indexterm><primary>installation directories</primary></indexterm>
244
245 <variablelist>
246
247 <varlistentry>
248 <term><literal>platform</literal></term>
249 <listitem>
250 <para>
251 the platform you are going to install for.
252 </para>
253 </listitem></varlistentry>
254 <varlistentry>
255 <term><literal>bindir</literal></term>
256 <listitem>
257 <para>
258 the directory in which to install user-invokable
259 binaries.
260 </para>
261 </listitem></varlistentry>
262 <varlistentry>
263 <term><literal>libdir</literal></term>
264 <listitem>
265 <para>
266 the directory in which to install
267 platform-dependent support files.
268 </para>
269 </listitem></varlistentry>
270 <varlistentry>
271 <term><literal>datadir</literal></term>
272 <listitem>
273 <para>
274 the directory in which to install
275 platform-independent support files.
276 </para>
277 </listitem></varlistentry>
278 <varlistentry>
279 <term><literal>infodir</literal></term>
280 <listitem>
281 <para>
282 the directory in which to install Emacs info
283 files.
284 </para>
285 </listitem></varlistentry>
286 <varlistentry>
287 <term><literal>htmldir</literal></term>
288 <listitem>
289 <para>
290 the directory in which to install HTML
291 documentation.
292 </para>
293 </listitem></varlistentry>
294 <varlistentry>
295 <term><literal>dvidir</literal></term>
296 <listitem>
297 <para>
298 the directory in which to install DVI
299 documentation.
300 </para>
301 </listitem></varlistentry>
302 </variablelist>
303
304 The values for these variables can be set through invocation of the
305 <command>configure</command><indexterm><primary>configure</primary></indexterm>
306 script that comes with the distribution, but doing an optical diff to
307 see if the values match your expectations is always a Good Idea.
308 </para>
309
310 <para>
311 <emphasis>Instead of running <command>configure</command>, it is
312 perfectly OK to copy <filename>Makefile.in</filename> to
313 <filename>Makefile</filename> and set all these variables directly
314 yourself.  But do it right!</emphasis>
315 </para>
316
317 </listitem>
318 <listitem>
319
320 <para>
321 Run <literal>make install</literal>.  This <emphasis>
322 should</emphasis> work with ordinary Unix
323 <literal>make</literal>&mdash;no need for fancy stuff like GNU
324 <literal>make</literal>.
325
326 </para>
327 </listitem>
328 <listitem>
329
330 <para>
331 <literal>rehash</literal> (t?csh or zsh users), so your shell will see the new
332 stuff in your bin directory.
333
334 </para>
335 </listitem>
336 <listitem>
337
338 <para>
339  Once done, test your &ldquo;installation&rdquo; as suggested in 
340 <xref linkend="GHC-test"/>.  Be sure to use a <literal>-v</literal>
341 option, so you can see exactly what pathnames it's using.
342
343 If things don't work as expected, check the list of known pitfalls in
344 the <ulink url="http://hackage.haskell.org/trac/ghc/wiki/Building">building guide</ulink>.
345 </para>
346 </listitem>
347
348 </orderedlist>
349
350 </para>
351
352 <para>
353 <indexterm><primary>link, installed as ghc</primary></indexterm>
354 When installing the user-invokable binaries, this installation
355 procedure will install GHC as <literal>ghc-x.xx</literal> where <literal>x.xx</literal> is the version
356 number of GHC.  It will also make a link (in the binary installation
357 directory) from <literal>ghc</literal> to <literal>ghc-x.xx</literal>.  If you install multiple versions
358 of GHC then the last one &ldquo;wins&rdquo;, and &ldquo;<literal>ghc</literal>&rdquo; will invoke the last
359 one installed.  You can change this manually if you want.  But
360 regardless, <literal>ghc-x.xx</literal> should always invoke GHC version <literal>x.xx</literal>.
361 </para>
362
363 </sect3>
364
365
366 <sect3>
367 <title>What bundles there are</title>
368
369 <para>
370 <indexterm><primary>bundles, binary</primary></indexterm> There are
371 plenty of &ldquo;non-basic&rdquo; GHC bundles.  The files for them are
372 called
373 <literal>ghc-x.xx-<replaceable>bundle</replaceable>-<replaceable>platform</replaceable>.tar.gz</literal>,
374 where the <replaceable>platform</replaceable> is as above, and
375 <replaceable>bundle</replaceable> is one of these:
376 </para>
377
378 <para>
379 <variablelist>
380
381 <varlistentry>
382 <term><literal>prof</literal>:</term>
383 <listitem>
384 <para>
385 Profiling with cost-centres.  You probably want this.
386 <indexterm><primary>profiling bundles</primary></indexterm>
387 <indexterm><primary>bundles, profiling</primary></indexterm>
388 </para>
389 </listitem></varlistentry>
390 <varlistentry>
391 <term><literal>par</literal>:</term>
392 <listitem>
393 <para>
394 Parallel Haskell features (sits on top of PVM).
395 You'll want this if you're into that kind of thing.
396 <indexterm><primary>parallel bundles</primary></indexterm>
397 <indexterm><primary>bundles, parallel</primary></indexterm>
398 </para>
399 </listitem></varlistentry>
400 <varlistentry>
401 <term><literal>gran</literal>:</term>
402 <listitem>
403 <para>
404 The &ldquo;GranSim&rdquo; parallel-Haskell simulator
405 (hmm&hellip; mainly for implementors).
406 <indexterm><primary>bundles, gransim</primary></indexterm>
407 <indexterm><primary>gransim bundles</primary></indexterm>
408 </para>
409 </listitem></varlistentry>
410 <varlistentry>
411 <term><literal>ticky</literal>:</term>
412 <listitem>
413 <para>
414 &ldquo;Ticky-ticky&rdquo; profiling; very detailed
415 information about &ldquo;what happened when I ran this program&rdquo;&mdash;really
416 for implementors.
417 <indexterm><primary>bundles, ticky-ticky</primary></indexterm>
418 <indexterm><primary>ticky-ticky bundles</primary></indexterm>
419 </para>
420 </listitem></varlistentry>
421 </variablelist>
422 </para>
423
424 <para>
425 One likely scenario is that you will grab <emphasis>two</emphasis>
426 binary bundles&mdash;basic, and profiling.  We don't usually make the
427 rest, although you can build them yourself from a source distribution.
428 </para>
429
430 <para>The various GHC bundles are designed to be unpacked into the
431 same directory; then installing as per the directions above will
432 install the whole lot in one go.  Note: you <emphasis>must</emphasis>
433 at least have the basic GHC binary distribution bundle, these extra
434 bundles won't install on their own.</para>
435
436 </sect3>
437
438 <sect3 id="GHC-test">
439 <title>Testing that GHC seems to be working
440 </title>
441
442 <para>
443 <indexterm><primary>testing a new GHC</primary></indexterm>
444 </para>
445
446 <para>
447 The way to do this is, of course, to compile and run <emphasis>this</emphasis> program
448 (in a file <literal>Main.hs</literal>):
449 </para>
450
451 <para>
452
453 <programlisting>
454 main = putStr "Hello, world!\n"
455 </programlisting>
456
457 </para>
458
459 <para>
460 Compile the program, using the <literal>-v</literal> (verbose) flag to verify that
461 libraries, etc., are being found properly:
462
463 <screen>
464 % ghc -v -o hello Main.hs</screen>
465
466 </para>
467
468 <para>
469 Now run it:
470
471 <screen>
472 % ./hello
473 Hello, world!</screen>
474
475 </para>
476
477 <para>
478 Some simple-but-profitable tests are to compile and run the notorious
479 <literal>nfib</literal><indexterm><primary>nfib</primary></indexterm> program, using different numeric types.  Start with
480 <literal>nfib :: Int -&gt; Int</literal>, and then try <literal>Integer</literal>, <literal>Float</literal>, <literal>Double</literal>,
481 <literal>Rational</literal> and perhaps the overloaded version.  Code for this is
482 distributed in <literal>ghc/misc/examples/nfib/</literal> in a source distribution.
483 </para>
484
485 <para>For more information on how to &ldquo;drive&rdquo; GHC, read
486 on...</para>
487
488 </sect3>
489
490 </sect2>
491
492 </sect1>
493
494
495 <sect1 id="install-windows"><title>Installing on Windows</title>
496
497 <para>
498 Getting the Glasgow Haskell Compiler (post 5.02) to run on Windows platforms is
499 a snap: the installer does everything you need.  
500 </para>
501
502 <sect2><title>Installing GHC on Windows</title>
503
504 <para>
505 To install GHC, use the following steps:
506 </para>
507 <itemizedlist>
508 <listitem><para>Download the installer
509 from the
510 <ulink
511 url="http://www.haskell.org/ghc/download.html">GHC download page</ulink>.
512 </para></listitem>
513
514 <listitem><para>Run the installer.
515 On Windows, all of GHC's files are installed in a single directory.
516 You can override it, but by default this directory is
517 <filename>c:/ghc/<replaceable>ghc-version</replaceable></filename>.
518 The executable binary for GHC will be installed in the
519 <filename>bin/</filename> sub-directory of the installation directory.
520 If you want to invoke GHC from a command line, add this
521 to your PATH environment variable.
522 </para>
523 <para>
524 When installation is complete, you should find GHCi and the GHC
525 documentation are available in your Start menu under
526 "Start/All Programs/GHC/<replaceable>ghc-version</replaceable>".
527 </para>
528 </listitem>
529
530 <listitem><para>
531 GHC needs a directory in which to create, and later delete, temporary files.
532 It uses the standard Windows procedure <literal>GetTempPath()</literal> to
533 find a suitable directory.  This procedure returns:
534 <itemizedlist>
535 <listitem><para>The path in environment variable TMP, 
536 if TMP is set.</para></listitem>
537 <listitem><para>Otherwise, the path in environment variable TEMP, 
538 if TEMP is set.</para></listitem>
539 <listitem><para>Otherwise, there is a per-user default which varies
540 between versions of Windows. On NT and XP-ish versions, it might 
541 be:
542 <filename>c:\Documents and Settings\&lt;username&gt;\Local Settings\Temp</filename>
543 </para></listitem>
544 </itemizedlist>
545 The main point is that if you don't do anything GHC will work fine;
546 but if you want to control where the directory is, you can do so by
547 setting TMP or TEMP.
548 </para></listitem>
549
550 <listitem>
551 <para>
552 To test the fruits of your labour, try now to compile a simple
553 Haskell program:
554 </para>
555
556 <screen>
557 bash$ cat main.hs
558 module Main(main) where
559
560 main = putStrLn "Hello, world!"
561 bash$ ghc -o main main.hs
562 ..
563 bash$ ./main
564 Hello, world!
565 bash$</screen>
566 </listitem>
567 </itemizedlist>
568
569 <para>
570 You do <emphasis>not</emphasis> need the Cygwin toolchain, or anything
571 else, to install and run GHC.
572 </para>
573 <para>
574 An installation of GHC requires about 340M of disk space.
575 To run GHC comfortably, your machine should have at least
576 64M of memory.
577 </para>
578 </sect2>
579
580 <sect2><title>Moving GHC around</title>
581 <para>
582 Once GHC is installed, you can freely move the entire GHC tree just by copying
583 the <filename>c:/ghc/<replaceable>ghc-version</replaceable></filename>
584 directory. (You will need to fix up 
585 the links in "Start/All Programs/GHC/<replaceable>ghc-version</replaceable>"
586 if you do this.)
587 </para>
588 <para>
589 It is OK to put GHC tree in a directory whose path involves spaces.  However,
590 don't do this if you use want to use GHC with the Cygwin tools, 
591 because Cygwin can get confused when this happens.
592 We havn't quite got to the bottom of this, but so far as we know it's not 
593 a problem with GHC itself.  Nevertheless, just to keep life simple we usually
594 put GHC in a place with a space-free path.
595 </para>
596 </sect2>
597
598 <sect2 id="winfaq">
599 <title>Installing ghc-win32 FAQ</title>
600
601       <variablelist>
602         <varlistentry>
603           <term>I'm having trouble with symlinks.</term>
604           <listitem>
605             <para>Symlinks only work under Cygwin (<xref linkend="install" />),
606           so binaries not linked to the Cygwin
607               DLL, in particular those built for Mingwin, will not work with
608               symlinks.</para>
609           </listitem>
610         </varlistentry>
611
612         <varlistentry>
613           <term>I'm getting &ldquo;permission denied&rdquo; messages from the
614             <command>rm</command> or <command>mv</command>.</term>
615           <listitem>
616             <para>This can have various causes: trying to rename a directory
617               when an Explorer window is open on it tends to fail. Closing the
618               window generally cures the problem, but sometimes its cause is
619               more mysterious, and logging off and back on or rebooting may be
620               the quickest cure.</para>
621           </listitem>
622         </varlistentry>
623       </variablelist>
624 </sect2>
625
626 </sect1>
627
628
629 <sect1 id="install-files"><title>The layout of installed files</title>
630
631 <para>
632 This section describes what files get installed where.  You don't need to know it
633 if you are simply installing GHC, but it is vital information if you are changing
634 the implementation.
635 </para>
636 <para> GHC is installed in two directory trees:</para>
637 <variablelist>
638 <varlistentry>
639 <term>Library directory,</term>
640 <listitem> <para> known as <filename>$(libdir)</filename>, holds all the 
641 support files needed to run GHC.  On Unix, this 
642 directory is usually something like <filename>/usr/lib/ghc/ghc-5.02</filename>. </para>
643 </listitem>
644 </varlistentry>
645 <varlistentry>
646 <term>Binary directory</term>
647 <listitem> <para> known as <filename>$(bindir)</filename>, holds executables that 
648 the user is expected to invoke.
649 Notably, it contains
650 <filename>ghc</filename> and <filename>ghci</filename>.  On Unix, this directory
651 can be anywhere, but is typically something like <filename>/usr/local/bin</filename>.  On Windows,
652 however, this directory <emphasis>must be</emphasis> <filename>$(libdir)/bin</filename>.
653 </para>
654 </listitem>
655 </varlistentry>
656 </variablelist>
657
658 <para>
659 When GHC runs, it must know where its library directory is.
660 It finds this out in one of two ways:
661 </para>
662 <itemizedlist>
663 <listitem>
664 <para>
665 <filename>$(libdir)</filename> is passed to GHC using the <option>-B</option> flag.
666 On Unix (but not Windows), the installed <filename>ghc</filename> is just a one-line 
667 shell script that invokes the real GHC, passing a suitable <option>-B</option> flag. 
668 [All the user-supplied flags
669 follow, and a later <option>-B</option> flag overrides an earlier one, so a user-supplied
670 one wins.]
671 </para>
672 </listitem>
673 <listitem>
674 <para> On Windows (but not Unix), if no <option>-B</option> flag is given, GHC uses a system
675 call to find the directory in which the running GHC executable lives, and derives 
676 <filename>$(libdir)</filename> from that. [Unix lacks such a system call.]
677 That is why <filename>$(bindir)</filename> must be <filename>$(libdir)/bin</filename>.
678 </para>
679 </listitem>
680 </itemizedlist>
681
682 <sect2> <title>The binary directory</title>
683
684 <para>The binary directory, <filename>$(bindir)</filename> contains user-visible
685 executables, notably <filename>ghc</filename> and <filename>ghci</filename>.
686 You should add it to your <literal>$PATH</literal>
687 </para>
688
689 <para>On Unix, the user-invokable <filename>ghc</filename> invokes <filename>$(libdir)/ghc-<replaceable>version</replaceable></filename>,
690 passing a suitable <option>-B</option> flag to tell <filename>ghc-<replaceable>version</replaceable></filename> where
691 <filename>$(libdir)</filename> is.
692 Similarly <filename>ghci</filename>, except the extra flag <literal>--interactive</literal> is passed.
693 </para>
694
695 <para>On Win32, the user-invokable <filename>ghc</filename> binary 
696 is the Real Thing (no intervening
697 shell scripts or <filename>.bat</filename> files). 
698 Reason: we sometimes invoke GHC with very long command lines,
699 and <filename>cmd.exe</filename> (which executes <filename>.bat</filename> files)
700 truncates them.  Similarly <filename>ghci</filename> is a C wrapper program that invokes <filename>ghc --interactive</filename>
701 (passing on all other arguments), not a <filename>.bat</filename> file.
702 </para>
703
704
705 </sect2>
706
707 <sect2> <title>The library directory</title>
708
709 <para>The layout of the library directory, <filename>$(libdir)</filename> is almost identical on
710 Windows and Unix, as follows.  Differences between Windows and Unix
711 are noted thus <literal>[Win32 only]</literal> and are commented below.</para>
712
713 <programlisting>
714   $(libdir)/
715     package.conf           GHC package configuration
716     ghc-usage.txt          Message displayed by ghc &ndash;&ndash;help
717     
718     bin/                   [Win32 only]  User-visible binaries
719          ghc.exe
720          ghci.exe
721
722     unlit                  Remove literate markup
723     
724     touchy.exe             [Win32 only]
725     perl.exe               [Win32 only]
726     gcc.exe                [Win32 only]
727    
728     ghc-x.xx               GHC executable [Unix only]
729    
730     ghc-split              Asm code splitter
731     ghc-asm                Asm code mangler
732
733     gcc-lib/               [Win32 only] Support files for gcc
734         specs              gcc configuration
735  
736         cpp0.exe           gcc support binaries
737         as.exe
738         ld.exe
739
740         crt0.o              Standard
741            ..etc..          binaries
742         
743         libmingw32.a        Standard
744            ..etc..          libraries
745
746         *.h                 Include files
747
748     imports/                GHC interface files
749         std/*.hi              'std' library
750         lang/*.hi             'lang' library
751         ..etc..
752
753     include/                 C header files
754         StgMacros.h           GHC-specific
755         ..etc...              header files
756
757         mingw/*.h            [Win32 only] Mingwin header files
758
759     libHSrts.a              GHC library archives
760     libHSstd.a
761     libHSlang.a
762       ..etc..
763
764     HSstd1.o                GHC library linkables
765     HSstd2.o                  (used by ghci, which does
766     HSlang.o                  not grok .a files yet)
767 </programlisting>
768
769 <para>Note that:
770 <itemizedlist>
771
772         <listitem>
773           <para><filename>$(libdir)</filename> also contains support
774           binaries.  These are <emphasis>not</emphasis> expected to be
775           on the user's <filename>PATH</filename>, but and are invoked
776           directly by GHC.  In the Makefile system, this directory is
777           also called <filename>$(libexecdir)</filename>, but
778           <emphasis>you are not free to change it</emphasis>.  It must
779           be the same as <filename>$(libdir)</filename>.</para>
780         </listitem>
781
782 <listitem>
783 <para>We distribute <filename>gcc</filename> with the Win32 distribution of GHC, so that users
784 don't need to install <filename>gcc</filename>, nor need to care about which version it is.
785 All <filename>gcc</filename>'s support files are kept in  <filename>$(libdir)/gcc-lib/</filename>.
786 </para> 
787 </listitem>
788
789 <listitem>
790 <para>Similarly, we distribute <filename>perl</filename> and a <filename>touch</filename> 
791 replacement (<filename>touchy.exe</filename>)
792 with the Win32 distribution of GHC. </para> 
793 </listitem>
794
795         <listitem>
796           <para>The support programs <filename>ghc-split</filename>
797           and <filename>ghc-asm</filename> are Perl scripts.  The
798           first line says <literal>#!/bin/perl</literal>; on Unix, the
799           script is indeed invoked as a shell script, which invokes
800           Perl; on Windows, GHC invokes
801           <filename>$(libdir)/perl.exe</filename> directly, which
802           treats the <literal>#!/bin/perl</literal> as a comment.
803           Reason: on Windows we want to invoke the Perl distributed
804           with GHC, rather than assume some installed one.  </para>
805         </listitem>
806 </itemizedlist>
807 </para>
808
809 </sect2>
810
811 </sect1>
812
813 </chapter>
814
815 <!-- Emacs stuff:
816      ;;; Local Variables: ***
817      ;;; mode: xml ***
818      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
819      ;;; End: ***
820  -->