Ensure that GHC.Stack.callStack doesn't fail
[ghc.git] / iserv / ghc.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009-2012 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 # http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13 iserv_USES_CABAL = YES
14 iserv_PACKAGE = iserv-bin
15 iserv_EXECUTABLE = iserv
16
17 ifeq "$(GhcDebugged)" "YES"
18 iserv_stage2_MORE_HC_OPTS += -debug
19 iserv_stage2_p_MORE_HC_OPTS += -debug
20 iserv_stage2_dyn_MORE_HC_OPTS += -debug
21 endif
22
23 ifeq "$(GhcThreaded)" "YES"
24 iserv_stage2_MORE_HC_OPTS += -threaded
25 iserv_stage2_p_MORE_HC_OPTS += -threaded
26 iserv_stage2_dyn_MORE_HC_OPTS += -threaded
27 endif
28
29 # Add -Wl,--export-dynamic enables GHCi to load dynamic objects that
30 # refer to the RTS. This is harmless if you don't use it (adds a bit
31 # of overhead to startup and increases the binary sizes) but if you
32 # need it there's no alternative.
33 ifeq "$(TargetElf)" "YES"
34 ifneq "$(TargetOS_CPP)" "solaris2"
35 # The Solaris linker does not support --export-dynamic option. It also
36 # does not need it since it exports all dynamic symbols by default
37 iserv_stage2_MORE_HC_OPTS += -optl-Wl,--export-dynamic
38 iserv_stage2_p_MORE_HC_OPTS += -optl-Wl,--export-dynamic
39 iserv_stage2_dyn_MORE_HC_OPTS += -optl-Wl,--export-dynamic
40 endif
41 endif
42
43 # Override the default way, because we want a specific version of this
44 # program for each way. Note that it's important to do this even for
45 # the vanilla version, otherwise we get a dynamic executable when
46 # DYNAMIC_GHC_PROGRAMS=YES.
47 iserv_stage2_PROGRAM_WAY = v
48 iserv_stage2_p_PROGRAM_WAY = p
49 iserv_stage2_dyn_PROGRAM_WAY = dyn
50
51 iserv_stage2_PROGNAME = ghc-iserv
52 iserv_stage2_p_PROGNAME = ghc-iserv-prof
53 iserv_stage2_dyn_PROGNAME = ghc-iserv-dyn
54
55 iserv_stage2_MORE_HC_OPTS += -no-hs-main
56 iserv_stage2_p_MORE_HC_OPTS += -no-hs-main
57 iserv_stage2_dyn_MORE_HC_OPTS += -no-hs-main
58
59 iserv_stage2_INSTALL = YES
60 iserv_stage2_p_INSTALL = YES
61 iserv_stage2_dyn_INSTALL = YES
62
63 # Install in $(libexec), not in $(bindir)
64 iserv_stage2_TOPDIR = YES
65 iserv_stage2_p_TOPDIR = YES
66 iserv_stage2_dyn_TOPDIR = YES
67
68 iserv_stage2_INSTALL_INPLACE = YES
69 iserv_stage2_p_INSTALL_INPLACE = YES
70 iserv_stage2_dyn_INSTALL_INPLACE = YES
71
72 $(eval $(call build-prog,iserv,stage2,1))
73
74 ifeq "$(CLEANING)" "YES"
75
76 NEED_iserv_p = YES
77 NEED_iserv_dyn = YES
78
79 else
80
81 ifneq "$(findstring p, $(GhcLibWays))" ""
82 NEED_iserv_p = YES
83 else
84 NEED_iserv_p = NO
85 endif
86
87 ifneq "$(findstring dyn, $(GhcLibWays))" ""
88 NEED_iserv_dyn = YES
89 else
90 NEED_iserv_dyn = NO
91 endif
92 endif
93
94 ifeq "$(NEED_iserv_p)" "YES"
95 $(eval $(call build-prog,iserv,stage2_p,1))
96 endif
97
98 ifeq "$(NEED_iserv_dyn)" "YES"
99 $(eval $(call build-prog,iserv,stage2_dyn,1))
100 endif
101
102 all_ghc_stage2 : $(iserv-stage2_INPLACE)
103 all_ghc_stage2 : $(iserv-stage2_p_INPLACE)
104 all_ghc_stage2 : $(iserv-stage2_dyn_INPLACE)