Close .ghci files after reading them; fixes trac #4487
[ghc-hetmet.git] / utils / ghc-cabal / ghc-cabal.hs
index 41abd39..81b47db 100644 (file)
@@ -176,7 +176,7 @@ doInstall ghc ghcpkg strip topdir directory distDir
                             libsubdir = toPathTemplate "$pkgid",
                             docdir    = toPathTemplate $
                                             if relocatableBuild
-                                            then "$topdir/$pkgid"
+                                            then "$topdir/../doc/html/libraries/$pkgid"
                                             else (myDocdir </> "$pkgid"),
                             htmldir   = toPathTemplate "$docdir"
                         }
@@ -363,7 +363,7 @@ generate config_args distdir directory
                 variablePrefix ++ "_HC_OPTS = " ++ escape (unwords
                        (   programDefaultArgs ghcProg
                         ++ hcOptions GHC bi
-                        ++ extensionsToFlags (compiler lbi) (extensions bi)
+                        ++ extensionsToFlags (compiler lbi) (usedExtensions bi)
                         ++ programOverrideArgs ghcProg)),
                 variablePrefix ++ "_CC_OPTS = " ++ unwords (ccOptions bi),
                 variablePrefix ++ "_CPP_OPTS = " ++ unwords (cppOptions bi),
@@ -372,7 +372,8 @@ generate config_args distdir directory
                 variablePrefix ++ "_DEP_CC_OPTS = "    ++ unwords (forDeps Installed.ccOptions),
                 variablePrefix ++ "_DEP_LIB_DIRS = "   ++ unwords (wrap $ forDeps Installed.libraryDirs),
                 variablePrefix ++ "_DEP_EXTRA_LIBS = " ++ unwords (forDeps Installed.extraLibraries),
-                variablePrefix ++ "_DEP_LD_OPTS = "    ++ unwords (forDeps Installed.ldOptions)]
+                variablePrefix ++ "_DEP_LD_OPTS = "    ++ unwords (forDeps Installed.ldOptions),
+                variablePrefix ++ "_BUILD_GHCI_LIB = " ++ boolToYesNo (withGHCiLib lbi)]
       writeFile (distdir ++ "/package-data.mk") $ unlines xs
       writeFile (distdir ++ "/haddock-prologue.txt") $ 
           if null (description pd) then synopsis pd
@@ -380,3 +381,5 @@ generate config_args distdir directory
   where
      escape = foldr (\c xs -> if c == '#' then '\\':'#':xs else c:xs) []
      wrap = map (\s -> "\'" ++ s ++ "\'")
+     boolToYesNo True = "YES"
+     boolToYesNo False = "NO"