Conditional compilation of Setup.hs
duncan.coutts at worc.ox.ac.uk
Tue Jul 31 09:06:35 EDT 2007
On Tue, 2007-07-31 at 13:46 +0100, Bayley, Alistair wrote:
> I'd like to add a #ifdef to Takusen's Setup.hs, so that we can have a
> single source file that will compile with ghc-6.6 and ghc-6.6.1. With
> ghc-6.6 and Cabal-22.214.171.124 we use splitFileName and joinPaths from
> Distribution.Compat.FilePath. With ghc-6.6.1 (which includes
> Cabal-126.96.36.199) these have been moved to System.FilePath. I'd like to do
> something like the following:
> #ifdef __CABAL_VERSION__ > 117
> import System.FilePath (splitFileName, combine)
> joinPaths = combine
> import Distribution.Compat.FilePath (splitFileName, joinPaths)
> Is something like this possible with Cabal?
No, Cabal does not define any cpp defines like that.
> It's either that, or make Takusen's install depend on filepath. I'm
> not sure which is the least desirable, but I'm open to suggestions.
> To be fair, we already require our ghc-6.6 users to upgrade Cabal from
> 1.1.6 to 188.8.131.52, so making them install filepath instead perhaps
> isn't so bad, and is no more effort.
I'd got with filepath in that case.
More information about the Libraries