micro-opt: replace stmGetEnclosingTRec() with a field access
[ghc-hetmet.git] / rules / package-config.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 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://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13
14 define package-config # args: $1 = dir, $2 = distdir, $3 = GHC stage
15
16 $1_$2_HC = $$(GHC_STAGE$3)
17
18 # configuration stuff that depends on which GHC we're building with
19 ifeq "$3" "0"
20 $1_$2_ghc_ge_609 = $$(ghc_ge_609)
21 $1_$2_HC_CONFIG = $$(GHC_STAGE0)
22 $1_$2_HC_CONFIG_DEP =
23 $1_$2_GHC_PKG = $$(GHC_PKG)
24 $1_$2_GHC_PKG_DEP = 
25 $1_$2_HC_MK_DEPEND = $$($1_$2_HC)
26 # We can't make rules depend on the bootstrapping compiler, as then
27 # on cygwin we get a dep on c:/ghc/..., and make gets confused by the :
28 $1_$2_HC_MK_DEPEND_DEP =
29 $1_$2_HC_DEP =
30 $1_$2_HC_PKGCONF = -package-conf $$(BOOTSTRAPPING_CONF)
31 $1_$2_GHC_PKG_OPTS = --package-conf=$$(BOOTSTRAPPING_CONF)
32 $1_$2_CONFIGURE_OPTS += --package-db=$$(TOP)/$$(BOOTSTRAPPING_CONF)
33 else
34 $1_$2_ghc_ge_609 = YES
35 $1_$2_HC_PKGCONF = 
36 $1_$2_HC_CONFIG = $$(TOP)/$$(DUMMY_GHC_INPLACE)
37 $1_$2_HC_CONFIG_DEP = $$(DUMMY_GHC_INPLACE)
38 $1_$2_GHC_PKG = $$(TOP)/$$(GHC_PKG_INPLACE)
39 $1_$2_GHC_PKG_DEP = $$(GHC_PKG_INPLACE)
40 $1_$2_GHC_PKG_OPTS =
41 # If stage is not 0 then we always use stage1 for making .depend, as later
42 # stages aren't available early enough
43 $1_$2_HC_MK_DEPEND = $$(GHC_STAGE1)
44 $1_$2_HC_MK_DEPEND_DEP = $$($1_$2_HC_MK_DEPEND)
45 $1_$2_HC_DEP = $$($1_$2_HC)
46 $1_$2_HC_OPTS += -no-user-package-conf
47 endif
48
49 # Useful later
50 $1_$2_SLASH_MODS = $$(subst .,/,$$($1_$2_MODULES))
51
52 endef