Build hsc2hs with Cabal
[ghc-hetmet.git] / mk / cabal-flags.mk
1
2 nothing=
3 space=$(nothing) $(nothing)
4
5 # We rely on all the CONFIGURE_ARGS being quoted with '...', and there
6 # being no 's inside the values.
7 FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\
8                                  $(space)--configure-option=',\
9                                  $(space)$(CONFIGURE_ARGS))
10
11 COMMON_CONFIGURE_FLAGS = \
12     --libsubdir='$$pkgid' \
13     --with-ld=$(LD) \
14     $(addprefix --hsc2hs-option=,$(SRC_HSC2HS_OPTS))
15
16 ifneq "$(HSCOLOUR)" ""
17 COMMON_CONFIGURE_FLAGS += --with-hscolour=$(HSCOLOUR)
18 endif
19
20 ifneq "$(ALEX)" ""
21 COMMON_CONFIGURE_FLAGS += --with-alex=$(ALEX)
22 endif
23
24 ifneq "$(HADDOCK)" ""
25 COMMON_CONFIGURE_FLAGS += --with-haddock=$(HADDOCK)
26 endif
27
28 ifneq "$(HAPPY)" ""
29 COMMON_CONFIGURE_FLAGS += --with-happy=$(HAPPY)
30 endif
31
32 COMMON_CONFIGURE_FLAGS += $(FLAGGED_CONFIGURE_ARGS) \
33                           --configure-option=--with-cc=$(CC)
34
35 # We put non-existant paths in when configuring things that we plan to
36 # install, as we require that builds don't depend on these paths when
37 # making bindists.
38 INSTALL_CONFIGURE_FLAGS = \
39     --prefix=$(NONEXISTENT) \
40     --bindir=$(NONEXISTENT) \
41     --libdir=$(NONEXISTENT) \
42     --libexecdir=$(NONEXISTENT) \
43     --datadir=$(NONEXISTENT) \
44     --docdir=$(NONEXISTENT) \
45     --haddockdir=$(NONEXISTENT) \
46     --htmldir=$(NONEXISTENT) \
47     --with-compiler=$(FPTOOLS_TOP_ABS)/compiler/stage1/ghc-inplace \
48     --with-hc-pkg=$(FPTOOLS_TOP_ABS)/utils/ghc-pkg/ghc-pkg-inplace \
49     --with-hsc2hs=$(HSC2HS_INPLACE) \
50     $(COMMON_CONFIGURE_FLAGS)
51
52 INPLACE_CONFIGURE_FLAGS = \
53     --prefix=`$(TOP)/utils/pwd/pwd forwardslash`/install-inplace \
54     --with-compiler=$(GHC) \
55     --with-hc-pkg=$(GHC_PKG) \
56     $(COMMON_CONFIGURE_FLAGS)
57
58 # XXX
59 #    --bindir='$$prefix/bin' \
60 #    --libdir='$$prefix/lib' \
61 #    --libexecdir='$$prefix/libexec' \
62 #    --datadir='$$prefix/data' \
63 #    --docdir='$$prefix/doc' \
64 #    --haddockdir='$$prefix/haddock' \
65 #    --htmldir='$$prefix/html' \
66
67 BUILD_FLAGS = $(addprefix --ghc-option=,$(SRC_HC_OPTS))
68