1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
module Way (
WayUnit (..), Way, wayUnit, addWayUnit, removeWayUnit, wayFromUnits, allWays,
vanilla, profiling, dynamic, profilingDynamic, threaded, debug, logging,
threadedDebug, threadedProfiling, threadedLogging, threadedDynamic,
threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic,
threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic,
wayPrefix, waySuffix, hisuf, osuf, hcsuf, obootsuf, hibootsuf, ssuf
) where
import Way.Type
-- | Build default _vanilla_ way.
vanilla :: Way
vanilla = wayFromUnits []
-- | Build with profiling.
profiling :: Way
profiling = wayFromUnits [Profiling]
-- | Build with dynamic linking.
dynamic :: Way
dynamic = wayFromUnits [Dynamic]
-- | Build with profiling and dynamic linking.
profilingDynamic :: Way
profilingDynamic = wayFromUnits [Profiling, Dynamic]
-- RTS only ways below. See compiler/GHC/Driver/Session.hs.
-- | Build RTS with event logging.
logging :: Way
logging = wayFromUnits [Logging]
-- | Build multithreaded RTS.
threaded :: Way
threaded = wayFromUnits [Threaded]
-- | Build RTS with debug information.
debug :: Way
debug = wayFromUnits [Debug]
-- | Various combinations of RTS only ways.
threadedDebug, threadedProfiling, threadedLogging, threadedDynamic,
threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic,
threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic :: Way
threadedDebug = wayFromUnits [Threaded, Debug]
threadedProfiling = wayFromUnits [Threaded, Profiling]
threadedLogging = wayFromUnits [Threaded, Logging]
threadedDynamic = wayFromUnits [Threaded, Dynamic]
threadedDebugProfiling = wayFromUnits [Threaded, Debug, Profiling]
threadedDebugDynamic = wayFromUnits [Threaded, Debug, Dynamic]
threadedProfilingDynamic = wayFromUnits [Threaded, Profiling, Dynamic]
threadedLoggingDynamic = wayFromUnits [Threaded, Logging, Dynamic]
debugProfiling = wayFromUnits [Debug, Profiling]
debugDynamic = wayFromUnits [Debug, Dynamic]
loggingDynamic = wayFromUnits [Logging, Dynamic]
-- | All ways supported by the build system.
allWays :: [Way]
allWays =
[ vanilla, profiling, dynamic, profilingDynamic, threaded, debug, logging
, threadedDebug, threadedProfiling, threadedLogging, threadedDynamic
, threadedDebugProfiling, threadedDebugDynamic, threadedProfilingDynamic
, threadedLoggingDynamic, debugProfiling, debugDynamic, loggingDynamic ]
wayPrefix :: Way -> String
wayPrefix way | way == vanilla = ""
| otherwise = show way ++ "_"
waySuffix :: Way -> String
waySuffix way | way == vanilla = ""
| otherwise = "_" ++ show way
osuf, ssuf, hisuf, hcsuf, obootsuf, hibootsuf :: Way -> String
osuf = (++ "o" ) . wayPrefix
ssuf = (++ "s" ) . wayPrefix
hisuf = (++ "hi" ) . wayPrefix
hcsuf = (++ "hc" ) . wayPrefix
obootsuf = (++ "o-boot" ) . wayPrefix
hibootsuf = (++ "hi-boot") . wayPrefix
|