[project @ 2004-08-16 09:31:50 by simonmar]
[ghc-hetmet.git] / ghc / utils / runghc / runghc.hs
index a79f411..be04cdf 100644 (file)
@@ -1,5 +1,9 @@
-{-# OPTIONS -cpp #-}
+{-# OPTIONS -cpp -fffi #-}
+#if __GLASGOW_HASKELL__ < 603
 #include "config.h"
+#else
+#include "ghcconfig.h"
+#endif
 -----------------------------------------------------------------------------
 --
 -- (c) The University of Glasgow, 2004
@@ -20,12 +24,18 @@ module Main where
 
 import System.Environment
 import System.IO
-import System.Cmd
 import Data.List
 import System.Directory
 import System.Exit
 import Data.Char
 
+#if __GLASGOW_HASKELL__ < 603
+import Foreign         ( withMany, withArray0, nullPtr, Ptr )
+import Foreign.C       ( CString, withCString, throwErrnoIfMinus1 )
+#else
+import System.Cmd      ( rawSystem )
+#endif
+
 main = do 
   args <- getArgs
   case args of
@@ -77,3 +87,6 @@ die msg = do hPutStr stderr msg; exitWith (ExitFailure 1)
 dieProg :: String -> IO a
 dieProg msg = do p <- getProgName; die (p ++ ": " ++ msg)
 
+#if __GLASGOW_HASKELL__ < 603
+#include "../../../libraries/base/System/RawSystem.hs-inc"
+#endif