From f1aeaa8d81962c8f0544fa4dcda4cd2ba892bf60 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 6 Apr 2010 22:54:23 +0900 Subject: [PATCH] GHC version check. --- Check.hs | 6 ++++++ ghc-mod.cabal | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Check.hs b/Check.hs index ec0e394..99592f1 100644 --- a/Check.hs +++ b/Check.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE CPP #-} + module Check (checkSyntax) where import Control.Applicative @@ -15,7 +17,11 @@ import System.Process checkSyntax :: Options -> String -> IO String checkSyntax opt file = do makeDirectory (outDir opt) +#if __GLASGOW_HASKELL__ == 612 (_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall","-fno-warn-unused-do-bind",file,"-outputdir","dist/flymake","-o","dist/flymake/a.out","-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing +#else + (_,_,herr,_) <- runInteractiveProcess (ghc opt) ["--make","-Wall",file,"-outputdir","dist/flymake","-o","dist/flymake/a.out","-i..","-i../..","-i../../..","-i../../../..","-i../../../../.."] Nothing Nothing +#endif hSetBinaryMode herr False refine <$> hGetContents herr where diff --git a/ghc-mod.cabal b/ghc-mod.cabal index d88af9d..6b39298 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -24,8 +24,11 @@ Data-Files: Makefile ghc.el ghc-func.el ghc-doc.el ghc-comp.el Executable ghc-mod Main-Is: GHCMod.hs Other-Modules: List Browse Check Param Lang - GHC-Options: -Wall -fno-warn-unused-do-bind - Build-Depends: base >= 4.0 && < 10, + if impl(ghc >= 6.12) + GHC-Options: -Wall -O2 -fno-warn-unused-do-bind + else + GHC-Options: -Wall -O2 + Build-Depends: base >= 4.0 && < 5, parsec >= 3, process, haskell-src-exts, directory, filepath Source-Repository head