summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m424
1 files changed, 22 insertions, 2 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 203d11f289..30fd220b11 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -109,6 +109,8 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
GHC_CONVERT_OS([$target_os], [$TargetArch], [TargetOS])
fi
+ GHC_LLVM_TARGET([$target_cpu],[$target_vendor],[$target_os],[LlvmTarget])
+
GHC_SELECT_FILE_EXTENSIONS([$host], [exeext_host], [soext_host])
GHC_SELECT_FILE_EXTENSIONS([$target], [exeext_target], [soext_target])
windows=NO
@@ -137,12 +139,12 @@ AC_DEFUN([FPTOOLS_SET_PLATFORM_VARS],
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"`
+ LLVMTarget_CPP=` echo "$LlvmTarget"`
echo "GHC build : $BuildPlatform"
echo "GHC host : $HostPlatform"
echo "GHC target : $TargetPlatform"
- echo "LLVM target: $target"
+ echo "LLVM target: $LlvmTarget"
AC_SUBST(BuildPlatform)
AC_SUBST(HostPlatform)
@@ -1880,6 +1882,24 @@ case "$1" in
esac
])
+# GHC_LLVM_TARGET(target_cpu, target_vendor, target_os, llvm_target_var)
+# --------------------------------
+# converts the canonicalized target into someting llvm can understand
+AC_DEFUN([GHC_LLVM_TARGET], [
+ case "$2-$3" in
+ hardfloat-*eabi)
+ llvm_target_vendor="unknown"
+ llvm_target_os="$3""hf"
+ ;;
+ *)
+ GHC_CONVERT_VENDOR([$2],[llvm_target_vendor])
+ GHC_CONVERT_OS([$3],[$1],[llvm_target_os])
+ ;;
+ esac
+ $4="$1-$llvm_target_vendor-$llvm_target_os"
+])
+
+
# GHC_CONVERT_VENDOR(vendor, target_var)
# --------------------------------
# converts vendor from gnu to ghc naming, and assigns the result to $target_var