summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-05-18 09:43:50 +0000
committersimonmar <unknown>2005-05-18 09:43:50 +0000
commit35eb7d56c0feafae71c35726925d6cd3bb7bb7c5 (patch)
treeb2421b4f22b85a58f1a09c31b508cf9d2fbfaa00
parent644e072887cab9146bf68b99092dd3ec27bc757d (diff)
downloadhaskell-35eb7d56c0feafae71c35726925d6cd3bb7bb7c5.tar.gz
[project @ 2005-05-18 09:43:50 by simonmar]
Fix and hopefully rationalise the #ifdefs for rawSystem/system/runProcess.
-rw-r--r--ghc/utils/hsc2hs/Main.hs24
1 files changed, 14 insertions, 10 deletions
diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs
index 0794503513..c7883b0cdf 100644
--- a/ghc/utils/hsc2hs/Main.hs
+++ b/ghc/utils/hsc2hs/Main.hs
@@ -1,7 +1,7 @@
{-# OPTIONS -fffi -cpp #-}
------------------------------------------------------------------------
--- $Id: Main.hs,v 1.73 2005/05/17 09:48:27 krasimir Exp $
+-- $Id: Main.hs,v 1.74 2005/05/18 09:43:50 simonmar 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.
@@ -38,23 +38,27 @@ import CString
#endif
-#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC)
-
-import Compat.RawSystem ( rawSystem )
+#if __GLASGOW_HASKELL__ >= 604
import System.Process ( runProcess, waitForProcess )
import System.IO ( openFile, IOMode(..), hClose )
-#define HAVE_rawSystem
#define HAVE_runProcess
+#endif
-#elif __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600
-
-import System.Cmd ( system, rawSystem )
+#if defined(__GLASGOW_HASKELL__) && !defined(BUILD_NHC)
+import Compat.RawSystem ( rawSystem )
+#define HAVE_rawSystem
+#elif __HUGS__ || __NHC__ >= 117
+import System.Cmd ( rawSystem )
#define HAVE_rawSystem
+#endif
+#if !defined(HAVE_runProcess) || !defined(HAVE_rawSystem)
+-- we need system
+#if __HUGS__ || __NHC__ >= 117 || __GLASGOW_HASKELL__ >= 600
+import System.Cmd ( system )
#else
-
import System ( system )
-
+#endif
#endif
version :: String