diff options
author | Ian Lynagh <igloo@earth.li> | 2006-11-20 12:13:09 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2006-11-20 12:13:09 +0000 |
commit | 51f782f416a8aa05153a9f2dcef34d8bcb79f1ed (patch) | |
tree | 93bf4394964baa31b23e75cabf8678d0a9d3a6a5 /aclocal.m4 | |
parent | d9dff2f709009b8bca9c30ac650a634df0457ae5 (diff) | |
download | haskell-51f782f416a8aa05153a9f2dcef34d8bcb79f1ed.tar.gz |
Cope with big endian float word order on little endian machines
Diffstat (limited to 'aclocal.m4')
-rw-r--r-- | aclocal.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4 index 619d414fb9..9d1e1cab9b 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -4,6 +4,33 @@ # ensure we don't clash with any pre-supplied autoconf ones. +# FPTOOLS_FLOAT_WORD_ORDER_BIGENDIAN +# ---------------------------------- +# Little endian Arm on Linux with some ABIs has big endian word order +# in doubles. Define FLOAT_WORDS_BIGENDIAN if this is the case. +AC_DEFUN([FPTOOLS_FLOAT_WORD_ORDER_BIGENDIAN], + [AC_CACHE_CHECK([whether float word order is big endian], [fptools_cv_float_word_order_bigendian], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include <endian.h>], + [#if defined(__FLOAT_WORD_ORDER) && __FLOAT_WORD_ORDER == BIG_ENDIAN + return 0; + #else + not float word order big endian + #endif] + )], + [fptools_cv_float_word_order_bigendian=yes], + [fptools_cv_float_word_order_bigendian=no]) + ]) + case $fptools_cv_float_word_order_bigendian in + yes) + AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, + [Define to 1 if your processor stores words of floats with + the most significant byte first]) ;; + esac +]) + + # FP_EVAL_STDERR(COMMAND) # ----------------------- # Eval COMMAND, save its stderr (without lines resulting from shell tracing) |