summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-18 11:47:53 +0000
committerIan Lynagh <igloo@earth.li>2008-07-18 11:47:53 +0000
commiteed437cdefb952e6c70e58012b23d436e74710af (patch)
tree712e227f0461bae88a31ab0409e7d6c678cb81e3 /compiler/main
parent249bcf1f34e240a39abbcbb29bd6b97ddece421f (diff)
downloadhaskell-eed437cdefb952e6c70e58012b23d436e74710af.tar.gz
More build system changes; ghc-pkg is now built with Cabal
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/SysTools.lhs21
1 files changed, 8 insertions, 13 deletions
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 1538b95d52..c4187893e0 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -163,19 +163,14 @@ initSysTools mbMinusB dflags0
; let installed, installed_bin :: FilePath -> FilePath
installed_bin pgm = top_dir </> pgm
installed file = top_dir </> file
- inplaceUpDirs
- | isWindowsHost = 2
- | otherwise = 4
- inplace dir pgm = let real_top_dir = foldr (</>) ""
- $ reverse
- $ drop inplaceUpDirs
- $ reverse
- $ splitDirectories top_dir
- in real_top_dir </> dir </> pgm
+ real_top_dir
+ | isWindowsHost = top_dir </> ".." </> ".."
+ | otherwise = top_dir </> ".."
+ inplace dir pgm = real_top_dir </> dir </> pgm
; let pkgconfig_path
| am_installed = installed "package.conf"
- | otherwise = inplace cGHC_DRIVER_DIR_REL "package.conf.inplace"
+ | otherwise = inplace "inplace-datadir" "package.conf"
ghc_usage_msg_path
| am_installed = installed "ghc-usage.txt"
@@ -331,10 +326,10 @@ findTopDir :: Maybe String -- Maybe TopDir path (without the '-B' prefix).
findTopDir mbMinusB
= do { top_dir <- get_proto
-- Discover whether we're running in a build tree or in an installation,
- -- by looking for the package configuration file.
- ; am_installed <- doesFileExist (top_dir </> "package.conf")
+ -- by looking for a file we use for that purpose
+ ; am_inplace <- doesFileExist (top_dir </> "inplace")
- ; return (am_installed, top_dir)
+ ; return (not am_inplace, top_dir)
}
where
-- get_proto returns a Unix-format path (relying on getBaseDir to do so too)