Skip to content

Commit

Permalink
configure.ac: Better handling of --enable-git-version
Browse files Browse the repository at this point in the history
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
jjacky committed Sep 23, 2012
1 parent 87c8579 commit 5479647
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions configure.ac
Expand Up @@ -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}
Expand Down

0 comments on commit 5479647

Please sign in to comment.