When installing, we can't rely on the ghc-pkg we just installed to work
authorIan Lynagh <igloo@earth.li>
Thu, 28 Aug 2008 18:24:47 +0000 (18:24 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 28 Aug 2008 18:24:47 +0000 (18:24 +0000)
If DESTDIR is defined, then on *nix machines ghc-pkg is a script that
doesn't point to the right path. Therefore we use the ghc-pkg binary
directly.

libraries/Makefile
mk/cabal-flags.mk
mk/cabal.mk

index d33435e..4249cee 100644 (file)
@@ -375,7 +375,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
 install.library.%: ifBuildable/ifBuildable
        if $(IFBUILDABLE) $*; then \
          cd $* && \
-         $(INSTALL_PACKAGE) install '$(DESTDIR)$(bindir)/ghc-pkg' '$(DESTDIR)$(datadir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idynlibdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
+         $(INSTALL_PACKAGE) install '$(GHC_PKG_INSTALL_PROG)' '$(DESTDIR)$(datadir)/package.conf' '$(DESTDIR)' '$(prefix)' '$(iprefix)' '$(ibindir)' '$(ilibdir)' '$(ilibexecdir)' '$(idynlibdir)' '$(idatadir)' '$(idocdir)' '$(ihtmldir)' '$(ihaddockdir)' ; \
        fi
 
 .PHONY: binary-dist binary-dist.library.%
index 4144f25..d69999f 100644 (file)
@@ -2,6 +2,8 @@
 nothing=
 space=$(nothing) $(nothing)
 
+GHC_PKG_INSTALL_PROG = $(FPTOOLS_TOP_ABS)/utils/ghc-pkg/dist-install/build/ghc-pkg/ghc-pkg
+
 LIBRARIES_ABS = $(FPTOOLS_TOP_ABS)/libraries
 UTILS_ABS     = $(FPTOOLS_TOP_ABS)/utils
 CABAL = $(LIBRARIES_ABS)/cabal-bin $(GHC) $(LIBRARIES_ABS)/bootstrapping.conf
index bdf8e99..efd75e2 100644 (file)
@@ -44,7 +44,7 @@ with-stage-2:
 
 install:
        $(INSTALL_PACKAGE) install                                        \
-                          '$(DESTDIR)$(bindir)/ghc-pkg'                  \
+                          '$(GHC_PKG_INSTALL_PROG)'                      \
                           '$(DESTDIR)$(datadir)/package.conf'            \
                           '$(DESTDIR)' '$(prefix)'                       \
                           '$(prefix)' '$(bindir)' '$(libdir)'            \