From: simonmar Date: Thu, 15 Mar 2001 16:16:05 +0000 (+0000) Subject: [project @ 2001-03-15 16:16:05 by simonmar] X-Git-Tag: Approximately_9120_patches~2395 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=cf136928e058162eaeed7273c135ec08edc92f35;p=ghc-hetmet.git [project @ 2001-03-15 16:16:05 by simonmar] - document new ghc-pkg tool - document source_dirs field --- diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml index 0228996..4eeff01 100644 --- a/ghc/docs/users_guide/packages.sgml +++ b/ghc/docs/users_guide/packages.sgml @@ -15,33 +15,10 @@ GHC comes with several packages (see ), and packages can be added/removed from an - existing GHC installation. - - - Listing the available packages - packages - listing - - To see what packages are currently installed, use the - --list-packages option: - --list-packages - - - - $ ghc --list-packages - gmp, rts, std, lang, concurrent, data, net, posix, text, util - - - 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. - The rest of the packages are optional libraries. - - + existing GHC installation, using the supplied + ghc-pkgghc-pkg + tool, described in . Using a package @@ -49,15 +26,15 @@ using To use a package, add the -package flag - to the command line: + to the GHC command line: - - -package <lib> option + + -package lib option This option brings into scope all the modules from - package <lib> (they still have to + package lib (they still have to be imported in your Haskell source, however). It also causes the relevant libraries to be linked when linking is being done. @@ -118,7 +95,7 @@ - + -package-name option @@ -142,8 +119,8 @@ indirection, intra-package references are cheaper than inter-package references. Of course, this applies to the Main package as well. - + Package management packages @@ -152,14 +129,41 @@ 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 GHC provides options for adding & removing - packages: + directly, instead packages can be added or removed using GHC's + package management tool, ghc-pkg. + + + + + This option displays the list of currently installed + packages. + + + $ ghc-pkg --list-packages + gmp, rts, std, lang, concurrent, data, net, posix, text, util + + + 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. + + + + - --add-package - option + + + Reads a package specification (see below) on stdin, and adds it to the database of installed packages. The @@ -169,9 +173,10 @@ - - --delete-package - option + + + + Removes the specified package from the installed configuration. @@ -191,6 +196,7 @@ Package { name = "mypkg", import_dirs = ["/usr/local/lib/imports/mypkg"], + source_dirs = [], library_dirs = ["/usr/local/lib"], hs_libraries = ["HSmypkg" ], extra_libraries = ["HSmypkg_cbits"], @@ -230,6 +236,18 @@ + source_dirs + source_dirs + package specification + + A list of directories containing Haskell source + files for this package. This field isn't used by GHC, but + could potentially be used by an all-interpreted system + like Hugs. + + + + library_dirs library_dirs package specification