Commit 328519b6 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Eliminate use of cpp in Distribution.Compiler

parent ea2a8b8e
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -cpp #-}
{-# OPTIONS_NHC98 -cpp #-}
{-# OPTIONS_JHC -fcpp #-}
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
-- | -- |
-- Module : Distribution.Compiler -- Module : Distribution.Compiler
...@@ -45,20 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -} ...@@ -45,20 +41,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module Distribution.Compiler (CompilerFlavor(..), defaultCompilerFlavor) where module Distribution.Compiler (CompilerFlavor(..), defaultCompilerFlavor) where
import System.Info (compilerName)
data CompilerFlavor data CompilerFlavor
= GHC | NHC | Hugs | HBC | Helium | JHC | OtherCompiler String = GHC | NHC | Hugs | HBC | Helium | JHC | OtherCompiler String
deriving (Show, Read, Eq, Ord) deriving (Show, Read, Eq, Ord)
defaultCompilerFlavor :: Maybe CompilerFlavor defaultCompilerFlavor :: Maybe CompilerFlavor
defaultCompilerFlavor = defaultCompilerFlavor = case compilerName of
#if defined(__GLASGOW_HASKELL__) "ghc" -> Just GHC
Just GHC "nhc98" -> Just NHC
#elif defined(__NHC__) "jhc" -> Just JHC
Just NHC "hugs" -> Just Hugs
#elif defined(__JHC__) _ -> Nothing
Just JHC
#elif defined(__HUGS__)
Just Hugs
#else
Nothing
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment