summaryrefslogtreecommitdiff
path: root/distrib/configure.ac.in
diff options
context:
space:
mode:
Diffstat (limited to 'distrib/configure.ac.in')
-rw-r--r--distrib/configure.ac.in16
1 files changed, 13 insertions, 3 deletions
diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
index ac6af24b94..a15b4a5a3c 100644
--- a/distrib/configure.ac.in
+++ b/distrib/configure.ac.in
@@ -134,10 +134,20 @@ dnl May need to use gcc to find platform details.
dnl --------------------------------------------------------------
FPTOOLS_SET_HASKELL_PLATFORM_VARS
-dnl WordSize for settings.in
+dnl TargetWordSize for settings.in
AC_CHECK_SIZEOF(void *, 4)
-WordSize=$ac_cv_sizeof_void_p
-AC_SUBST(WordSize)
+if test "x$ac_cv_sizeof_void_p" = "x0"; then
+ AC_MSG_ERROR([Failed to determine machine word size. Does your toolchain actually work?])
+fi
+dnl Check that the toolchain we have is consistent with what the compiler expects
+if test "x$ac_cv_sizeof_void_p" != "x@TargetWordSize@"; then
+ AC_MSG_ERROR([This binary distribution produces binaries for a target with
+ word size of @TargetWordSize@, but your target toolchain produces binaries
+ with a word size of $ac_cv_sizeof_void_p. Are you sure your toolchain
+ targets the intended target platform of this compiler?])
+fi
+TargetWordSize=$ac_cv_sizeof_void_p
+AC_SUBST(TargetWordSize)
#
dnl ** how to invoke `ar' and `ranlib'