[project @ 2001-08-17 12:43:24 by sewardj]
authorsewardj <unknown>
Fri, 17 Aug 2001 12:43:24 +0000 (12:43 +0000)
committersewardj <unknown>
Fri, 17 Aug 2001 12:43:24 +0000 (12:43 +0000)
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

index fdda9dd..e3df000 100644 (file)
@@ -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
 --
 --
 -- (c) The University of Glasgow 2001
 --
@@ -76,12 +76,20 @@ import List         ( isPrefixOf )
 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
 
 #include "HsVersions.h"
 
 
 #include "HsVersions.h"
 
@@ -798,6 +806,7 @@ getProcessID = Posix.getProcessID
 #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
@@ -807,5 +816,9 @@ rawSystem cmd =
         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
+
 
 \end{code}
 
 \end{code}