X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Fcabal-flags.mk;h=bfa11a84b05b52ab6d48ef94a3abe4cd1b68eda8;hb=2dce32ca5188120ca220a36139ff216b852b389e;hp=d69999f9b0681744e40a9e74f1afdd1b234b9f98;hpb=ecb13508a1c09df7b87ba5260a30a2a23bdd46d0;p=ghc-hetmet.git diff --git a/mk/cabal-flags.mk b/mk/cabal-flags.mk index d69999f..bfa11a8 100644 --- a/mk/cabal-flags.mk +++ b/mk/cabal-flags.mk @@ -1,6 +1,7 @@ nothing= space=$(nothing) $(nothing) +comma=, GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg @@ -11,6 +12,11 @@ INSTALL_PACKAGE = \ $(UTILS_ABS)/installPackage/install-inplace/bin/installPackage STAGE3_PACKAGE_CONF = $(FPTOOLS_TOP_ABS)/stage3.package.conf +# Euch, hideous hack: +CABAL_DOTTED_VERSION = $(shell grep "^Version:" $(LIBRARIES_ABS)/Cabal/Cabal.cabal | sed "s/^Version: //") +CABAL_VERSION = $(subst .,$(comma),$(CABAL_DOTTED_VERSION)) +CABAL_CONSTRAINT = --constraint="Cabal == $(CABAL_DOTTED_VERSION)" + # We rely on all the CONFIGURE_ARGS being quoted with '...', and there # being no 's inside the values. FLAGGED_CONFIGURE_ARGS = $(subst $(space)',\ @@ -38,7 +44,7 @@ endif COMMON_CONFIGURE_FLAGS += $(FLAGGED_CONFIGURE_ARGS) \ --configure-option=--with-cc=$(CC) -COMMON_CONFIGURE_FLAGS += $(shell [ -e $(HSC2HS_INPLACE) ] && \ +COMMON_CONFIGURE_FLAGS += $(shell [ -f $(HSC2HS_INPLACE) ] && \ echo --with-hsc2hs=$(HSC2HS_INPLACE) ) ifeq "$(Windows)" "YES" @@ -88,3 +94,37 @@ USE_STAGE2_CONFIGURE_FLAGS = \ BUILD_FLAGS = $(addprefix --ghc-option=,$(SRC_HC_OPTS)) + +# We now define various i* variables, which are used for the paths +# when installing Cabal libraries +ifeq "$(RelocatableBuild)" "YES" +# On Windows we want to make moveable bindists, but we need to tell +# ghc-pkg where the haddock docs are. Therefore we completely ignore +# where the user tells us to put the haddock documentation and put it +# somewhere whose relative location we know. When installing we need +# to give Cabal a real path, though. +iprefix = $$topdir +ibindir = $$topdir +ilibdir = $$topdir +ilibexecdir = $$topdir +idynlibdir = $$topdir +idatadir = $$topdir +idocdir = $$topdir/doc/libraries/$$pkg +ihaddockdir = $$topdir/doc/libraries/$$pkg +ihtmldir = $$httptopdir/doc/libraries/$$pkg +html_installed_root = $(prefix)/doc/libraries +else +# On non-Windows we can just give absolute paths all the time, and +# thus obey the htmldir that we are given. +iprefix = $(prefix) +ibindir = $(bindir) +ilibdir = $(libdir) +ilibexecdir = $(libexecdir) +idynlibdir = $(dynlibdir) +idatadir = $(datadir) +idocdir = $(docdir)/libraries/$$pkg +ihaddockdir = $(htmldir)/libraries/$$pkg +ihtmldir = $(htmldir)/libraries/$$pkg +html_installed_root = $(htmldir)/libraries +endif +