haskell/cabal — pull request #1437 by hvr (2013-08-25 14:59:04+00:00)
Title: Add `ghcOptOutputDir` to `GhcOptions` for GHC's `-outputdir`

The flag `-outputdir` sets `-odir`, `-hidir`, `-stubdir`, and `-dumpdir`.

Using `-outputdir` has the benefit of redirecting all output files with
only one flag to a temporary directory.

Cabal currently only sets the first three but not the `-dumpdir` flag for
compiling Haskell modules, which clutters the top-level package directory
and sometimes dump files get overwritten if their names collide for
different build targets.

This minimal commit merely adds the `ghcOptOutputDir` flag to the data
structures and enables its use for the compilation of Haskell modules. A
later commit may remove the use of the now redundant `ghcOptStubDir` and
`ghcOptHiDir` flags in favor of the new `ghcOptOutputDir` flag.

The flag `-outputdir` is available since GHC 6.10; see also
ghc/ghc@bb074cb7f881ab865e9fba04ab7244a3951d3494 and
http://ghc.haskell.org/trac/ghc/ticket/2295