summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2012-12-13 11:20:50 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2012-12-13 11:20:50 +0100
commita16dcf7c11d80775b07a0fa6f3ac5527190fb486 (patch)
treeb75001e80db7f24cc861b3d0d1092e4b96fafd21
parent4209a88759c41aac54465b6d4389b7daaad6ac80 (diff)
build: check for .git in configure.ac
Don't error out when someone tries using --with-pkg-git-version on something that isn't actually a git checkout (like a dist tarball). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rwxr-xr-xconfigure.ac14
1 files changed, 9 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index c1a4d8cd..405693c9 100755
--- a/configure.ac
+++ b/configure.ac
@@ -195,10 +195,7 @@ AC_ARG_WITH(pkg-extra-version,
[EXTRAVERSION=$withval],)
AC_ARG_WITH(pkg-git-version,
AS_HELP_STRING([--with-pkg-git-version], [add git information to MOTD and build version string]),
- [ if test "x$withval" != "xno"; then
- with_pkg_git_version="1"
- AC_DEFINE(GIT_VERSION, [1], [include git version info])
- fi ],)
+ [ test "x$withval" != "xno" && with_pkg_git_version="yes" ])
AC_ARG_ENABLE(vtysh,
[ --enable-vtysh include integrated vty shell for Quagga])
AC_ARG_ENABLE(ipv6,
@@ -410,7 +407,14 @@ if test "x${EXTRAVERSION}" != "x" ; then
PACKAGE_STRING="${PACKAGE_STRING}${EXTRAVERSION}"
fi
-AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" != "x"])
+if test "x$with_pkg_git_version" = "xyes"; then
+ if test -d "${srcdir}/.git"; then
+ AC_DEFINE(GIT_VERSION, [1], [include git version info])
+ else with_pkg_git_version="no"
+ AC_MSG_WARN([--with-pkg-git-version given, but this is not a git checkout])
+ fi
+fi
+AM_CONDITIONAL([GIT_VERSION], [test "x$with_pkg_git_version" = "xyes"])
dnl ------------------------------------
dnl Check C keywords and standard types