3 space=$(nothing) $(nothing)
6 GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg
8 LIBRARIES_ABS = $(FPTOOLS_TOP_ABS)/libraries
9 UTILS_ABS = $(FPTOOLS_TOP_ABS)/utils
10 CABAL = $(LIBRARIES_ABS)/cabal-bin $(GHC) $(LIBRARIES_ABS)/bootstrapping.conf
12 $(UTILS_ABS)/installPackage/install-inplace/bin/installPackage
13 STAGE3_PACKAGE_CONF = $(FPTOOLS_TOP_ABS)/stage3.package.conf
16 CABAL_DOTTED_VERSION = $(shell grep "^Version:" $(LIBRARIES_ABS)/Cabal/Cabal.cabal | sed "s/^Version: //")
17 CABAL_VERSION = $(subst .,$(comma),$(CABAL_DOTTED_VERSION))
18 CABAL_CONSTRAINT = --constraint="Cabal == $(CABAL_DOTTED_VERSION)"
20 # We rely on all the CONFIGURE_ARGS being quoted with '...', and there
21 # being no 's inside the values.
22 FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\
23 $(space)--configure-option=',\
24 $(space)$(CONFIGURE_ARGS))
26 COMMON_CONFIGURE_FLAGS = \
27 --libsubdir='$$pkgid' \
28 --with-gcc=$(WhatGccIsCalled) \
30 $(addprefix --hsc2hs-option=,$(SRC_HSC2HS_OPTS))
32 ifneq "$(HSCOLOUR)" ""
33 COMMON_CONFIGURE_FLAGS += --with-hscolour=$(HSCOLOUR)
37 COMMON_CONFIGURE_FLAGS += --with-alex=$(ALEX)
41 COMMON_CONFIGURE_FLAGS += --with-happy=$(HAPPY)
44 COMMON_CONFIGURE_FLAGS += $(FLAGGED_CONFIGURE_ARGS) \
45 --configure-option=--with-cc=$(CC)
47 COMMON_CONFIGURE_FLAGS += $(shell [ -f $(HSC2HS_INPLACE) ] && \
48 echo --with-hsc2hs=$(HSC2HS_INPLACE) )
50 ifeq "$(Windows)" "YES"
51 NONEXISTENT=c:/NONEXISTENT
53 NONEXISTENT=/NONEXISTENT
56 # We put non-existant paths in when configuring things that we plan to
57 # install, as we require that builds don't depend on these paths when
59 INSTALL_DIRS_CONFIGURE_FLAGS = \
60 --prefix=$(NONEXISTENT) \
61 --bindir=$(NONEXISTENT) \
62 --libdir=$(NONEXISTENT) \
63 --libexecdir=$(NONEXISTENT) \
64 --datadir=$(NONEXISTENT) \
65 --docdir=$(NONEXISTENT) \
66 --haddockdir=$(NONEXISTENT) \
67 --htmldir=$(NONEXISTENT)
69 INPLACE_GHC_DATADIR_CONFIGURE_FLAGS = \
70 --datadir=$(FPTOOLS_TOP_ABS)/inplace-datadir \
73 INPLACE_DIRS_CONFIGURE_FLAGS = \
74 --prefix=`$(FPTOOLS_TOP_ABS)/utils/pwd/pwd forwardslash`/install-inplace
76 USE_BOOT_CONFIGURE_FLAGS = \
77 --with-compiler=$(GHC) \
78 --with-hc-pkg=$(GHC_PKG) \
79 --package-db $(FPTOOLS_TOP_ABS)/libraries/bootstrapping.conf
81 USE_STAGE_CONFIGURE_FLAGS = \
82 --with-hc-pkg=$(GHC_PKG_INPLACE) \
83 $(addprefix --cc-option=,$(MACOSX_DEPLOYMENT_CC_OPTS)) \
84 $(addprefix --ld-option=,$(MACOSX_DEPLOYMENT_LD_OPTS))
86 USE_STAGE1_CONFIGURE_FLAGS = \
87 --with-compiler=$(GHC_STAGE1) \
88 $(USE_STAGE_CONFIGURE_FLAGS)
90 USE_STAGE2_CONFIGURE_FLAGS = \
91 --with-compiler=$(GHC_STAGE2) \
92 $(USE_STAGE_CONFIGURE_FLAGS) \
93 --package-db $(STAGE3_PACKAGE_CONF)
95 BUILD_FLAGS = $(addprefix --ghc-option=,$(SRC_HC_OPTS))
98 # We now define various i* variables, which are used for the paths
99 # when installing Cabal libraries
100 ifeq "$(RelocatableBuild)" "YES"
101 # On Windows we want to make moveable bindists, but we need to tell
102 # ghc-pkg where the haddock docs are. Therefore we completely ignore
103 # where the user tells us to put the haddock documentation and put it
104 # somewhere whose relative location we know. When installing we need
105 # to give Cabal a real path, though.
109 ilibexecdir = $$topdir
110 idynlibdir = $$topdir
112 idocdir = $$topdir/doc/libraries/$$pkg
113 ihaddockdir = $$topdir/doc/libraries/$$pkg
114 ihtmldir = $$httptopdir/doc/libraries/$$pkg
115 html_installed_root = $(prefix)/doc/libraries
117 # On non-Windows we can just give absolute paths all the time, and
118 # thus obey the htmldir that we are given.
122 ilibexecdir = $(libexecdir)
123 idynlibdir = $(dynlibdir)
124 idatadir = $(datadir)
125 idocdir = $(docdir)/libraries/$$pkg
126 ihaddockdir = $(htmldir)/libraries/$$pkg
127 ihtmldir = $(htmldir)/libraries/$$pkg
128 html_installed_root = $(htmldir)/libraries