Commit cdf16555 authored by ian@well-typed.com's avatar ian@well-typed.com

Build system tweak: Do the package checks at configure time

This removes the '.PHONY' rule, so means that "make" in a built tree
won't repeat the check.

We also now check the .cabal files for the executables as well as the
libraries.
parent 3c839acd
......@@ -24,6 +24,11 @@ compiler_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
compiler_stage1_C_FILES_NODEPS = compiler/parser/cutils.c
# This package doesn't pass the Cabal checks because include-dirs
# points outside the source directory. This isn't a real problem, so
# we just skip the check.
compiler_NO_CHECK = YES
ifneq "$(BINDIST)" "YES"
compiler/stage1/package-data.mk : compiler/stage1/build/Config.hs
compiler/stage2/package-data.mk : compiler/stage2/build/Config.hs
......
......@@ -566,23 +566,6 @@ libraries/dph/dph-lifted-copy_dist-install_EXCLUDED_WAYS := dyn
libraries/dph/dph-lifted-vseg_dist-install_EXCLUDED_WAYS := dyn
endif
# ----------------------------------------------
# Checking packages with 'cabal check'
ifeq "$(phase)" "final"
ifeq "$(CHECK_PACKAGES)" "YES"
all: check_packages
endif
endif
# These packages don't pass the Cabal checks because hs-source-dirs
# points outside the source directory. This isn't a real problem in
# these cases, so we just skip checking them.
# NB. these must come before we include the ghc.mk files below, because
# they disable the relevant rules.
# In compiler's case, include-dirs points outside of the source tree
CHECKED_compiler = YES
# -----------------------------------------------------------------------------
# Include build instructions from all subdirs
......
......@@ -31,6 +31,11 @@ ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES"
ghc_stage1_CONFIGURE_OPTS += --constraint "ghc == $(compiler_stage1_MUNGED_VERSION)"
endif
# This package doesn't pass the Cabal checks because data-dir
# points outside the source directory. This isn't a real problem, so
# we just skip the check.
ghc_NO_CHECK = YES
ghc_stage1_MORE_HC_OPTS = $(GhcStage1HcOpts)
ghc_stage2_MORE_HC_OPTS = $(GhcStage2HcOpts)
ghc_stage3_MORE_HC_OPTS = $(GhcStage3HcOpts)
......
......@@ -102,6 +102,14 @@ $1/$2/build/autogen/cabal_macros.h : $1/$2/package-data.mk
# for our build system, and registers the package for use in-place in
# the build tree.
$1/$2/package-data.mk : $$(GHC_CABAL_INPLACE) $$($1_$2_GHC_PKG_DEP) $1/$$($1_PACKAGE).cabal $$(wildcard $1/configure) $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_CONFIG_DEP)
# Checking packages built with the bootstrapping compiler would
# generally be a waste of time. Either we will rebuild them with
# stage1/stage2, or we don't really care about them.
ifneq "$3" "0"
ifneq "$$($1_NO_CHECK)" "YES"
CROSS_COMPILE="$(CrossCompilePrefix)" "$$(GHC_CABAL_INPLACE)" check $1
endif
endif
CROSS_COMPILE="$(CrossCompilePrefix)" "$$(GHC_CABAL_INPLACE)" configure --with-ghc="$$($1_$2_HC_CONFIG)" --with-ghc-pkg="$$($1_$2_GHC_PKG)" $$($1_CONFIGURE_OPTS) $$($1_$2_CONFIGURE_OPTS) -- $2 $1
ifeq "$$($1_$2_PROG)" ""
ifneq "$$($1_$2_REGISTER_PACKAGE)" "NO"
......
......@@ -137,14 +137,6 @@ ifneq "$$($1_$2_GROUP)" ""
all_$$($1_$2_GROUP): all_$1_$2
endif
ifneq "$$(CHECKED_$1)" "YES"
CHECKED_$1 = YES
check_packages: check_$1
.PHONY: check_$1
check_$1: $$(GHC_CABAL_INPLACE)
CROSS_COMPILE="$(CrossCompilePrefix)" $$(GHC_CABAL_INPLACE) check $1
endif
ifneq "$3" "0"
$(call haddock,$1,$2)
endif
......
......@@ -11,7 +11,7 @@ Description:
XXX
Category: Development
build-type: Simple
cabal-version: >=1.2
cabal-version: >=1.4
Executable ghc-pkg
Main-Is: Main.hs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment