Teach darcs-all how to get testsuite and nofib
[ghc-hetmet.git] / aclocal.m4
index ab0ba43..2649df7 100644 (file)
@@ -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)
@@ -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 <nlist.h>
 struct nlist xYzzY1[] = {{"xYzzY1", 0},{0}};
@@ -812,7 +843,7 @@ EOF
 # 'PATH'. Note that /usr/bin/fop is broken in SuSE 9.1 (unpatched), so try
 # /usr/share/fop/fop.sh in that case (or no 'fop'), too.
 AC_DEFUN([FP_PROG_FOP],
-[AC_PATH_PROGS([FopCmd1], [fop])
+[AC_PATH_PROGS([FopCmd1], [fop fop.sh])
 if test -n "$FopCmd1"; then
   AC_CACHE_CHECK([for $FopCmd1 usability], [fp_cv_fop_usability],
     [FP_GEN_FO
@@ -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])