X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=aclocal.m4;h=99a4d03ff6a23a735b46f6db43820dca4a4ec41a;hp=8593b897888fe4512441b75bba740062cdebf1dd;hb=c4ec8f2a77894af1c6160c4e8ad5625ab62f0bea;hpb=1cb262099e1d777a0413517633ba9de85d647635 diff --git a/aclocal.m4 b/aclocal.m4 index 8593b89..99a4d03 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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. @@ -298,27 +254,6 @@ AC_SUBST(HappyVersion) ]) dnl -dnl Check for Haddock and version. If there's no installed Haddock, we look -dnl for a haddock source tree and point the build system at that instead. -dnl -AC_DEFUN([FPTOOLS_HADDOCK], -[AC_PATH_PROG(HaddockCmd,haddock,) -dnl Darn, I forgot to make Haddock print out its version number when -dnl invoked with -v. We could try generating some HTML and grepping -dnl through that to find the version number, but I think we'll make -dnl do without it for now. -# Haddock is passed to Cabal, so we need a native path -if test "x$HostPlatform" = "xi386-unknown-mingw32" && \ - test "${OSTYPE}" != "msys" && \ - test "${HaddockCmd}" != "" -then - # Canonicalise to :/path/to/gcc - HaddockCmd=`cygpath -m ${HaddockCmd}` - AC_MSG_NOTICE([normalized haddock command to $HaddockCmd]) -fi -]) - -dnl dnl Check for Alex and version. If we're building GHC, then we need dnl at least Alex version 2.0.1. dnl @@ -1032,7 +967,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 +990,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 +1131,7 @@ out: tock = 0; - usleep(300); + usleep(3000); if (!tock) { fprintf(stderr,"no CLOCK_REALTIME signal\n");