summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-02-06 21:25:36 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-02-06 21:25:36 +0000
commit06decfcd62d1ca9069cd4707115ecb92bea39064 (patch)
tree040c7bca94a80fc3acc735c19597c55ca0f7bc5f /aclocal.m4
parente975c8f09ac8d85059a4b42cf56ebe036aa95dc7 (diff)
downloadhaskell-06decfcd62d1ca9069cd4707115ecb92bea39064.tar.gz
Detect the snapshot version number using darcs
For non-release builds, we want to append a date to the version number (e.g. 6.7.20070206). Previously this was done by the nightly build script, this new method figures out the snapshot version by querying the darcs repository and finding the date of the most recent patch (actually it finds the most recent of the last 100 patches, but that should be good enough). This is done by the configure script. To handle source distributions, we create a file VERSION in the top-level directory that contains the version number, and ship this in the source distribution. The configure script picks up the version from this file if it doesn't see a _darcs directory.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m419
1 files changed, 18 insertions, 1 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 36c0128b7b..87149a7dc1 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -969,7 +969,24 @@ 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 --last=100 --xml | 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`
+ changequote([, ])dnl
+ 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])