import Outputable
import ErrUtils ( putMsg, debugTraceMsg )
import Panic ( GhcException(..) )
-import Util ( Suffix, global, notNull, consIORef,
- normalisePath, pgmPath, platformPath )
+import Util ( Suffix, global, notNull, consIORef, joinFileName,
+ normalisePath, pgmPath, platformPath, joinFileExt )
import DynFlags ( DynFlags(..), DynFlag(..), dopt, Option(..),
setTmpDir, defaultDynFlags )
; let installed, installed_bin :: FilePath -> FilePath
installed_bin pgm = pgmPath top_dir pgm
installed file = pgmPath top_dir file
- inplace dir pgm = pgmPath (top_dir `slash`
- cPROJECT_DIR `slash` dir) pgm
+ inplace dir pgm = pgmPath (top_dir `joinFileName`
+ cPROJECT_DIR `joinFileName` dir) pgm
; let pkgconfig_path
| am_installed = installed "package.conf"
= 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 `slash` "package.conf")
+ ; am_installed <- doesFileExist (top_dir `joinFileName` "package.conf")
; return (am_installed, top_dir)
}
findTempName (tmp_dir ++ "/ghc" ++ show x ++ "_") 0
where
findTempName prefix x
- = do let filename = prefix ++ show x ++ '.':extn
+ = do let filename = (prefix ++ show x) `joinFileExt` extn
b <- doesFileExist filename
if b then findTempName prefix (x+1)
else do consIORef v_FilesToClean filename -- clean it up later
; throwDyn (PhaseFailed phase_name (ExitFailure 1)) }
\end{code}
------------------------------------------------------------------------------
- Path name construction
-
-\begin{code}
-slash :: String -> String -> String
-slash s1 s2 = s1 ++ ('/' : s2)
-\end{code}
-
-
%************************************************************************
%* *
\subsection{Support code}