+ifeq "$(STANDALONE_PACKAGE)" "NO"
+PKGCONF_CPP_EXTRA_OPTS = -I$(GHC_INCLUDE_DIR)
+else
+PKGCONF_CPP_EXTRA_OPTS =
+endif
+
+package.conf.inplace : package.conf.in
+ $(CPP) $(RAWCPP_FLAGS) -P $(PKGCONF_CPP_EXTRA_OPTS) -x c $(PACKAGE_CPP_OPTS) $< | \
+ sed -e 's/""//g' -e 's/\[ *,/[ /g' >$@
+
+package.conf.installed : package.conf.in
+ $(CPP) $(RAWCPP_FLAGS) -P $(PKGCONF_CPP_EXTRA_OPTS) -DINSTALLING -x c $(PACKAGE_CPP_OPTS) $< | \
+ sed -e 's/""//g' -e 's/\[ *,/[ /g' >$@
+
+# we could be more accurate here and add a dependency on
+# ghc/driver/package.conf, but that doesn't work too well because of
+# make's limited accuracy with modification times: when doing 'make
+# boot' in multiple packages, make won't detect that the package
+# configuration needs updating if it was updated already in the last
+# second.
+#
+# The stamp file goes in $(GHC_DRIVER_DIR), so that if someone happens
+# to 'make clean' in ghc without cleaning in libraries too, the packages
+# will be correctly re-installed.
+#
+ifeq "$(STANDALONE_PACKAGE)" "NO"
+
+STAMP_PKG_CONF = $(GHC_DRIVER_DIR)/stamp-pkg-conf-$(PACKAGE)
+CLEAN_FILES += $(STAMP_PKG_CONF)
+
+ifneq "$(BootingFromHc)" "YES"
+boot all :: $(STAMP_PKG_CONF)
+endif