Skip to content
Snippets Groups Projects
Commit 8ea69b58 authored by judah's avatar judah
Browse files

Print a warning message during configure if Cabal decides not to use the terminfo package.

This can happen when installing a development version of Haskeline, if the
required version of terminfo hasn't yet been uploaded to Hackage.
parent b787700f
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,7 @@ import System.IO ...@@ -14,6 +14,7 @@ import System.IO
import System.Exit import System.Exit
import System.Directory import System.Directory
import Control.Exception.Extensible import Control.Exception.Extensible
import Control.Monad(when)
main :: IO () main :: IO ()
main = defaultMainWithHooks myHooks main = defaultMainWithHooks myHooks
...@@ -23,6 +24,7 @@ myHooks ...@@ -23,6 +24,7 @@ myHooks
| buildOS == Windows = simpleUserHooks | buildOS == Windows = simpleUserHooks
| otherwise = simpleUserHooks { | otherwise = simpleUserHooks {
confHook = \genericDescript flags -> do confHook = \genericDescript flags -> do
warnIfNotTerminfo flags
lbi <- confHook simpleUserHooks genericDescript flags lbi <- confHook simpleUserHooks genericDescript flags
let pkgDescr = localPkgDescr lbi let pkgDescr = localPkgDescr lbi
let Just lib = library pkgDescr let Just lib = library pkgDescr
...@@ -104,3 +106,6 @@ iconv_prog = unlines $ ...@@ -104,3 +106,6 @@ iconv_prog = unlines $
, "}" , "}"
] ]
warnIfNotTerminfo flags = when (not (hasFlagSet flags (FlagName "terminfo"))) $
putStrLn $
"*** Warning: running on POSIX but not building the terminfo backend. ***"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment