Build system: fix bindist for cross-build GHC
authorFangrui Song <i@maskray.me>
Fri, 21 Apr 2017 00:03:30 +0000 (17:03 -0700)
committerSergei Trofimovich <slyfox@gentoo.org>
Fri, 21 Apr 2017 21:32:22 +0000 (22:32 +0100)
The change fixes case of installing cross-built GHC
from bindist (BINDIST=YES) on TARGET.

In this case we need to use TARGET tools in `INSTALLED_GHC{,_PKG}_REAL`.

The original change is provided by Fangrui Song
as pull request https://github.com/ghc/ghc/pull/34

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
ghc.mk
mk/config.mk.in

diff --git a/ghc.mk b/ghc.mk
index 8971f25..d1dbb9e 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -962,7 +962,7 @@ endif
 
 INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
 
-ifeq "$(CrossCompiling)" "YES"
+ifeq "$(BINDIST) $(CrossCompiling)" "NO YES"
 # when installing ghc-stage2 we can't run target's
 # 'ghc-pkg' and 'ghc-stage2' but those are needed for registration.
 INSTALLED_GHC_REAL=$(TOP)/inplace/bin/ghc-stage1
index 1f7353c..8901137 100644 (file)
@@ -415,6 +415,7 @@ GhcRtsWithLibdw=$(strip $(if $(filter $(TargetArch_CPP),i386 x86_64),@UseLibdw@,
 #
 ################################################################################
 
+BINDIST               = NO
 BIN_DIST_NAME         = ghc-$(ProjectVersion)
 BIN_DIST_PREP_DIR     = bindistprep/$(BIN_DIST_NAME)
 BIN_DIST_PREP_TAR     = bindistprep/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar