From bc4b6a82cce6b18be2076a8eac2bab37863bad96 Mon Sep 17 00:00:00 2001 From: panne Date: Thu, 30 Sep 2004 20:56:49 +0000 Subject: [PATCH] [project @ 2004-09-30 20:56:49 by panne] Get all project info from configure.ac --- ghc/VERSION.in | 2 +- ghc/aclocal.m4 | 28 ++++++++++++++++++++++++++-- ghc/configure.ac | 12 ++---------- ghc/mk/version.mk.in | 8 ++++---- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/ghc/VERSION.in b/ghc/VERSION.in index 3abedb6..72ee7cd 100644 --- a/ghc/VERSION.in +++ b/ghc/VERSION.in @@ -1 +1 @@ -The @PACKAGE_NAME@, version @PACKAGE_VERSION@ +@PACKAGE_NAME@, version @PACKAGE_VERSION@ diff --git a/ghc/aclocal.m4 b/ghc/aclocal.m4 index fbea551..a871c1a 100644 --- a/ghc/aclocal.m4 +++ b/ghc/aclocal.m4 @@ -1,2 +1,26 @@ -# Empty file to avoid a dependency on automake: autoreconf calls aclocal to -# generate a temporary aclocal.m4t when no aclocal.m4 is present. +# FP_SETUP_PROJECT_INFO +# --------------------- +AC_DEFUN([FP_SETUP_PROJECT_INFO], +[# Some renamings +AC_SUBST([ProjectName], [$PACKAGE_NAME]) +AC_SUBST([ProjectNameShort], [$PACKAGE_TARNAME]) +AC_SUBST([ProjectVersion], [$PACKAGE_VERSION]) + +# Split PACKAGE_VERSION into (possibly empty) parts +VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\1'/` +VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\3'/` +VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\1'/` +ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\?\(.*\)\)$/\3'/` + +# Calculate project version as an integer, using 2 digits for minor version +case $VERSION_MINOR in + ?) ProjectVersionInt=${VERSION_MAJOR}0${VERSION_MINOR} ;; + ??) ProjectVersionInt=${VERSION_MAJOR}${VERSION_MINOR} ;; + *) AC_MSG_ERROR([bad minor version in $PACKAGE_VERSION]) ;; +esac +AC_SUBST([ProjectVersionInt]) + +# The project patchlevel is zero unless stated otherwise +test -z "$ProjectPatchLevel" && ProjectPatchLevel=0 +AC_SUBST([ProjectPatchLevel]) +])# FP_SETUP_PROJECT_INFO diff --git a/ghc/configure.ac b/ghc/configure.ac index a7b74e1..9e4d6cd 100644 --- a/ghc/configure.ac +++ b/ghc/configure.ac @@ -1,16 +1,8 @@ # Initialise and check sanity. -AC_INIT([Glasgow Haskell Compiler], [6.3], [glasgow-haskell-bugs@haskell.org], [ghc]) +AC_INIT([The Glorious Glasgow Haskell Compilation System], [6.3], [glasgow-haskell-bugs@haskell.org], [ghc]) AC_CONFIG_SRCDIR([ghc.spec.in]) -# Calculate project version as an integer, using 2 digits for minor version -case $PACKAGE_VERSION in - *.?) ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(.\)$,\10\2,'` ;; - *.??) ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(..\)$,\1\2,'` ;; - *.?.*) ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(.\)\.\(.*\)$,\10\2,'` ;; - *.??.*) ProjectVersionInt=`echo "$PACKAGE_VERSION" | sed 's,^\(.*\)\.\(..\)\.\(.*\)$,\1\2,'` ;; - *) AC_MSG_ERROR([bad package version $PACKAGE_VERSION]) ;; -esac -AC_SUBST([ProjectVersionInt]) +FP_SETUP_PROJECT_INFO # Hmmm, we fix the RPM release number to 1 here... Is this convenient? AC_SUBST([release], [1]) diff --git a/ghc/mk/version.mk.in b/ghc/mk/version.mk.in index ec5ef86..e8e1656 100644 --- a/ghc/mk/version.mk.in +++ b/ghc/mk/version.mk.in @@ -34,11 +34,11 @@ # change between versions. Rationale: calling conventions or other # random .o-file stuff might change even if the .hi syntax doesn't -ProjectName = The Glorious Glasgow Haskell Compilation System -ProjectNameShort = ghc -ProjectVersion = @PACKAGE_VERSION@ +ProjectName = @ProjectName@ +ProjectNameShort = @ProjectNameShort@ +ProjectVersion = @ProjectVersion@ ProjectVersionInt = @ProjectVersionInt@ -ProjectPatchLevel = 0 +ProjectPatchLevel = @ProjectPatchLevel@ # Interface file version (hi-boot files only) # -- 1.7.10.4