Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : cross-compiler-alienless

http://hackage.haskell.org/trac/ghc/changeset/78bea858089392ee404674bad97d11b8c2a25c20

>---------------------------------------------------------------

commit 78bea858089392ee404674bad97d11b8c2a25c20
Author: Gabor Greif <[email protected]>
Date:   Fri Aug 31 11:14:20 2012 +0200

    employ make variable BuildingCrossCompiler in all relevant places

>---------------------------------------------------------------

 ghc/ghc.mk                      |    6 +++---
 libffi/ghc.mk                   |    4 ++--
 rules/build-dependencies.mk     |    4 ++--
 rules/build-package-data.mk     |    4 ++--
 rules/cross-compiling.mk        |   24 ------------------------
 rules/distdir-way-opts.mk       |    4 ++--
 rules/hs-suffix-rules-srcdir.mk |    2 +-
 rules/shell-wrapper.mk          |    4 ++--
 8 files changed, 14 insertions(+), 38 deletions(-)

diff --git a/ghc/ghc.mk b/ghc/ghc.mk
index c78fa3b..12b837c 100644
--- a/ghc/ghc.mk
+++ b/ghc/ghc.mk
@@ -45,7 +45,7 @@ ghc_stage1_C_FILES_NODEPS = ghc/hschooks.c
 
 ghc_stage2_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
 ghc_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 ghc_stage2_MKDEPENDC_OPTS += -DCOMPILING_GHC
 endif
 
@@ -77,7 +77,7 @@ ghc_stage3_PROG = ghc-stage3$(exeext)
 ghc_stage1_SHELL_WRAPPER = YES
 ghc_stage2_SHELL_WRAPPER = YES
 ghc_stage3_SHELL_WRAPPER = YES
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 ghc_stage1_SHELL_WRAPPER_NAME = ghc/ghc-cross.wrapper
 ghc_stage2_SHELL_WRAPPER_NAME = ghc/ghc-cross.wrapper
 else
@@ -100,7 +100,7 @@ ifneq "$(filter-out 1,$(stage))" ""
 ghc_stage1_NOT_NEEDED = YES
 endif
 
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 ghc_stage2_NOT_NEEDED = YES
 ghc_stage3_NOT_NEEDED = YES
 else
diff --git a/libffi/ghc.mk b/libffi/ghc.mk
index c5c1ff7..dad675d 100644
--- a/libffi/ghc.mk
+++ b/libffi/ghc.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2009-2012 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -44,7 +44,7 @@ endif
 
 # libffi has a different nomenclature from ours
 # regarding 'host' (our target) and 'build' (also our build)
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 LIBFFI_PLATFORMS = --host=$(TARGETPLATFORM) --build=$(HOSTPLATFORM)
 else
 # XXX: --host=$(TARGETPLATFORM) also?
diff --git a/rules/build-dependencies.mk b/rules/build-dependencies.mk
index 867ea14..db999a3 100644
--- a/rules/build-dependencies.mk
+++ b/rules/build-dependencies.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2009-2012 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -24,7 +24,7 @@ $1_$2_C_FILES_DEPS = $$(filter-out 
$$($1_$2_C_FILES_NODEPS),$$($1_$2_C_FILES))
 
 $1_$2_MKDEPENDHS_FLAGS = -dep-makefile $$($1_$2_depfile_haskell).tmp 
$$(foreach way,$$(filter-out v,$$($1_$2_WAYS)),-dep-suffix $$(way))
 $1_$2_MKDEPENDHS_FLAGS += -include-pkg-deps
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 $1_$2_MKDEPENDHS_FLAGS += -DCOMPILING_GHC
 endif
 
diff --git a/rules/build-package-data.mk b/rules/build-package-data.mk
index 34f09a0..92e0413 100644
--- a/rules/build-package-data.mk
+++ b/rules/build-package-data.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2009-2012 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -64,7 +64,7 @@ $1_$2_CONFIGURE_OPTS += $$(BOOT_PKG_CONSTRAINTS)
 endif
 
 ifeq "$3" "1"
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 $1_$2_CONFIGURE_OPTS += --configure-option=--host=$(HOSTPLATFORM)
 $1_$2_CONFIGURE_OPTS += --configure-option=--target=$(TARGETPLATFORM)
 endif
diff --git a/rules/cross-compiling.mk b/rules/cross-compiling.mk
deleted file mode 100644
index 9f9ec6f..0000000
--- a/rules/cross-compiling.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-# -----------------------------------------------------------------------------
-#
-# (c) 2012 The University of Glasgow
-#
-# This file is part of the GHC build system.
-#
-# To understand how the build system works and how to modify it, see
-#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
-#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
-#
-# -----------------------------------------------------------------------------
-
-define cross-compiling # $1 = then, $2 = else, $3 = then, ...
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
-ifneq "$(BUILDPLATFORM)" "$(HOSTPLATFORM)"
-$(warning When cross-compiling, the build and host platforms must be equal 
(--build=$(BUILDPLATFORM) --host=$(HOSTPLATFORM) --target=$(TARGETPLATFORM)))
-endif
-$1
-$3
-else
-$2
-$4
-endif
-endef
diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
index b3426bf..20cb0b6 100644
--- a/rules/distdir-way-opts.mk
+++ b/rules/distdir-way-opts.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2009-2012 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -182,7 +182,7 @@ ifneq ($$(strip $$($1_$2_DIST_LD_OPTS)),)
 $1_$2_$3_HSC2HS_LD_OPTS:=$$(shell for i in $$($1_$2_DIST_LD_OPTS); do echo 
\'--lflag=$$$$i\'; done)
 endif
 
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 $1_$2_$3_HSC2HS_CC_OPTS += -DCOMPILING_GHC
 endif
 
diff --git a/rules/hs-suffix-rules-srcdir.mk b/rules/hs-suffix-rules-srcdir.mk
index 7238b76..197edb1 100644
--- a/rules/hs-suffix-rules-srcdir.mk
+++ b/rules/hs-suffix-rules-srcdir.mk
@@ -34,7 +34,7 @@ $1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : 
$1/$4/%.hsc $$(HSC2HS
 
 # Compiling Haskell source
 
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 --CROSS-OPTS-- = -DCOMPILING_GHC
 endif
 
diff --git a/rules/shell-wrapper.mk b/rules/shell-wrapper.mk
index be51c96..2f27357 100644
--- a/rules/shell-wrapper.mk
+++ b/rules/shell-wrapper.mk
@@ -1,6 +1,6 @@
 # -----------------------------------------------------------------------------
 #
-# (c) 2009 The University of Glasgow
+# (c) 2009-2012 The University of Glasgow
 #
 # This file is part of the GHC build system.
 #
@@ -34,7 +34,7 @@ endif
 ifneq "$$($1_$2_INSTALL_INPLACE)" "NO"
 all_$1_$2 : $$(INPLACE_BIN)/$$($1_$2_PROG)
 
-ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+ifeq "$(BuildingCrossCompiler)" "YES"
 $1_$2_PGMGCC = $$(CC_STAGE1)
 else
 $1_$2_PGMGCC = $$(WhatGccIsCalled)



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to