X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FSysTools.lhs;h=874387fc88c690b9e28740eabfca104aa13a7c37;hb=311b1cdfc9b1c311cc53482c461c18cba8885b2a;hp=fb9cf378044cbffd1725ca437cd871020d1016a9;hpb=d7fdebe8a174f968b63c98845cb16577e444ee13;p=ghc-hetmet.git diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs index fb9cf37..874387f 100644 --- a/compiler/main/SysTools.lhs +++ b/compiler/main/SysTools.lhs @@ -11,10 +11,6 @@ module SysTools ( -- Initialisation initSysTools, - getTopDir, -- IO String -- The value of $topdir - getPackageConfigPath, -- IO String -- Where package.conf is - getUsageMsgPaths, -- IO (String,String) - -- Interface to system tools runUnlit, runCpp, runCc, -- [Option] -> IO () runPp, -- [Option] -> IO () @@ -35,40 +31,33 @@ module SysTools ( -- System interface system, -- String -> IO ExitCode - -- Misc - getSysMan, -- IO String Parallel system only - Option(..) ) where #include "HsVersions.h" -import DriverPhases ( isHaskellUserSrcFilename ) +import DriverPhases import Config import Outputable -import ErrUtils ( putMsg, debugTraceMsg, showPass, Severity(..), Messages ) -import Panic ( GhcException(..) ) -import Util ( Suffix, global, notNull, consIORef, joinFileName, - normalisePath, pgmPath, platformPath, joinFileExt ) -import DynFlags ( DynFlags(..), DynFlag(..), dopt, Option(..), - setTmpDir, defaultDynFlags ) - -import EXCEPTION ( throwDyn, finally ) -import DATA_IOREF ( IORef, readIORef, writeIORef ) -import DATA_INT - -import Monad ( when, unless ) -import System ( ExitCode(..), getEnv, system ) -import IO ( try, catch, hGetContents, - openFile, hPutStr, hClose, hFlush, IOMode(..), - stderr, ioError, isDoesNotExistError, - isAlreadyExistsError ) -import Directory ( doesFileExist, removeFile, - createDirectory, removeDirectory ) -import Maybe ( isJust ) -import List ( partition ) -import FiniteMap ( FiniteMap, emptyFM, lookupFM, addToFM, eltsFM ) +import ErrUtils +import Panic +import Util +import DynFlags +import FiniteMap + +import Control.Exception +import Data.IORef +import Data.Int +import Control.Monad +import System.Exit +import System.Cmd +import System.Environment +import System.IO +import SYSTEM_IO_ERROR as IO +import System.Directory +import Data.Maybe +import Data.List -- GHC <= 4.08 didn't have rawSystem, and runs into problems with long command -- lines on mingw32, so we disallow it now. @@ -95,10 +84,8 @@ import Text.Regex -- rawSystem comes from libghccompat.a in stage1 import Compat.RawSystem ( rawSystem ) import GHC.IOBase ( IOErrorType(..) ) -import System.IO.Error ( ioeGetErrorType ) #else import System.Process ( runInteractiveProcess, getProcessExitCode ) -import System.IO ( hSetBuffering, hGetLine, BufferMode(..) ) import Control.Concurrent( forkIO, newChan, readChan, writeChan ) import Data.Char ( isSpace ) import FastString ( mkFastString ) @@ -168,34 +155,6 @@ stuff. End of NOTES --------------------------------------------- - -%************************************************************************ -%* * -\subsection{Global variables to contain system programs} -%* * -%************************************************************************ - -All these pathnames are maintained IN THE NATIVE FORMAT OF THE HOST MACHINE. -(See remarks under pathnames below) - -\begin{code} -GLOBAL_VAR(v_Pgm_T, error "pgm_T", String) -- touch -GLOBAL_VAR(v_Pgm_CP, error "pgm_CP", String) -- cp - -GLOBAL_VAR(v_Path_package_config, error "path_package_config", String) -GLOBAL_VAR(v_Path_usages, error "ghc_usage.txt", (String,String)) - -GLOBAL_VAR(v_TopDir, error "TopDir", String) -- -B