diff --git a/Setup.hs b/Setup.hs deleted file mode 100644 index 841d4d0..0000000 --- a/Setup.hs +++ /dev/null @@ -1,16 +0,0 @@ -import Distribution.Simple -import Distribution.Setup ( ConfigFlags (..) ) -import System.Directory ( findExecutable ) - -main = defaultMainWithHooks (defaultUserHooks { postConf = defaultPostConf }) - where defaultPostConf args flags lbi xxx - = do args' <- fmap (args++) (configToArgs flags) - (postConf defaultUserHooks) args' flags lbi xxx - -configToArgs :: ConfigFlags -> IO [String] -configToArgs (ConfigFlags { configHcPath = Just hcPath }) - = do exec <- findExecutable hcPath - case exec of - Just realPath -> return ["--with-ghc="++realPath] - Nothing -> return ["--with-ghc="++hcPath] -configToArgs _ = return [] diff --git a/Setup.lhs b/Setup.lhs new file mode 100644 index 0000000..6527aae --- /dev/null +++ b/Setup.lhs @@ -0,0 +1,19 @@ +#!/usr/bin/env runhaskell +> module Main where +> import Distribution.Simple +> import Distribution.Setup ( ConfigFlags (..) ) +> import System.Directory ( findExecutable ) +> +> main :: IO () +> main = defaultMainWithHooks (defaultUserHooks { postConf = defaultPostConf }) +> where defaultPostConf args flags lbi {- xx -} +> = do args' <- fmap (args++) (configToArgs flags) +> (postConf defaultUserHooks) args' flags lbi {- xx -} +> +> configToArgs :: ConfigFlags -> IO [String] +> configToArgs (ConfigFlags { configHcPath = Just hcPath }) +> = do exec <- findExecutable hcPath +> case exec of +> Just realPath -> return ["--with-ghc="++realPath] +> Nothing -> return ["--with-ghc="++hcPath] +> configToArgs _ = return [] diff --git a/plugins.cabal b/plugins.cabal index a10fe74..a17ba4e 100644 --- a/plugins.cabal +++ b/plugins.cabal @@ -34,5 +34,5 @@ c-sources: includes: Linker.h extensions: CPP, ForeignFunctionInterface Build-Depends: base, Cabal, haskell-src -ghc-options: -Wall -O -fvia-C -funbox-strict-fields -fno-warn-missing-signatures +ghc-options: -Wall -O -fasm -funbox-strict-fields -fno-warn-missing-signatures hs-source-dir: src