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.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--- $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
--
--
-- (c) The University of Glasgow 2001
--
import MarshalArray
#endif
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 )
-- 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
#endif
rawSystem :: String -> IO ExitCode
#endif
rawSystem :: String -> IO ExitCode
+#if __GLASGOW_HASKELL__ > 408
rawSystem "" = ioException (IOError Nothing InvalidArgument "rawSystem" "null command" Nothing)
rawSystem cmd =
withCString cmd $ \s -> do
rawSystem "" = ioException (IOError Nothing InvalidArgument "rawSystem" "null command" Nothing)
rawSystem cmd =
withCString cmd $ \s -> do
n -> return (ExitFailure n)
foreign import ccall "rawSystemCmd" unsafe primRawSystem :: CString -> IO Int
n -> return (ExitFailure n)
foreign import ccall "rawSystemCmd" unsafe primRawSystem :: CString -> IO Int
+#else
+rawSystem = System.system
+#endif
+