bindist fixes
authorIan Lynagh <igloo@earth.li>
Sun, 10 Aug 2008 13:39:25 +0000 (13:39 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 10 Aug 2008 13:39:25 +0000 (13:39 +0000)
12 files changed:
Makefile
compiler/Makefile
distrib/Makefile
docs/docbook-cheat-sheet/Makefile
docs/ext-core/Makefile
docs/storage-mgt/Makefile
docs/users_guide/Makefile
driver/Makefile
ghc/Makefile
libraries/Makefile
mk/package.mk
utils/ghc-pkg/Makefile

index 1f9b653..b48cdca 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -337,6 +337,7 @@ binary-dist::
        $(MAKE) -C gmp                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/gmp
        $(MAKE) -C includes            binary-dist WHERE_AM_I=$(WHERE_AM_I)/includes
        $(MAKE) -C compiler            binary-dist WHERE_AM_I=$(WHERE_AM_I)/compiler $(INSTALL_STAGE)
+       $(MAKE) -C ghc                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/ghc      $(INSTALL_STAGE)
        $(MAKE) -C rts                 binary-dist WHERE_AM_I=$(WHERE_AM_I)/rts
        $(MAKE) -C driver              binary-dist WHERE_AM_I=$(WHERE_AM_I)/driver
        $(MAKE) -C utils               binary-dist WHERE_AM_I=$(WHERE_AM_I)/utils
@@ -346,8 +347,6 @@ binary-dist::
 # Now thinks get messier. Some files we need to move around, rename or
 # generate. We do this under $(BIN_DIST_PREP).
        $(RM) -rf    $(BIN_DIST_PREP_DIR)
-       $(MKDIRHIER) $(BIN_DIST_PREP)/utils/pwd
-       cp utils/pwd/dist-install/build/pwd/pwd $(BIN_DIST_PREP)/utils/pwd
        $(MKDIRHIER) $(BIN_DIST_PREP)/mk
        echo 'include $$(TOP)/Makefile-vars' >  $(BIN_DIST_PREP)/mk/boilerplate.mk
        echo 'include $$(TOP)/mk/package.mk' >  $(BIN_DIST_PREP)/mk/target.mk
@@ -366,6 +365,15 @@ endif
 # 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)
@@ -380,6 +388,7 @@ endif
        echo "XSLTPROC = $(XSLTPROC)"                     >> $(BIN_DIST_VARFILE)
        echo "TARGETPLATFORM = $(TARGETPLATFORM)"         >> $(BIN_DIST_VARFILE)
        echo "HADDOCK_DOCS = $(HADDOCK_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
index 1dbb2d3..c0f703e 100644 (file)
@@ -439,25 +439,6 @@ primop-usage.hs-incl: prelude/primops.txt
 # binary-dist
 #
 
-# XXX This is just broken, currently
-binary-dist:
-       @:
-
-#binary-dist:
-#      $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler
-#      $(INSTALL_DIR)                         $(BIN_DIST_DIR)/compiler/stage$(stage)
-#      echo "stage=$(stage)"                > $(BIN_DIST_DIR)/compiler/Makefile
-#      cat Makefile                        >> $(BIN_DIST_DIR)/compiler/Makefile
-#      $(INSTALL_DATA)    package.conf.in     $(BIN_DIST_DIR)/compiler/
-#      set -e; for d in stage$(stage)/*/; do $(INSTALL_DIR) $(BIN_DIST_DIR)/compiler/$$d; done
-#      set -e; for f in $(HS_IFACES); do $(INSTALL_DATA) $$f $(BIN_DIST_DIR)/compiler/$$f; done
-#ifneq "$(INSTALL_LIBS)" ""
-#      set -e; for f in $(INSTALL_LIBS); do $(INSTALL_DATA) $$f $(BIN_DIST_DIR)/compiler/$$f; done
-#endif
-#ifneq "$(INSTALL_PROGS)" ""
-#      set -e; for f in $(INSTALL_PROGS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
-#endif
-#ifneq "$(INSTALL_LIBEXECS)" ""
-#      set -e; for f in $(INSTALL_LIBEXECS); do $(INSTALL_PROGRAM) $$f $(BIN_DIST_DIR)/compiler/$$f; done
-#endif
+include $(TOP)/mk/bindist.mk
+LIB_DIST_DIR = dist-stage$(stage)
 
index bfa3b91..951ec7e 100644 (file)
@@ -27,6 +27,7 @@ install::
        $(MAKE) -C rts       install      DOING_BIN_DIST=YES
        $(MAKE) -C libraries install      DOING_BIN_DIST=YES
        $(MAKE) -C compiler  install      DOING_BIN_DIST=YES
+       $(MAKE) -C ghc       install      DOING_BIN_DIST=YES
        $(MAKE) -C gmp       install      DOING_BIN_DIST=YES
        $(MAKE) -C docs      install-docs DOING_BIN_DIST=YES
        $(MAKE) -C libraries/Cabal/doc install-docs DOING_BIN_DIST=YES
index 14e0c3c..8cd9f51 100644 (file)
@@ -4,7 +4,6 @@ include $(TOP)/mk/boilerplate.mk
 XML_DOC = docbook-cheat-sheet
 INSTALL_XML_DOC = docbook-cheat-sheet
 
-binary-dist:
-       @:
+include $(TOP)/mk/bindist.mk
 
 include $(TOP)/mk/target.mk
index 10f3183..704cfc3 100644 (file)
@@ -1,3 +1,5 @@
+TOP = ../..
+
 #      General makefile for Latex stuff
 
 LATEX=latex \\nonstopmode \\input
@@ -28,8 +30,7 @@ distclean: clean
 
 maintainer-clean: distclean
 
-binary-dist:
-       @:
+include $(TOP)/mk/bindist.mk
 
 # dummy targets
 all:
index 9ef54ad..0ef3037 100644 (file)
@@ -1,3 +1,5 @@
+TOP = ../..
+
 #      General makefile for Latex stuff
 
 dvi: sm.dvi rp.dvi ldv.dvi
@@ -25,8 +27,7 @@ distclean: clean
 
 maintainer-clean: distclean
 
-binary-dist:
-       @:
+include $(TOP)/mk/bindist.mk
 
 # dummy targets
 all:
index 1a370d5..0657f4a 100644 (file)
@@ -4,7 +4,6 @@ include $(TOP)/mk/boilerplate.mk
 XML_DOC = users_guide
 INSTALL_XML_DOC = users_guide
 
-binary-dist:
-       @:
+include $(TOP)/mk/bindist.mk
 
 include $(TOP)/mk/target.mk
index 5825356..7a07cbd 100644 (file)
@@ -7,7 +7,7 @@
 TOP=..
 include $(TOP)/mk/boilerplate.mk
 
-SUBDIRS = mangler split ghc ghci
+SUBDIRS = mangler split ghci
 
 INPLACE_DATA_DIR = $(FPTOOLS_TOP_ABS)/inplace-datadir
 INPLACE_PKG_CONF = $(INPLACE_DATA_DIR)/package.conf
index 894f2df..cb12241 100644 (file)
@@ -119,16 +119,11 @@ build.stage.%:
 install:
        $(INSTALL_PACKAGE) install UNUSED UNUSED '$(DESTDIR)' '$(prefix)' \
                           '$(prefix)' '$(bindir)' '$(libdir)'            \
-                       '$(libexecdir)' '$(dynlibdir)' '$(libdir)'     \
+                       '$(libexecdir)' '$(dynlibdir)' '$(datadir)'    \
                        '$(docdir)' '$(htmldir)' '$(haddockdir)'       \
                           --distpref dist-stage2                         \
                           $(INSTALL_FLAGS)
 
-# XXX fix:
-#binary-dist:
-#      $(INSTALL_DIR)                      $(BIN_DIST_DIR)/utils/hsc2hs
-#      $(INSTALL_DATA)    Makefile         $(BIN_DIST_DIR)/utils/hsc2hs/
-#      $(INSTALL_DATA)    hsc2hs.sh        $(BIN_DIST_DIR)/utils/hsc2hs/
-#      $(INSTALL_DATA)    $(INSTALL_DATAS) $(BIN_DIST_DIR)/utils/hsc2hs/
-#      $(INSTALL_PROGRAM) $(HS_PROG)       $(BIN_DIST_DIR)/utils/hsc2hs/
+include $(TOP)/mk/bindist.mk
+EXE_DIST_DIR = dist-stage$(stage)
 
index 6cc349b..50cd518 100644 (file)
@@ -119,6 +119,8 @@ ihtmldir            = $(htmldir)/libraries/$$pkg
 html_installed_root = $(htmldir)/libraries
 endif
 
+IFBUILDABLE=ifBuildable/ifBuildable $(FPTOOLS_TOP_ABS)/packages
+
 ifneq "$(DOING_BIN_DIST)" "YES"
 
 CONFIGURE_OPTS =
@@ -146,8 +148,6 @@ subdirs:
 
 HERE_ABS=$(FPTOOLS_TOP_ABS)/libraries
 
-IFBUILDABLE=ifBuildable/ifBuildable $(FPTOOLS_TOP_ABS)/packages
-
 CABAL_GHC_FLAGS = -Wall
 ifeq "$(ghc_ge_605)" "NO"
 CABAL_GHC_FLAGS += -cpp
@@ -364,7 +364,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
 install.library.%: ifBuildable/ifBuildable
        if $(IFBUILDABLE) $*; then \
          cd $* && \
-         $(INSTALL_PACKAGE) install '$(GHC_PKG_PROG)' '$(DESTDIR)$(libdir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idynlibdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
+         $(INSTALL_PACKAGE) install '$(DESTDIR)$(bindir)/ghc-pkg' '$(DESTDIR)$(datadir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idynlibdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
        fi
 
 .PHONY: binary-dist binary-dist.library.%
@@ -372,14 +372,16 @@ install.library.%: ifBuildable/ifBuildable
 BIN_DIST_LIBDIR=$(BIN_DIST_DIR)/libraries
 
 BINDIST_EXTRAS += ifBuildable/ifBuildable
-ifeq "$(HADDOCK_DOCS)" "YES"
-BINDIST_EXTRAS += gen_contents_index
-BINDIST_EXTRAS += index.html
-BINDIST_EXTRAS += doc-index*.html
-endif
 binary-dist: $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR))
-# This is a bit of a hack, but it works...
        echo $(WHERE_AM_I)/Makefile >> $(BIN_DIST_LIST)
+# XXX This needs to be changed: This ifBuildable is built with the
+# bootstrapping compiler, so isn't OS X friendly. It should be made into
+# a Cabal package if we keep it. However, once we drop extralibs we can
+# probably remove it anyway.
+       echo $(WHERE_AM_I)/ifBuildable/ifBuildable >> $(BIN_DIST_LIST)
+ifeq "$(HADDOCK_DOCS)" "YES"
+       for FILE in gen_contents_index index.html doc-index*.html; do echo $(WHERE_AM_I)/$$FILE >> $(BIN_DIST_LIST); done
+endif
 
 $(foreach SUBDIR,$(SUBDIRS),binary-dist.library.$(SUBDIR)): \
 binary-dist.library.%:
index 44087aa..ef20386 100644 (file)
@@ -84,7 +84,7 @@ install::
               -x c $(PACKAGE_CPP_OPTS) package.conf.in \
            | grep -v '^#pragma GCC' \
            | sed -e 's/""//g' -e 's/:[   ]*,/: /g' \
-           | $(GHC_PKG_PROG) --global-conf $(DESTDIR)$(libdir)/package.conf update - --force
+           | $(DESTDIR)$(bindir)/ghc-pkg --global-conf $(DESTDIR)$(datadir)/package.conf update - --force
 
 # we could be more accurate here and add a dependency on
 # driver/package.conf, but that doesn't work too well because of
index 560fa4a..0783d3f 100644 (file)
@@ -3,6 +3,7 @@ TOP=../..
 ENABLE_SHELL_WRAPPERS = YES
 EXTRA_CLEAN = Version.hs
 EXTRA_INPLACE_CONFIGURE_FLAGS = $(INPLACE_GHC_DATADIR_CONFIGURE_FLAGS)
+EXTRA_STAGE1_CONFIGURE_FLAGS = --datasubdir=.
 
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/cabal.mk