summaryrefslogtreecommitdiff
path: root/ghc/ghc.mk
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2012-01-30 11:19:03 +0000
committerSimon Marlow <marlowsd@gmail.com>2012-01-30 11:19:03 +0000
commit9fff25eaf08016c4c0e32a7087a1249d586550c0 (patch)
tree7a2f13260f24d610abea5cd8f8bf3a51d0787c54 /ghc/ghc.mk
parent4ff3a642fbb61cf329d468993e9f732940f9f680 (diff)
downloadhaskell-9fff25eaf08016c4c0e32a7087a1249d586550c0.tar.gz
Improve support for cross-compilation
Patchset from Stephen Blackheath <stephen.blackheath@ipwnstudios.com>
Diffstat (limited to 'ghc/ghc.mk')
-rw-r--r--ghc/ghc.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index 2af90bed28..022ee85a84 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -86,6 +86,10 @@ endif
ifneq "$(filter-out 2,$(stage))" ""
ghc_stage2_NOT_NEEDED = YES
endif
+# When cross-compiling, the stage 1 compiler is our release compiler, so omit stage 2
+ifeq "$(BuildingCrossCompiler)" "YES"
+ghc_stage2_NOT_NEEDED = YES
+endif
# stage 3 has to be requested explicitly with stage=3
ifneq "$(stage)" "3"
ghc_stage3_NOT_NEEDED = YES
@@ -147,7 +151,7 @@ install: install_ghc_link
.PNONY: install_ghc_link
install_ghc_link:
$(call removeFiles,"$(DESTDIR)$(bindir)/ghc")
- $(LN_S) ghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/ghc"
+ $(LN_S) $(CrossCompilePrefix)ghc-$(ProjectVersion) "$(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghc"
else
# On Windows we install the main binary as $(bindir)/ghc.exe
# To get ghc-<version>.exe we have a little C program in driver/ghc
@@ -155,6 +159,6 @@ install: install_ghc_post
.PHONY: install_ghc_post
install_ghc_post: install_bins
$(call removeFiles,$(DESTDIR)$(bindir)/ghc.exe)
- "$(MV)" -f $(DESTDIR)$(bindir)/ghc-stage$(INSTALL_GHC_STAGE).exe $(DESTDIR)$(bindir)/ghc.exe
+ "$(MV)" -f $(DESTDIR)$(bindir)/ghc-stage$(INSTALL_GHC_STAGE).exe $(DESTDIR)$(bindir)/$(CrossCompilePrefix)ghc.exe
endif