Permalink
Browse files

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"
  • Loading branch information...
1 parent 87c8579 commit 5479647f4d6f1f3be6363d4b558c990e70964571 @jjk-jacky committed Sep 23, 2012
Showing with 11 additions and 7 deletions.
  1. +11 −7 configure.ac
View
@@ -117,29 +117,33 @@ 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")
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
echo "
- ${PACKAGE} version ${PACKAGE_VERSION}
+ ${PACKAGE} version ${PACKAGE_VERSION}${gitver}
Build information:
source code location : ${srcdir}

0 comments on commit 5479647

Please sign in to comment.