From 29a36bb753f2ef0ba57a4095e6e51825e8b1534a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 2 May 2010 22:48:39 +0200 Subject: [PATCH] Moved generation of fb_features.h from configure to src/Makefile. This ensures that we'll have up-to-date version information on each build. For this purpose, version-gen.sh now creates a file ``version'' including the current version. --- .gitignore | 1 + configure.ac | 15 +-------------- src/Makefile.am | 15 +++++++++++++++ version-gen.sh | 20 ++++++++++++++++++++ 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 69fab01..2c5f4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ depcomp install-sh missing stamp-h1 +version # ltdl stuff libtool diff --git a/configure.ac b/configure.ac index 97e3ca0..e1c988f 100644 --- a/configure.ac +++ b/configure.ac @@ -190,22 +190,9 @@ build_date="`date --utc '+%F %T'` (UTC)" AC_DEFINE_UNQUOTED([BUILD_DATE], ["$build_date"], [Define to the date the package has been built on.]) -dnl Version information provided by fb_features.h. -FB_VERSION_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1` -FB_VERSION_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2` -FB_VERSION_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3` -FB_VERSION_EXTRA=`echo $PACKAGE_VERSION | cut -d'.' -f4-` -FB_VERSION_STRING="$FB_VERSION_MAJOR.$FB_VERSION_MINOR.$FB_VERSION_PATCH" - -AC_SUBST(FB_VERSION_MAJOR) -AC_SUBST(FB_VERSION_MINOR) -AC_SUBST(FB_VERSION_PATCH) -AC_SUBST(FB_VERSION_EXTRA) -AC_SUBST(FB_VERSION_STRING) - AC_CHECK_HEADERS(libgen.h) -AC_CONFIG_FILES([Makefile src/Makefile src/fb_features.h]) +AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT cat < fb_features.h + +.PHONY: FORCE + diff --git a/version-gen.sh b/version-gen.sh index ca8414d..5730071 100755 --- a/version-gen.sh +++ b/version-gen.sh @@ -17,3 +17,23 @@ fi VERSION="$( echo "$VERSION" | sed -e 's/-/./g' )" echo -n "$VERSION" +OLD_VERSION="" +if test -e version; then + OLD_VERSION=$( sed -ne 's/^VERSION="\(.*\)"/\1/p' version ) +fi + +if test "$OLD_VERSION" != "$VERSION"; then + VERSION_MAJOR=$( echo $VERSION | cut -d'.' -f1 ) + VERSION_MINOR=$( echo $VERSION | cut -d'.' -f2 ) + VERSION_PATCH=$( echo $VERSION | cut -d'.' -f3 ) + VERSION_EXTRA="\"$( echo $VERSION | cut -d'.' -f4- )\"" + ( + echo "VERSION=\"$VERSION\"" + echo "VERSION_MAJOR=$VERSION_MAJOR" + echo "VERSION_MINOR=$VERSION_MINOR" + echo "VERSION_PATCH=$VERSION_PATCH" + echo "VERSION_EXTRA=\"$VERSION_EXTRA\"" + echo "VERSION_STRING=\"$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH\"" + ) > version +fi + -- 2.30.2