X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FSysTools.lhs;h=d1fd9f7c400b22c146aaf76d10b73b3615d1eab2;hb=4ca6790feb128b03e0783de7f44399fef5c5ad22;hp=7b9ac1d3383bf92fc3a84714da6f9656b94a7f10;hpb=c9bf1a2ccbf93198488b1446977e50b0a5f6ecf5;p=ghc-hetmet.git diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index 7b9ac1d..d1fd9f7 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -844,16 +844,17 @@ getBaseDir = do let len = (2048::Int) -- plenty, PATH_MAX is 512 under Win32. return (Just (rootDir s)) where rootDir s = case splitFileName $ normalise s of - (d, "ghc.exe") -> + (d, ghc_exe) | lower ghc_exe == "ghc.exe" -> case splitFileName $ takeDirectory d of -- installed ghc.exe is in $topdir/bin/ghc.exe - (d', "bin") -> takeDirectory d' + (d', bin) | lower bin == "bin" -> takeDirectory d' -- inplace ghc.exe is in $topdir/ghc/stage1-inplace/ghc.exe - (d', x) | "-inplace" `isSuffixOf` x -> + (d', x) | "-inplace" `isSuffixOf` lower x -> takeDirectory d' ".." _ -> fail _ -> fail where fail = panic ("can't decompose ghc.exe path: " ++ show s) + lower = map toLower foreign import stdcall unsafe "GetModuleFileNameA" getModuleFileName :: Ptr () -> CString -> Int -> IO Int32