GHC new build system megapatch
[ghc-hetmet.git] / rules / package-config.mk
1
2 define package-config # args: $1 = dir, $2 = distdir, $3 = GHC stage
3
4 $1_$2_HC = $$(GHC_STAGE$3)
5
6 # configuration stuff that depends on which GHC we're building with
7 ifeq "$3" "0"
8 $1_$2_ghc_ge_609 = $(ghc_ge_609)
9 $1_$2_HC_CONFIG = $$(GHC_STAGE0)
10 $1_$2_HC_CONFIG_DEP =
11 $1_$2_GHC_PKG = $$(GHC_PKG)
12 $1_$2_GHC_PKG_DEP = 
13 $1_$2_HC_MK_DEPEND = $$($1_$2_HC)
14 # We can't make rules depend on the bootstrapping compiler, as then
15 # on cygwin we get a dep on c:/ghc/..., and make gets confused by the :
16 $1_$2_HC_MK_DEPEND_DEP =
17 $1_$2_HC_DEP =
18 ifeq "$$($1_$2_USE_BOOT_LIBS)" "YES"
19 $1_$2_HC_PKGCONF = -package-conf $(BOOTSTRAPPING_CONF)
20 $1_$2_GHC_PKG_OPTS = --package-conf=$$(BOOTSTRAPPING_CONF)
21 $1_$2_CONFIGURE_OPTS += --package-db=$$(TOP)/$$(BOOTSTRAPPING_CONF)
22 endif
23 else
24 $1_$2_ghc_ge_609 = YES
25 $1_$2_HC_PKGCONF = 
26 $1_$2_HC_CONFIG = $$(TOP)/$$(DUMMY_GHC_INPLACE)
27 $1_$2_HC_CONFIG_DEP = $$(DUMMY_GHC_INPLACE)
28 $1_$2_GHC_PKG = $$(TOP)/$$(GHC_PKG_INPLACE)
29 $1_$2_GHC_PKG_DEP = $$(GHC_PKG_INPLACE)
30 $1_$2_GHC_PKG_OPTS =
31 # If stage is not 0 then we always use stage1 for making .depend, as later
32 # stages aren't available early enough
33 $1_$2_HC_MK_DEPEND = $$(GHC_STAGE1)
34 $1_$2_HC_MK_DEPEND_DEP = $$($1_$2_HC_MK_DEPEND)
35 $1_$2_HC_DEP = $$($1_$2_HC)
36 $1_$2_HC_OPTS += -no-user-package-conf
37 endif
38
39 # Useful later
40 $1_$2_SLASH_MODS = $$(subst .,/,$$($1_$2_MODULES))
41 endef