[project @ 2002-02-14 08:23:25 by sof]
authorsof <unknown>
Thu, 14 Feb 2002 08:23:26 +0000 (08:23 +0000)
committersof <unknown>
Thu, 14 Feb 2002 08:23:26 +0000 (08:23 +0000)
Right, that's it! Nuke rawSystem nonsense, as it turns
out the SysTools replacement for it wasn't 4.08 compatible,
hence nightly build break.

Should you bootstrap with 4.08 under mingw, and subseq.
do a stage2 build, you'll run into command-line length
probs during the final big linker invocation. Nothing
to lose sleep over, there are plenty of newer versions
to base a stage1 build on.

ghc/compiler/Makefile
ghc/compiler/main/SysTools.lhs

index 3839546..daa95bc 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.211 2002/02/13 20:14:42 sof Exp $
+# $Id: Makefile,v 1.212 2002/02/14 08:23:25 sof Exp $
 
 TOP = ..
 
@@ -146,27 +146,6 @@ endif
 HS_OBJS         += $(C_OBJS)
 
 # -----------------------------------------------
-# system hack.
-#
-# GHCi calls the C procedure 'rawSystem'; but alas GHC 4.08 
-# does not have this.  Everything is fine if you are compiling
-# GHC with GHC 5.02 or better, but lacking that we have the following
-# hack: 
-#      copy rawSystem.c from hslibs/lang/cbits
-#      into main/ (where it'll be compiled and linked with the compiler)
-#       (the Haskell-side code is ifdefed into main/SysTools.lhs)
-
-ifeq "$(bootstrapped)/$(ghc_502_at_least)" "NO/NO"
-SRC_CC_OPTS += -I$(GHC_LIB_DIR)/std/cbits
-SRC_MKDEPENDC_OPTS += -I$(GHC_LIB_DIR)/std/cbits
-ALL_SRCS += main/rawSystem.c
-main/rawSystem.c : $(FPTOOLS_TOP)/hslibs/lang/cbits/rawSystem.c
-       $(CP) $< main/
-else
-EXCLUDED_SRCS = main/rawSystem.c
-endif
-
-# -----------------------------------------------
 # mkdependC stuff
 #
 # Big Fudge to get around inherent problem that Makefile setup
index 066ae67..ad64752 100644 (file)
@@ -81,24 +81,15 @@ 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
 # if __GLASGOW_HASKELL__ >= 503
 import GHC.IOBase
 # else
-import PrelIOBase -- this can be removed when SystemExts is used
 # endif
 # ifdef mingw32_TARGET_OS
 import SystemExts       ( rawSystem )
 # endif
 #else
-import CError           ( throwErrnoIfMinus1 ) -- as can this
 import System          ( system )
 #endif
 
@@ -864,15 +855,12 @@ getProcessID = Posix.getProcessID
 
 #if defined(mingw32_TARGET_OS) && (__GLASGOW_HASKELL__ <= 408)
 rawSystem :: String -> IO ExitCode
-rawSystem "" = ioException (IOError Nothing InvalidArgument "rawSystem" "null command" Nothing)
-rawSystem cmd =
-  withCString cmd $ \s -> do
-    status <- throwErrnoIfMinus1 "rawSystem" (primRawSystem s)
-    case status of
-        0  -> return ExitSuccess
-        n  -> return (ExitFailure n)
-
-foreign import ccall "rawSystemCmd" unsafe primRawSystem :: CString -> IO Int
+rawSystem cmd = system cmd
+ -- mingw only: if you try to build a stage2 compiler with a stage1
+ -- that has been bootstrapped with 4.08 (or earlier), this will run
+ -- into problems with limits on command-line lengths with the std.
+ -- Win32 command interpreters. So don't this - use 5.00 or later
+ -- to compile up the GHC sources.
 #endif