From 0e3ae44da965e7492be10a97ca90417703f4832c Mon Sep 17 00:00:00 2001 From: sewardj Date: Fri, 17 Aug 2001 12:43:24 +0000 Subject: [PATCH] [project @ 2001-08-17 12:43:24 by sewardj] On 4.08.X compilers, just make rawSystem be System.system. This is so we can still build stage1s with 4.08.X. It won't work on Win32 but the minimum compiler to build a stage1 for Win32 is 5.01 AFAICS. --- ghc/compiler/main/SysTools.lhs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/main/SysTools.lhs b/ghc/compiler/main/SysTools.lhs index fdda9dd..e3df000 100644 --- a/ghc/compiler/main/SysTools.lhs +++ b/ghc/compiler/main/SysTools.lhs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: SysTools.lhs,v 1.53 2001/08/16 14:43:59 rrt Exp $ +-- $Id: SysTools.lhs,v 1.54 2001/08/17 12:43:24 sewardj Exp $ -- -- (c) The University of Glasgow 2001 -- @@ -76,12 +76,20 @@ import List ( isPrefixOf ) import MarshalArray #endif +-- This is a kludge for bootstrapping with 4.08.X. Given that +-- all distributed compilers >= 5.0 will be compiled with themselves. +-- I don't think this kludge is a problem. And we have to start +-- building with >= 5.0 on Win32 anyway. +#if __GLASGOW_HASKELL__ > 408 -- use the line below when we can be sure of compiling with GHC >= -- 5.02, and remove the implementation of rawSystem at the end of this -- file import PrelIOBase -- this can be removed when SystemExts is used import CError ( throwErrnoIfMinus1 ) -- as can this -- import SystemExts ( rawSystem ) +#else +import System ( system ) +#endif #include "HsVersions.h" @@ -798,6 +806,7 @@ getProcessID = Posix.getProcessID #endif rawSystem :: String -> IO ExitCode +#if __GLASGOW_HASKELL__ > 408 rawSystem "" = ioException (IOError Nothing InvalidArgument "rawSystem" "null command" Nothing) rawSystem cmd = withCString cmd $ \s -> do @@ -807,5 +816,9 @@ rawSystem cmd = n -> return (ExitFailure n) foreign import ccall "rawSystemCmd" unsafe primRawSystem :: CString -> IO Int +#else +rawSystem = System.system +#endif + \end{code} -- 1.7.10.4