package-config.mk 1.96 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
#
# -----------------------------------------------------------------------------

Ian Lynagh's avatar
Ian Lynagh committed
13
14
15
16
17
18
19

define package-config # args: $1 = dir, $2 = distdir, $3 = GHC stage

$1_$2_HC = $$(GHC_STAGE$3)

# configuration stuff that depends on which GHC we're building with
ifeq "$3" "0"
20
21
22
$1_$2_ghc_ge_6102 = $$(ghc_ge_6102)
$1_$2_ghc_ge_611 = $$(ghc_ge_611)
$1_$2_ghc_ge_613 = $$(ghc_ge_613)
Ian Lynagh's avatar
Ian Lynagh committed
23
24
25
26
27
28
29
30
31
$1_$2_HC_CONFIG = $$(GHC_STAGE0)
$1_$2_HC_CONFIG_DEP =
$1_$2_GHC_PKG = $$(GHC_PKG)
$1_$2_GHC_PKG_DEP = 
$1_$2_HC_MK_DEPEND = $$($1_$2_HC)
# We can't make rules depend on the bootstrapping compiler, as then
# on cygwin we get a dep on c:/ghc/..., and make gets confused by the :
$1_$2_HC_MK_DEPEND_DEP =
$1_$2_HC_DEP =
32
$1_$2_HC_PKGCONF = -package-conf $$(BOOTSTRAPPING_CONF)
Ian Lynagh's avatar
Ian Lynagh committed
33
34
$1_$2_GHC_PKG_OPTS = --package-conf=$$(BOOTSTRAPPING_CONF)
$1_$2_CONFIGURE_OPTS += --package-db=$$(TOP)/$$(BOOTSTRAPPING_CONF)
35
$1_$2_HC_OPTS += -no-user-package-conf
36
37
38
ifeq "$(ghc_ge_613)" "YES"
$1_$2_HC_OPTS += -rtsopts
endif
Ian Lynagh's avatar
Ian Lynagh committed
39
else
40
41
42
$1_$2_ghc_ge_6102 = YES
$1_$2_ghc_ge_611 = YES
$1_$2_ghc_ge_613 = YES
Ian Lynagh's avatar
Ian Lynagh committed
43
44
45
46
47
48
49
50
51
52
53
54
$1_$2_HC_PKGCONF = 
$1_$2_HC_CONFIG = $$(TOP)/$$(DUMMY_GHC_INPLACE)
$1_$2_HC_CONFIG_DEP = $$(DUMMY_GHC_INPLACE)
$1_$2_GHC_PKG = $$(TOP)/$$(GHC_PKG_INPLACE)
$1_$2_GHC_PKG_DEP = $$(GHC_PKG_INPLACE)
$1_$2_GHC_PKG_OPTS =
# If stage is not 0 then we always use stage1 for making .depend, as later
# stages aren't available early enough
$1_$2_HC_MK_DEPEND = $$(GHC_STAGE1)
$1_$2_HC_MK_DEPEND_DEP = $$($1_$2_HC_MK_DEPEND)
$1_$2_HC_DEP = $$($1_$2_HC)
$1_$2_HC_OPTS += -no-user-package-conf
55
$1_$2_HC_OPTS += -rtsopts
Ian Lynagh's avatar
Ian Lynagh committed
56
57
58
59
endif

# Useful later
$1_$2_SLASH_MODS = $$(subst .,/,$$($1_$2_MODULES))
60

Ian Lynagh's avatar
Ian Lynagh committed
61
endef