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.
SUBDIRS = $(SUBDIRS_NOLIB) libraries
+VERSION :
+ 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 :
SRC_DIST_FILES += \
configure.ac config.guess config.sub configure \
aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
- ghc.spec.in
+ ghc.spec.in VERSION
# -----------------------------------------------------------------------------
# Source distributions
# don't clean config.mk: it's needed when cleaning stuff later on
LATE_DIST_CLEAN_FILES += mk/config.mk
+# VERSION is shipped in a source dist
+MAINTAINER_CLEAN_FILES += VERSION
+
extraclean::
$(RM) -rf autom4te.cache
# 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])
dnl (or some such) to see the outline of this file)
dnl
#
-# (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.
#
AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.7], [glasgow-haskell-bugs@haskell.org], [ghc])
+# Set this to YES for a released version, otherwise NO
+RELEASE=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/config.h.in; then
echo "mk/config.h.in doesn't exist: perhaps you haven't run 'autoreconf'?"
exit 1