+ cp distrib/Makefile $(BIN_DIST_PREP)
+ cp distrib/INSTALL $(BIN_DIST_PREP)
+ cp distrib/README $(BIN_DIST_PREP)
+ cp distrib/configure-bin.ac $(BIN_DIST_PREP)/configure.ac
+# We can't just list aclocal.m4 in $(BIN_DIST_LIST), as it needs to be
+# next to configure.ac when we run autoreconf
+ cp aclocal.m4 $(BIN_DIST_PREP)
+ cd $(BIN_DIST_PREP) && autoreconf
+# We need to copy the pwd program that was built with stage1 to where
+# the build system expects to find it, i.e. the location the pwd built
+# with the bootstrapping compiler normally occupies
+ $(MKDIRHIER) $(BIN_DIST_PREP)/utils/pwd
+ cp utils/pwd/dist-install/build/pwd/pwd $(BIN_DIST_PREP)/utils/pwd
+# And likewise the installPackage program
+ $(MKDIRHIER) $(BIN_DIST_PREP)/utils/installPackage/install-inplace/bin
+ cp utils/installPackage/dist-install/build/installPackage/installPackage \
+ $(BIN_DIST_PREP)/utils/installPackage/install-inplace/bin
+
+ echo "package = ghc" >> $(BIN_DIST_VARFILE)
+ echo "version = $(ProjectVersion)" >> $(BIN_DIST_VARFILE)
+ echo "ProjectVersion = $(ProjectVersion)" >> $(BIN_DIST_VARFILE)
+ echo "HaveLibGmp = $(HaveLibGmp)" >> $(BIN_DIST_VARFILE)
+ echo "GhcLibsWithUnix = $(GhcLibsWithUnix)" >> $(BIN_DIST_VARFILE)
+ echo "GhcWithInterpreter = $(GhcWithInterpreter)" >> $(BIN_DIST_VARFILE)
+ echo "GhcHasEditline = $(GhcHasEditline)" >> $(BIN_DIST_VARFILE)
+ echo "BootingFromHc = $(BootingFromHc)" >> $(BIN_DIST_VARFILE)
+ echo "XMLDocWays = $(XMLDocWays)" >> $(BIN_DIST_VARFILE)
+# We won't actually use xsltproc, but we need to know if it's "" or not
+ echo "XSLTPROC = $(XSLTPROC)" >> $(BIN_DIST_VARFILE)
+ echo "TARGETPLATFORM = $(TARGETPLATFORM)" >> $(BIN_DIST_VARFILE)
+ echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_VARFILE)
+ echo "LATEX_DOCS = $(LATEX_DOCS)" >> $(BIN_DIST_VARFILE)
+ echo "INTEGER_LIBRARY = $(INTEGER_LIBRARY)" >> $(BIN_DIST_VARFILE)
+ cat distrib/Makefile-bin-vars.in >> $(BIN_DIST_VARFILE)
+
+# With that done, we can now build the actual tarball
+
+ $(RM) -f $(BIN_DIST_NAME)
+ ln -s . $(BIN_DIST_NAME)
+# h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
+# tree then we want to include the real file, not a symlink to it
+ $(TAR) hcf $(BIN_DIST_TAR) -T $(BIN_DIST_LIST)
+ cd $(BIN_DIST_PREP_DIR) && $(TAR) rf ../$(BIN_DIST_TAR) $(BIN_DIST_NAME)
+ bzip2 < $(BIN_DIST_TAR) > $(BIN_DIST_TAR_BZ2)
+ $(TAR) tf $(BIN_DIST_TAR) | sort > bin-manifest-$(ProjectVersion)
+endif