From 5479647f4d6f1f3be6363d4b558c990e70964571 Mon Sep 17 00:00:00 2001 From: jjacky Date: Sun, 23 Sep 2012 13:23:06 +0200 Subject: [PATCH] configure.ac: Better handling of --enable-git-version Multiple messages were put on the same line, so the output could be a bit confusing. Also, it didn't fail on error, i.e. if git or .git were missing the configure still ran successfully, but git version wasn't enabled. Now all messages are on their own line, if git or .git is not found, an error occurs, and on success the version ("kalu version x.y.z") is suffixed with "-git" --- configure.ac | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 6cff6cb..b12339c 100644 --- a/configure.ac +++ b/configure.ac @@ -117,21 +117,25 @@ AC_DEFINE_UNQUOTED([AUR_URL_PREFIX_PKG], ["$AUR_URL_PREFIX_PKG"], [Prefix before each package to construct AUR URL]) # git version -AC_MSG_CHECKING([whether to use git version if available]) +AC_MSG_CHECKING([if git version must be used]) if test "x$wantgitver" = "xyes"; then + AC_MSG_RESULT([yes]) AC_CHECK_PROGS([GIT], [git]) + if test "x$GIT" = "x"; then + AC_MSG_ERROR([Cannot use git version: git not found]) + fi AC_CHECK_FILE([.git/], hasgitdir=yes) - if test $GIT -a "x$hasgitdir" = "xyes"; then - AC_MSG_RESULT([yes]) + if test "x$hasgitdir" = "xyes"; then usegitver=yes + gitver=-git AC_DEFINE([USE_GIT_VERSION], , [Use GIT version]) else - AC_MSG_RESULT([no, git or .git dir missing]) - usegitver=no + AC_MSG_ERROR([Cannot use git version: .git not found]) fi else - AC_MSG_RESULT([no, disabled]) + AC_MSG_RESULT([no]) usegitver=no + gitver= fi AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes") @@ -139,7 +143,7 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT echo " - ${PACKAGE} version ${PACKAGE_VERSION} + ${PACKAGE} version ${PACKAGE_VERSION}${gitver} Build information: source code location : ${srcdir}