On Sat, Nov 27, 2010 at 9:59 AM, Jinjing Wang 
<nfjinjing@gmail.com> wrote:
Thanks Michael,
So the user should use `cabal install --flags -ghc7 package-name` to
install the package, if I'm not mistaken?
Will it work if the package is installed as a dependency? Will the
flag environment be passed down from the root package?
Is there a way to detect GHC version automatically?
I see that others have provided answers on here, but another way is to change the check from:
   if flag(ghc7)
       build-depends:   base                      >= 4.3      && < 5
       cpp-options:     -DGHC7
   else
       build-depends:   base                      >= 4        && < 4.3
to this:
   if impl(ghc >= 7)
       build-depends:   base                      >= 4.3      && < 5
       cpp-options:     -DGHC7
   else
       build-depends:   base                      >= 4        && < 4.3
I hope that helps,
Jason