X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=aclocal.m4;h=2649df734fc973bbe053ef58b0d60faf317e3ce0;hp=619d414fb947721a02384f759025047bc0ec90c4;hb=9fd4d1e84e5a305e227db2ec78a46d1762907493;hpb=6153c763ec6d3dde482812eb871f485ec34a9f01 diff --git a/aclocal.m4 b/aclocal.m4 index 619d414..2649df7 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 ], + [#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) @@ -141,6 +168,10 @@ case $HostPlatform in alpha-dec-osf*) fptools_cv_leading_underscore=no;; *cygwin32) fptools_cv_leading_underscore=yes;; *mingw32) fptools_cv_leading_underscore=yes;; + + # HACK: Apple doesn't seem to provide nlist in the 64-bit-libraries +x86_64-apple-darwin*) fptools_cv_leading_underscore=yes;; + *) AC_RUN_IFELSE([AC_LANG_SOURCE([[#ifdef HAVE_NLIST_H #include struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}}; @@ -923,10 +954,42 @@ if test "$fp_cv_gcc_has_no_unit_at_a_time" = "yes"; then AC_DEFINE([HAVE_GCC_HAS_NO_UNIT_AT_A_TIME], [1], [Define to 1 if gcc supports -fno-unit-at-a-time.]) fi]) +# FP_GCC_HAS_WRAPV +# -------------------------- +AC_DEFUN([FP_GCC_HAS_WRAPV], +[AC_REQUIRE([FP_HAVE_GCC]) +AC_CACHE_CHECK([whether gcc has -fwrapv], [fp_cv_gcc_has_wrapv], +[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.4], + [fp_cv_gcc_has_wrapv=yes], + [fp_cv_gcc_has_wrapv=no])]) +if test "$fp_cv_gcc_has_wrapv" = "yes"; then + AC_DEFINE([HAVE_GCC_HAS_WRAPV], [1], [Define to 1 if gcc supports -fwrapv.]) +fi]) + # FP_SETUP_PROJECT_VERSION # --------------------- AC_DEFUN([FP_SETUP_PROJECT_VERSION], -[# Some renamings +[ +if test "$RELEASE" = "NO"; then + AC_MSG_CHECKING([for GHC version date]) + if test -d _darcs; then + changequote(, )dnl + ver_date=`darcs changes --quiet --no-summary --xml | head -500 | grep 'date=' | sed "s/^.*date='\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*$/\1/g" | sort -n | tail -1` + if echo $ver_date | grep '^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$' 2>&1 >/dev/null; then true; else + changequote([, ])dnl + AC_MSG_ERROR([failed to detect version date: check that darcs is in your path]) + fi + PACKAGE_VERSION=${PACKAGE_VERSION}.$ver_date + AC_MSG_RESULT($PACKAGE_VERSION) + elif test -f VERSION; then + PACKAGE_VERSION=`cat VERSION` + AC_MSG_RESULT($PACKAGE_VERSION) + else + AC_MSG_ERROR([no version found]) + fi +fi + +# Some renamings AC_SUBST([ProjectName], [$PACKAGE_NAME]) AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])