summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aclocal.m45
-rw-r--r--compiler/ghc.mk2
-rw-r--r--mk/project.mk.in37
3 files changed, 26 insertions, 18 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 0d113c1da8..a7920a71ac 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -136,9 +136,13 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
TargetVendor_CPP=` echo "$TargetVendor" | sed -e 's/\./_/g' -e 's/-/_/g'`
TargetOS_CPP=` echo "$TargetOS" | sed -e 's/\./_/g' -e 's/-/_/g'`
+ # we intend to pass trough --targets to llvm as is.
+ LLVMTarget_CPP=` echo "$target"`
+
echo "GHC build : $BuildPlatform"
echo "GHC host : $HostPlatform"
echo "GHC target : $TargetPlatform"
+ echo "LLVM target: $target"
AC_SUBST(BuildPlatform)
AC_SUBST(HostPlatform)
@@ -154,6 +158,7 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
AC_SUBST(HostOS_CPP)
AC_SUBST(BuildOS_CPP)
AC_SUBST(TargetOS_CPP)
+ AC_SUBST(LLVMTarget_CPP)
AC_SUBST(HostVendor_CPP)
AC_SUBST(BuildVendor_CPP)
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index d5498c4f58..2d2fedec4a 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -170,6 +170,7 @@ compiler/stage1/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
@echo "#define BUILD_ARCH \"$(BuildArch_CPP)\"" >> $@
@echo "#define HOST_ARCH \"$(HostArch_CPP)\"" >> $@
@echo "#define TARGET_ARCH \"$(TargetArch_CPP)\"" >> $@
+ @echo "#define LLVM_TARGET \"$(LLVMTarget_CPP)\"" >> $@
@echo >> $@
@echo "#define $(BuildOS_CPP)_BUILD_OS 1" >> $@
@echo "#define $(HostOS_CPP)_HOST_OS 1" >> $@
@@ -211,6 +212,7 @@ compiler/stage2/$(PLATFORM_H) : mk/config.mk mk/project.mk | $$(dir $$@)/.
@echo "#define BUILD_ARCH \"$(HostArch_CPP)\"" >> $@
@echo "#define HOST_ARCH \"$(TargetArch_CPP)\"" >> $@
@echo "#define TARGET_ARCH \"$(TargetArch_CPP)\"" >> $@
+ @echo "#define LLVM_TARGET \"$(LLVMTarget_CPP)\"" >> $@
@echo >> $@
@echo "#define $(HostOS_CPP)_BUILD_OS 1" >> $@
@echo "#define $(TargetOS_CPP)_HOST_OS 1" >> $@
diff --git a/mk/project.mk.in b/mk/project.mk.in
index 03bd7441cb..d620ed5a61 100644
--- a/mk/project.mk.in
+++ b/mk/project.mk.in
@@ -12,7 +12,7 @@
# Versioning scheme: A.B.C
# A: major version, decimal, any number of digits
# B: minor version, decimal, any number of digits
-# C: patchlevel, one digit, omitted if zero.
+# C: patchlevel, one digit, omitted if zero.
#
# ProjectVersionInt does *not* contain the patchlevel (rationale: this
# figure is used for conditional compilations, and library interfaces
@@ -35,7 +35,7 @@ ProjectGitCommitId = @ProjectGitCommitId@
################################################################################
#
-# Platform variables
+# Platform variables
#
################################################################################
@@ -81,24 +81,25 @@ ProjectGitCommitId = @ProjectGitCommitId@
# You have to do a lot of work by hand to cross compile: see the
# section on "Porting GHC" in the Building Guide.
-HOSTPLATFORM = @HostPlatform@
-TARGETPLATFORM = @TargetPlatform@
-BUILDPLATFORM = @BuildPlatform@
+HOSTPLATFORM = @HostPlatform@
+TARGETPLATFORM = @TargetPlatform@
+BUILDPLATFORM = @BuildPlatform@
-HostPlatform_CPP = @HostPlatform_CPP@
-HostArch_CPP = @HostArch_CPP@
-HostOS_CPP = @HostOS_CPP@
-HostVendor_CPP = @HostVendor_CPP@
+HostPlatform_CPP = @HostPlatform_CPP@
+HostArch_CPP = @HostArch_CPP@
+HostOS_CPP = @HostOS_CPP@
+HostVendor_CPP = @HostVendor_CPP@
-TargetPlatform_CPP = @TargetPlatform_CPP@
-TargetArch_CPP = @TargetArch_CPP@
-TargetOS_CPP = @TargetOS_CPP@
-TargetVendor_CPP = @TargetVendor_CPP@
+TargetPlatform_CPP = @TargetPlatform_CPP@
+TargetArch_CPP = @TargetArch_CPP@
+TargetOS_CPP = @TargetOS_CPP@
+TargetVendor_CPP = @TargetVendor_CPP@
+LLVMTarget_CPP = @LLVMTarget_CPP@
-BuildPlatform_CPP = @BuildPlatform_CPP@
-BuildArch_CPP = @BuildArch_CPP@
-BuildOS_CPP = @BuildOS_CPP@
-BuildVendor_CPP = @BuildVendor_CPP@
+BuildPlatform_CPP = @BuildPlatform_CPP@
+BuildArch_CPP = @BuildArch_CPP@
+BuildOS_CPP = @BuildOS_CPP@
+BuildVendor_CPP = @BuildVendor_CPP@
@HostPlatform_CPP@_HOST = 1
@TargetPlatform_CPP@_TARGET = 1
@@ -118,7 +119,7 @@ BuildVendor_CPP = @BuildVendor_CPP@
################################################################################
#
-# Global configuration options
+# Global configuration options
#
################################################################################