X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fpackages.sgml;h=e6f0b7b2b440109eb8a1c80bdce5e48c116bbdab;hb=af76ab6142576b7cc4af11c4883c387e96b18f73;hp=769a7cd4fa509d15104862de3318164869f13870;hpb=551edc4344bb9848e367034c44bee0646b394be2;p=ghc-hetmet.git
diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml
index 769a7cd..e6f0b7b 100644
--- a/ghc/docs/users_guide/packages.sgml
+++ b/ghc/docs/users_guide/packages.sgml
@@ -25,8 +25,16 @@
packagesusing
- To use a package, add the -package flag
- to the GHC command line:
+ Some packages are automatically available: you don't need
+ to specify any extra flags to use them (except in certain
+ circumstances; see below). All the packages which contain
+ hierarchical libraries fall into this category.
+
+ Some other packages are not
+ automatically available: those are normally the packages
+ containing old non-hierarchical libraries. To gain access to a
+ non-auto package, use the command-line
+ flag:
@@ -42,6 +50,20 @@
+ There's one case where you need to use the
+ option even for auto packages: when
+ linking a program in batch modeThis is because
+ GHC can't figure out from the object files which packages are
+ required; in mode and in
+ GHCi the compiler has more information available to figure out
+ the package dependencies. We might try to lift this restriction
+ in the future.. For example, to link a
+ program consisting of objects Foo.o and
+ Main.o, where we made use of the
+ network package:
+
+$ ghc -o myprog Foo.o Main.o -package network
+
Some packages depend on other packages, for example the
text package makes use of some of the modules
in the lang package. The package system
@@ -254,11 +276,18 @@
- Use file instead of the
- default package configuration file. This, in conjunction
- with GHC's option, allows
- a user to have a local set of packages in addition to the
- system-wide installed set.
+ Use file as an additional
+ package configuration file. This is used to modify
+ configuration files for use with GHC's
+ option.
+
+ There may be any number of configuration files named
+ on the command line; files mentioned later on the
+ command-line override those mentioned earlier. The
+ last configuration file mentioned on
+ the command-line is the only one that is actually modified
+ by ghc-pkg.
+
@@ -268,23 +297,44 @@
This option displays the list of currently installed
- packages.
+ packages, including those in extra configuration files
+ specified with the
+ option.
$ ghc-pkg ––list-packages
- gmp, rts, std, lang, concurrent, data, net, posix, text, util
+ /usr/local/lib/ghc-5.05/package.conf:
+ hdirect, readline, lang, concurrent, posix, util, data, text, net,
+ hssource, rts, haskell98, network, haskell-src, unix, base
Note that your GHC installation might have a
slightly different set of packages installed.
- The gmp and
- rts packages are always present, and
- represent the multi-precision integer and runtime system
- libraries respectively. The std
- package contains the Haskell prelude and standard
- libraries. The rest of the packages are optional
- libraries.
+ The rts package is always
+ present, and represents the runtime system library. The
+ base package contains the Haskell
+ prelude and basic hierarchical libraries, and the
+ haskell98 package contains the Haskell
+ 98 standard libraries. The rest of the packages are
+ optional libraries.
+
+
+
+
+
+
+
+
+ Displays the list of packages installed in the
+ topmost configuration file only: that will be the
+ configuration file specified using on
+ the command line, or the system configuration file
+ otherwise.
+
+ This option may be more convenient than
+ when the output needs to be parsed by
+ a script.
@@ -335,6 +385,7 @@
Package {
name = "mypkg",
+ auto = True,
import_dirs = ["${installdir}/imports/mypkg"],
source_dirs = [],
library_dirs = ["${installdir}"],
@@ -366,12 +417,34 @@
+ auto
+ auto
+ package specification
+
+
+ Set to True if the package should
+ be automatically available (see ). This is normally set to
+ True for packages which contain
+ hierarchical libraries, because in that case there is no
+ danger of polluting the module namespace.
+
+
+
+ import_dirsimport_dirspackage specificationA list of directories containing interface files
(.hi files) for this package.
+
+ If the package contains profiling libraries, then
+ the interface files for those library modules should have
+ the suffix .p_hi. So the package can
+ contain both normal and profiling versions of the same
+ library without conflict (see also
+ library_dirs below).
@@ -545,8 +618,9 @@
extra_ld_optspackage specification
- Extra arguments to be added to the gcc command line
- (for linking) when this package is being used.
+ Extra arguments to be added to the
+ gcc command line (for linking) when
+ this package is being used.