aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CabalHelper/Main.hs')
-rw-r--r--CabalHelper/Main.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/CabalHelper/Main.hs b/CabalHelper/Main.hs
index 62fe729..043e57c 100644
--- a/CabalHelper/Main.hs
+++ b/CabalHelper/Main.hs
@@ -52,8 +52,9 @@ import Distribution.Simple.Program.GHC (GhcOptions(..), renderGhcOptions)
import Distribution.Simple.Setup (ConfigFlags(..),Flag(..))
import Distribution.Simple.Build (initialBuildSteps)
import Distribution.Simple.BuildPaths (autogenModuleName, cppHeaderName, exeExtension)
-import Distribution.Simple.Compiler (PackageDB(..))
+import Distribution.Simple.Compiler (PackageDB(..), compilerId)
+import Distribution.Compiler (CompilerId(..))
import Distribution.ModuleName (components)
import qualified Distribution.ModuleName as C (ModuleName)
import Distribution.Text (display)
@@ -89,6 +90,7 @@ usage = do
++"DIST_DIR ( version\n"
++" | print-lbi\n"
++" | write-autogen-files\n"
+ ++" | compiler-version"
++" | ghc-options [--with-inplace]\n"
++" | ghc-src-options [--with-inplace]\n"
++" | ghc-pkg-options [--with-inplace]\n"
@@ -100,7 +102,7 @@ usage = do
commands :: [String]
commands = [ "print-bli"
, "write-autogen-files"
- , "component-from-file"
+ , "compiler-version"
, "ghc-options"
, "ghc-src-options"
, "ghc-pkg-options"
@@ -157,6 +159,10 @@ main = do
initialBuildSteps distdir pd lbi v
return Nothing
+ "compiler-version":[] -> do
+ let CompilerId comp ver = compilerId $ compiler lbi
+ return $ Just $ ChResponseVersion (show comp) ver
+
"ghc-options":flags -> do
res <- componentsMap lbi v distdir $ \c clbi bi -> let
outdir = componentOutDir lbi c