summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Mestanogullari <alp@well-typed.com>2018-10-02 14:46:28 +0200
committerKrzysztof Gogolewski <krz.gogolewski@gmail.com>2018-10-02 16:00:19 +0200
commite3355b7c5955df8daab0f3fc75fe021f42d21dbb (patch)
treec6131c8d2afbc3195db5e97bf3515722df57893f
parentabfb91fb0ea27eb618f297b1d3ba60cfa021afe0 (diff)
downloadhaskell-e3355b7c5955df8daab0f3fc75fe021f42d21dbb.tar.gz
rts.cabal.in: add more flags to control the extra flavours (for hadrian)
Summary: In order to properly honor the different ways in which the RTS must be built by hadrian, and in particular to have fine grained control over that, I'm introducing new Cabal flags in rts.cabal[.in]. This should not affect the make build system and will only be used and picked up by hadrian, which uses Cabal directly to operate on cabal packages, including libHSrts. Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5166
-rw-r--r--rts/rts.cabal.in40
1 files changed, 24 insertions, 16 deletions
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index e09c0548f7..76fd353134 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -28,8 +28,17 @@ flag leading-underscore
default: @CabalLeadingUnderscore@
flag smp
default: True
+-- Some cabal flags used to control the flavours we want to produce
+-- for libHSrts in hadrian. By default, we just produce vanilla and
+-- threaded. The flags "compose": if you enable debug and profiling,
+-- you will produce vanilla, _thr, _debug, _p but also _thr_p,
+-- _thr_debug_p and so on.
flag profiling
default: False
+flag debug
+ default: False
+flag logging
+ default: False
library
-- rts is a wired in package and
@@ -40,25 +49,24 @@ library
extra-bundled-libraries: Cffi-6
else
extra-bundled-libraries: Cffi
- -- the rts comes in a variety of flavours that ar built outside
- -- of cabal. The combination of extra-bundled-libraries and
- -- extra-library-flavours results in the following libraries to
- -- be copied:
- -- libHSrts-1.0_debug libHSrts-1.0_l libHSrts-1.0_p
- -- libHSrts-1.0_thr libHSrts-1.0_thr_debug libHSrts-1.0_thr_l
- -- libHSrts-1.0_thr_p
- -- libCffi_debug libCffi_ libCffi_l libCffi_p
- -- libCffi_thr libCffi_thr_debug libCffi_thr_l libCffi_thr_p
- extra-library-flavours: _debug _l _thr _thr_debug _thr_l
-- The make build system does something special in config.mk.in
- -- for generating profiled builds of those libraries, but we need to
- -- be transparent for hadrian which gets information about the rts
- -- "package" through Cabal and this cabal file. We therefore declare
- -- several profiling-enabled flavours to be available when passing the
- -- 'profiling' flag when configuring the RTS from hadrian, using Cabal.
+ -- for generating profiled, debugged, etc builds of those
+ -- libraries, but we need to be transparent for hadrian which
+ -- gets information about the rts "package" through Cabal and
+ -- this cabal file. We therefore declare several
+ -- flavours to be available when passing the suitable (combination of)
+ -- flag(s) when configuring the RTS from hadrian, using Cabal.
+ extra-library-flavours: _thr
+
if flag(profiling)
- extra-library-flavours: _p _thr_p _debug_p _thr_debug_p
+ extra-library-flavours: _p _thr_p
+ if flag(debug)
+ extra-library-flavours: _debug_p _thr_debug_p
+ if flag(debug)
+ extra-library-flavours: _debug _thr_debug
+ if flag(logging)
+ extra-library-flavours: _l _thr_l
exposed: True
exposed-modules: