Move --with-ghc Setup.lhs into Scripts, use standard Setup.lhs at top level
This commit is contained in:
parent
fc1a519459
commit
3d372cfe5b
16
Setup.lhs
16
Setup.lhs
@ -1,19 +1,5 @@
|
|||||||
#!/usr/bin/env runhaskell
|
#!/usr/bin/env runhaskell
|
||||||
> module Main where
|
> module Main where
|
||||||
> import Distribution.Simple
|
> import Distribution.Simple
|
||||||
> import Distribution.Setup ( ConfigFlags (..) )
|
|
||||||
> import System.Directory ( findExecutable )
|
|
||||||
>
|
|
||||||
> main :: IO ()
|
> main :: IO ()
|
||||||
> main = defaultMainWithHooks (defaultUserHooks { postConf = defaultPostConf })
|
> main = defaultMainWithHooks defaultUserHooks
|
||||||
> 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 []
|
|
||||||
|
20
scripts/Setup-with-ghc.lhs
Normal file
20
scripts/Setup-with-ghc.lhs
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/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 -}
|
||||||
|
>
|
||||||
|
> -- need to pass with-ghc arg onto ./configure for non-standard ghcs
|
||||||
|
> 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 []
|
Loading…
x
Reference in New Issue
Block a user