Whitespace.
Fix building of executables that use TH with dyn-by-default GHC.

Fixes #1252. Makes the test suite pass with GHC HEAD.

(If 'TemplateHaskell/profiling' still fails, you're probably affected by this
GHC bug: http://ghc.haskell.org/trac/ghc/ticket/7978 . Try compiling a more
recent GHC HEAD.)
Merge remote-tracking branch 'upstream/master'
Merge remote-tracking branch 'origin/master'
Test for "vanilla" lib/exe that uses TH.
When possible, use -dynamic-too for exes that use TH.
Make the code a bit more readable.
Rename and rearrange some variables.

Based on discussion with @dcoutts.
Merge pull request #1386 from 23Skidoo/ghc-head-fixes

Fix building of executables that use TH with dyn-by-default GHC.
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'upstream/master'
Initialise all subfields of 'install-dirs' in 'sandbox init'.

Inheriting e.g. 'libsubdir' from '~/.cabal/config' can break things if it set to
an empty string.

Fixes #1389.
Don't change the types of 'withTemp[File,Directory]' in 1.18.

Add new functions 'withTempFileEx' and 'withTempDirectoryEx' instead.

Fixes #1387.
Pass '--libdir' etc to 'setup configure' when installing.

Otherwise libs with 'build-type: Custom' get installed under
'$prefix/lib/$pkgname' instead of '$prefix/lib/$arch-$compiler-$os/$pkgname' if
the setup script is compiled against Cabal < 1.17.
Merge pull request #1388 from 23Skidoo/with-temp-file-ex

Don't change the types of 'withTemp[File,Directory]' in 1.18.
Merge pull request #1390 from 23Skidoo/install-dirs-fix

Pass '--libdir' etc to 'setup configure' when installing.
Merge remote-tracking branch 'upstream/master'