X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Faclocal.m4;h=ed5415680e886a160f53c9d7695e071eef7928fa;hb=61ccfec175e1f51b2c89559faf91d9bee0b3b601;hp=d4fba2e1514502ae53bb2da08ff955a54b3e23e7;hpb=13ec31c00cdb714370077c8b0a3805452609315d;p=ghc-hetmet.git diff --git a/ghc/aclocal.m4 b/ghc/aclocal.m4 index d4fba2e..ed54156 100644 --- a/ghc/aclocal.m4 +++ b/ghc/aclocal.m4 @@ -1,3 +1,26 @@ -# Although we don't need any local macros currently, we leave this file here. -# Otherwise autoreconf invokes aclocal from the automake tools, which might -# be nonexistent or too old. +# 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/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/` +VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\3'/` +VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\1'/` +ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\(@<:@^.@:>@*\)\(\.\{0,1\}\(.*\)\)$/\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