Commit 06decfcd authored by Simon Marlow's avatar Simon Marlow
Browse files

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.
parent e975c8f0
......@@ -66,6 +66,11 @@ endif
echo $(ProjectVersion) >VERSION
all :: VERSION
# Sanity check that all the core libraries are in the tree, to catch
# failure to run darcs-all.
check-packages :
......@@ -417,7 +422,7 @@ SRC_DIST_DIRS += mk docs distrib $(filter-out docs distrib,$(SUBDIRS))
SRC_DIST_FILES += \ config.guess config.sub configure \
aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \ VERSION
# -----------------------------------------------------------------------------
# Source distributions
......@@ -506,6 +511,9 @@ DIST_CLEAN_FILES += config.cache config.status mk/config.h mk/stamp-h \
# don't clean it's needed when cleaning stuff later on
# VERSION is shipped in a source dist
$(RM) -rf autom4te.cache
......@@ -969,7 +969,24 @@ fi])
# ---------------------
[# 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
elif test -f VERSION; then
AC_MSG_ERROR([no version found])
# Some renamings
AC_SUBST([ProjectName], [$PACKAGE_NAME])
AC_SUBST([ProjectVersion], [$PACKAGE_VERSION])
......@@ -3,9 +3,9 @@ dnl (run "grep '^dnl \*' | sed -e 's/dnl / /g; s/\*\*/ +/g;'"
dnl (or some such) to see the outline of this file)
# (c) The AQUA Project, Glasgow University, 1994-2004
# (c) The University of Glasgow 1994-2004
# Configure script template for the Glasgow functional programming tools
# Configure script template for GHC
# Process with 'autoreconf' to get a working configure script.
......@@ -15,6 +15,17 @@ dnl
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.7], [], [ghc])
# Set this to YES for a released version, otherwise NO
# The primary version (e.g. 6.7, 6.6.1) is set in the AC_INIT line
# above. If this is not a released version, then we will append the
# date to the version number (e.g. 6.7.20070204). The date is
# constructed by finding the date of the most recent patch in the
# darcs repository. If this is a source distribution (not a darcs
# checkout), then we ship a file 'VERSION' containing the full version
# when the source distribution was created.
if test ! -f mk/; then
echo "mk/ doesn't exist: perhaps you haven't run 'autoreconf'?"
exit 1
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment