Make ASSERT2 mention msg even when debug is off (avoid warnings)
[ghc-hetmet.git] / aclocal.m4
index 8593b89..f739bfe 100644 (file)
@@ -1,15 +1,3 @@
-    struct sigevent ev;
-    timer_t timer;
-    ev.sigev_notify = SIGEV_SIGNAL;
-    ev.sigev_signo  = SIGVTALRM;
-    if (timer_create(CLOCK_PROCESS_CPUTIME_ID, &ev, &timer) != 0) {
-       exit(1);
-    }
-#else
-    exit(1)
-#endif
-    exit(0);
-}
 # Extra autoconf macros for the Glasgow fptools
 #
 # To be a good autoconf citizen, names of local macros have prefixed with FP_ to
@@ -56,38 +44,6 @@ AC_DEFUN([FP_EVAL_STDERR],
 ])# FP_EVAL_STDERR
 
 
-# FP_CHECK_FLAG(FLAG, [ACTION-IF-SUPPORTED], [ACTION-IF-NOT-SUPPORTED])
-# ---------------------------------------------------------------------
-# Check to see whether the compiler for the current language supports a
-# particular option.
-#
-# Implementation note: When given an unkown option, GCC issues an warning on
-# stderr only, but returns an exit value of 0 nevertheless. Consequently we have
-# to check stderr *and* the exit value.
-#
-# Used by ghc.
-AC_DEFUN([FP_CHECK_FLAG],
-[AC_LANG_COMPILER_REQUIRE()dnl
-AC_LANG_CASE([C],          [fp_compiler="$CC"  m4_pushdef([fp_Flags], [CFLAGS])],
-             [C++],        [fp_compiler="$CXX" m4_pushdef([fp_Flags], [CXXFLAGS])],
-             [Fortran 77], [fp_compiler="$F77" m4_pushdef([fp_Flags], [FFLAGS])])
-m4_pushdef([fp_Cache], [fp_cv_[]fp_Flags[]AS_TR_SH([$1])])[]dnl
-AC_CACHE_CHECK([whether $fp_compiler accepts $1], [fp_Cache],
-[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
-fp_save_flags="$fp_Flags"
-fp_Flags="$fp_Flags $1"
-fp_Cache=no
-if FP_EVAL_STDERR([$ac_compile conftest.$ac_ext]) >/dev/null; then
-  test -s conftest.err || fp_Cache=yes
-fi
-fp_Flags="$fp_save_flags"
-rm -f conftest.err conftest.$ac_ext])
-AS_IF([test $fp_Cache = yes], [$2], [$3])[]dnl
-m4_popdef([fp_Cache])[]dnl
-m4_popdef([fp_Flags])[]dnl
-])# FP_CHECK_FLAG
-
-
 # FP_PROG_CONTEXT_DIFF
 # --------------------
 # Figure out how to do context diffs. Sets the output variable ContextDiffCmd.
@@ -1032,7 +988,17 @@ if test "$RELEASE" = "NO"; then
     if test -f VERSION_DATE; then
         PACKAGE_VERSION=${PACKAGE_VERSION}.`cat VERSION_DATE`
         AC_MSG_RESULT(given $PACKAGE_VERSION)
+    elif test -d .git; then
+        changequote(, )dnl
+        ver_date=`git log -n 1 --date=short --pretty=format:%ci | sed "s/^.*\([0-9][0-9][0-9][0-9]\)-\([0-9][0-9]\)-\([0-9][0-9]\).*$/\1\2\3/"`
+        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 git is in your path])
+        fi
+        PACKAGE_VERSION=${PACKAGE_VERSION}.$ver_date
+        AC_MSG_RESULT(inferred $PACKAGE_VERSION)
     elif test -d _darcs; then
+        # TODO: Remove this branch after conversion to Git
         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
@@ -1045,7 +1011,7 @@ if test "$RELEASE" = "NO"; then
         PACKAGE_VERSION=`cat VERSION`
         AC_MSG_RESULT(given $PACKAGE_VERSION)
     else
-        AC_MSG_WARN([cannot determine snapshot version: no _darcs directory and no VERSION file])
+        AC_MSG_WARN([cannot determine snapshot version: no .git or _darcs directory and no VERSION file])
     fi
 fi
 
@@ -1186,7 +1152,7 @@ out:
 
     tock = 0;
 
-    usleep(300);
+    usleep(3000);
 
     if (!tock) {
         fprintf(stderr,"no CLOCK_REALTIME signal\n");