[project @ 2005-01-06 14:55:02 by malcolm]
[ghc-hetmet.git] / ghc / utils / hsc2hs / Main.hs
index 0ad0a03..c2dfc20 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -fffi -cpp #-}
 
 ------------------------------------------------------------------------
--- $Id: Main.hs,v 1.61 2005/01/05 10:26:45 simonmar Exp $
+-- $Id: Main.hs,v 1.66 2005/01/06 14:55:02 malcolm Exp $
 --
 -- Program for converting .hsc files to .hs files, by converting the
 -- file into a C program which is run to generate the Haskell source.
@@ -17,8 +17,6 @@ import System.Console.GetOpt
 import GetOpt
 #endif
 
-import Compat.RawSystem        ( rawSystem )
-
 import System        (getProgName, getArgs, ExitCode(..), exitWith, system)
 import Directory     (removeFile,doesFileExist)
 import Monad         (MonadPlus(..), liftM, liftM2, when)
@@ -36,6 +34,14 @@ import CString
 #endif
 
 
+#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC)
+import Compat.RawSystem        ( rawSystem )
+#elif __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600
+import System.Cmd              ( rawSystem )
+#else
+rawSystem prog args = system (prog++" "++unwords args)
+#endif
+
 version :: String
 version = "hsc2hs version 0.66\n"