From: simonmar Date: Mon, 13 Aug 2001 16:32:43 +0000 (+0000) Subject: [project @ 2001-08-13 16:32:43 by simonmar] X-Git-Tag: Approximately_9120_patches~1270 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=fa92604ad897cfd18cfea8be1b0b58334adb1e4f;p=ghc-hetmet.git [project @ 2001-08-13 16:32:43 by simonmar] Document -package-conf and ghc-pkg --config-file --- diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml index db33b77..e2b53e3 100644 --- a/ghc/docs/users_guide/packages.sgml +++ b/ghc/docs/users_guide/packages.sgml @@ -14,8 +14,8 @@ layer over a C library. GHC comes with several packages (see ), and packages can be added/removed from an - existing GHC installation, using the supplied + linkend="book-hslibs">), and packages can be added to or removed + from an existing GHC installation, using the supplied ghc-pkgghc-pkg tool, described in . @@ -50,6 +50,39 @@ automatically get -package lang too. + + Maintaining a local set of packages + + When GHC starts up, it automatically reads the default set + of packages from a configuration file, normally named + package.conf in your GHC installation + directory. + + You can load in additional package configuration files + using the option: + + + + + + + + Read in the package configuration file + file in addition to the system + default file. This allows the user to have a local set of + packages in addition to the system-wide ones. + + + + + To create your own package configuration file, just create + a new file and put the string + [] in it. Packages can be + added to the new configuration file using the + ghc-pkg tool, described in . + + Building a package from Haskell source packages @@ -142,14 +175,46 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a packages management - GHC uses a package configuration file, called - packages.conf, which can be found in your GHC - install directory. This file isn't intended to be edited - directly, instead packages can be added or removed using GHC's - package management tool, ghc-pkg. + The ghc-pkg tool allows packages to be + added or removed from a package configuration file. By default, + the system-wide configuration file is used, but alternatively + packages can be added or removed from a user-specified + configuration file using the + option. An empty package configuration file consists of the + string []. + + The ghc-pkg program accepts the + following options: + + + + + + Reads a package specification (see below) on stdin, + and adds it to the database of installed packages. The + package specification must be a package that isn't already + installed. + + + + + + + + + + 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. + + + + @@ -176,19 +241,6 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a - - - - - - Reads a package specification (see below) on stdin, - and adds it to the database of installed packages. The - package specification must be a package that isn't already - installed. - - - - @@ -200,11 +252,11 @@ ld -r --whole-archive -o HSfoo.o libHSfoo.a - In both cases, the old package configuration file is saved - in packages.conf.old in your GHC install - directory, so in an emergency you can always copy this file into - package.conf to restore the old - settings. + When modifying the configuration file + file, a copy of the original file is + saved in file.old, + so in an emergency you can always restore the old settings by + copying the old file back again. A package specification looks like this: