summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
Diffstat (limited to 'rts')
-rw-r--r--rts/configure.ac25
-rw-r--r--rts/ghcplatform.h.bottom2
-rw-r--r--rts/ghcplatform.h.top.in23
-rw-r--r--rts/rts.cabal.in2
4 files changed, 50 insertions, 2 deletions
diff --git a/rts/configure.ac b/rts/configure.ac
index 21e6f57602..be8ecb7cb3 100644
--- a/rts/configure.ac
+++ b/rts/configure.ac
@@ -22,6 +22,8 @@ dnl #define SIZEOF_CHAR 0
dnl recently.
AC_PREREQ([2.69])
+AC_CONFIG_FILES([ghcplatform.h.top])
+
AC_CONFIG_HEADERS([ghcautoconf.h.autoconf])
AC_ARG_ENABLE(asserts-all-ways,
@@ -85,6 +87,10 @@ FP_CC_LLVM_BACKEND
AS_IF([test x"$CcLlvmBackend" = x"YES"],
[AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])])
+GHC_CONVERT_PLATFORM_PARTS([build], [Build])
+FPTOOLS_SET_PLATFORM_VARS([build],[Build])
+FPTOOLS_SET_HASKELL_PLATFORM_VARS([Build])
+
GHC_CONVERT_PLATFORM_PARTS([host], [Host])
FPTOOLS_SET_PLATFORM_VARS([host], [Host])
FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
@@ -357,11 +363,28 @@ dnl --------------------------------------------------------------
AC_OUTPUT
dnl ######################################################################
-dnl Generate ghcautoconf.h
+dnl Generate ghcplatform.h
dnl ######################################################################
[
mkdir -p include
+
+touch include/ghcplatform.h
+> include/ghcplatform.h
+
+cat ghcplatform.h.top >> include/ghcplatform.h
+]
+AS_IF([test x"${Unregisterised}" = x"YES"],
+ [echo "#define UnregisterisedCompiler 1" >> include/ghcplatform.h])
+[
+cat $srcdir/ghcplatform.h.bottom >> include/ghcplatform.h
+]
+
+dnl ######################################################################
+dnl Generate ghcautoconf.h
+dnl ######################################################################
+
+[
touch include/ghcautoconf.h
> include/ghcautoconf.h
diff --git a/rts/ghcplatform.h.bottom b/rts/ghcplatform.h.bottom
new file mode 100644
index 0000000000..77c4b77653
--- /dev/null
+++ b/rts/ghcplatform.h.bottom
@@ -0,0 +1,2 @@
+
+#endif /* __GHCPLATFORM_H__ */
diff --git a/rts/ghcplatform.h.top.in b/rts/ghcplatform.h.top.in
new file mode 100644
index 0000000000..ebb1961a1f
--- /dev/null
+++ b/rts/ghcplatform.h.top.in
@@ -0,0 +1,23 @@
+#if !defined(__GHCPLATFORM_H__)
+#define __GHCPLATFORM_H__
+
+#define BuildPlatform_TYPE @BuildPlatform_CPP@
+#define HostPlatform_TYPE @HostPlatform_CPP@
+
+#define @BuildPlatform_CPP@_BUILD 1
+#define @HostPlatform_CPP@_HOST 1
+
+#define @BuildArch_CPP@_BUILD_ARCH 1
+#define @HostArch_CPP@_HOST_ARCH 1
+#define BUILD_ARCH "@BuildArch_CPP@"
+#define HOST_ARCH "@HostArch_CPP@"
+
+#define @BuildOS_CPP@_BUILD_OS 1
+#define @HostOS_CPP@_HOST_OS 1
+#define BUILD_OS "@BuildOS_CPP@"
+#define HOST_OS "@HostOS_CPP@"
+
+#define @BuildVendor_CPP@_BUILD_VENDOR 1
+#define @HostVendor_CPP@_HOST_VENDOR 1
+#define BUILD_VENDOR "@BuildVendor_CPP@"
+#define HOST_VENDOR "@HostVendor_CPP@"
diff --git a/rts/rts.cabal.in b/rts/rts.cabal.in
index 98ca808917..d9bfa8657c 100644
--- a/rts/rts.cabal.in
+++ b/rts/rts.cabal.in
@@ -224,7 +224,7 @@ library
include-dirs: include
includes: Rts.h
- autogen-includes: ghcautoconf.h
+ autogen-includes: ghcautoconf.h ghcplatform.h
install-includes: Cmm.h HsFFI.h MachDeps.h Rts.h RtsAPI.h Stg.h
ghcautoconf.h ghcconfig.h ghcplatform.h ghcversion.h
-- ^ from include