From: simonpj Date: Tue, 22 Jun 2004 13:47:27 +0000 (+0000) Subject: [project @ 2004-06-22 13:47:27 by simonpj] X-Git-Tag: Initial_conversion_from_CVS_complete~1796 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=12370c0317fb4298d45605f56144fa695c4a98e6;p=ghc-hetmet.git [project @ 2004-06-22 13:47:27 by simonpj] Clarify words about the -package flag --- diff --git a/ghc/docs/users_guide/packages.sgml b/ghc/docs/users_guide/packages.sgml index 18602f0..0852ec7 100644 --- a/ghc/docs/users_guide/packages.sgml +++ b/ghc/docs/users_guide/packages.sgml @@ -25,7 +25,8 @@ packages using - Some packages are automatically available: you don't need + Some packages, called auto 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. @@ -46,13 +47,20 @@ be imported in your Haskell source, however). It also causes the relevant libraries to be linked when linking is being done. + 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 + takes care of all these dependencies, so that when you say + -package text on the command line, you + automatically get -package lang too. There's one case where you need to use the option even for auto packages: when - linking a program in batch modeThis is because + linking a program in batch mode mode () + This 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 @@ -60,18 +68,20 @@ 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: + network package, we need to give GHC the -package flag thus: $ 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 - takes care of all these dependencies, so that when you say - -package text on the command line, you - automatically get -package lang too. + The same flag is necessary even if we compiled the modules from source, because GHC still + reckons it's in batch mode: +$ ghc -o myprog Foo.hs Main.hs -package network +In --make and --interactive modes (), however, GHC figures out +the auto packages required for linking without further assistance. + + + Maintaining a local set of packages diff --git a/ghc/docs/users_guide/using.sgml b/ghc/docs/users_guide/using.sgml index 2c8e1ca..8b65f30 100644 --- a/ghc/docs/users_guide/using.sgml +++ b/ghc/docs/users_guide/using.sgml @@ -405,7 +405,7 @@ olleh Batch compiler mode - In this mode, GHC will compile one or more source files + In batch mode, GHC will compile one or more source files given on the command line. The first phase to run is determined by each input-file