From eae65ca88fc09342e295874fb253f83775c61051 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 3 Jul 2008 22:46:33 +0000 Subject: [PATCH] Remove Cabal modules from compat We now get them from the bootstrapping package.conf instead --- compat/Distribution/Compat/ReadP.hs | 3 --- compat/Distribution/Compat/TempFile.hs | 3 --- compat/Distribution/Compiler.hs | 3 --- compat/Distribution/GetOpt.hs | 3 --- compat/Distribution/InstalledPackageInfo.hs | 3 --- compat/Distribution/License.hs | 4 ---- compat/Distribution/ModuleName.hs | 3 --- compat/Distribution/Package.hs | 3 --- compat/Distribution/ParseUtils.hs | 3 --- compat/Distribution/ReadE.hs | 3 --- compat/Distribution/Simple/Program.hs | 3 --- compat/Distribution/Simple/Utils.hs | 3 --- compat/Distribution/System.hs | 3 --- compat/Distribution/Text.hs | 3 --- compat/Distribution/Verbosity.hs | 3 --- compat/Distribution/Version.hs | 3 --- compat/Language/Haskell/Extension.hs | 3 --- compat/Makefile | 24 ------------------------ compat/System/FilePath.hs | 3 --- compat/System/FilePath/Internal.hs | 3 --- compat/System/FilePath/Posix.hs | 3 --- compat/System/FilePath/Windows.hs | 3 --- compat/compat.mk | 19 ------------------- compiler/Makefile | 4 ---- mk/config.mk.in | 4 ++++ mk/opts.mk | 5 +++-- mk/package.mk | 1 + utils/ghc-pkg/Makefile | 2 ++ 28 files changed, 10 insertions(+), 113 deletions(-) delete mode 100644 compat/Distribution/Compat/ReadP.hs delete mode 100644 compat/Distribution/Compat/TempFile.hs delete mode 100644 compat/Distribution/Compiler.hs delete mode 100644 compat/Distribution/GetOpt.hs delete mode 100644 compat/Distribution/InstalledPackageInfo.hs delete mode 100644 compat/Distribution/License.hs delete mode 100644 compat/Distribution/ModuleName.hs delete mode 100644 compat/Distribution/Package.hs delete mode 100644 compat/Distribution/ParseUtils.hs delete mode 100644 compat/Distribution/ReadE.hs delete mode 100644 compat/Distribution/Simple/Program.hs delete mode 100644 compat/Distribution/Simple/Utils.hs delete mode 100644 compat/Distribution/System.hs delete mode 100644 compat/Distribution/Text.hs delete mode 100644 compat/Distribution/Verbosity.hs delete mode 100644 compat/Distribution/Version.hs delete mode 100644 compat/Language/Haskell/Extension.hs delete mode 100644 compat/System/FilePath.hs delete mode 100644 compat/System/FilePath/Internal.hs delete mode 100644 compat/System/FilePath/Posix.hs delete mode 100644 compat/System/FilePath/Windows.hs diff --git a/compat/Distribution/Compat/ReadP.hs b/compat/Distribution/Compat/ReadP.hs deleted file mode 100644 index 5fc69da..0000000 --- a/compat/Distribution/Compat/ReadP.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Compat/ReadP.hs" --- dummy comment diff --git a/compat/Distribution/Compat/TempFile.hs b/compat/Distribution/Compat/TempFile.hs deleted file mode 100644 index 631eb76..0000000 --- a/compat/Distribution/Compat/TempFile.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Compat/TempFile.hs" --- dummy comment diff --git a/compat/Distribution/Compiler.hs b/compat/Distribution/Compiler.hs deleted file mode 100644 index b5a2f68..0000000 --- a/compat/Distribution/Compiler.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Compiler.hs" --- dummy comment diff --git a/compat/Distribution/GetOpt.hs b/compat/Distribution/GetOpt.hs deleted file mode 100644 index 7da2e30..0000000 --- a/compat/Distribution/GetOpt.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/GetOpt.hs" --- dummy comment diff --git a/compat/Distribution/InstalledPackageInfo.hs b/compat/Distribution/InstalledPackageInfo.hs deleted file mode 100644 index 03f5092..0000000 --- a/compat/Distribution/InstalledPackageInfo.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/InstalledPackageInfo.hs" --- dummy comment diff --git a/compat/Distribution/License.hs b/compat/Distribution/License.hs deleted file mode 100644 index 31b1b27..0000000 --- a/compat/Distribution/License.hs +++ /dev/null @@ -1,4 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/License.hs" - --- dummy comment diff --git a/compat/Distribution/ModuleName.hs b/compat/Distribution/ModuleName.hs deleted file mode 100644 index 24db2a0..0000000 --- a/compat/Distribution/ModuleName.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/ModuleName.hs" --- dummy comment diff --git a/compat/Distribution/Package.hs b/compat/Distribution/Package.hs deleted file mode 100644 index d40171e..0000000 --- a/compat/Distribution/Package.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Package.hs" --- dummy comment diff --git a/compat/Distribution/ParseUtils.hs b/compat/Distribution/ParseUtils.hs deleted file mode 100644 index f5bf266..0000000 --- a/compat/Distribution/ParseUtils.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/ParseUtils.hs" --- dummy comment diff --git a/compat/Distribution/ReadE.hs b/compat/Distribution/ReadE.hs deleted file mode 100644 index 821b902..0000000 --- a/compat/Distribution/ReadE.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/ReadE.hs" --- dummy comment diff --git a/compat/Distribution/Simple/Program.hs b/compat/Distribution/Simple/Program.hs deleted file mode 100644 index 86d2e1a..0000000 --- a/compat/Distribution/Simple/Program.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Simple/Program.hs" --- dummy comment diff --git a/compat/Distribution/Simple/Utils.hs b/compat/Distribution/Simple/Utils.hs deleted file mode 100644 index 004418d..0000000 --- a/compat/Distribution/Simple/Utils.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Simple/Utils.hs" --- dummy comment diff --git a/compat/Distribution/System.hs b/compat/Distribution/System.hs deleted file mode 100644 index 8cf5f26..0000000 --- a/compat/Distribution/System.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/System.hs" --- dummy comment diff --git a/compat/Distribution/Text.hs b/compat/Distribution/Text.hs deleted file mode 100644 index e841203..0000000 --- a/compat/Distribution/Text.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Text.hs" --- dummy comment diff --git a/compat/Distribution/Verbosity.hs b/compat/Distribution/Verbosity.hs deleted file mode 100644 index 2c18f59..0000000 --- a/compat/Distribution/Verbosity.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Verbosity.hs" --- dummy comment diff --git a/compat/Distribution/Version.hs b/compat/Distribution/Version.hs deleted file mode 100644 index 1140c03..0000000 --- a/compat/Distribution/Version.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Distribution/Version.hs" --- dummy comment diff --git a/compat/Language/Haskell/Extension.hs b/compat/Language/Haskell/Extension.hs deleted file mode 100644 index 410a07b..0000000 --- a/compat/Language/Haskell/Extension.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "Cabal/Language/Haskell/Extension.hs" --- dummy comment diff --git a/compat/Makefile b/compat/Makefile index a95e161..fb28e2c 100644 --- a/compat/Makefile +++ b/compat/Makefile @@ -4,13 +4,6 @@ include $(TOP)/mk/boilerplate.mk ALL_DIRS = \ Data \ Compat \ - Distribution \ - Distribution/Compat \ - Distribution/Simple \ - Language/Haskell \ - System \ - System/FilePath \ - System/Directory \ Trace/Hpc \ cbits @@ -60,14 +53,6 @@ SRC_CC_OPTS += -D__GHC_PATCHLEVEL__=$(GhcPatchLevel) # This module shouldn't be compiled itself, only #included into other files EXCLUDED_SRCS += System/FilePath/Internal.hs -ifneq "$(ghc_ge_607)" "YES" -# GHC 6.3+ has Cabal, but we're replacing it: -SRC_HC_OPTS += -ignore-package Cabal - -# only GHC 6.3+ has -ignore-package -SRC_HC_OPTS += -ignore-package filepath -endif - ifeq "$(ghc_ge_607)" "YES" SRC_HC_OPTS += -package directory SRC_HC_OPTS += -package pretty @@ -76,15 +61,6 @@ endif # Some explicit dependencies, needed because ghc -M can't discover the # true dependencies of these stub files. System/Directory/Internals.$(way_)o : $(FPTOOLS_TOP)/libraries/directory/System/Directory/Internals.hs -Distribution/Compat/ReadP.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/ReadP.hs -Distribution/GetOpt.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/GetOpt.hs -Distribution/InstalledPackageInfo.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs -Distribution/License.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs -Distribution/Package.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs -Distribution/ParseUtils.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs -Distribution/Compiler.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compiler.hs -Distribution/Version.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs -Language/Haskell/Extension.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Language/Haskell/Extension.hs Trace/Hpc/Mix.$(way_)o : $(FPTOOLS_TOP)/libraries/hpc/Trace/Hpc/Mix.hs Trace/Hpc/Util.$(way_)o : $(FPTOOLS_TOP)/libraries/hpc/Trace/Hpc/Util.hs Trace/Hpc/Tix.$(way_)o : $(FPTOOLS_TOP)/libraries/hpc/Trace/Hpc/Tix.hs diff --git a/compat/System/FilePath.hs b/compat/System/FilePath.hs deleted file mode 100644 index 749d727..0000000 --- a/compat/System/FilePath.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "filepath/System/FilePath.hs" --- dummy comment diff --git a/compat/System/FilePath/Internal.hs b/compat/System/FilePath/Internal.hs deleted file mode 100644 index ce99a93..0000000 --- a/compat/System/FilePath/Internal.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "filepath/System/FilePath/Internal.hs" --- dummy comment diff --git a/compat/System/FilePath/Posix.hs b/compat/System/FilePath/Posix.hs deleted file mode 100644 index 132f5cb..0000000 --- a/compat/System/FilePath/Posix.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "filepath/System/FilePath/Posix.hs" --- dummy comment diff --git a/compat/System/FilePath/Windows.hs b/compat/System/FilePath/Windows.hs deleted file mode 100644 index 85a3214..0000000 --- a/compat/System/FilePath/Windows.hs +++ /dev/null @@ -1,3 +0,0 @@ -{-# OPTIONS -cpp #-} -#include "filepath/System/FilePath/Windows.hs" --- dummy comment diff --git a/compat/compat.mk b/compat/compat.mk index c2bfeb1..00a3c9f 100644 --- a/compat/compat.mk +++ b/compat/compat.mk @@ -14,9 +14,6 @@ SRC_HC_OPTS += -DUSING_COMPAT SRC_HC_OPTS += -i$(GHC_COMPAT_DIR) SRC_LD_OPTS += -L$(GHC_COMPAT_DIR) -lghccompat -# Do *not* use the installed Cabal: -SRC_HC_OPTS += -ignore-package Cabal - ifeq "$(ghc_ge_607)" "YES" SRC_HC_OPTS += -package directory SRC_HC_OPTS += -package pretty @@ -37,22 +34,6 @@ endif # from mkDependHS. SRC_MKDEPENDHS_OPTS += \ -optdep--exclude-module=Compat.Unicode \ - -optdep--exclude-module=Distribution.Compat.FilePath \ - -optdep--exclude-module=Distribution.Compat.ReadP \ - -optdep--exclude-module=Distribution.Extension \ - -optdep--exclude-module=Distribution.GetOpt \ - -optdep--exclude-module=Distribution.InstalledPackageInfo \ - -optdep--exclude-module=Distribution.License \ - -optdep--exclude-module=Distribution.ModuleName \ - -optdep--exclude-module=Distribution.Package \ - -optdep--exclude-module=Distribution.ParseUtils \ - -optdep--exclude-module=Distribution.Compiler \ - -optdep--exclude-module=Distribution.Version \ - -optdep--exclude-module=Distribution.ReadE \ - -optdep--exclude-module=Distribution.Text \ - -optdep--exclude-module=System.FilePath \ - -optdep--exclude-module=System.FilePath.Posix \ - -optdep--exclude-module=System.FilePath.Windows \ -optdep--exclude-module=Trace.Hpc.Mix \ -optdep--exclude-module=Trace.Hpc.Tix \ -optdep--exclude-module=Trace.Hpc.Util diff --git a/compiler/Makefile b/compiler/Makefile index ce69bae..5e503ea 100644 --- a/compiler/Makefile +++ b/compiler/Makefile @@ -602,12 +602,8 @@ SRC_HC_OPTS += -package unix PKG_DEPENDS += unix endif -# 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 # Ignore lang, to avoid potential clash with the Generics module if # lang happens to be a dependency of some exposed package in the local diff --git a/mk/config.mk.in b/mk/config.mk.in index e19a1cd..3749b3e 100644 --- a/mk/config.mk.in +++ b/mk/config.mk.in @@ -884,6 +884,8 @@ GHC_STAGE1 = $(GHC_COMPILER_DIR)/stage1/ghc-inplace -no-user-package-conf GHC_STAGE2 = $(GHC_COMPILER_DIR)/stage2/ghc-inplace -no-user-package-conf GHC_STAGE3 = $(GHC_COMPILER_DIR)/stage3/ghc-inplace -no-user-package-conf +BOOTSTRAPPING_CONF = $(FPTOOLS_TOP_ABS)/libraries/bootstrapping.conf + # NOTE: add -no-user-package-conf for stage 1-3 above, so that # we avoid picking up any packages the user might happen to have # installed for this GHC version. They are bound to be incompatible @@ -912,6 +914,8 @@ else # not UseStage1 or BootingFromHc HC = @WithHc@ MKDEPENDHS = $(GHC) +BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS = -package-conf $(BOOTSTRAPPING_CONF) +BOOTSTRAPPING_PACKAGE_CONF_MKDEPENDHS_OPTS = -package-conf $(BOOTSTRAPPING_CONF) GhcVersion = @GhcVersion@ GhcPatchLevel = @GhcPatchLevel@ GhcMajVersion = @GhcMajVersion@ diff --git a/mk/opts.mk b/mk/opts.mk index fe2d060..08ec4b6 100644 --- a/mk/opts.mk +++ b/mk/opts.mk @@ -60,7 +60,7 @@ endif # All the standard gluing together, as in the comment right at the front -HC_OPTS = $(SRC_HC_OPTS) $(WAY$(_way)_HC_OPTS) $($*_HC_OPTS) $(EXTRA_HC_OPTS) +HC_OPTS = $(BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS) $(SRC_HC_OPTS) $(WAY$(_way)_HC_OPTS) $($*_HC_OPTS) $(EXTRA_HC_OPTS) HC_POST_OPTS = $(SRC_HC_POST_OPTS) $(WAY$(_way)_HC_POST_OPTS) $($*_HC_POST_OPTS) $(EXTRA_HC_POST_OPTS) HC_PRE_OPTS = $(SRC_HC_PRE_OPTS) $(WAY$(_way)_HC_PRE_OPTS) $($*_HC_PRE_OPTS) $(EXTRA_HC_PRE_OPTS) @@ -95,7 +95,8 @@ LIT2HTML_OPTS = $(SRC_LIT2HTML_OPTS) $(WAY$(_way)_LIT2HTML_OPTS) $(EXTRA_LI LIT2LATEX_OPTS = $(SRC_LIT2LATEX_OPTS) $(WAY$(_way)_LIT2LATEX_OPTS) $(EXTRA_LIT2LATEX_OPTS) LIT2PGM_OPTS = $(SRC_LIT2PGM_OPTS) $(WAY$(_way)_LIT2PGM_OPTS) $(EXTRA_LIT2PGM_OPTS) MKDEPENDC_OPTS = $(SRC_MKDEPENDC_OPTS) $(WAY$(_way)_MKDEPENDC_OPTS) $(EXTRA_MKDEPENDC_OPTS) -MKDEPENDHS_OPTS = $(SRC_MKDEPENDHS_OPTS) $(WAY$(_way)_MKDEPENDHS_OPTS) \ +MKDEPENDHS_OPTS = $(BOOTSTRAPPING_PACKAGE_CONF_MKDEPENDHS_OPTS) \ + $(SRC_MKDEPENDHS_OPTS) $(WAY$(_way)_MKDEPENDHS_OPTS) \ $(EXTRA_MKDEPENDHS_OPTS) MKDEPENDLIT_OPTS = $(SRC_MKDEPENDLIT_OPTS) $(WAY$(_way)_MKDEPENDLIT_OPTS) \ $(EXTRA_MKDEPENDLIT_OPTS) diff --git a/mk/package.mk b/mk/package.mk index f17f9e0..44087aa 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -120,6 +120,7 @@ SRC_HSC2HS_OPTS += -I. ifneq "$(NO_SET_HC)" "YES" HC = $(GHC_INPLACE) +BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS = endif IGNORE_PACKAGE_FLAG = -package-name $(PACKAGE)-$(VERSION) diff --git a/utils/ghc-pkg/Makefile b/utils/ghc-pkg/Makefile index f35bbf9..adce829 100644 --- a/utils/ghc-pkg/Makefile +++ b/utils/ghc-pkg/Makefile @@ -33,6 +33,8 @@ ifeq "$(ghc_ge_607)" "YES" SRC_HC_OPTS += -package containers endif +SRC_HC_OPTS += -package Cabal + # 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