From: simonmar Date: Tue, 25 Mar 2003 17:22:27 +0000 (+0000) Subject: [project @ 2003-03-25 17:22:27 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1037 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c1d9adc69d5afff2b7bf30b7b1b245f920b2e116;p=ghc-hetmet.git [project @ 2003-03-25 17:22:27 by simonmar] Update ghc-pkg documentation w.r.t. multiple config files, and add documentation for 'auto' packages. --- diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml index bfe5dcc..fe54098 100644 --- a/ghc/docs/users_guide/packages.sgml +++ b/ghc/docs/users_guide/packages.sgml @@ -25,8 +25,16 @@ packages using - 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,27 @@ 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. @@ -335,6 +368,7 @@ Package { name = "mypkg", + auto = True, import_dirs = ["${installdir}/imports/mypkg"], source_dirs = [], library_dirs = ["${installdir}"], @@ -366,6 +400,21 @@ + 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_dirs import_dirs package specification