X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=99a4d03ff6a23a735b46f6db43820dca4a4ec41a;hb=911a3e09ad48ff8dac5ee1399fe9294edf58d30c;hp=3f0ec004fccd6fdcc5820bd370878228f2971886;hpb=491544aed513c3b542f6dc2e63b8c66a34dc5bef;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 3f0ec00..99a4d03 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -254,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 @@ -988,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 @@ -1001,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