@@ -2804,8 +2804,10 @@ Declaring a ``custom-setup`` stanza also enables the generation of
28042804 :synopsis: Custom Setup.hs build information.
28052805 :since: 1.24
28062806
2807- The optional :pkg-section: `custom-setup ` stanza contains information needed
2808- for the compilation of custom ``Setup.hs `` scripts,
2807+ A :pkg-section: `custom-setup ` stanza is required for
2808+ :pkg-field: `build-type ` ``Custom `` and will be ignored (with a warning)
2809+ otherwise. The stanza contains information needed for the compilation of
2810+ custom ``Setup.hs `` scripts. For example:
28092811
28102812::
28112813
@@ -2838,7 +2840,7 @@ Backward compatibility and ``custom-setup``
28382840
28392841Versions prior to Cabal 1.24 don't recognise ``custom-setup `` stanzas,
28402842and will behave agnostic to them (except for warning about an unknown
2841- section). Consequently, versions prior to Cabal 1.24 can't ensure the
2843+ ' section' ). Consequently, versions prior to Cabal 1.24 can't ensure the
28422844declared dependencies ``setup-depends `` are in scope, and instead
28432845whatever is registered in the current package database environment
28442846will become eligible (and resolved by the compiler) for the
@@ -2848,8 +2850,9 @@ The availability of the
28482850``MIN_VERSION_package_(A,B,C) `` CPP macros
28492851inside ``Setup.hs `` scripts depends on the condition that either
28502852
2851- - a ``custom-setup `` section has been declared (or ``cabal build `` is being
2852- used which injects an implicit hard-coded ``custom-setup `` stanza if it's missing), or
2853+ - a ``custom-setup `` stanza has been declared (or ``cabal build `` is being used
2854+ which injects an implicit hard-coded ``custom-setup `` stanza if it's missing),
2855+ or
28532856- GHC 8.0 or later is used (which natively injects package version CPP macros)
28542857
28552858Consequently, if you need to write backward compatible ``Setup.hs ``
0 commit comments