Don't use the cc-options from packages when compiling .hc files
[ghc-hetmet.git] / mk / config.mk.in
index 3812475..b1b54f3 100644 (file)
@@ -752,6 +752,8 @@ GHC_MANGLER_DIR_REL = $(GHC_DRIVER_DIR_REL)/mangler
 GHC_SPLIT_DIR_REL      = $(GHC_DRIVER_DIR_REL)/split
 GHC_SYSMAN_DIR_REL     = $(GHC_RTS_DIR_REL)/parallel
 
+INPLACE_DATA_DIR       = $(FPTOOLS_TOP_ABS)/inplace-datadir
+
 GHC_UTILS_DIR          = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
 GHC_INCLUDE_DIR                = $(FPTOOLS_TOP)/$(GHC_INCLUDE_DIR_REL)
 GHC_COMPILER_DIR       = $(FPTOOLS_TOP)/$(GHC_COMPILER_DIR_REL)
@@ -922,13 +924,22 @@ 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@
 GhcMinVersion  = @GhcMinVersion@
 
+# We build a few packages using the installed GHC as part of the
+# bootstrapping process.  These are installed into a local
+# package.conf file, $(BOOTSTRAPPING_CONF).  When we invoke the
+# installed GHC we need to pass it -package-conf $(BOOTSTRAPPING_CONF).
+# So the following variables expand to -package-conf $(BOOTSTRAPPING_CONF)
+# when $(HC) does *not* point to one of the GHC binaries built in
+# the local tree.
+#
+BOOTSTRAPPING_PACKAGE_CONF_HC_OPTS =$(if $(findstring $(GHC_COMPILER_DIR_ABS), $(HC)),,-package-conf $(BOOTSTRAPPING_CONF))
+BOOTSTRAPPING_PACKAGE_CONF_MKDEPENDHS_OPTS =$(if $(findstring $(GHC_COMPILER_DIR_ABS), $(MKDEPENDHS)),,-package-conf $(BOOTSTRAPPING_CONF))
+
 # Some useful GHC version predicates:
 ghc_ge_605 = @ghc_ge_605@
 ghc_ge_607 = @ghc_ge_607@