diff --git a/ghc.mk b/ghc.mk index b070777035fcda33d1e067d7e1bd146c6925d171..159f15edf150977070a921d5e08134ffb2fdf7e0 100644 --- a/ghc.mk +++ b/ghc.mk @@ -356,6 +356,8 @@ endif # so we don't have to include it below. BOOT_PKGS = Cabal hpc extensible-exceptions binary bin-package-db +BOOT_PKG_CONSTRAINTS := $(foreach p,$(BOOT_PKGS),--constraint "$p == $(shell grep -i "^Version:" libraries/$p/$p.cabal | sed "s/[^0-9.]//g")") + # The actual .a and .so/.dll files: needed for dependencies. ALL_STAGE1_LIBS = $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_v_LIB)) ifeq "$(BuildSharedLibs)" "YES" diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk index 88e2c63171d7a37533c73687fe4ca288868586e6..5882e89a37ab66423d46cc8fc8202eb7b92b50f1 100644 --- a/rules/build-package-data.mk +++ b/rules/build-package-data.mk @@ -42,6 +42,10 @@ ifneq "$$(ICONV_LIB_DIRS)" "" $1_$2_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="$$(ICONV_LIB_DIRS)" endif +ifeq "$3" "0" +$1_$2_CONFIGURE_OPTS += $$(BOOT_PKG_CONSTRAINTS) +endif + # This rule configures the package, generates the package-data.mk file # for our build system, and registers the package for use in-place in # the build tree.