Skip to content

Instantly share code, notes, and snippets.

@yihuang
Created June 24, 2012 01:51
Show Gist options
  • Save yihuang/2980983 to your computer and use it in GitHub Desktop.
Save yihuang/2980983 to your computer and use it in GitHub Desktop.
build ghc-ios
diff --git a/Cabal/Distribution/Simple.hs b/Cabal/Distribution/Simple.hs
index 02a5255..c2a0859 100644
--- a/Cabal/Distribution/Simple.hs
+++ b/Cabal/Distribution/Simple.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple
@@ -142,7 +143,10 @@ import Control.Monad (when)
import Data.List (intersperse, unionBy, nub, (\\))
import Control.Exception (catch, throwIO)
import Data.Maybe (maybeToList)
+
+#if __GLASGOW_HASKELL__ < 705
import Prelude hiding (catch)
+#endif
-- | A simple implementation of @main@ for a Cabal setup script.
-- It reads the package description file using IO, and performs the
diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs
index a0bc64f..cb4628a 100644
--- a/Cabal/Distribution/Simple/Configure.hs
+++ b/Cabal/Distribution/Simple/Configure.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Configure
@@ -65,6 +66,10 @@ module Distribution.Simple.Configure (configure,
)
where
+#if __GLASGOW_HASKELL__ < 705
+import Prelude hiding (catch)
+#endif
+
import Distribution.Simple.Compiler
( CompilerFlavor(..), Compiler(compilerId), compilerFlavor, compilerVersion
, showCompilerId, unsupportedLanguages, unsupportedExtensions
diff --git a/Cabal/Distribution/Simple/PreProcess.hs b/Cabal/Distribution/Simple/PreProcess.hs
index 0128580..3e8c8dd 100644
--- a/Cabal/Distribution/Simple/PreProcess.hs
+++ b/Cabal/Distribution/Simple/PreProcess.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.PreProcess
@@ -103,7 +104,9 @@ import System.Info (os, arch)
import System.IO.Error (isDoesNotExistError)
import System.FilePath (splitExtension, dropExtensions, (</>), (<.>),
takeDirectory, normalise, replaceExtension)
+#if __GLASGOW_HASKELL__ < 705
import Prelude hiding (catch)
+#endif
-- |The interface to a preprocessor, which may be implemented using an
-- external program, but need not be. The arguments are the name of
diff --git a/Cabal/Distribution/Simple/Utils.hs b/Cabal/Distribution/Simple/Utils.hs
index 7df1950..d68d2f2 100644
--- a/Cabal/Distribution/Simple/Utils.hs
+++ b/Cabal/Distribution/Simple/Utils.hs
@@ -137,6 +137,9 @@ module Distribution.Simple.Utils (
wrapLine,
) where
+#if __GLASGOW_HASKELL__ < 705
+import Prelude hiding (catch)
+#endif
import Control.Monad
( when, unless, filterM )
#ifdef __GLASGOW_HASKELL__
@@ -187,7 +190,7 @@ import qualified Distribution.ModuleName as ModuleName
import Distribution.Version
(Version(..))
-import Control.Exception (evaluate)
+import Control.Exception (evaluate, catch)
import System.Process (runProcess)
#ifdef __GLASGOW_HASKELL__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment