From 5971cecb8634e95278295c8c563bebd9700509e3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 13 Sep 2005 12:50:59 +0000 Subject: [PATCH] [project @ 2005-09-13 12:50:59 by simonmar] Never use an installed Cabal package when building GHC (except when bootstrapping in stages 2 & 3). This insulates us from changes the user may have made to their Cabal installation. --- ghc/compiler/Makefile | 4 +++- ghc/lib/compat/Makefile | 29 ++++++----------------------- ghc/lib/compat/compat.mk | 5 +++++ ghc/utils/ghc-pkg/Makefile | 4 ---- 4 files changed, 14 insertions(+), 28 deletions(-) diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile index bed555c..2d47f04 100644 --- a/ghc/compiler/Makefile +++ b/ghc/compiler/Makefile @@ -491,7 +491,9 @@ PKG_DEPENDS += unix endif endif -ifneq "$(findstring YES, $(bootstrapped) $(ghc_ge_603))" "" +# We use the Cabal package in stages 2/3 only; in stage 1 we're using +# the libcompat library which provides the Cabal modules. +ifneq "$(stage)" "1" SRC_HC_OPTS += -package Cabal PKG_DEPENDS += Cabal endif diff --git a/ghc/lib/compat/Makefile b/ghc/lib/compat/Makefile index 95277c4..9cc0395 100644 --- a/ghc/lib/compat/Makefile +++ b/ghc/lib/compat/Makefile @@ -41,32 +41,15 @@ UseGhcForCc = YES SRC_HC_OPTS += $(filter-out -D%, $(GhcHcOpts)) ifeq "$(ghc_ge_603)" "YES" -# These modules are all provided in GHC 6.3+ +# These modules are provided in GHC 6.3+ EXCLUDED_SRCS += \ - System/Directory/Internals.hs \ - Distribution/Compat/FilePath.hs \ - Distribution/Compat/ReadP.hs \ - Distribution/GetOpt.hs \ - Distribution/InstalledPackageInfo.hs \ - Distribution/License.hs \ - Distribution/Package.hs \ - Distribution/ParseUtils.hs \ - Distribution/Compiler.hs \ - Distribution/Version.hs \ - Language/Haskell/Extension.hs + System/Directory/Internals.hs SRC_MKDEPENDHS_OPTS += \ - -optdep--exclude-module=System.Directory.Internals \ - -optdep--exclude-module=Distribution.Compat.FilePath \ - -optdep--exclude-module=Distribution.Compat.ReadP \ - -optdep--exclude-module=Distribution.GetOpt \ - -optdep--exclude-module=Distribution.InstalledPackageInfo \ - -optdep--exclude-module=Distribution.License \ - -optdep--exclude-module=Distribution.Package \ - -optdep--exclude-module=Distribution.ParseUtils \ - -optdep--exclude-module=Distribution.Compiler \ - -optdep--exclude-module=Distribution.Version \ - -optdep--exclude-module=Language.Haskell.Extension + -optdep--exclude-module=System.Directory.Internals + +# GHC 6.3+ has Cabal, but we're replacing it: +SRC_HC_OPTS += -ignore-package Cabal endif # Some explicit dependencies, needed because ghc -M can't discover the diff --git a/ghc/lib/compat/compat.mk b/ghc/lib/compat/compat.mk index c85e6df..156f033 100644 --- a/ghc/lib/compat/compat.mk +++ b/ghc/lib/compat/compat.mk @@ -10,6 +10,11 @@ SRC_HC_OPTS += -i$(GHC_LIB_COMPAT_DIR) SRC_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR) -lghccompat +# Do *not* use the installed Cabal: +ifeq "$(ghc_ge_603)" "YES" +SRC_HC_OPTS += -ignore-package Cabal +endif + # And similarly for when booting from .hc files: HC_BOOT_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR) HC_BOOT_LIBS += -lghccompat diff --git a/ghc/utils/ghc-pkg/Makefile b/ghc/utils/ghc-pkg/Makefile index 2e09ab0..d513a91 100644 --- a/ghc/utils/ghc-pkg/Makefile +++ b/ghc/utils/ghc-pkg/Makefile @@ -23,10 +23,6 @@ ifeq "$(ghc_ge_504)" "NO" SRC_HC_OPTS += -package lang -package util -package text endif -ifeq "$(ghc_ge_603)" "YES" -SRC_HC_OPTS += -package Cabal -endif - # On Windows, ghc-pkg is a standalone program # ($bindir/ghc-pkg.exe), whereas on Unix it needs a wrapper script # to pass the appropriate flag to the real binary -- 1.7.10.4